You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Martin Fernau <m....@cps-net.de> on 2009/07/17 10:09:26 UTC

axis2 and embedded jetty

Hi,

can someone provide me a simple description how to get axis2 to run in an 
embedded jetty6 Server?
Until now I'm unable to get it to work.
What I currently have is the following:

--- cut
		Server server = new Server(8080);

		ServletHolder axisServletholder = new ServletHolder(new AxisServlet());
		ServletHolder axisAdminServletholder = new ServletHolder(new 
AxisAdminServlet());

		Context root = new Context(server, "/", Context.SESSIONS);
		// set Path to exploded axis2.war
		FileResource basePath = new FileResource(new URL("file:/tests/webapps")); // 
Without these axis complain about missing axis2.xml
		root.setBaseResource(basePath);
		root.addServlet(axisServletholder, "/servlet/AxisServlet");
		root.addServlet(axisServletholder, "/services/*");
		root.addServlet(axisServletholder, "*.jws");
		root.addServlet(axisAdminServletholder, "/servlet/AdminServlet");

		server.start();
--- cut

But this just throw me some "java.lang.NoClassDefFoundError: 
org/apache/catalina/tribes/ChannelException" messages. It seems that axis2 
needs tomcat libraries?

Anyone with helpful comments or code snipsets which get axis2 to work under an 
embedded jetty?

Thanks a lot,
Martin

Re: A generally [silly] Q

Posted by Demetris G <de...@ece.neu.edu>.
Exactly what I was looking for - thanks Dennis.

Dennis Sosnoski wrote:
> There can be many types of differences between XML documents which are 
> not considered to be significant (whitespace, prefixes used for 
> namespaces, etc.), so if by "exactly identical" you mean the same 
> exact sequence of characters the answer is very likely "no". If you 
> mean they'll be equivalent XML documents, the answer is still very 
> likely "no" in the case of the WSDL, since Axis2 uses very different 
> code from Axis 1.4 to generate the WSDL and many aspects of the WSDL 
> are arbitrary (message names, etc.). For the actual SOAP message 
> you're more likely to have equivalent XML documents, but even here 
> there's room for differences without either implementation being in 
> error (skipping an element vs. including it with xsi:nil='true' when 
> the schema has both minOccurs="0" and nillable="true", for instance).
>
>  - Dennis
>

Re: AXIS2 excludeOperations and static WSDL

Posted by Deepal Jayasinghe <de...@gmail.com>.
Please create a JIRA. I will check it as soon as I get time.

On Wed, Jul 22, 2009 at 12:56 PM, Nadir Amra<am...@us.ibm.com> wrote:
> Apparently excludeOperations  in services.xml file does not work.  Is this
> a known problem or do I need to open a JIRA?  I have tried 1.5 and 1.4.
>
> Nadir Amra
>
>



-- 
http://blogs.deepal.org

AXIS2 excludeOperations and static WSDL

Posted by Nadir Amra <am...@us.ibm.com>.
Apparently excludeOperations  in services.xml file does not work.  Is this 
a known problem or do I need to open a JIRA?  I have tried 1.5 and 1.4.

Nadir Amra


Re: A generally [silly] Q

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
There can be many types of differences between XML documents which are 
not considered to be significant (whitespace, prefixes used for 
namespaces, etc.), so if by "exactly identical" you mean the same exact 
sequence of characters the answer is very likely "no". If you mean 
they'll be equivalent XML documents, the answer is still very likely 
"no" in the case of the WSDL, since Axis2 uses very different code from 
Axis 1.4 to generate the WSDL and many aspects of the WSDL are arbitrary 
(message names, etc.). For the actual SOAP message you're more likely to 
have equivalent XML documents, but even here there's room for 
differences without either implementation being in error (skipping an 
element vs. including it with xsi:nil='true' when the schema has both 
minOccurs="0" and nillable="true", for instance).

  - Dennis

