hi all,
i have a WEB Service in my code and for exception handling i write this
class :
public class MyException extends SOAPFaultException {
>
> public MyException(SOAPFault soapFault) {
> super(soapFault);
> }
>
> public static MyException createMyException(String message, String
> code) {
> try {
> SOAPFault fault = SOAPFactory.newInstance().createFault();
> fault.setFaultString(message);
> fault.setFaultCode(code);
>
> //noinspection ThrowableInstanceNeverThrown
> return new MyException(fault);
> } catch (SOAPException e) {
> throw new RuntimeException(e);
> }
> }
> }
>
but during creating this exception glassfish logs me another exception like
this :
Message ID
javax.ejb.EJBException at
com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java
Complete Message
3869) at
com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3769)
at
com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
at
com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:200)
at $Proxy172.insertSignType(Unknown Source) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
com.sun.enterprise.webservice.InvokerImpl.invoke(InvokerImpl.java:81) at
com.sun.enterprise.webservice.EjbInvokerImpl.invoke(EjbInvokerImpl.java:82)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146) at
com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
at
com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595) at
com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554) at
com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539) at
com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436) at
com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
at
com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java:147)
at
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595) at
com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554) at
com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539) at
com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436) at
com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
at
com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:218)
at
com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:129)
at
com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595) at
com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554) at
com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539) at
com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436) at
com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243) at
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244) at
com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at
com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:113)
at
com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
at
com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:200)
at
com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:129)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831) at
com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:114)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87) at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080) at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272) at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
Caused by: java.lang.NullPointerException at
com.sun.xml.messaging.saaj.soap.impl.ElementImpl.addTextNode(ElementImpl.java:474)
at
com.sun.xml.messaging.saaj.soap.ver1_1.Fault1_1Impl.setFaultString(Fault1_1Impl.java:189)
at
com.kishware.ebank.condition.util.MyException.createMyException(MyException.java:21)
at
com.kishware.ebank.condition.facade.impl.SignManagerFacadeImpl.insertSignType(SignManagerFacadeImpl.java:61)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176) at
com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
at
com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:189)
... 62 more
please take a look at highlight part of log. any idea ?
any resource for exception handling in EJB3 Remote Stateless and Web
Service.
:((
--
sincerely yours
M. H. Shamsi