This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

SAAJ sample failure in weblogic12.1.1  RSS feed

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a SAAJ sample application which is working fine in tomcat6.

But the same application is failing with "java.lang.ClassCastException" exception in weblogic 12.1.1. I have attached the application.



Please let me know if any one knows some pointer.

Thanks,
Kamal
simple-zip.jpeg
[Thumbnail for simple-zip.jpeg]
 
Ranch Hand
Posts: 349
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try changing SAAJ implementation:

-Djavax.xml.soap.MessageFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
-Djavax.xml.soap.SOAPFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl

 
Hindusthan Kamal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Morris,

Thanks for your reply.

I found why the issue occurs,

Weblogic-12x uses 'weblogic.xml.saaj.*' package to handle SAAJ where as weblogic-10x support this through 'weblogic.webservice.core.soap.*'.

For weblogic 10x:
SOAPMessageImpl is handled by 'weblogic.webservice.core.soap.SOAPMessageImpl'.

For weblogic 12x:
SOAPMessageImpl is handled by 'weblogic.xml.saaj.SOAPMessageImpl'

The error occurs because, I used to intercept it weblogic.webservice.core.soap.SOAPMessageImpl is used instead of weblogic.xml.saaj.SOAPMessageImpl

So, we need to use 'weblogic.xml.saaj.*' package for handling respective operations.
 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,


I am getting below exception
Caused by: javax.xml.soap.SOAPException: Message send failed: com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl cannot be cast to oracle.j2ee.ws.saaj.soap.MessageImpl

please find below the details that i am using in my app
1.  java8  
2.  weblgic 12.2.3
3. i have also set up the JAVA_OPTIONS TO  -Djavax.xml.soap.MessageFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl
-Djavax.xml.soap.SOAPFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl
in the startWeblogic.sh script.
4. Also  tried with putting the below lines in application weblogic.xml
<prefer-application-packages>
  <package-name>com.sun.xml.messaging.saaj.*</package-name>
</prefer-application-packages>

but nothing worked still getting the exception :

 at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call2(HttpSOAPConnection.java:346)
       at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:142)
       at oracle.j2ee.ws.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:135)
       at cafe.backend.soap.GenericSOAPClient.execute(GenericSOAPClient.java:128)
       at cafe.backend.soap.AddressSOAPClient.validateAddressforAddrVal(AddressSOAPClient.java:115)
       at cafe.business.action.ValidateAddressAction.execute(ValidateAddressAction.java:827)
       at cafe.PreOrderServlet.cafeDoPost(PreOrderServlet.java:71)
       at cafe.SecureServlet.doPost(SecureServlet.java:45)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
       at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
       at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
       at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
       at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
       at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
       at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
       at cafe.filter.XSSFilter.doFilter(XSSFilter.java:52)
       at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
       at cafe.filter.HeadersFilter.doFilter(HeadersFilter.java:149)
       at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
       at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3701)
       at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3667)
       at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
       at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
       at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
       at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
       at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2443)
       at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2291)
       at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2269)
       at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
       at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
       at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
       at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
       at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
       at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
       at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
       at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
       at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
       at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: javax.xml.soap.SOAPException: Message send failed: com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl cannot be cast to oracle.j2ee.ws.saaj.soap.MessageImpl


Please suggest something so that it can work

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also getting the same issue
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I am getting the same issue in weblogic 12.2.1.2

Try this!

weblogic.xml
<wls:container-descriptor>
  <wls:prefer-web-inf-classes>false</wls:prefer-web-inf-classes>
  <wls:prefer-application-packages>
     <!-- Libreria para log4j -->
     <wls:package-name>org.apache.log4j.*</wls:package-name>
     <!-- Librerias para JSF -->
     <wls:package-name>javax.faces.*</wls:package-name>
     <wls:package-name>com.sun.faces.*</wls:package-name>
     <wls:package-name>com.bea.faces.*</wls:package-name>
     <!-- Importante. Para que la invocación al servio web no de error de casting a oracle.j2ee.ws.saaj.soap.soap12.Message12 -->
     <wls:package-name>com.sun.xml.messaging.saaj.soap.ver1_2.Message1_2Impl</wls:package-name>
     <wls:package-name>com.sun.xml.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl</wls:package-name>
     <wls:package-name>com.sun.xml.messaging.saaj.soap.ver1_2.SOAPFactory1_2Impl</wls:package-name>
     <wls:package-name>com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl</wls:package-name>
  </wls:prefer-application-packages>
  <wls:prefer-application-resources>
     <!-- Importante. Para que la invocación al servio web no de error de casting a oracle.j2ee.ws.saaj.soap.soap12.Message12 -->
     <wls:resource-name>META-INF/services/javax.xml.soap.MessageFactory</wls:resource-name>
     <wls:resource-name>META-INF/services/javax.xml.soap.MetaFactory</wls:resource-name>
     <wls:resource-name>META-INF/services/javax.xml.soap.SOAPConnectionFactory</wls:resource-name>
     <wls:resource-name>META-INF/services/javax.xml.soap.SOAPFactory</wls:resource-name>
     <!-- Recursos para JSF -->
     <wls:resource-name>javax.faces.*</wls:resource-name>
     <wls:resource-name>com.sun.faces.*</wls:resource-name>
     <wls:resource-name>com.bea.faces.*</wls:resource-name>
     <wls:resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</wls:resource-name>                        
  </wls:prefer-application-resources>
</wls:container-descriptor>

pom.xml
<dependency>
   <groupId>com.sun.xml.messaging.saaj</groupId>
   <artifactId>saaj-impl</artifactId>
   <version>1.3.3</version>
</dependency>

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!