-- 
Dennis M. Sosnoski
Java XML and Web Services
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Demetris G wrote:
>
> Both a WSDL request response from the Axis2 server and a SOAP message 
> leaving
> an Axis2 client are exactly identical with what the Axis 1.4 and its 
> corresponding
> client would emit. Yes? Both WSDl and SOAP are standards so I am not 
> expecting
> them to be any different, but do the two different implementations 
> emit any other data
> that is different between them?
>
> Thanks
>

A generally [silly] Q

Posted by Demetris G <de...@ece.neu.edu>.
Both a WSDL request response from the Axis2 server and a SOAP message 
leaving
an Axis2 client are exactly identical with what the Axis 1.4 and its 
corresponding
 client would emit. Yes? Both WSDl and SOAP are standards so I am not 
expecting
them to be any different, but do the two different implementations emit 
any other data
that is different between them?

Thanks


Re: axis2 and embedded jetty

Posted by Andreas Veithen <an...@gmail.com>.
Martin,

The explanation for this could be that the contextRoot and servicePath
parameters are not set correctly in axis2.xml.

Andreas

On Fri, Jul 17, 2009 at 10:33, Martin Fernau<m....@cps-net.de> wrote:
> Hi Andreas,
>
> you're right. After removing the corresponding parts from axis2.xml I don't get these exceptions any more.
> But the service isn't working properly. I get the follwoing output during startup:
>
> --- cut
> 2 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@32c41a via org.mortbay.log.Slf4jLog
> 275 [main] INFO org.mortbay.log - jetty-6.1.3
> 1232 [main] INFO org.apache.axis2.deployment.AxisConfigBuilder - Unable to instantiate deployer org.apache.axis2.deployment.TransportDeployer
> 1647 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: addressing-1.5 - file:/tests/webapps/WEB-INF/modules/addressing-1.5.mar
> 1666 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: jaxws-1.5 - file:/tests/webapps/WEB-INF/modules/axis2-jaxws-mar-1.5.mar
> 1686 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: script-1.5 - file:/tests/webapps/WEB-INF/modules/axis2-scripting-1.5.mar
> 1749 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: metadataExchange-1.5 - file:/tests/webapps/WEB-INF/modules/mex-1.5.mar
> 1778 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: mtompolicy-1.5 - file:/tests/webapps/WEB-INF/modules/mtompolicy-1.5.mar
> 1805 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: ping-1.5 - file:/tests/webapps/WEB-INF/modules/ping-1.5.mar
> 1829 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: soapmonitor-1.5 - file:/tests/webapps/WEB-INF/modules/soapmonitor-1.5.mar
> 1914 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: metadataExchange - file:/opt/java_libraries/axis2-1.4.1/lib/mex-1.4.1.jar
> 2658 [main] INFO org.apache.axis2.deployment.ServiceDeployer - Deploying Web service: version-1.5.aar - file:/tests/webapps/WEB-INF/services/version-1.5.aar
> 2230 [main] INFO org.apache.axis2.deployment.ServiceDeployer - Deploying Web service: SimpleHotelService.aar - file:/tests/webapps/WEB-INF/services/SimpleHotelService.aar
> 2756 [main] INFO org.mortbay.log - Started SocketConnector @ 0.0.0.0:8080
> --- cut
>
> but I can't call eny EPR
>
> --- cut
> 53138 [btpool0-1] ERROR org.apache.axis2.engine.AxisEngine - The endpoint reference (EPR) for the Operation not found is /services/SimpleHotelService and the WSA Action = null
> [...]
> --- cut
>
>
> I think I do something wrong with the paths and/or initializing the Axis-Servlet within Jetty.
> A working code snipset would be helpful if anyone can provide this for me.
>
> Thanks,
> Martin
>
> Am Freitag 17 Juli 2009 schrieb Andreas Veithen:
>> Martin,
>>
>> I think that Axis2 relies on some Tomcat libraries for clustering
>> support. Have a look at axis2.xml and try to disable clustering.
>>
>> Andreas
>>
>> On Fri, Jul 17, 2009 at 10:09, Martin Fernau<m....@cps-net.de> wrote:
>> > Hi,
>> >
>> > can someone provide me a simple description how to get axis2 to run in an
>> > embedded jetty6 Server?
>> > Until now I'm unable to get it to work.
>> > What I currently have is the following:
>> >
>> > --- cut
>> >                Server server = new Server(8080);
>> >
>> >                ServletHolder axisServletholder = new ServletHolder(new
>> > AxisServlet()); ServletHolder axisAdminServletholder = new
>> > ServletHolder(new AxisAdminServlet());
>> >
>> >                Context root = new Context(server, "/", Context.SESSIONS);
>> >                // set Path to exploded axis2.war
>> >                FileResource basePath = new FileResource(new
>> > URL("file:/tests/webapps")); // Without these axis complain about missing
>> > axis2.xml
>> >                root.setBaseResource(basePath);
>> >                root.addServlet(axisServletholder,
>> > "/servlet/AxisServlet"); root.addServlet(axisServletholder,
>> > "/services/*"); root.addServlet(axisServletholder, "*.jws");
>> >                root.addServlet(axisAdminServletholder,
>> > "/servlet/AdminServlet");
>> >
>> >                server.start();
>> > --- cut
>> >
>> > But this just throw me some "java.lang.NoClassDefFoundError:
>> > org/apache/catalina/tribes/ChannelException" messages. It seems that
>> > axis2 needs tomcat libraries?
>> >
>> > Anyone with helpful comments or code snipsets which get axis2 to work
>> > under an embedded jetty?
>> >
>> > Thanks a lot,
>> > Martin
>

Re: axis2 and embedded jetty

Posted by Martin Fernau <m....@cps-net.de>.
Hi Andreas,

you're right. After removing the corresponding parts from axis2.xml I don't get these exceptions any more.
But the service isn't working properly. I get the follwoing output during startup:

--- cut
2 [main] INFO org.mortbay.log - Logging to org.slf4j.impl.SimpleLogger@32c41a via org.mortbay.log.Slf4jLog
275 [main] INFO org.mortbay.log - jetty-6.1.3
1232 [main] INFO org.apache.axis2.deployment.AxisConfigBuilder - Unable to instantiate deployer org.apache.axis2.deployment.TransportDeployer
1647 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: addressing-1.5 - file:/tests/webapps/WEB-INF/modules/addressing-1.5.mar
1666 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: jaxws-1.5 - file:/tests/webapps/WEB-INF/modules/axis2-jaxws-mar-1.5.mar
1686 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: script-1.5 - file:/tests/webapps/WEB-INF/modules/axis2-scripting-1.5.mar
1749 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: metadataExchange-1.5 - file:/tests/webapps/WEB-INF/modules/mex-1.5.mar
1778 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: mtompolicy-1.5 - file:/tests/webapps/WEB-INF/modules/mtompolicy-1.5.mar
1805 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: ping-1.5 - file:/tests/webapps/WEB-INF/modules/ping-1.5.mar
1829 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: soapmonitor-1.5 - file:/tests/webapps/WEB-INF/modules/soapmonitor-1.5.mar
1914 [main] INFO org.apache.axis2.deployment.ModuleDeployer - Deploying module: metadataExchange - file:/opt/java_libraries/axis2-1.4.1/lib/mex-1.4.1.jar
2658 [main] INFO org.apache.axis2.deployment.ServiceDeployer - Deploying Web service: version-1.5.aar - file:/tests/webapps/WEB-INF/services/version-1.5.aar
2230 [main] INFO org.apache.axis2.deployment.ServiceDeployer - Deploying Web service: SimpleHotelService.aar - file:/tests/webapps/WEB-INF/services/SimpleHotelService.aar
2756 [main] INFO org.mortbay.log - Started SocketConnector @ 0.0.0.0:8080
--- cut

