This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 91622 - NoClassDefFoundError: com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder
Summary: NoClassDefFoundError: com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder
Status: VERIFIED FIXED
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Milan Kuchtiak
URL: http://weblogs.java.net/blog/vivekp/a...
Keywords:
: 90685 (view as bug list)
Depends on:
Blocks: 89517 89958 93301
  Show dependency tree
 
Reported: 2006-12-28 20:24 UTC by Lukas Jungmann
Modified: 2007-02-16 11:30 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch for netbeans launcher (trunk version) (3.13 KB, patch)
2007-01-30 09:06 UTC, _ rkubacki
Details | Diff
rebuilt launcher (trunk) (42.00 KB, application/octet-stream)
2007-01-30 09:08 UTC, _ rkubacki
Details
rebuilt console version of launcher (trunk) (29.00 KB, application/octet-stream)
2007-01-30 09:09 UTC, _ rkubacki
Details
rebuilt launcher (release551) (41.00 KB, application/octet-stream)
2007-01-30 12:21 UTC, _ rkubacki
Details
rebuilt console version of launcher (release551) (28.50 KB, application/octet-stream)
2007-01-30 12:22 UTC, _ rkubacki
Details
proposed patch (3.67 KB, application/octet-stream)
2007-01-30 12:23 UTC, _ rkubacki
Details
unix launcher patch (release551) (1.73 KB, patch)
2007-01-31 15:38 UTC, _ rkubacki
Details | Diff
Patch to IDE main classloader to filter out JAX-WS 2.0 from JDK 6 (811 bytes, text/plain)
2007-02-12 22:27 UTC, Petr Jiricka
Details
updated launcher patch for 551 (both unix and win) (4.41 KB, patch)
2007-02-15 11:16 UTC, _ rkubacki
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Jungmann 2006-12-28 20:24:34 UTC
[own build from trunk 12/28/2006, IDE running on JDK 6]

-create jaxws client in java se project
-expand ws client node

=> following exception is being thrown until one (somehow) quits from the IDE:

SEVERE [org.openide.util.RequestProcessor]
java.lang.NoClassDefFoundError: Could not initialize class
com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder
	at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:389)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:253)
	at
com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getJAXBContext(BindInfo.java:316)
	at
com.sun.tools.xjc.reader.internalizer.SCDBasedBindingSet.apply(SCDBasedBindingSet.java:195)
	at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:502)
	at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:211)
	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:119)
	at
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2156)
	at
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:176)
	at
com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:126)
	at
org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler.generateWsdlModel(WsdlModeler.java:185)
	at
org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler.access$000(WsdlModeler.java:46)
	at
org.netbeans.modules.websvc.api.jaxws.wsdlmodel.WsdlModeler$1.run(WsdlModeler.java:69)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:541)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:963)

Seems to be related to using JAX-WS 2.1 on JDK 6
Comment 1 Lukas Jungmann 2007-01-02 09:33:23 UTC
Possible "fix" is explained in Vivek's blog, see:
http://weblogs.java.net/blog/vivekp/archive/2006/12/webservices_in.html
Comment 3 Milan Kuchtiak 2007-01-05 13:12:59 UTC
I tested setting the "java.endorsed.dirs" property with jdk1.6 in my Linux:

netbeans.conf :

netbeans_default_options="-J-Xms32m -J-Xmx128m -J-XX:PermSize=32m
-J-XX:MaxPermSize=160m -J-Dnetbeans.logger.console=true -J-ea
-J-Dapple.laf.useScreenMenuBar=true
-J-Djava.endorsed.dirs=$progdir/../ide8/modules/ext/jaxws20"

and it works. Nevertheless, I don't believe it will work on Windows.
Comment 4 Roderico Cruz 2007-01-09 17:47:36 UTC
Per phone discussion, reassigning to Milan.
Comment 5 Lukas Jungmann 2007-01-11 17:39:57 UTC
Solution (or at least workaround for now) for this is to:

1) split JAX-WS library into two parts (in different directories):
   1st must contain only "jaxws-tools.jar" - say LibA
   2nd must contain the rest of jars from this library - say LibB

2) "java.endorsed.dirs" system property must be set during IDE startup and must
point to the directory of LibB or the content of this lib. must be copied into
$JAVA_HOME/jre/lib/endorsed

3) wsimport task in generated projects' build scripts must be run with
'fork="true"' and following nested element must be added to this task:
  <jvmarg value="-Djava.endorsed.dirs=${java.endorsed.dirs}"/>
Comment 6 Lukas Jungmann 2007-01-11 18:24:48 UTC
*** Issue 91346 has been marked as a duplicate of this issue. ***
Comment 7 Milan Kuchtiak 2007-01-11 18:27:53 UTC
Too complicated workaround.
The original problem is in JAX-WS and JDK1.6.

