This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Services and the fly likes JAX-WS in web application. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-WS in web application." Watch "JAX-WS in web application." New topic
Author

JAX-WS in web application.

Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Hi,

I am learning JAX-WS.

What is best way to deploy web services in web application?

I just did that with one web service in tomcat6 by writing web.xml and sun-jaxws.xml.

But if I want to deploy multiple web services in the same web application, do I need to map same servlet(com.sun.xml.ws.transport.http.servlet.WSServlet) to multiple url-mappings? and add separate entry in sun-jaxws.xml for each web service?



One more question.

When I deployed same web service web application in tomcat 5.5, I got following error. But it works in tomcat6 What is fix for it?

Oct 12, 2009 11:47:53 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.12
Oct 12, 2009 11:47:53 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
log4j:WARN Please initialize the log4j system properly.
Oct 12, 2009 11:48:00 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
INFO: WSSERVLET12: JAX-WS context listener initializing
Oct 12, 2009 11:48:16 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.AbstractMethodError: org.apache.catalina.core.ApplicationContextFacade.getContextPath()Ljava/lang/String;
java.lang.AbstractMethodError: org.apache.catalina.core.ApplicationContextFacade.getContextPath()Ljava/lang/String;
at weblogic.wsee.jaxws.framework.jaxrpc.server.ServerEnvironmentFactory.getContextPath(ServerEnvironmentFactory.java:105)
at weblogic.wsee.jaxws.framework.jaxrpc.EnvironmentFactory.getDeploymentContext(EnvironmentFactory.java:606)
at weblogic.wsee.jaxws.framework.jaxrpc.TubelineDeploymentListener.createServer(TubelineDeploymentListener.java:74)
at weblogic.wsee.jaxws.WLSTubelineAssemblerFactory$TubelineAssemblerImpl.createServer(WLSTubelineAssemblerFactory.java:93)
at com.sun.xml.ws.server.WSEndpointImpl.<init>(WSEndpointImpl.java:158)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:246)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:230)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:476)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3692)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4127)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:910)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:873)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:680)
at org.apache.catalina.startup.Catalina.start(Catalina.java:536)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Oct 12, 2009 11:48:17 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Oct 12, 2009 11:48:17 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/07_11_ws] startup failed due to previous errors
Oct 12, 2009 11:48:17 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextDestroyed
INFO: WSSERVLET13: JAX-WS context listener destroyed
Oct 12, 2009 11:48:17 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8088
Oct 12, 2009 11:48:19 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Oct 12, 2009 11:48:19 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/328 config=null
Oct 12, 2009 11:48:20 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Oct 12, 2009 11:48:21 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 28968 ms
Oct 13, 2009 12:15:48 AM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8088



Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
This looks odd - where are those WebLogic classes coming from? Tomcat doesn't have them, and neither does the JAX-WS reference implementation.


Ping & DNS - my free Android networking tools app
Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Thank you very much Ulf.

Long back I added weblogic jars it in my Tomcat 5.5 startup class path in eclipse. It worked when I removed those jars from Tomcat classpath.

Thank you very much for the help.


But I have following questions.

What is best way to deploy web services in web application?

I just did that with one web service in tomcat6 by writing web.xml and sun-jaxws.xml.

But if I want to deploy multiple web services in the same web application, do I need to map same servlet(com.sun.xml.ws.transport.http.servlet.WSServlet) to multiple url-mappings? and add separate entry in sun-jaxws.xml for each web service?

Sorry if my questions looks very silly but as far as webservices is concerned, I am very new to it.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42061
    
  64
You only need one entry for WSServlet in web.xml. But you'll have multiple endpoints in the sun-jaxws.xml file.
Sagar Kale
Ranch Hand

Joined: May 02, 2008
Posts: 188
Hi Ulf,

Once again thank you for reply.


Regards

Sagar.
 
GeeCON Prague 2014
 
subject: JAX-WS in web application.