Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-1939

Can't pass business exceptions across Web services when using Sun JDK

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • Java-SCA-1.1
    • Java-SCA-1.1
    • SCA Java Runtime
    • None
    • Sun JDK, Windows XP

    Description

      The changes in commit r601501 prevent business exceptions from being passed over Web services when using the Sun JDK. This is because Tuscany's POJO serialization to XML now uses JAXB, and JAXB cannot handle Java exception objects. This problem causes the exceptions-simple-ws itest to fail with the following exception:

      -------------------------------------------------------
      T E S T S
      -------------------------------------------------------
      Running com.example.ExampleTestCase
      17-Dec-2007 21:40:27 org.apache.catalina.core.StandardEngine start
      INFO: Starting Servlet Engine: Apache Tomcat/6.0.10
      17-Dec-2007 21:40:27 org.apache.catalina.startup.ContextConfig defaultWebConfig
      INFO: No default web.xml
      17-Dec-2007 21:40:27 org.apache.catalina.startup.DigesterFactory register
      WARNING: Could not get url for /javax/servlet/jsp/resources/jsp_2_0.xsd
      17-Dec-2007 21:40:27 org.apache.catalina.startup.DigesterFactory register
      WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_
      1.dtd
      17-Dec-2007 21:40:27 org.apache.catalina.startup.DigesterFactory register
      WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_1_
      2.dtd
      17-Dec-2007 21:40:27 org.apache.catalina.startup.DigesterFactory register
      WARNING: Could not get url for /javax/servlet/jsp/resources/web-jsptaglibrary_2_
      0.xsd
      17-Dec-2007 21:40:27 org.apache.catalina.startup.DigesterFactory register
      WARNING: Could not get url for /javax/servlet/resources/j2ee_web_services_1_1.xs
      d
      17-Dec-2007 21:40:27 org.apache.coyote.http11.Http11Protocol init
      INFO: Initializing Coyote HTTP/1.1 on http-8085
      17-Dec-2007 21:40:27 org.apache.coyote.http11.Http11Protocol start
      INFO: Starting Coyote HTTP/1.1 on http-8085
      17-Dec-2007 21:40:27 org.apache.tuscany.sca.http.tomcat.TomcatServer addServletM
      apping
      INFO: Added Servlet mapping: http://EUREKA:8085/axis2/services/ExampleService
      17-Dec-2007 21:40:28 org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSy
      ncMessageReceiver invokeBusinessLogic
      SEVERE: org.apache.tuscany.sca.databinding.TransformationException: com.sun.xml.
      bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExcept
      ions
      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.getS
      tackTrace()
      at java.lang.Throwable
      at java.lang.Exception
      at com.example.BusinessException

      org.osoa.sca.ServiceRuntimeException: org.apache.tuscany.sca.databinding.Transfo
      rmationException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 cou
      nts 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.getS
      tackTrace()
      at java.lang.Throwable
      at java.lang.Exception
      at com.example.BusinessException

      at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(Runt
      imeWireInvoker.java:127)
      at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(Runt
      imeWireInvoker.java:89)
      at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(Runt
      imeWireInvoker.java:83)
      at org.apache.tuscany.sca.core.assembly.RuntimeWireImpl.invoke(RuntimeWi
      reImpl.java:127)
      at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.invokeTa
      rget(Axis2ServiceProvider.java:572)
      at org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceInOutSyncMessageR
      eceiver.invokeBusinessLogic(Axis2ServiceInOutSyncMessageReceiver.java:59)
      at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBus
      inessLogic(AbstractInOutSyncMessageReceiver.java:42)
      at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMe
      ssageReceiver.java:96)
      at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
      at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostReq
      uest(HTTPTransportUtils.java:275)
      at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:1
      20)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:228)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:104)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:216)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ss(Http11Protocol.java:634)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoin
      t.java:352)
      at org.apache.tuscany.sca.core.work.Jsr237Work.run(Jsr237Work.java:61)
      at org.apache.tuscany.sca.core.work.ThreadPoolWorkManager$DecoratingWork
      .run(ThreadPoolWorkManager.java:205)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
      utor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
      .java:675)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: org.apache.tuscany.sca.databinding.TransformationException: com.sun.x
      ml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExc
      eptions
      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.getS
      tackTrace()
      at java.lang.Throwable
      at java.lang.Exception
      at com.example.BusinessException

      at org.apache.tuscany.sca.databinding.jaxb.JAXB2Node.transform(JAXB2Node
      .java:49)
      at org.apache.tuscany.sca.databinding.jaxb.JAXB2Node.transform(JAXB2Node
      .java:33)
      at org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint$L
      azyPullTransformer.transform(DefaultTransformerExtensionPoint.java:199)
      at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(Mediator
      Impl.java:73)
      at org.apache.tuscany.sca.core.databinding.transformers.Exception2Except
      ionTransformer.transform(Exception2ExceptionTransformer.java:98)
      at org.apache.tuscany.sca.core.databinding.transformers.Exception2Except
      ionTransformer.transform(Exception2ExceptionTransformer.java:35)
      at org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(Mediator
      Impl.java:73)
      at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterc
      eptor.transformException(DataTransformationInterceptor.java:250)
      at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterc
      eptor.invoke(DataTransformationInterceptor.java:148)
      at org.apache.tuscany.sca.core.invocation.RuntimeWireInvoker.invoke(Runt
      imeWireInvoker.java:118)
      ... 28 more
      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.getS
      tackTrace()
      at java.lang.Throwable
      at java.lang.Exception
      at com.example.BusinessException

      at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check
      (IllegalAnnotationsException.java:102)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContex
      tImpl.java:438)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.ja
      va:286)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
      139)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
      117)
      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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
      at org.apache.tuscany.sca.databinding.jaxb.JAXBContextHelper.createJAXBC
      ontext(JAXBContextHelper.java:59)
      at org.apache.tuscany.sca.databinding.jaxb.JAXB2Node.transform(JAXB2Node
      .java:40)
      ... 37 more
      17-Dec-2007 21:40:28 org.apache.catalina.core.StandardWrapper unload
      INFO: Waiting for 1 instance(s) to be deallocated
      17-Dec-2007 21:40:28 org.apache.coyote.http11.Http11Protocol destroy
      INFO: Stopping Coyote HTTP/1.1 on http-8085
      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.757 sec <<< FA
      ILURE!
      test(com.example.ExampleTestCase) Time elapsed: 4.716 sec <<< ERROR!
      java.lang.reflect.UndeclaredThrowableException
      at $Proxy8.hello(Unknown Source)
      at com.example.ExampleClientImpl.runTest(ExampleClientImpl.java:38)
      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.apache.tuscany.sca.implementation.java.invocation.JavaImplementat
      ionInvoker.invoke(JavaImplementationInvoker.java:105)
      at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
      KInvocationHandler.java:249)
      at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
      KInvocationHandler.java:146)
      at $Proxy7.runTest(Unknown Source)
      at com.example.ExampleTestCase.test(ExampleTestCase.java:42)
      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 junit.framework.TestCase.runTest(TestCase.java:168)
      at junit.framework.TestCase.runBare(TestCase.java:134)
      at junit.framework.TestResult$1.protect(TestResult.java:110)
      at junit.framework.TestResult.runProtected(TestResult.java:128)
      at junit.framework.TestResult.run(TestResult.java:113)
      at junit.framework.TestCase.run(TestCase.java:124)
      at junit.framework.TestSuite.runTest(TestSuite.java:232)
      at junit.framework.TestSuite.run(TestSuite.java:227)
      at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.
      java:35)
      at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.
      java:62)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTes
      tSet(AbstractDirectoryTestSuite.java:138)
      at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(Ab
      stractDirectoryTestSuite.java:125)
      at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
      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.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(Su
      refireBooter.java:308)
      at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j
      ava:879)
      Caused by: org.apache.tuscany.sca.interfacedef.util.FaultException: org.apache.t
      uscany.sca.databinding.TransformationException: com.sun.xml.bind.v2.runtime.Ille
      galAnnotationsException: 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.getS
      tackTrace()
      at java.lang.Throwable
      at java.lang.Exception
      at com.example.BusinessException

      at org.apache.tuscany.sca.binding.ws.axis2.Axis2BindingInvoker.invoke(Ax
      is2BindingInvoker.java:79)
      at org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterc
      eptor.invoke(DataTransformationInterceptor.java:74)
      at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
      KInvocationHandler.java:249)
      at org.apache.tuscany.sca.core.invocation.JDKInvocationHandler.invoke(JD
      KInvocationHandler.java:146)
      ... 34 more

      Results :

      Tests in error:
      test(com.example.ExampleTestCase)

      Tests run: 1, Failures: 0, Errors: 1, Skipped: 0

      Attachments

        Activity

          People

            scnash Simon Nash
            scnash Simon Nash
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: