2 Replies Latest reply: Apr 16, 2013 9:41 AM by 1003192 RSS

    Weblogic12.c and JWS - NoClassDefFoundError using JwscTask

    1003192
      I recently upgraded to Weblogic 12c and have been attempting to follow the following tutorial to create a Java WebService.
      http://docs.oracle.com/cd/E24329_01/web.1211/e24964/use_cases.htm#g264633

      I used the following to create wlfullclient.jar in the server/lib directory:
      java -jar wljarbuilder.jar

      I am using apache-ant-1.9.0.

      I created the following in my build.xml. The JwscTask lives in both the weblogic.jar and the wseeclient.jar. I included other jars to resolve ClassNotFoundExceptions until the stacktrace threw a ClassNotFoundException while looking for com/bea/xml/XmlException. XmlException should be part of the apache pacakge included in xbean.jar. I don't understand why the weblogic12 server/lid dir does not provide all the necessary files to support the JwscTask used for building Jax-ws webservices using JWS annotations.

      Build.xml entry
      <taskdef name="jwsc"
           classname="weblogic.wsee.tools.anttasks.JwscTask">
                <classpath>     
                     <pathelement location="lib/wseeclient.jar"/>     
                     <pathelement location="lib/wlclient.jar"/>
                     <pathelement location="lib/wlthint3client.jar"/>     
                     <pathelement location="lib/wlfullclient.jar"/>     
                     <pathelement location="lib/jaxws-api.jar"/>
                     <pathelement location="lib/jaxws-rt.jar"/>
                     <pathelement location="lib/xbean.jar"/>     
           </classpath>
           </taskdef>          


      StackTrace:
      BUILD FAILED
      /cclamp/home/ydb6rhy/cclampWorkspace2/jwsPlay/build.xml:140: java.lang.NoClassDefFoundError: com/bea/xml/XmlException
      at weblogic.wsee.jws.HandlerChainDeclFactory.newInstance(HandlerChainDeclFactory.java:20)
      at weblogic.wsee.jws.WebServiceRuntimeDecl.<init>(WebServiceRuntimeDecl.java:91)
      at weblogic.wsee.tools.jws.decl.WebServiceDecl.<init>(WebServiceDecl.java:48)
      at weblogic.wsee.tools.jws.decl.WebServiceSEIDecl.<init>(WebServiceSEIDecl.java:81)
      at weblogic.wsee.tools.jws.decl.WebServiceSEIDecl.<init>(WebServiceSEIDecl.java:68)
      at weblogic.wsee.tools.jws.decl.WebServiceDeclFactory.newInstance(WebServiceDeclFactory.java:54)
      at weblogic.wsee.tools.anttasks.JwsModule.buildAndValidate(JwsModule.java:596)
      at weblogic.wsee.tools.anttasks.JwsModule.loadWebServices(JwsModule.java:587)
      at weblogic.wsee.tools.anttasks.JwsModule.generate(JwsModule.java:382)
      at weblogic.wsee.tools.anttasks.JwsModule.build(JwsModule.java:258)
      at weblogic.wsee.tools.anttasks.JwscTask.execute(JwscTask.java:229)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      at org.apache.tools.ant.Task.perform(Task.java:348)
      at org.apache.tools.ant.Target.execute(Target.java:435)
      at org.apache.tools.ant.Target.performTasks(Target.java:456)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
      at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
      at org.apache.tools.ant.Main.runBuild(Main.java:851)
      at org.apache.tools.ant.Main.startAnt(Main.java:235)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        • 1. Re: Weblogic12.c and JWS - NoClassDefFoundError using JwscTask
          1003192
          I was able to resolve by cleaning up my classpath in my build.xml. I'm not sure where all the ClassNotFoundExceptions came from. Classes exist in multiple WL12 jars so I believe there was a class confilct and I was using deprecated code inadvertantly.

          <property name="weblogic.classpath" value="<wl12_home>/server/lib"/>

               <taskdef name="jwsc"
               classname="weblogic.wsee.tools.anttasks.JwscTask">
               <classpath>      
               <path id="weblogic.classpath" > <!-- Path value = ${classpath} -->     
               <pathelement path="classpath"/>
                    <fileset dir="${weblogic.classpath}">
                    <include name="weblogic.jar"/>
                    </fileset>
               </path>
               </classpath>
               </taskdef>

          Edited by: 1000189 on Apr 16, 2013 7:02 AM
          • 2. Re: Weblogic12.c and JWS - NoClassDefFoundError using JwscTask
            1003192
            It looks like the original WL12 download was either corrupted when stored on our system or when we created the wlfullclient.jar. I had to dl Oracle 12.c again in order to see the fix.