You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Michal <ca...@yahoo.com> on 2007/08/23 17:28:04 UTC

Re: Unable to create SOAP Factory

I am having similar issue - throwing exception inside jsr181 pojo. I simply
would like to have a control over the faultcode: client/server. I see that
xfire implementation do it like this:
- if the cause is declared in a pojo method (so it means that it would need
to be declared in wsdl - at least this is how wsgen task works: it generates
exceptions only for wsdl:fault) then the code=server
- if the cause is not declared (so ofcourse it needs to be runtime
exception) then the code=client

Such behaviour does not satisfy me. But fortunately, I can define my own
fault handler to override this. My custom handler would use exception
hierarchies to decide about the fault code. 
I would just need to set it to the MessageContext. However jsr181endpoint
does not expose any such posibility. Furtheremore, this endpoint does not
expose setter for processor either - and if it did then I could do a
workaround here.

Any idea on how to control exceptions inside jsr181 pojos - actually their
look on the client side?

Michal



Carl23 wrote:
> 
> My service unit is defined by a wsdl, and there is a http su defined so it
> can be accessed like a web service. How do I handle exceptions in it?
> Normally in a webservice, a SOAPFaultException or an application Exception
> mapped in the wsdl can be thrown.
> 
> Can you point me to some documentation which further explains what you
> mean?
> 
> Thanks
> 
> Carl
> 
> 
> 
> gnodet wrote:
>> 
>> It won't answer your question, but you should not have to deal with SOAP
>> directly
>> from within the JBI bus.  This is the responsability of a Binding
>> component.
>> You should just send an xml message to a JBI endpoint instead (or maybe
>> use
>> the jsr181 proxy if you want).
>> 
>> On 5/24/07, Carl23 <c....@oclcpica.org> wrote:
>>>
>>>
>>> I'm trying to create a SOAPFaultException and a SOAPFault from within my
>>> SU,
>>> however the following line generates an error:
>>>
>>> SOAPFactory factory = SOAPFactory.newInstance();
>>>
>>> here's the error:
>>>
>>> javax.xml.soap.SOAPException: Unable to create SOAP Factory: Unable to
>>> create SA
>>> AJ meta-factoryProvider
>>> com.sun.xml.messaging.saaj.soap.SAAJMetaFactoryImpl
>>> not
>>> found
>>>         at javax.xml.soap.SOAPFactory.newInstance(Unknown Source)
>>>         at
>>> eu.multimatch.eir.translate.QueryTranslationServiceImpl.translateQuer
>>> yTerms(QueryTranslationServiceImpl.java:40)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>>> java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>>> sorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>>         at
>>> org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInv
>>> oker.java:54)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessa
>>> ge(ServiceInvocationHandler.java:271)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler$1.run(Ser
>>> viceInvocationHandler.java:84)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.execute(S
>>> erviceInvocationHandler.java:132)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.invoke(Se
>>> rviceInvocationHandler.java:107)
>>>         at
>>> org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.jav
>>> a:131)
>>>         at
>>> org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoin
>>> t.java:64)
>>>         at
>>> org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.
>>> java:38)
>>>         at
>>> org.apache.servicemix.jsr181.Jsr181ExchangeProcessor.process(Jsr181Ex
>>> changeProcessor.java:110)
>>>         at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLi
>>> feCycle.java:489)
>>>         at
>>> org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(Async
>>> BaseLifeCycle.java:441)
>>>         at
>>> org.apache.servicemix.common.BaseLifeCycle.onMessageExchange(BaseLife
>>> Cycle.java:46)
>>>         at
>>> org.apache.servicemix.jbi.messaging.DeliveryChannelImpl.processInBoun
>>> d(DeliveryChannelImpl.java:593)
>>>         at
>>> org.apache.servicemix.jbi.nmr.flow.AbstractFlow.doRouting(AbstractFlo
>>> w.java:174)
>>>         at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaFlow.doRouting(SedaFlow.j
>>> ava:176)
>>>         at
>>> org.apache.servicemix.jbi.nmr.flow.seda.SedaQueue$1.run(SedaQueue.jav
>>> a:134)
>>>         at
>>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
>>> ker.runTask(ThreadPoolExecutor.java:665)
>>>         at
>>> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
>>> ker.run(ThreadPoolExecutor.java:690)
>>>         at java.lang.Thread.run(Thread.java:595)
>>> ERROR - DefaultFaultHandler            - Fault occurred!
>>> java.lang.NullPointerException
>>>         at
>>> javax.xml.ws.soap.SOAPFaultException.<init>(SOAPFaultException.java:4
>>> 3)
>>>         at
>>> eu.multimatch.eir.translate.QueryTranslationServiceImpl.translateQuer
>>> yTerms(QueryTranslationServiceImpl.java:47)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
>>> java:39)
>>>         at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>>> sorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>>         at
>>> org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInv
>>> oker.java:54)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.sendMessa
>>> ge(ServiceInvocationHandler.java:271)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler$1.run(Ser
>>> viceInvocationHandler.java:84)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.execute(S
>>> erviceInvocationHandler.java:132)
>>>         at
>>> org.codehaus.xfire.service.binding.ServiceInvocationHandler.invoke(Se
>>> rviceInvocationHandler.java:107)
>>>         at
>>> org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.jav
>>> a:131)
>>>         at
>>> org.codehaus.xfire.transport.DefaultEndpoint.onReceive(DefaultEndpoin
>>> t.java:64)
>>>         at
>>> org.codehaus.xfire.transport.AbstractChannel.receive(AbstractChannel.
>>> java:38)
>>>         at
>>> org.apache.servicemix.jsr181.Jsr181ExchangeProcessor.process(Jsr181Ex
>>> changeProces
>>> sor.java:110)
>>>
>>> I have saaj-impl-1.3.jar and saaj-api-1.3.jar as part of my su project.
>>>
>>> cheers!
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Unable-to-create-SOAP-Factory-tf3809009s12049.html#a10780419
>>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>>
>>>
>> 
>> 
>> -- 
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Principal Engineer, IONA
>> Blog: http://gnodet.blogspot.com/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Unable-to-create-SOAP-Factory-tf3809009s12049.html#a12295924
Sent from the ServiceMix - User mailing list archive at Nabble.com.