but I can't call eny EPR

--- cut
53138 [btpool0-1] ERROR org.apache.axis2.engine.AxisEngine - The endpoint reference (EPR) for the Operation not found is /services/SimpleHotelService and the WSA Action = null
[...]
--- cut


I think I do something wrong with the paths and/or initializing the Axis-Servlet within Jetty.
A working code snipset would be helpful if anyone can provide this for me.

Thanks,
Martin

Am Freitag 17 Juli 2009 schrieb Andreas Veithen:
> Martin,
>
> I think that Axis2 relies on some Tomcat libraries for clustering
> support. Have a look at axis2.xml and try to disable clustering.
>
> Andreas
>
> On Fri, Jul 17, 2009 at 10:09, Martin Fernau<m....@cps-net.de> wrote:
> > Hi,
> >
> > can someone provide me a simple description how to get axis2 to run in an
> > embedded jetty6 Server?
> > Until now I'm unable to get it to work.
> > What I currently have is the following:
> >
> > --- cut
> >                Server server = new Server(8080);
> >
> >                ServletHolder axisServletholder = new ServletHolder(new
> > AxisServlet()); ServletHolder axisAdminServletholder = new
> > ServletHolder(new AxisAdminServlet());
> >
> >                Context root = new Context(server, "/", Context.SESSIONS);
> >                // set Path to exploded axis2.war
> >                FileResource basePath = new FileResource(new
> > URL("file:/tests/webapps")); // Without these axis complain about missing
> > axis2.xml
> >                root.setBaseResource(basePath);
> >                root.addServlet(axisServletholder,
> > "/servlet/AxisServlet"); root.addServlet(axisServletholder,
> > "/services/*"); root.addServlet(axisServletholder, "*.jws");
> >                root.addServlet(axisAdminServletholder,
> > "/servlet/AdminServlet");
> >
> >                server.start();
> > --- cut
> >
> > But this just throw me some "java.lang.NoClassDefFoundError:
> > org/apache/catalina/tribes/ChannelException" messages. It seems that
> > axis2 needs tomcat libraries?
> >
> > Anyone with helpful comments or code snipsets which get axis2 to work
> > under an embedded jetty?
> >
> > Thanks a lot,
> > Martin

Re: axis2 and embedded jetty

Posted by Andreas Veithen <an...@gmail.com>.
Martin,

I think that Axis2 relies on some Tomcat libraries for clustering
support. Have a look at axis2.xml and try to disable clustering.

Andreas

On Fri, Jul 17, 2009 at 10:09, Martin Fernau<m....@cps-net.de> wrote:
> Hi,
>
> can someone provide me a simple description how to get axis2 to run in an
> embedded jetty6 Server?
> Until now I'm unable to get it to work.
> What I currently have is the following:
>
> --- cut
>                Server server = new Server(8080);
>
>                ServletHolder axisServletholder = new ServletHolder(new AxisServlet());
>                ServletHolder axisAdminServletholder = new ServletHolder(new
> AxisAdminServlet());
>
>                Context root = new Context(server, "/", Context.SESSIONS);
>                // set Path to exploded axis2.war
>                FileResource basePath = new FileResource(new URL("file:/tests/webapps")); //
> Without these axis complain about missing axis2.xml
>                root.setBaseResource(basePath);
>                root.addServlet(axisServletholder, "/servlet/AxisServlet");
>                root.addServlet(axisServletholder, "/services/*");
>                root.addServlet(axisServletholder, "*.jws");
>                root.addServlet(axisAdminServletholder, "/servlet/AdminServlet");
>
>                server.start();
> --- cut
>
> But this just throw me some "java.lang.NoClassDefFoundError:
> org/apache/catalina/tribes/ChannelException" messages. It seems that axis2
> needs tomcat libraries?
>
> Anyone with helpful comments or code snipsets which get axis2 to work under an
> embedded jetty?
>
> Thanks a lot,
> Martin
>