Skip to main content

Error running the JAX-WS samples

5 replies [Last post]
achaudha
Offline
Joined: 2005-08-04

Per instructions, I installed SJSAS 8.1, installed jaxws-2.0ea2. I deployed one of the sample WebSerivces (fromjava-soap12), which seems to have deployed alright (since I can access the wsdl, and confirm that the service is active if I go to the service uri).

After generating the client, and running it I get the following error. Any help is appreciated.

[java] Invoking addNumbers(10, 20)
[java] Aug 4, 2005 11:56:59 AM com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
[java] SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
[java] Aug 4, 2005 11:56:59 AM com.sun.xml.messaging.saaj.soap.MessageImpl
[java] SEVERE: SAAJ0535: Unable to internalize message
[java] Exception in thread "main" HTTP transport error: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize mes
sage
[java] at com.sun.xml.ws.transport.http.client.HttpClientTransport.invoke(HttpClientTransport.java:150)
[java] at com.sun.xml.ws.client.ClientConnectionBase.sendResponse(ClientConnectionBase.java:133)
[java] at com.sun.xml.ws.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:111)
[java] at com.sun.xml.ws.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:69)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:122)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:76)
[java] at $Proxy18.addNumbers(Unknown Source)
[java] at fromjava_soap12.client.AddNumbersClient.main(Unknown Source)

[java] CAUSE:

[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImpl.java:251)
[java] at com.sun.xml.messaging.saaj.soap.ver1_2.Message1_2Impl.(Message1_2Impl.java:36)
[java] at com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl.createMessage(SOAPMessageFactory1_2Impl.java:36)

[java] at com.sun.xml.ws.transport.http.client.HttpClientTransport.readResponse(HttpClientTransport.java:227)
[java] at com.sun.xml.ws.transport.http.client.HttpClientTransport.invoke(HttpClientTransport.java:121)
[java] at com.sun.xml.ws.client.ClientConnectionBase.sendResponse(ClientConnectionBase.java:133)
[java] at com.sun.xml.ws.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:111)
[java] at com.sun.xml.ws.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:69)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:122)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:76)
[java] at $Proxy18.addNumbers(Unknown Source)
[java] at fromjava_soap12.client.AddNumbersClient.main(Unknown Source)
[java] Caused by: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instea
d of a SOAP response?
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentType(MessageImpl.java:319)
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImpl.java:165)
[java] ... 12 more

[java] CAUSE:

[java] com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP
response?
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentType(MessageImpl.java:319)
[java] at com.sun.xml.messaging.saaj.soap.MessageImpl.(MessageImpl.java:165)
[java] at com.sun.xml.messaging.saaj.soap.ver1_2.Message1_2Impl.(Message1_2Impl.java:36)
[java] at com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl.createMessage(SOAPMessageFactory1_2Impl.java:36)

[java] at com.sun.xml.ws.transport.http.client.HttpClientTransport.readResponse(HttpClientTransport.java:227)
[java] at com.sun.xml.ws.transport.http.client.HttpClientTransport.invoke(HttpClientTransport.java:121)
[java] at com.sun.xml.ws.client.ClientConnectionBase.sendResponse(ClientConnectionBase.java:133)
[java] at com.sun.xml.ws.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:111)
[java] at com.sun.xml.ws.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:69)
[java] at com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:65)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:122)
[java] at com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:76)
[java] at $Proxy18.addNumbers(Unknown Source)
[java] at fromjava_soap12.client.AddNumbersClient.main(Unknown Source)
[java] Java Result: 1

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pfeng
Offline
Joined: 2006-04-06

My environment: JWSDP2.0 and Sun Javaâ„¢ System Application Server Platform Edition 8.2.

I am trying to run the javaws samples. starting with the most basic and I ran into a different error than the one above. The step 4 referred to above is NOT relevant for JWSDP2.0. In fact, I had downloaded it separately JAXWS2.0EA2 and copied the jar files from there. That did not help me. My ERROR: when running ant run
[java] SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message in
stead of a SOAP message
[java] Couldn't create SOAP message due to exception: com.sun.xml.messaging
.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error messag
So I went over to the Application Server server.log and found the following messages:

[#|2006-04-06T17:05:48.340-0700|SEVERE|sun-appserver-pe8.2|javax.enterprise.resource.webservices.jaxws.servlet.http|_ThreadID=11;|caught throwable
java.lang.NoSuchMethodError: javax.xml.soap.MessageFactory.newInstance(Ljava/lang/String;)Ljavax/xml/soap/MessageFactory;
at com.sun.xml.ws.util.SOAPUtil.createMessageFactory(SOAPUtil.java:181)

So the solution is our friend javax.xml.soap.MessageFactory class interface appears in several jar files of while the intended version in appserv-ws.jar or saaj.jar is NOT being loaded since there is an interface in j2ee.jar which takes precedence.

I am only posting this message so that other developers in the community do not make any assumptions as I did and spend too much time

anandnpanchal
Offline
Joined: 2005-12-15

hi,
can you tell me what is the solution for this..?

i know that saaj 1.3 have implementation class also.and i m using websphere application server 6.1. In that i m getting same error in server log.problem is only with saaj1.2 and saaj1.3 .

thank u.

sekhar
Offline
Joined: 2003-06-25

Make sure the Application Server is not running before doing Step 4 outlined in the section 2.0, "Prerequisites" in the following documentation:
https://jax-rpc.dev.java.net/jaxws20-ea2/samples/docs/index.html

achaudha
Offline
Joined: 2005-08-04

Sekhar: Thanks for your response. Since I may have done it incorrectly first time around, do I just re-run Step 4 as you suggested or do you suggest that I re-install the SJSAS, and then install JAX-WS.

Thanks.

sekhar
Offline
Joined: 2003-06-25

There is no need to reinstall SJSAS or JAX-WS.
Just stop the AppSever if it is running.
Then do step 4.