Skip to main content

Going nuts: NB 5.5.1 & OpenESB & Jax-WS 2.1 vs Jax-WS 2.0

11 replies [Last post]
applet5
Offline
Joined: 2007-04-09

Hi,

I apologize in advance for my newbie questions and I'm sorry to bother you, but I’m going nuts while attempting to create a webservice-client with netbeans 5.5.1. (I'm more familiar with Eclipse, but I need to use openESB + glassfish...whatever)

That is my situation:

I started with a clean Windows XP installation and then installed JDK 1.6 as a first. Afterwards, I downloaded and installed the openESB/Alaska/Netbeans5.5.1-bundle and I'm now trying to build a ws-client within a web-project for a sun appl. server.
It turns out that without modifying anything in this installation, there's jax-ws ver. 2.0 installed, and ver. 2.1 expected. Thanks to this, there won't be any ws-client-creation...

Downloading and installing (=double-clicking) JAXB2_20070125.jar & JAXWS2.1EA3_20061115.jar didn't work. Extracting both and copying them to (in the end) various lib and lib/endorsed-folders (as suggested by http://weblogs.java.net/blog/ramapulavarthi/archive/2007/01/problems_usi...) didn't work either. So didn't adding the jar files to the project. Even so didn't installing JDK 1.5 work. Environment-variables are all set.

Question one: how do I solve this problem? I don't know what else to do...

