aspose file tools*
The moose likes Web Services and the fly likes JAXWS in tomcat 7... java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger exception. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAXWS in tomcat 7... java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger exception." Watch "JAXWS in tomcat 7... java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger exception." New topic
Author

JAXWS in tomcat 7... java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger exception.

Ashwin Raghavan
Ranch Hand

Joined: Dec 26, 2012
Posts: 30
Hi I am creating a simple JAX WS project in eclipse and deploying in tomcat. i am getting and error "SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger"


Below is my class description.

HelloWorld Interface

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService
public interface HelloWorld {

@WebMethod public String helloWorld(String name);
}



HelloWorldImpl.class

package org.arpit.javapostsforlearning.webservice;
import javax.jws.WebService;

@WebService(endpointInterface="org.arpit.javapostsforlearning.webservice.HelloWorld")
public class HelloWorldImpl implements HelloWorld{

public String helloWorld(String name) {
return "Hello world from "+name;
}

}


web.xml

<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>HellooWorldWS</display-name>
<listener>
<listener-class>
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>HelloWorldWS</servlet-name>
<servlet-class>
com.sun.xml.ws.transport.http.servlet.WSServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorldWS</servlet-name>
<url-pattern>/HelloWorldWS</url-pattern>
</servlet-mapping>
</web-app>


sun-jaxws.xml

<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">
<endpoint
name="HelloWorldWS"
implementation="org.arpit.javapostsforlearning.webservice.HelloWorldImpl"
url-pattern="/HelloWorldWS"/>
</endpoints>

I have put the following jars in the tomcat lib folder.



The stack trace of the error. jaxb-impl.jar
jaxws-api.jar
jaxws-rt.jar
gmbal-api-only.jar
management-api.jar
stax-ex.jar
streambuffer.jar
policy.jar


Below is the stack trace of the error.


INFO: Deploying web application archive C:\tomcat 7.0\tomcat-7.0.42-src\apache-tomcat-7.0.42\webapps\HelloWorldWS.war
Aug 19, 2013 12:52:58 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener parseAdaptersAndCreateDelegate
SEVERE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger
java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.sun.xml.ws.policy.jaxws.PolicyWSDLGeneratorExtension.<clinit>(PolicyWSDLGeneratorExtension.java:111)
at com.sun.xml.ws.wsdl.writer.WSDLGenerator.<init>(WSDLGenerator.java:249)
at com.sun.xml.ws.db.DatabindingImpl.generateWSDL(DatabindingImpl.java:223)
at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:654)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:291)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:158)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:577)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:303)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:179)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
at com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer.onStartup(WSServletContainerInitializer.java:65)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.istack.logging.Logger
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 36 more
Aug 19, 2013 12:52:58 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error during ServletContainerInitializer processing
javax.servlet.ServletException: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger
at com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer.onStartup(WSServletContainerInitializer.java:70)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5423)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: com.sun.xml.ws.transport.http.servlet.WSServletException: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:141)
at com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer.onStartup(WSServletContainerInitializer.java:65)
... 13 more
Caused by: java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at com.sun.xml.ws.policy.jaxws.PolicyWSDLGeneratorExtension.<clinit>(PolicyWSDLGeneratorExtension.java:111)
at com.sun.xml.ws.wsdl.writer.WSDLGenerator.<init>(WSDLGenerator.java:249)
at com.sun.xml.ws.db.DatabindingImpl.generateWSDL(DatabindingImpl.java:223)
at com.sun.xml.ws.server.EndpointFactory.generateWSDL(EndpointFactory.java:654)
at com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:291)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:158)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:577)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:303)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:179)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.parseAdaptersAndCreateDelegate(WSServletContextListener.java:131)
... 14 more
Caused by: java.lang.ClassNotFoundException: com.sun.istack.logging.Logger
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 36 more
Aug 19, 2013 12:52:58 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/HelloWorldWS] startup failed due to previous errors


I am using eclipse Juno. I created a dynamic web project and the exported the project as war to deploy.


Ashwin Raghavan
Ranch Hand

Joined: Dec 26, 2012
Posts: 30
Hi

Issue solved.

I added ha-api.jar, jaxb-core.jar to the $TOMCAT/lib path and it got deployed. i am able to see the wsdl file.

So in all we have to add the following jars to either TOMCAT/lib folder or WEB-INF/lib folder.

1. gmbal-api-only.jar
2. ha-api.jar
3. jaxb-core.jar
4. jaxb-impl.jar
5. jaxws-api.jar
6. jaxws-rt.jar
7. management-api.jar
8. policy.jar
9. stax-ex.jar
10. streambuffer.jar

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAXWS in tomcat 7... java.lang.NoClassDefFoundError: com/sun/istack/logging/Logger exception.
 
Similar Threads
SOAPBinding annotation
JAX-WS and Prefix '' is already bound to ''
Difference between running bootstrap.jar and catalina.bat
JAX-WS in web application.
Class path magic