Thursday, April 12, 2012

SEVERE: WSSERVLET11: failed to parse runtime descriptor: A @WebService.targetNamespace must be specified on classes with no package.


If you get below mentioned exception.


SEVERE: WSSERVLET11: failed to parse runtime descriptor: A @WebService.targetNamespace must be specified on classes with no package.  Class: Ball
com.sun.xml.ws.model.RuntimeModelerException: A @WebService.targetNamespace must be specified on classes with no package.  Class: Ball
                at com.sun.xml.ws.model.RuntimeModeler.getServiceName(RuntimeModeler.java:1489)
                at com.sun.xml.ws.model.RuntimeModeler.getServiceName(RuntimeModeler.java:1459)
                at com.sun.xml.ws.server.EndpointFactory.getDefaultServiceName(EndpointFactory.java:472)
                at com.sun.xml.ws.server.EndpointFactory.getDefaultServiceName(EndpointFactory.java:461)
                at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:236)
                at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:153)
                at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
                at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:152)
                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4681)
                at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5184)
                at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5179)
                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
                at java.util.concurrent.FutureTask.run(FutureTask.java:138)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                at java.lang.Thread.run(Thread.java:619)
Apr 9, 2012 6:04:00 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.xml.ws.transport.http.servlet.WSServletContextListener
com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: A @WebService.targetNamespace must be specified on classes with no package.  Class: Ball
                at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:141)
                at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:152)
                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4681)
                at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5184)
                at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5179)
                at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
                at java.util.concurrent.FutureTask.run(FutureTask.java:138)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                at java.lang.Thread.run(Thread.java:619)
Caused by: com.sun.xml.ws.model.RuntimeModelerException: A @WebService.targetNamespace must be specified on classes with no package.  Class: Ball
                at com.sun.xml.ws.model.RuntimeModeler.getServiceName(RuntimeModeler.java:1489)
                at com.sun.xml.ws.model.RuntimeModeler.getServiceName(RuntimeModeler.java:1459)
                at com.sun.xml.ws.server.EndpointFactory.getDefaultServiceName(EndpointFactory.java:472)
                at com.sun.xml.ws.server.EndpointFactory.getDefaultServiceName(EndpointFactory.java:461)
                at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:236)
                at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:153)
                at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
                ... 9 more

You shoud check for package name for Java Classes and Interfaces within the Web service project. Default package is not allowed for them. You should explicitly add them to some package.

Please see belwo link.

How to Publish, Consume a simple web service using Tomcat?