Nous réalisons un projet de service Web avec Axis 1.x et je n'arrive pas à faire fonctionner la version Maven.Pourquoi axistools-maven-plugin tente-t-il d'accéder à cet emplacement de schéma relatif?
Je fais
mvn clean generate-sources
qui déclenche wsdl2java
but de axistools-maven-plugin. Il finit par abandonner avec
[INFO] [axistools:wsdl2java {execution: generate-project}]
[INFO] about to add compile source root
[INFO] Processing wsdl: C:\Project\src\main\webapp\WEB-INF\wsdl\project.wsdl
Jan 24, 2011 11:24:58 AM org.apache.axis.utils.JavaUtils isAttachmentSupported
WARNING: Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error generating Java code from WSDL.
Embedded error: Error running Axis
C:\Project\src\main\webapp\WEB-INF\project.xsd (The system cannot find the file specified)
Ceci est correct. Ce fichier n'existe pas. (Et -e ne donne aucun renseignement supplémentaire utile -. Il est un LifecycleExecutionException, causée par une MojoExecutionException, causée par une AxisPluginException, causée par un FileNotFoundException)
Le point est, il ne faut pas chercher WEB-INF\project.xsd
, il devrait accéder WEB-INF\wsdl\project.xsd
.
Voici ce que dit le WSDL:
<wsdl:types>
<xsd:schema targetNamespace="http://domain/project/">
<xsd:import namespace="http://domain/schema/" schemaLocation="project.xsd"/>
</xsd:schema>
</wsdl:types>
Cela semble fonctionner très bien pour tous mes collègues. Nous utilisons tous Maven 2.2.1 et axistools-maven-plugin est épinglée à 1,4 avec la configuration suivante:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>generate-project</id>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>
<sourceDirectory>${basedir}/src/main/webapp/WEB-INF/wsdl/</sourceDirectory>
<outputDirectory>target/generated-sources</outputDirectory>
<serverSide>true</serverSide>
<testCases>false</testCases>
<wrapArrays>false</wrapArrays>
</configuration>
</execution>
</executions>
</plugin>
je l'ai déjà complètement éclaircis dépôt local, en espérant que c'était une dépendance voyou, mais n'a rien changé. Une idée de ce qui pourrait causer cela juste pour moi, mais pas pour mes collègues?
EDIT 1: J'ai essayé de changer le schemaLocation à wsdl/project.xsd
(juste à des fins de test, je ne pourrai pas apporter des modifications permanentes au WSDL) et a obtenu ce résultat amusant:
Embedded error: Error running Axis
WSDLException (at /wsdl:definitions/wsdl:types/xsd:schema):
faultCode=OTHER_ERROR: An error occurred trying to resolve
schema referenced at 'wsdl\project.xsd', relative to
'file:/C:/Project/src/main/webapp/WEB-INF/wsdl/project.wsdl'.:
This file was not found:
file:/C:/Project/src/main/webapp/WEB-INF/wsdl/wsdl/project.xsd
Si vous êtes, comme moi, maintenant en pensant que peut-être ./project.xsd
pourrait fonctionner ... non, désolé, cela le rend directement à la recherche de WEB-INF/project.xsd
encore.
EDIT 2: D'accord, axistools maintenant est me taquine ...
../project.xsd
->src/main/webapp/project.xsd
(mal)
../wsdl/project.xsd
->src/main/webapp/wsdl/project.xsd
(mal)
../WEB-INF/wsdl/project.xsd
->src/main/webapp/WEB-INF/WEB-INF/wsdl/project.xsd
(faux)
Pour rappel, le chemin correct serait src/main/webapp/WEB-INF/wsdl/project.xsd
.
Avez-vous essayé mvn clean generate-sources? – Raghuram
@Raghuram: Oui, c'est ce que je suis en train de faire. Je vais l'éditer dans la question. –
Avez-vous expurgé le nom du répertoire du projet pour SO? Je pense que ce problème se produit si vous avez des espaces dans le chemin .. Commun sur Windows XP –