I reported an issue to JAX-WS2.1 :
https://jax-ws-sources.dev.java.net/issues/show_bug.cgi?id=39
Comment 8 Lukas Jungmann 2007-01-11 18:30:36 UTC
"jaxb-xjc.jar" must be excluded from "LibB" too, because it contains ant tasks
definitions (for xjc and schemagen)
Comment 9 Lukas Jungmann 2007-01-18 17:22:24 UTC
*** Issue 92788 has been marked as a duplicate of this issue. ***
Comment 10 Milan Kuchtiak 2007-01-23 16:14:26 UTC
JAX-WS team recommends to set java.endorsed.dirs property containing 2 jars:
jaxb-api.jar
jaxws-api.jar
Comment 12 _ rkubacki 2007-01-29 12:37:03 UTC
OK, I am working on a patch for shell launcher and netbeans.exe that will pass
thiw property (unless there is another definition in netbeans_default_options).
Comment 13 _ rkubacki 2007-01-30 09:06:08 UTC
Created attachment 37803 [details]
patch for netbeans launcher (trunk version)
Comment 14 _ rkubacki 2007-01-30 09:08:13 UTC
Created attachment 37804 [details]
rebuilt launcher (trunk)
Comment 15 _ rkubacki 2007-01-30 09:09:25 UTC
Created attachment 37805 [details]
rebuilt console version of launcher (trunk)
Comment 16 _ rkubacki 2007-01-30 10:10:37 UTC
Windows launcher is fixed in trunk. Please test it carefully

Checking in netbeans.exe;
/shared/data/ccvs/repository/ide/launcher/windows/netbeans.exe,v  <--  netbeans.exe
new revision: 1.25; previous revision: 1.24
done
Checking in nb.exe;
/shared/data/ccvs/repository/ide/launcher/windows/nb.exe,v  <--  nb.exe
new revision: 1.25; previous revision: 1.24
done
Checking in netbeans.cpp;
/shared/data/ccvs/repository/ide/launcher/windows/netbeans.cpp,v  <--  netbeans.cpp
new revision: 1.27; previous revision: 1.26
done
Comment 17 _ rkubacki 2007-01-30 12:21:50 UTC
Created attachment 37811 [details]
rebuilt launcher (release551)
Comment 18 _ rkubacki 2007-01-30 12:22:25 UTC
Created attachment 37812 [details]
rebuilt console version of launcher (release551)
Comment 19 _ rkubacki 2007-01-30 12:23:04 UTC
Created attachment 37813 [details]
proposed patch
Comment 20 _ rkubacki 2007-01-30 13:33:28 UTC
Fixed also launcher in trunk -
/shared/data/ccvs/repository/ide/launcher/unix/netbeans,v  <--  netbeans
new revision: 1.42; previous revision: 1.41

Now I will prepare patch for 5.5.1
Comment 21 Jaroslav Pospisil 2007-01-30 15:54:37 UTC
In NB5.5.1 proposed patch works O.K. for Glassfish,however on Tomcat,although
web service could be successfully deployed now,it's still deployed
stopped,because Tomcat doesn't use endorsed directory,as indicated by exception
in Tomcat output tab(the same exception mentioned here).This should be solved
maybe in separate issue.
Fix for NB6.0 works O.K. on Glassfish - Tomcat is still blocked by issue 92342.
Comment 22 Milan Kuchtiak 2007-01-31 15:37:27 UTC
I played with the new launcher (Netbeans6.0).

The solution is good for Netbeans running on jdk1.6 but not for jdk1.5.
The "java.endorsed.dirs" propery should be setup conditionaly: only if jdk
version is 1.6.

There is a discussion in JAX-WS team, nowadays, about these inconveniences and
JAX-WS team is looking for a solution for the final release of JAX-WS2.1.

We will see if they manage to find solution and whether the solution will be
found for both jax-ws runtime and for jax-ws ant scripts.
Comment 23 _ rkubacki 2007-01-31 15:38:57 UTC
Created attachment 37882 [details]
unix launcher patch (release551)
Comment 24 _ rkubacki 2007-01-31 15:50:05 UTC
re Milan'c comment about JDK5/6: there is no simple and fast way how to find
what version of JDK will be used. Sorry.
Comment 25 Milan Kuchtiak 2007-02-01 15:42:53 UTC
I tested thoroughly Radim's changes to NB Launcher.
We can set the "java.endorsed.dirs" property to IDE JVM regardless the jdk version.

We only need to put the right jar files to endorsed directory.
I found that except of jaxws-api.jar and jaxb-api.jar we need to add jsr173_api.jar.

