Sun's SAAJ impl should be ok. CXF has been using Sun's SAAJ as default since 
CXF's inception.

> -----Original Message-----
> From: Christian Vest Hansen [mailto:[EMAIL PROTECTED]
> Sent: 2007年8月17日 17:12
> To: cxf-user@incubator.apache.org
> Subject: Re: Unable to create message factory for SOAP
> 
> 
> I stuck that in a JSP file and added an import.
> 
> When I run that it gives a root complaint much like the one 
> in my previous mail:
> 
> javax.xml.soap.SOAPException: Unable to create message factory for
> SOAP: org.jboss.ws.core.soap.MessageFactoryImpl
>       javax.xml.soap.MessageFactory.newInstance(Unknown Source)
>       org.apache.jsp.index_jsp._jspService(index_jsp.java:59)
>       
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>       
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:387)
>       
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:320)
>       
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>       javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>       
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyH
> eaderFilter.java:96)
> 
> 
> 
> Another thing worth noting is that I've come upon the ability to
> change which implementation class should be used by
> MessageFactory.getInstance() using a systems property, for instance:
> 
>     System.setProperty("javax.xml.soap.MessageFactory",
>         "com.sun.xml.messaging.saaj.soap.MessageFactoryImpl");
> 
> Since I write the interceptor myself, I could do some hacky magic to
> make sure that the SAAJ interceptor got initialized with the correct
> MessageFactory, but in that case, which MessageFactory should I use?
> The SUN one above dosn't seem to quite cut it either.
> 
> 
> 2007/8/17, Liu, Jervis <[EMAIL PROTECTED]>:
> > Not familiar with JBOSS, look likes JBOSS has its own SAAJ 
> impl, and the exception was caused by initializing the 
> MessageFactory. I suggest you try following code in your 
> JBOSS env to see what happens:
> >
> >             MessageFactory factory = MessageFactory.newInstance();
> >
> > Cheers,
> > Jervis
> >
> >
> > > -----Original Message-----
> > > From: Christian Vest Hansen [mailto:[EMAIL PROTECTED]
> > > Sent: 2007年8月16日 23:06
> > > To: cxf-user@incubator.apache.org
> > > Cc: [EMAIL PROTECTED]
> > > Subject: Unable to create message factory for SOAP
> > >
> > >
> > > Hello people,
> > >
> > > I'm writing an interceptor to do some custom WS-Secutity 
> integration
> > > to our single sign-on system, and my interceptor is based on the
> > > WSS4JInInterceptor.
> > >
> > > But alas, I'm having some trouble getting it to work.
> > >
> > > In the constructor for my interceptor, I specify my phase and a
> > > dependency on the SAAJInInterceptor like this:
> > >
> > >         setPhase(Phase.PRE_PROTOCOL);
> > >         getAfter().add(SAAJInInterceptor.class.getName());
> > >
> > > And my jaxws:endpoint in my beans.xml (in an example web service)
> > > looks like this:
> > >
> > >     <jaxws:endpoint
> > >         id="webStatServiceEndpoint"
> > >         implementor="#webStatService"
> > >         address="/WebStat"
> > >         wsdlLocation="classpath:WebStat1.0.wsdl">
> > >         <jaxws:inInterceptors>
> > >             <ref bean="casInterceptor"/>
> > >             <bean
> > > class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
> > >         </jaxws:inInterceptors>
> > >     </jaxws:endpoint>
> > >
> > > That is all dandy, so I built my project (the demo web 
> service) with
> > > maven and deploy it on my jboss, but when I try to invoke the web
> > > service, this happens:
> > >
> > > 16:30:39,692 ERROR [STDERR] Aug 16, 2007 4:30:39 PM
> > > org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> > > INFO: Interceptor has thrown exception, unwinding now
> > > org.apache.cxf.binding.soap.SoapFault:
> > > SOAPHANDLERINTERCEPTOR_EXCEPTION
> > >       at
> > > org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessa
> > > ge(SAAJInInterceptor.java:114)
> > >       at
> > > org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessa
> > > ge(SAAJInInterceptor.java:63)
> > >       at
> > > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseIn
> > > terceptorChain.java:207)
> > >       at
> > > org.apache.cxf.transport.ChainInitiationObserver.onMessage(Cha
> > > inInitiationObserver.java:73)
> > >       at
> > > org.apache.cxf.transport.servlet.ServletDestination.doMessage(
> > > ServletDestination.java:78)
> > >       at
> > > org.apache.cxf.transport.servlet.ServletController.invokeDesti
> > > nation(ServletController.java:231)
> > >       at
> > > org.apache.cxf.transport.servlet.ServletController.invoke(Serv
> > > letController.java:139)
> > >       at
> > > org.apache.cxf.transport.servlet.CXFServlet.invoke(CXFServlet.
> > > java:271)
> > >       at
> > > org.apache.cxf.transport.servlet.CXFServlet.doPost(CXFServlet.
> > > java:249)
> > >       at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> > >       at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > >       at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> > > er(ApplicationFilterChain.java:290)
> > >       at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> > > cationFilterChain.java:206)
> > >       at
> > > org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyH
> > > eaderFilter.java:96)
> > >       at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> > > er(ApplicationFilterChain.java:235)
> > >       at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> > > cationFilterChain.java:206)
> > >       at
> > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> > > rapperValve.java:230)
> > >       at
> > > org.apache.catalina.core.StandardContextValve.invoke(StandardC
> > > ontextValve.java:175)
> > >       at
> > > org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(
> > > SecurityAssociationValve.java:179)
> > >       at
> > > org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccCont
> > > extValve.java:84)
> > >       at
> > > org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> > > Valve.java:128)
> > >       at
> > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> > > Valve.java:104)
> > >       at
> > > org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(
> > > CachedConnectionValve.java:156)
> > >       at
> > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> > > gineValve.java:109)
> > >       at
> > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdap
> > > ter.java:241)
> > >       at
> > > org.apache.coyote.http11.Http11Processor.process(Http11Process
> > > or.java:844)
> > >       at
> > > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> > > r.process(Http11Protocol.java:580)
> > >       at
> > > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.
> > > java:447)
> > >       at java.lang.Thread.run(Thread.java:613)
> > > Caused by: javax.xml.soap.SOAPException: Unable to create message
> > > factory for SOAP: org.jboss.ws.core.soap.MessageFactoryImpl
> > >       at javax.xml.soap.MessageFactory.newInstance(Unknown Source)
> > >       at
> > > org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessa
> > > ge(SAAJInInterceptor.java:77)
> > >       ... 28 more
> > >
> > >
> > >
> > > So, any helpful thoughts?
> > >
> > > --
> > > Venlig hilsen / Kind regards,
> > > Christian Vest Hansen.
> > >
> >
> > ----------------------------
> > IONA Technologies PLC (registered in Ireland)
> > Registered Number: 171387
> > Registered Address: The IONA Building, Shelbourne Road, 
> Dublin 4, Ireland
> >
> 
> 
> -- 
> Venlig hilsen / Kind regards,
> Christian Vest Hansen.
> 

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to