From axis-user Sun Aug 12 13:52:04 2007 From: Sebastian Stein Date: Sun, 12 Aug 2007 13:52:04 +0000 To: axis-user Subject: Problems adding Axis2 to an existing Webapp Message-Id: <20070812135204.GE8914 () hpfsc ! de> X-MARC-Message: https://marc.info/?l=axis-user&m=118692675705598 Hi, I have an existing webapp. Now, I want to add Axis2 to expose some classes as web service. I can't alter the structure of the existing webapp. I added the Axis2 libs to WEB-INF/ and I will later strip out the libs not actually needed. At the moment the content of WEB-INF/lib is: activation-1.1.jar commons-logging-1.1.jar activation-LICENSE.txt commons-logging-LICENSE.txt annogen-0.1.0.jar geronimo-spec-jms-1.1-rc4.jar annogen-LICENSE.txt geronimo-spec-jms-LICENSE.txt axiom-api-1.2.4.jar jakarta-httpcore-4.0-alpha4.jar axiom-api-LICENSE.txt jakarta-httpcore-LICENSE.txt axiom-dom-1.2.4.jar jaxb-api-2.0.2.jar axiom-dom-LICENSE.txt jaxb-impl-2.0.2.jar axiom-impl-1.2.4.jar jaxb-xjc-2.0.2.jar axiom-impl-LICENSE.txt jaxen-1.1-beta-10.jar axis2-adb-1.2.jar jaxen-LICENSE.txt axis2-adb-codegen-1.2.jar jettison-1.0-RC1.jar axis2-codegen-1.2.jar jibx-bind-1.1.4.jar axis2-fastinfoset-1.2.jar jibx-run-1.1.4.jar axis2-java2wsdl-1.2.jar mail-1.4.jar axis2-jaxbri-1.2.jar mail-LICENSE.txt axis2-jaxws-1.2.jar neethi-2.0.1.jar axis2-jaxws-api-1.2.jar neethi-LICENSE.txt axis2-jibx-1.2.jar stax-api-1.0.1.jar axis2-json-1.2.jar stax-api-LICENSE.txt axis2-kernel-1.2.jar stax-utils-20060915.jar axis2-LICENSE.txt stax-utils-LICENSE.txt axis2-metadata-1.2.jar woden-1.0-incubating-M7a.jar axis2-saaj-1.2.jar woden-LICENSE.txt axis2-saaj-api-1.2.jar wsdl4j-1.6.2.jar axis2-soapmonitor-1.2.jar wsdl4j-LICENSE.txt axis2-spring-1.2.jar wstx-asl-3.2.1.jar axis2-tools-1.2.jar wstx-LICENSE.txt axis2-xmlbeans-1.2.jar xalan-2.7.0.jar backport-util-concurrent-2.2.jar xbean-2.2.0.jar backport-util-concurrent-LICENSE.txt xbean-LICENSE.txt commons-codec-1.3.jar xercesImpl-2.8.1.jar commons-codec-LICENSE.txt xercesImpl-LICENSE.txt commons-fileupload-1.1.1.jar xml-apis-1.3.03.jar commons-fileupload-LICENSE.txt xml-apis-LICENSE.txt commons-httpclient-3.0.1.jar XmlSchema-1.3.1.jar commons-httpclient-LICENSE.txt XmlSchema-LICENSE.txt commons-io-1.2.jar I created a small example, just consisting of a servlet and a POJO java class, which should be exposed as web service. The webapp folder structure looks as follows: |-- META-INF |-- WEB-INF | |-- classes | | `-- de | | `-- hpfsc | | |-- Echo.class | | `-- EchoServlet.class | |-- lib | | |-- ... | |-- services | | `-- Echo | | |-- META-INF | | | `-- services.xml | `-- web.xml `-- index.jsp I added Axis to my web.xml: Axis2Test Echo Servlet EchoServlet de.hpfsc.EchoServlet Apache-Axis Servlet AxisServlet org.apache.axis2.transport.http.AxisServlet 1 EchoServlet /servlet/EchoServlet AxisServlet /servlet/AxisServlet AxisServlet *.jws AxisServlet /services/* index.html index.htm index.jsp default.html default.htm default.jsp Finally, I created a services.xml file to expose de.echo.Echo class as a web service. The content of the file looks as follows: EchoAxis2 de.echo.Echo My first question is if there is a XML Schema file (XSD) available to validate the services.xml file? Now, if I deploy this complete web app on Tomcat, I get the following exception: 12.08.2007 14:52:25 org.apache.axis2.deployment.ServiceDeployer deploy SCHWERWIEGEND: The Echo service, which is not valid, caused Processing Operations Modules with an error of The following error occurred during schema generation: de.echo.Echo org.apache.axis2.deployment.DeploymentException: Processing Operations Modules with an error of The following error occurred during schema generation: de.echo.Echo at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:381) at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:98) at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:175) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:79) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:582) ... Caused by: java.lang.ClassNotFoundException: de.echo.Echo 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 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.SchemaGenerator.(SchemaGenerator.java:121) at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:306) at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:339) ... 38 more I think the second part is more interesting, because it says that my class de.echo.Echo can't be found. Any ideas what I'm doing wrong? Do I have to specify somehow a path where Axis should look for class files? I'm pretty sure it must work somehow like that, because I was able to generate such an example webapp using Eclipse and Axis1. Regards, Sebastian -- http://www.halle-ist-schoen.de/ City of Halle, Germany --------------------------------------------------------------------- To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org For additional commands, e-mail: axis-user-help@ws.apache.org