According to the discussion with jax-ws team. we don't need to care about jdk
version. I am still waiting to the exact list of jars that need to be put to
endorsed directory.

As for me : Radim's changes are correct and can be integrated to release551 branch.

As far as WS running on Tomcat: 
yes we also need to resolve the issue 92342.
Tomcat (running in different JVM) requires setting the JAVA_ENDORSED_DIRS
property to the same value as IDE's "java.endorsed.dirs"
Comment 26 _ rkubacki 2007-02-02 14:58:30 UTC
Note that after integration to trunk we see approx. 5% startup regression due
more JARs on bootclasspath and mainly disabled class data sharing. Manual
measurements comparing builds from Jan 29 and Jan 31 on my P3/800MHz/512MB/Linux
Ubuntu0610/JDK1.6.0_01-b03 desktop show similar numbers and 6-7% regresion for a
cold start.
Comment 28 Peter Liu 2007-02-09 00:24:10 UTC
*** Issue 90685 has been marked as a duplicate of this issue. ***
Comment 29 Petr Jiricka 2007-02-12 22:27:04 UTC
Created attachment 38397 [details]
Patch to IDE main classloader to filter out JAX-WS 2.0 from JDK 6
Comment 30 Petr Jiricka 2007-02-12 22:30:25 UTC
I have attached a patch against NB 5.5.1 which filters out JAX-WS 2.0 API
classes from the main IDE classloader. This helped somewhat - the functionality
works in the IDE and does not throw exceptions. Ant still throws errors
(LinkageError), but this may be because of the fact that we don't have the
latest Kohsuke's fixes bundled in the IDE.
Comment 31 _ rkubacki 2007-02-15 10:29:36 UTC
Petr N. found that there is wrong condition in my patch - 

/shared/data/ccvs/repository/ide/launcher/unix/netbeans,v  <--  netbeans
new revision: 1.43; previous revision: 1.42
Comment 32 _ rkubacki 2007-02-15 10:34:34 UTC
Petr N. found that there is wrong condition in my patch, fixed and checked that
now it is really possible to set this property in netbeans.conf - 

/shared/data/ccvs/repository/ide/launcher/unix/netbeans,v  <--  netbeans
new revision: 1.43; previous revision: 1.42

and he also pointed that comment in windows launcher source is wrong 

/shared/data/ccvs/repository/ide/launcher/windows/netbeans.cpp,v  <--  netbeans.cpp
new revision: 1.28; previous revision: 1.27
Comment 33 _ rkubacki 2007-02-15 11:16:11 UTC
Created attachment 38530 [details]
updated launcher patch for 551 (both unix and win)
Comment 34 _ rkubacki 2007-02-15 11:17:54 UTC
I hope that Petr now can add his yes to these patches
Comment 35 Petr Nejedly 2007-02-15 12:26:21 UTC
Yes, the patch is correct now. Thanks.
Comment 36 _ rkubacki 2007-02-15 15:31:05 UTC
Launcher part fixed in release551 branch

Checking in ide/launcher/unix/netbeans;
/shared/data/ccvs/repository/ide/launcher/unix/netbeans,v  <--  netbeans
new revision: 1.23.2.3.2.6.22.1; previous revision: 1.23.2.3.2.6
done
Checking in ide/launcher/windows/nb.exe;
/shared/data/ccvs/repository/ide/launcher/windows/nb.exe,v  <--  nb.exe
new revision: 1.15.2.3.2.5.28.1; previous revision: 1.15.2.3.2.5
done
Checking in ide/launcher/windows/netbeans.cpp;
/shared/data/ccvs/repository/ide/launcher/windows/netbeans.cpp,v  <--  netbeans.cpp
new revision: 1.17.2.2.2.6.22.1; previous revision: 1.17.2.2.2.6
done
Checking in ide/launcher/windows/netbeans.exe;
/shared/data/ccvs/repository/ide/launcher/windows/netbeans.exe,v  <--  netbeans.exe
new revision: 1.15.2.3.2.5.28.1; previous revision: 1.15.2.3.2.5
done
Comment 37 Roderico Cruz 2007-02-15 21:43:54 UTC
Changing the resolution to FIXED. I will open another bug to track of 5%
performance regression as a result of the endorsed mechanism. Note that this fix
is temporary only for beta.
Comment 38 Roderico Cruz 2007-02-15 21:48:50 UTC
Opened http://www.netbeans.org/issues/show_bug.cgi?id=95741 to keep track of the
performance regression
Comment 39 Lukas Jungmann 2007-02-16 11:30:43 UTC
It works as I expect now, thanks => v. (also setting correct TM)