[
https://issues.apache.org/jira/browse/AXIS2-2303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12480470
]
Eduardo de Vera commented on AXIS2-2303:
----------------------------------------
Great work with the patch!
I think there is a need for the java2wsdl plugin to handle the project's
classpath in order to be able to generate a wsdl out of a class file generated
by the project.
Lets imagine I have a module called example-impl. On this project I have all
the business logic that I will be calling from the class that represents the
web service On the other hand I have a module called example-ws which contains
the example-impl as a dependency and a java class that exposes the methods as a
web service.
When I try to execute the java2wsdl maven plugin, it expects to find the class
described in the <className>test.TestInterface</className> in one of the jars
included as a dependency (either as a project dependency, thanks to shane's
work, or as the plugin's dependency). I think it would be also very useful to
be able to pick one of the classes generated by the module that contains the
java2wsdl plugin configuration. Thus, the classpath of the project should be
added to the one of the plugin.
> java2wsdl-maven-plugin throws ClassNotFoundException on execution of
> java2wsdl goal
> -----------------------------------------------------------------------------------
>
> Key: AXIS2-2303
> URL: https://issues.apache.org/jira/browse/AXIS2-2303
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: Tools
> Environment: Maven 2.0.5, Windows, JDK 1.5
> Reporter: Shane Isbell
> Priority: Minor
> Fix For: nightly
>
> Attachments: java2wsdl-plugin.patch, patch-tests.zip
>
>
> When invoking the java2wsdl maven plugin on a project, I receive a
> java.lang.ClassNotFoundException. This is due to the maven plugin not adding
> the pom dependencies to the option map ( which is fed into the class loader).
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.axis2</groupId>
> <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>java2wsdl</goal>
> </goals>
> </execution>
> </executions>
> <configuration>
> <className>test.TestInterface</className>
> <outputFileName>target/service.wsdl</outputFileName>
> </configuration>
> </plugin>
> </plugins>
> </build>
> Stack Trace:
> [INFO] [axis2-java2wsdl:java2wsdl {execution: default}]
> java.lang.Exception: java.lang.ClassNotFoundException: test.TestInterface
> at
> org.apache.ws.java2wsdl.Java2WSDLCodegenEngine.generate(Java2WSDLCode
> genEngine.java:58)
> at
> org.apache.axis2.maven2.java2wsdl.Java2WSDLMojo.execute(Java2WSDLMojo
> .java:164)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:420)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:539)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:480)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:459)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:311)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:278)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:143)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> 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: test.TestInterface
> 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(RealmClassL
> oader.java:195)
> at
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassReal
> m.java:255)
> at
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassReal
> m.java:274)
> at
> org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassReal
> m.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:242)
> at
> org.apache.ws.java2wsdl.Java2WSDLUtils.namespaceFromClassName(Java2WS
> DLUtils.java:63)
> at
> org.apache.ws.java2wsdl.Java2WSDLUtils.schemaNamespaceFromClassName(J
> ava2WSDLUtils.java:82)
> at
> org.apache.ws.java2wsdl.Java2WSDLBuilder.getSchemaTargetNamespace(Jav
> a2WSDLBuilder.java:56)
> at
> org.apache.ws.java2wsdl.Java2WSDLBuilder.generateWSDL(Java2WSDLBuilde
> r.java:152)
> at
> org.apache.ws.java2wsdl.Java2WSDLCodegenEngine.generate(Java2WSDLCode
> genEngine.java:56)
> ... 19 more
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] java.lang.ClassNotFoundException: test.TestInterface
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]