Bonjour

J'essaie d'utiliser la fonction Java2WSDL avec Maven, mais j'ai toujours l'erreur ClassNotFoundException .
Quel est le problème ? Comment le résoudre ? Même en lançant Java2WSDL.bat j'ai la même erreur.
J'ai cherché sur internet toute la journée, je trouve des gens qui ont le même problème, mais pas de solution.

Environnement :
Windows 7 x64
Eclipse Juno (4.2) avec les plugins Apache Maven 2.1 et m2e 1.2
Axis2 1.6.2
Maven 3.0.5

Ma classe de test :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 
package test;
public class Sample {
	public String method(String input)
	{
		return "hello";
	}
}
Mon fichier pom.xml (Maven)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<groupId>Sample</groupId>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>SampleJAVA2WSDL</artifactId>
	<version>1.0.0</version>
	<dependencies>
 
	        <!-- Axis2 -->
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2</artifactId>
            <version>1.6.2</version>
        </dependency>
 
        <dependency>
             <groupId>org.apache.axis2</groupId>
             <artifactId>axis2-spring</artifactId>
             <version>1.6.2</version>
        </dependency>
	<dependency>
	<groupId>org.apache.axis2</groupId>
	<artifactId>axis2-java2wsdl</artifactId>
	<version>1.6.2</version>
</dependency>
<dependency>
	<groupId>org.apache.axis2.maven2</groupId>
	<artifactId>axis2-java2wsdl-maven-plugin</artifactId>
	<version>1.1</version>
</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>1.4</version>
		</dependency>
		<dependency>
			<groupId>javax.sql</groupId>
			<artifactId>jdbc-stdext</artifactId>
			<version>2.0</version>
			<scope>system</scope>
			<systemPath>${java.home}/lib/rt.jar</systemPath>
		</dependency>
 
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<type>jar</type>
			<version>2.3</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl104-over-slf4j</artifactId>
			<type>jar</type>
			<version>1.4.2</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<type>jar</type>
			<version>3.0.1-FINAL</version>
			<scope>compile</scope>
		</dependency>
 
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<type>jar</type>
			<version>1.2</version>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>commons-digester</groupId>
			<artifactId>commons-digester</artifactId>
			<type>jar</type>
			<version>1.6</version>
			<scope>runtime</scope>
		</dependency>
	</dependencies>
 
	<build>
		<finalName>toto.jar</finalName>
		<sourceDirectory>src</sourceDirectory>
		<resources>
			<resource>
				<directory>${basedir}/src</directory>
			</resource>
			<resource>
				<directory>src</directory>
				<includes>
					<include>**</include>
				</includes>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
		</resources>
 
		<pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse 
                m2e settings only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.apache.axis2.maven2</groupId>
                                    <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
                                    <versionRange>[1.0,)</versionRange>
                                    <goals>
                                        <goal>test-compile</goal>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <execute />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
            	<plugin>
		        <groupId>org.apache.axis2.maven2</groupId>
		        <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
		        <version>1.1</version>
		        <configuration>
		          <className>test.Sample</className>
		        <outputFileName>sample.wsdl</outputFileName>
 
		        </configuration>
		        <executions>
		          <execution>
		            <goals>
		              <goal>java2wsdl</goal>
		            </goals>
		          </execution>
		         </executions>
		     </plugin>
            </plugins>
            </pluginManagement>
            <plugins>
            
 
			<plugin>
		        <groupId>org.apache.axis2.maven2</groupId>
		        <artifactId>axis2-java2wsdl-maven-plugin</artifactId>
 
		        <configuration>
		          	<className>test.Sample</className>
		        <outputFileName>sample.wsdl</outputFileName>
 
		        </configuration>
		        <executions>
		          <execution>
 
		          <phase>install</phase>
		            <goals>
		              <goal>java2wsdl</goal>
		            </goals>
		          </execution>
		         </executions>
		     </plugin>
        </plugins>
    
	</build>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>
</project>
Extrait du log de Maven
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 
error : 
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.280s
[INFO] Finished at: Tue May 14 15:42:48 CEST 2013
	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.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
	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.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.lang.ClassNotFoundException: test.Sample
	at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
	at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
	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)
	... 22 more
[INFO] Final Memory: 12M/162M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.axis2.maven2:axis2-java2wsdl-maven-plugin:1.1:java2wsdl (default) on project SampleJAVA2WSDL: java.lang.ClassNotFoundException: test.Sample -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Essais en ligne de commande :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
C:\rootDev\axis2-1.6.2\bin\java2wsdl -cn test.Sample
Résultat :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 
Using AXIS2_HOME:   C:\rootDev\axis2-1.6.2
Using JAVA_HOME:    C:\Program Files\Java\jdk1.7.0_15
log4j:WARN No appenders could be found for logger (org.apache.axis2.util.Loader).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.ClassNotFoundException: test.Sample
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:266)
        at org.apache.axis2.description.java2wsdl.Java2WSDLUtils.namespaceFromClassName(Java2WSDLUtils.java:65)
        at org.apache.axis2.description.java2wsdl.Java2WSDLUtils.schemaNamespaceFromClassName(Java2WSDLUtils.java:84)
        at org.apache.ws.java2wsdl.Java2WSDLBuilder.getSchemaTargetNamespace(Java2WSDLBuilder.java:120)
        at org.apache.ws.java2wsdl.Java2WSDLBuilder.generateWSDL(Java2WSDLBuilder.java:211)
        at org.apache.ws.java2wsdl.Java2WSDLCodegenEngine.generate(Java2WSDLCodegenEngine.java:60)
        at org.apache.ws.java2wsdl.Java2WSDL.main(Java2WSDL.java:36)
Toute aide sera appréciée !