Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-3069

ClassNotFoundException at java2wsdl when using maven2

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Invalid
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Component/s: codegen
    • Labels:
      None
    • Environment:

      Description

      when running 'mvn compile' in the attached artifact, the following is the output, which shows that a ClassNotFoundException is thrown. It is remarkable that after 'mvn compile' a directory 'home' with sub folders is created in the local directory (which doesn't make any sense, I believe). Here the output:

      [INFO] Scanning for projects...
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building Unnamed - chris-test:java2wsdl-fails:jar:0.0.1-SNAPSHOT
      [INFO] task-segment: [compile]
      [INFO] ----------------------------------------------------------------------------
      Downloading: http://repo1.maven.org/maven//woodstox/poms/wstx-asl-3.0.1.pom
      Downloading: http://ws.zones.apache.org/repository//woodstox/poms/wstx-asl-3.0.1.pom
      Downloading: http://repo1.maven.org/maven2/woodstox/wstx-asl/3.0.1/wstx-asl-3.0.1.pom
      Downloading: http://repo1.maven.org/maven2/woodstox/wstx-asl/3.0.1/wstx-asl-3.0.1.pom
      Downloading: http://repo1.maven.org/maven//jaxen/poms/jaxen-1.1-beta-10.pom
      Downloading: http://ws.zones.apache.org/repository//jaxen/poms/jaxen-1.1-beta-10.pom
      Downloading: http://repo1.maven.org/maven2/jaxen/jaxen/1.1-beta-10/jaxen-1.1-beta-10.pom
      Downloading: http://repo1.maven.org/maven2/jaxen/jaxen/1.1-beta-10/jaxen-1.1-beta-10.pom
      [INFO] [axis2-java2wsdl:java2wsdl

      {execution: default}

      ]
      java.lang.Exception: java.lang.ClassNotFoundException: pojoservice.MyService
      at org.apache.ws.java2wsdl.Java2WSDLCodegenEngine.generate(Java2WSDLCodegenEngine.java:58)
      at org.apache.axis2.maven2.java2wsdl.Java2WSDLMojo.execute(Java2WSDLMojo.java:146)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
      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 org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: java.lang.ClassNotFoundException: pojoservice.MyService
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
      at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
      at org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
      at org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:247)
      at org.apache.ws.java2wsdl.Java2WSDLUtils.namespaceFromClassName(Java2WSDLUtils.java:63)
      at org.apache.ws.java2wsdl.Java2WSDLUtils.schemaNamespaceFromClassName(Java2WSDLUtils.java:82)
      at org.apache.ws.java2wsdl.Java2WSDLBuilder.getSchemaTargetNamespace(Java2WSDLBuilder.java:56)
      at org.apache.ws.java2wsdl.Java2WSDLBuilder.generateWSDL(Java2WSDLBuilder.java:152)
      at org.apache.ws.java2wsdl.Java2WSDLCodegenEngine.generate(Java2WSDLCodegenEngine.java:56)
      ... 19 more
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] java.lang.ClassNotFoundException: pojoservice.MyService

      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 16 seconds
      [INFO] Finished at: Fri Aug 03 21:05:48 CEST 2007
      [INFO] Final Memory: 3M/7M
      [INFO] ------------------------------------------------------------------------

      1. chris-test-works.zip
        3 kB
        Davanum Srinivas
      2. chris-test.tgz
        1 kB
        Chris Oloff

        Activity

        Hide
        virgil_trasca@yahoo.com Trasca Virgil added a comment -

        It seems that it is not solved. Please check my post on axis-dev list about this.

        Show
        virgil_trasca@yahoo.com Trasca Virgil added a comment - It seems that it is not solved. Please check my post on axis-dev list about this.
        Hide
        cdaniluk Cris Daniluk added a comment -

        This doesn't exactly seem fixed to me. First of all, I can't make this work on an actual RELEASED version of the plugin. Second, I can't even get the most recent snapshot to work at all. The POM includes all sorts of noise that just shouldn't be required, per Chris's point. Can this issue get some attention? I'm fairly certain this plugin just flat out doesn't work in its current state.

        Show
        cdaniluk Cris Daniluk added a comment - This doesn't exactly seem fixed to me. First of all, I can't make this work on an actual RELEASED version of the plugin. Second, I can't even get the most recent snapshot to work at all. The POM includes all sorts of noise that just shouldn't be required, per Chris's point. Can this issue get some attention? I'm fairly certain this plugin just flat out doesn't work in its current state.
        Hide
        chris_o Chris Oloff added a comment -

        Sounds good that it's working now, but: Now the pom is polluted with lots of dependencies, which are dependencies of the plugin, not my artifact. Shouldn't these dependencies go to the plugin's pom?

        Chris

        Show
        chris_o Chris Oloff added a comment - Sounds good that it's working now, but: Now the pom is polluted with lots of dependencies, which are dependencies of the plugin, not my artifact. Shouldn't these dependencies go to the plugin's pom? Chris
        Hide
        dims Davanum Srinivas added a comment -

        Here's the zip with a pom.xml that works fine with latest nightly of 1.3 branch.

        thanks,
        dims

        Show
        dims Davanum Srinivas added a comment - Here's the zip with a pom.xml that works fine with latest nightly of 1.3 branch. thanks, dims
        Hide
        dims Davanum Srinivas added a comment -

        Chris,

        Many problems with the pom.xml...I will upload a zip that works.

        thanks,
        dims

        Show
        dims Davanum Srinivas added a comment - Chris, Many problems with the pom.xml...I will upload a zip that works. thanks, dims
        Hide
        chris_o Chris Oloff added a comment -

        The maven project to reproduce the issue.

        Show
        chris_o Chris Oloff added a comment - The maven project to reproduce the issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            chris_o Chris Oloff
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development