jQuery in Action, 2nd edition*
The moose likes BEA/Weblogic and the fly likes can't generate web service with jwsc in weblogic 9.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "can Watch "can New topic

can't generate web service with jwsc in weblogic 9.2

Dudley Dawson
Ranch Hand

Joined: Dec 14, 2004
Posts: 57
Hello, when trying to use the jwsc webservice generator task, I get the following exception:

[jwsc] JWS: processing module /path/to/my/service/Class
[jwsc] Parsing source files
[jwsc] Parsing source files
[jwsc] java.lang.NoSuchMethodException: com.bea.util.jam.internal.javadoc.JavadocResults._setRoot(com.sun.javadoc.RootDoc)
[jwsc] at java.lang.Class.getMethod(Class.java:1605)
[jwsc] at com.bea.util.jam.internal.javadoc.JavadocResults.getRoot(JavadocResults.java:71)
[jwsc] at com.bea.util.jam.internal.javadoc.JavadocRunner.run(JavadocRunner.java:148)
[jwsc] at com.bea.util.jam.internal.javadoc.JavadocClassBuilder.initJavadoc(JavadocClassBuilder.java:238)
[jwsc] at com.bea.util.jam.internal.javadoc.JavadocClassBuilder.init(JavadocClassBuilder.java:88)
[jwsc] at com.bea.util.jam.provider.CompositeJamClassBuilder.init(CompositeJamClassBuilder.java:45)
[jwsc] at com.bea.util.jam.provider.JamServiceFactoryImpl.createBuilder(JamServiceFactoryImpl.java:178)
[jwsc] at com.bea.util.jam.provider.JamServiceFactoryImpl.createClassLoader(JamServiceFactoryImpl.java:137)
[jwsc] at com.bea.util.jam.provider.JamServiceFactoryImpl.createService(JamServiceFactoryImpl.java:78)
[jwsc] at weblogic.wsee.util.JamUtil.parseSource(JamUtil.java:149)
[jwsc] at weblogic.wsee.tools.anttasks.JwsLoader.loadJClasses(JwsLoader.java:185)
[jwsc] at weblogic.wsee.tools.anttasks.JwsLoader.load(JwsLoader.java:72)
[jwsc] at weblogic.wsee.tools.anttasks.JwsModule.loadWebServices(JwsModule.java:425)
[jwsc] at weblogic.wsee.tools.anttasks.JwsModule.generate(JwsModule.java:279)
[jwsc] at weblogic.wsee.tools.anttasks.JwsModule.build(JwsModule.java:219)
[jwsc] at weblogic.wsee.tools.anttasks.JwscTask.execute(JwscTask.java:182)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[jwsc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[jwsc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.Target.execute(Target.java:357)
[jwsc] at org.apache.tools.ant.Target.performTasks(Target.java:385)
[jwsc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
[jwsc] at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
[jwsc] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[jwsc] at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
[jwsc] at org.apache.tools.ant.Main.runBuild(Main.java:698)
[jwsc] at org.apache.tools.ant.Main.startAnt(Main.java:199)
[jwsc] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
[jwsc] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

I don't understand this. I checked in weblogic.jar the class com.bea.util.jam.internal.javadoc.JavadocResults indeed does have a method with signature _setRoot(com.sun.javadoc.RootDoc)

please advise
Jeff Horan
Ranch Hand

Joined: Apr 03, 2003
Posts: 37
just wondering if you solved this one. I am having the same problem.

Bob Pollack

Joined: Aug 20, 2008
Posts: 2
I solved my instance of this problem by following the procedure outlined by Carlo de Rossi ("cdrcdr") at http://forums.bea.com/thread.jspa?threadID=570000856 (a BEA forum). Basically, this procedure involves changing the Ant startup script so that your JDK's tools.jar is included in Ant's classpath.

Apparently what causes this problem (at least in my case and Mr. Rossi's) is that Ant can load the class com.sun.javadoc.RootDoc from one location and the BEA JavadocResults class can load it from another. This results in a method mismatch in _setRoot(com.sun.javadoc.RootDoc), because even though the JVM finds a _setRoot method that takes com.sun.javadoc.RootDoc as an argument, it's not the same com.sun.javadoc.RootDoc, but one that was loaded with a different class loader.

It seems the problem goes away if Ant is given a classpath that includes the Rootdoc class that the BEA class will later load. This seems to make the classloader conclude that RootDoc is already loaded and so avoid loading an incompatible version.

In my case, I suspect this was all due to my use of JDK 1.6 instead of the JDKs that are delivered with WebLogic (I'm using version 10.0 of WLS).
Bob Pollack

Joined: Aug 20, 2008
Posts: 2
Later, I had a "pure" jwsc problem, in which I got a message that begins

com.bea.util.jam.internal.javadoc.JavadocClassloadingException: An error has occurred while invoking javadoc ...

I won't quote the message in its entirety; see http://forums.bea.com/thread.jspa?threadID=570001084 for the complete text.

I was able to solve this by running Ant with an explicit class path. I simply put the following script, under the name "ant.bat" into my working directory, and it seems to work fine. I am a Windows user, so this is a Windows .bat script. To use it, even if you're a Windows user, you'll have to change the value of "realAnt" to point to where Ant is installed on your system. If you're a Unix user, you'll also have to convert this to a shell script.

@echo OFF
echo Running Ant with modified class path

set realAnt=C:\java\ant\bin\ant
set bea=D:/bea
set beaJDK=%bea%/jdk150_11
set toolsJar=%beaJDK%/lib/tools.jar


%realAnt% %*

[ September 15, 2008: Message edited by: Bob Pollack ]
[ September 15, 2008: Message edited by: Bob Pollack ]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: can't generate web service with jwsc in weblogic 9.2
Similar Threads
javax.xml.rpc.soap. SOAPFaultException , unrecognized operation
Exception in Ant
Weblogic 8.1.3 Custom Identity Asserter
Regarding Ant issue.
How to using Hibernate with in Axis2 web services