Question two: I've got a second WebService, which I'm going to access, which is (like google's ws) encoded in rpc-style. As error messages on a friend's system do suggest, jax-ws doesn't support those wsdl-files any more. Jax-rpc would still do. How do I persuade Netbeans that I'm smart enough, to choose jax-rpc instead of jax-ws within the new->ws-client dialogue?

I'm doing this as a part of my master thesis, so success is kinda crutial for me...
Thanks for all of your help!!

Kay

__
Probably useful system-settings:
java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Programme\Alaska\JDK\jdk1.6.0\jre\bin
java.vm.version = 1.6.0-b105
java.vm.vendor = Sun Microsystems Inc.
java.vendor.url = http://java.sun.com/
java.runtime.version = 1.6.0-b105
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Programme\Alaska\JDK\jdk1.6.0\jre\lib\endorsed
java.library.path = C:\Programme\Alaska\JDK\jdk1.6.0\jre\bin; .; C:\WINDOWS\Sun\Java\bin; C:\WINDOWS\system32; C:\WINDOWS; C:\WINDOWS\system32; C:\WINDOWS; C:\WINDOWS\System32\Wbem; C:\Programme\ATI Technologies\ATI.ACE\Core-Static; C:\Programme\QuickTime\QTSystem\; C:\Programme\Alaska\JDK\jdk1.6.0\bin; C:\Programme\Alaska\JDK\jdk1.6.0; C:\Programme\Alaska; C:\Programme\Alaska\JDK\jdk1.6.0\bin; C:\Programme\SSH Communications Security\SSH Secure Shell

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kohsuke
Offline
Joined: 2003-06-09

When you say "didn't work" what do you see? Any errors? We need more details.

applet5
Offline
Joined: 2007-04-09

Hi kohsuke,

this is the stack-trace of netbeans 5.5.1:

init:
wsimport-init:
Created dir: D:\Eigene Dateien\1 Studium\_Masterarbeit\Coding\Alaska_07-04-10\WS_invoke_Test\build\generated\wsimport\client
Created dir: D:\Eigene Dateien\1 Studium\_Masterarbeit\Coding\Alaska_07-04-10\WS_invoke_Test\build\generated\wsimport\binaries
wsimport-client-check-2007-04-10_201631_20namespace_bug:
wsimport-client-2007-04-10_201631_20namespace_bug:
Consider using /
so that wsimport won't do unnecessary compilation
parsing WSDL...

[b]Exception in thread "main" java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Programme/Alaska/netbeans/ide7/modules/ext/jaxws21/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)[/b]
at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:389)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:253)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXBContext(BindInfo.java:316)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryImpl$1.(AnnotationParserFactoryImpl.java:63)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryImpl.create(AnnotationParserFactoryImpl.java:62)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.createAnnotationParser(NGCCRuntimeEx.java:320)
at com.sun.xml.xsom.impl.parser.state.annotation.action0(annotation.java:48)
at com.sun.xml.xsom.impl.parser.state.annotation.enterElement(annotation.java:68)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.NGCCHandler.spawnChildFromEnterElement(NGCCHandler.java:74)
at com.sun.xml.xsom.impl.parser.state.attributeDeclBody.enterElement(attributeDeclBody.java:107)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.NGCCHandler.revertToParentFromEnterElement(NGCCHandler.java:111)
at com.sun.xml.xsom.impl.parser.state.foreignAttributes.enterElement(foreignAttributes.java:50)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.NGCCHandler.spawnChildFromEnterElement(NGCCHandler.java:74)
at com.sun.xml.xsom.impl.parser.state.attributeDeclBody.enterElement(attributeDeclBody.java:119)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.attributeDeclBody.enterElement(attributeDeclBody.java:96)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.attributeDeclBody.enterElement(attributeDeclBody.java:135)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.NGCCHandler.spawnChildFromEnterElement(NGCCHandler.java:74)
at com.sun.xml.xsom.impl.parser.state.Schema.enterElement(Schema.java:396)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.Schema.enterElement(Schema.java:364)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.sendEnterElement(NGCCRuntime.java:378)
at com.sun.xml.xsom.impl.parser.state.Schema.enterElement(Schema.java:423)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:219)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.util.SubtreeCutter.startElement(SubtreeCutter.java:68)
at com.sun.tools.xjc.reader.ExtensionBindingChecker.startElement(ExtensionBindingChecker.java:128)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.reader.xmlschema.parser.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:97)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.startElement(CustomizationContextChecker.java:172)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.startElement(DOMForestScanner.java:125)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:224)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:107)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:73)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:81)
at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:83)
at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:246)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:298)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.importSchema(NGCCRuntimeEx.java:204)
at com.sun.xml.xsom.impl.parser.state.importDecl.action0(importDecl.java:45)
at com.sun.xml.xsom.impl.parser.state.importDecl.leaveElement(importDecl.java:143)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:275)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.util.SubtreeCutter.endElement(SubtreeCutter.java:72)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.endElement(CustomizationContextChecker.java:178)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.endElement(DOMForestScanner.java:119)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:235)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:107)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:73)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:81)
at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:83)
at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:246)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:298)
at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:497)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:216)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:69)
at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:120)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2159)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:179)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:127)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:146)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.tools.ws.Invoker.WsimportMain(Invoker.java:78)
at com.sun.tools.ws.WsImport.main(WsImport.java:38)
Command invoked: wsimport C:\Programme\Alaska\jdk1.6.0\jre\bin\java.exe -Djava.endorsed.dirs=/C:/Programme/Alaska/netbeans/ide7/modules/ext/jaxws21/api -classpath C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\activation.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\FastInfoset.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\http.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\api\jaxb-api.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\jaxb-impl.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\jaxb-xjc.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\api\jaxws-api.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\jaxws-rt.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\jsr250-api.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\saaj-impl.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\sjsxp.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\resolver.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\stax-ex.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\streambuffer.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\jaxws-tools.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\api\jsr173_api.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\api\jsr181-api.jar; C:\Programme\Alaska\netbeans\ide7\modules\ext\jaxws21\api\saaj-api.jar com.sun.tools.ws.WsImport -d "D:\Eigene Dateien\1 Studium\_Masterarbeit\Coding\Alaska_07-04-10\WS_invoke_Test\build\generated\wsimport\binaries" -keep -s "D:\Eigene Dateien\1 Studium\_Masterarbeit\Coding\Alaska_07-04-10\WS_invoke_Test\build\generated\wsimport\client" -catalog "D:\Eigene Dateien\1 Studium\_Masterarbeit\Coding\Alaska_07-04-10\WS_invoke_Test\catalog.xml" "D:\Eigene Dateien\1 Studium\_Masterarbeit\Coding\Alaska_07-04-10\WS_invoke_Test/xml-resources/web-service-references/2007-04-10_201631_20namespace_bug/wsdl/2007-04-10 1631 namespace_bug.wsdl" -p ips -wsdllocation file:/D:/Eigene%20Dateien/1%20Studium/_Masterarbeit/Coding/WSDL/2007-04-10%201631%20namespace_bug.wsdl
D:\Eigene Dateien\1 Studium\_Masterarbeit\Coding\Alaska_07-04-10\WS_invoke_Test\nbproject\build-impl.xml:251: wsimport failed
BUILD FAILED (total time: 14 seconds)

I wasn't able to provide the trace earlier, as I uninstalled and re-installed any java-related stuff yesterday. I had the hope that this would solve my issues - but it didn't....

cheers,

Kay

Message was edited by: applet5 (reformatting)

null

