• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Carey Brown
  • Frits Walraven

runtime error with web services

Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am getting the following runtime error when creating a soap request.

I have xalan.jar and xcersesIml.jar in my classpath. pls help me to sort out this problem.

java.lang.NoClassDefFoundError: com/sun/org/apache/xerces/internal/dom/DocumentImpl
java.lang.ClassLoader.defineClass0(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
Posts: 43015
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that the missing class is named com/sun/org/apache/xerces/internal/dom/DocumentImpl, and not org/apache/xerces/internal/dom/DocumentImpl - Sun has repackaged it so as to avoid version conflicts. Look for a jar file that includes this class; likely it would have come in the same download as the com.sun.xml.messaging.saaj.soap.SOAPPartImpl class.
[ December 10, 2006: Message edited by: Ulf Dittmer ]
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web services client runtime troubleshooting tips:

Running your Web service client with an ibm-jaxrpc-client.jar file in a Solaris environment can cause an exception
If you use the -jar option, for example, java -jar <java_application>.jar, to specify a Java application in a Solaris environment, a class not found exception can occur. To avoid an exception, use the -classpath option instead of the -jar option, for example,

java -jar <your_client_application>.jar, <main_class_file>


The problem occurs because the Sun JDK classloading specification is more strict than the IBM JDK specifications.
You can make one of three changes to avoid an exception:

* Use the -classpath option instead of the -jar option, for example,

java -jar <java_application>.jar, <main_class_file >

* Use the -Djava.ext.dirs option with the -jar option, for example,

export WAS_HOME=/opt/IBM/WebSphere/AppServer ${WAS_HOME}/java/jre/bin/java
-jar <your_client_application>.jar, <your_client_application>.args

* Modify Class Path in Manifest.MF to include the Java archive (JAR) files that you need, for example,

Class Path: /opt/IBM/WebSphere/AppServer/runtimes/ibm-jaxrpc-client.jar

Resolving DNS causes performance problems when using HTTP to connect to a service endpoint interface that is not based on a private IP address

The DNS service is often not available when you use HTTP to connect to a service endpoint interface that is based on a private IP address. Therefore, performance is degraded during the DNS resolution.

This problem occurs when the outbound HTTP connector in the Web service engine attempts to resolve the host address name and times out.

You can modify the HOSTS file for the targeted IP address to avoid the DNS resolution.
Runtime migration error
If you installed a Web service application that was developed for a WebSphere Application Server version prior to Version 6, you might get the following exception:

WSWS3701E: Error: An exception was encountered. Use wsdeploy to deploy your application.
This may correct the problem. The exception is <exception data>.

This exception indicates that a problem occurred while running the application that was developed with tools supported by versions prior to Version 6. A solution to the problem is to uninstall the application, run the wsdeploy command and redeploy the application.
WebServicesFault exception displays during the application server run time for certain Web Services Description Language (WSDL) files

A WebServicesFault exception displays during the application server run time for WSDL files that define operations with document style and literal use, and use the SOAP header to transmit the input data.

If the WSDL files define the operation with document style and literal use, and this operation maps the input to the SOAP header, the Web services run time fails to find the correct operation for the target service and the WebServicesFault exception displays.

To solve the problem, change the WSDL files so that the operation does not have input that uses the SOAP header to transmit the data.
Increase the value of the ConnectionIOTimeOut parameter to avoid receiving an exception when hosting Web services on WebSphere Application Server

When hosting Web services on WebSphere Application Server, the following exception displays: java.net.SocketTimeOutException: Read Timed Out.

A slow network connection between the client and the Web service causes this problem. In such cases, the HTTP socket might time out before the Web service engine completely reads the SOAP request. In the majority of cases, a sudden increase in overall network activity causes this problem. The problem can also occur when the client is accessing the Web service from a slow network connection and when the SOAP request has a lot of data.
To solve the problem, increase the ConnectionIOTimeOut parameter for the Web container HTTP transport. The default value is 5 seconds. Increase the value to 30 seconds or greater. Refer to HTTP transport custom properties for setting the value using the administrative console. Type the following property name and value:

* Name: ConnectionIOTimeOut
* Value: 30

If the Web service is hosted in a clustered environment, set the property on each application server in the cluster. If your application server is listening on more than one port number, set the property on all ports.
Executing a Web services client application with session persistence turned on or in a clustered environment might cause a WebServicesFault error
When you execute a Web services client application with session persistence turned on or in a cluster environment, an error might display because the Web service client attempts to use a connection that has been closed by the HTTP server. The following is an example of the error:

[mm/dd/yy hh:mm:ss:ttt EST] 0000006e SystemErr R WebServicesFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultString: java.io.IOException: Connection close: Read failed.Possible end of
stream encountered.
faultActor: null

You can avoid this error by following one of two ways:

* Set the com.ibm.websphere.webservices.http.requestResendEnabled property to true, for example, com.ibm.websphere.webservices.http.requestResendEnabled=true. When this property is set to true, the Web services client is programmed to re-send the request if the request has failed. Monitor your client runtime if you change the property value, because the request might be sent twice.

For example, if your client is a banking application, and you set the com.ibm.websphere.webservices.http.requestResendEnabled property to true, a transaction might be posted twice to an account. See Configuring additional HTTP transport properties using the JVM custom property panel in the administrative console to configure the com.ibm.websphere.webservices.http.requestResendEnabled property.
* [Linux] If you are using the IBM HTTP Server on an AIX or Linux operating systems, you can set the MaxSpareThreads property to the same value as the MaxClients property that is located in the http.conf file. For example, if the MaxClients=600, change the MaxSpareThreads to equal 600 (MaxSpareThreads=600).

The advantage to choosing this way to avoid the error, is that the IBM HTTP Server does not shut down idle or near-idle connections. The disadvantage to this choice is that the IBM HTTP Server uses excess resources to keep extra threads available, even during periods of light activity. This choice can only be done on an AIX or Linux operating system.
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unsure whether this is relevant but I have found that you should (ought to) dump your XML-processing-related classes (Xerces, Xalan) into Tomcat's common\endorsed folder rather than in axis's lib folder (that's of course in a scenario where you use Axis in Tomcat) or any other web app sitting in Tomcat.

Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Saravana,
You need to add <your jwsdp local path>/jaxp/lib/endorsed/xercesImpl.jar in your CLASSPATH. That should solve the problem.
What's gotten into you? Could it be this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
    Bookmark Topic Watch Topic
  • New Topic