3 Replies Latest reply on Apr 24, 2010 6:43 AM by adhirmehta

    webservices and custom exception handling

    843833
      hi all,

      I have one ejb method which promote as webservices.

      @WebMethod
      @Oneway
      public void test(String arg) throws STARS21BOException{
      }

      my Custom Exception class STARS21BOException extends from EjbException and it has no-arg constructor.

      but when i deploy on server i get following exception.
      if i remove throws clause from method, it is working fine.

      javax.xml.ws.WebServiceException: Unable to create JAXBContext
           at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)
           at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
           at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:271)
           at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:351)
           at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:201)
           Truncated. see log file for complete stacktrace

      Caused By: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
      java.lang.StackTraceElement does not have a no-arg default constructor.
           this problem is related to the following location:
                at java.lang.StackTraceElement
                at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
                at java.lang.Throwable
                at java.lang.Exception
                at public java.lang.Exception sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean.causedByException
                at sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean

           at java.security.AccessController.doPrivileged(Native Method)
           at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:148)
           at com.sun.xml.ws.model.AbstractSEIModelImpl.postProcess(AbstractSEIModelImpl.java:87)
           at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:271)
           at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:351)
           Truncated. see log file for complete stacktrace

      Caused By: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
      java.lang.StackTraceElement does not have a no-arg default constructor.
           this problem is related to the following location:
                at java.lang.StackTraceElement
                at public java.lang.StackTraceElement[] java.lang.Throwable.getStackTrace()
                at java.lang.Throwable
                at java.lang.Exception
                at public java.lang.Exception sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean.causedByException
                at sg.com.stee.stars21.showcase.business.jaxws.STARS21BOExceptionBean

           at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
           at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)
           at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
           at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
           at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:105)
           Truncated. see log file for complete stacktrace
      >
      <Apr 23, 2010 10:51:33 AM SGT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1271991082383' for task '2'. Error is: 'weblogic.application.ModuleException: Exception activating module: EJBModule(ejb-showcaseEJB.jar)