kohsuke
Offline
Joined: 2003-06-09

OK. Either follow that instruction, or use Java 5.

There's various nasty issues in using 2.1 on JavaSE 6 right now. Sorry about that.

applet5
Offline
Joined: 2007-04-09

Hi,
as stated in my first post, I allready followed any instructions given - instructions given by the stack trace and given by a couple of webpages (please look above)...

Installing Java 5 was something I allready did. I changed path environment settings accordingly as well. Setting up netbeans to use java 1.5 didn't change anything ... sadly...

Reinstalling wont't change anything, as the netbeans-open-esb-bundle comes with java 6. Isn't there anoterh way of installing netbeans & open-esb as a configured combo w/o java6?

cheers...again

kohsuke
Offline
Joined: 2003-06-09

The easiest way to get this fixed once and for all is to put the JAX-WS 2.1 API and JAXB 2.1 API in the endorsed directory of JRE. That's $JAVA_HOME/jre/lib/endorsed for JDK.

If you say it didn't work, it must be that you are putting them in the wrong place. The other possibility is that someone is changing the endorsed directory.

I guess we can improve the error message by pointing out where the endorsed directory is. That might have helped in a situation like this.

applet5
Offline
Joined: 2007-04-09

Hi again,

thanks again for your help.... but as already stated in my first post, this didn't solve the problem. It seems like that the endorsed directory is no help in solving this issue.
Again, as told above, copying the jar-files in various, if not any, lib/endorsed-folders I found in the various java-installation instances on my harddrive, didn't work either.

I actually was able to solve my problem by using apache axis instead of jax-ws/rpc to access the rpc-encoded webservice... nevertheless: thank you.

BTW: java5&netbeans6 work together without turning a hair...

kohsuke
Offline
Joined: 2003-06-09

I'm sorry to hear that.

I suspect NetBeans set a different endorsed directory than the default one.

applet5
Offline
Joined: 2007-04-09

OK, this is new to me. Does Netbeans set or have an own endrosed-directory? How do I figure that one out?

Having java printing out the parameters and settings, including the used endorsed-directory doesn't give a hint for a Netbeans-endorsed-dir...

cheers
__

javacode, displaying java-system-settings
public static void main(String[] args) {
System.out.println("Testrun");

Properties prob = System.getProperties();
for(Object o : prob.keySet())
System.out.println(o.toString() + " => " + prob.get(o));

Map env = new HashMap();
env = System.getenv();
System.out.println(env);
for ( String elem : env.keySet() )
System.out.println( elem + " => " + env.get(elem));
System.out.println("done.");
}

kohsuke
Offline
Joined: 2003-06-09

A large program often has its own endorsed directories, so I'm just guessing that NetBeans might, too. That would certainly explain the behavior.

You might be able to find out the information on NetBeans website. When you write code like that, you need to make sure that that is executed on the same JVM as NetBeans, or else there's no point.

runarb
Offline
Joined: 2003-08-07

This sounds more like a common problem to me. I've just tried to run the "fromjava" example app (yep, I'm a newbie to web services) on Tomcat 5.5.20 running Java6 on WinXP. I've also followed the "endorsed" suggestions (found here: https://jax-ws.dev.java.net/guide/Using_JAX_WS_2_1_with_JavaSE6.html), but still I'm getting the exception below when launching the app with Tomcat.

Monitoring the startup with 'filemon' I can see that both jaxb-api.jar and jaxws-api.jar are read from [CATALINA_HOME]/shared/lib and not from [JAVA_HOME]/jre/lib/endorsed. Removing the jars from [CATALINA_HOME]/shared/lib gives a java.lang.NoClassDefFoundError.

SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.LinkageError: JAXB 2.0 API is being loaded
from the bootstrap classloader, but this RI (from jar:file:/C:/apache-tomcat-5.5.20/shared/lib/jaxb-impl.jar!/
com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to plac
e jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:fil
e:/C:/apache-tomcat-5.5.20/shared/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs
2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://
java.sun.com/j2se/1.5.0/docs/guide/standards/)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.(ModelBuilder.java:136)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:406)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:270)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:103)
at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:89)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:132)
at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:131)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:130)
at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:69)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:230)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:308)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:174)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:453)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.j
ava:237)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:133)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextL
istener.java:94)

kohsuke
Offline
Joined: 2003-06-09

Again, I think it's the same thing. Tomcat might be using a different endorsed directory, so you need to find out where that is.

Looking at my Tomcat installation, I suspect $TOMCAT_HOME/common/endorsed looks like the one.