You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Douglas Leite <do...@gmail.com> on 2009/02/04 15:58:22 UTC
Doubts related to the binding.ws
When I try to use the binding.ws over an interface that has an operation
that takes a complex type with no-arg default constructor, in some part of
the hierarchy, as argument, I get an error.
More specifically I have something like this:
*
@Remotable
public interface MyService {
@OneWay
public void throwsAnException(Exception ex);
}*
At the SCDL file:
*<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://myservice"
name="myservice">
**<component name="MyServiceComponent">
*
*
**<implementation.java class="service.MyServiceImpl"/>
*
*
** <service name="MyService">
*
* <interface.java interface="service.MyService"/>
*
* <binding.ws uri="
http://localhost:8086/MyServiceComponent" />
*
* </service>
*
*</component>
*
*</composite>*
I got the following error:
SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
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
Although the Exception an Throwable classes have no-arg default
constructors, the StackTraceElement doesn't have.
What can I do to avoid this problem?
Thanks in advance,
--
Douglas Siqueira Leite
Computer Science Master's degree student of University of Campinas
(Unicamp), Brazil
Re: Doubts related to the binding.ws
Posted by Douglas Leite <do...@gmail.com>.
Hi Ramkumar,
After taking a look at the *
binding-ws-axis2/srct/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom
*, I could solve the problem of using a class that extends *Exception* as a
parameter in a method of a remotable interface.
However, I am getting some problems when I try to use interfaces as
parameters. For example, if I have something like this:
*@Remotable
public interface RemotableInterface {
public void setInterface(Interface interface);
public Interface getInterface();
** public void
setAnException(@XmlJavaTypeAdapter(MyExceptionAdapter.class) MyException
ex);
}*
And, if I invoke *setInterface* or *getInterface*, I got an error like this:
"Interface is an interface, and JAXB can't handle interfaces."
"Interface does not have a no-arg default constructor."
Should I create an adapter class for the interfaces and annotate the methods
with @XmlJavaTypeAdapter? Why it is not necessary at FileTransferService [1]
interface? As we can see, the *uploadSourceFile()* method, has a interface (
*javax.xml.Source)* as parameter, and does not need a @XmlJavaTypeAdpater.
Regards,
[1]
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
On Wed, May 27, 2009 at 3:45 AM, Ramkumar R <ra...@gmail.com> wrote:
> Hi Douglas,
>
> I believe, the solution here for the *StackTracElement *class would be
> same as the sample* *JUnit test available in binding-ws-axis2 module....
>
> http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
>
> To be more specific.... in your case you need to create a class that would
> extend the *StackTracElement and create an Adapter for the same. The **
> @XmlJavaTypeAdpater* should be used in the service methods as what Adapter
> should be used to resolve the class.
>
> //This method uses an user defined interface MyException as parameter type.
> public String sendMyException(@XmlJavaTypeAdapter(MyExceptionAdapter.class)
> MyException attachment)
>
>
> throws Exception;
>
> Let me know, if you need more clarification.
>
>
> On Wed, May 20, 2009 at 6:29 PM, Douglas Leite <do...@gmail.com>wrote:
>
>> Hi Ramkumar,
>>
>> The article shows that we need to create an adapter to the class that does
>> not have a no-arg default constructor, ie, create a class that extends *
>> XmlAdapter<>* and implement the inherited methods. Moreover, we need to
>> annotate the class that was adapted with *@XmlJavaTypeAdapter*annotation.
>>
>> However, the problem is that although the *Exception* an *Throwable*classes have no-arg default constructors, the
>> *StackTraceElement* doesn't. So, I would need to create an adpater to *
>> StackTracElement* and annotate it with *@XmlJavaTypeAdpater*, what is not
>> possible.
>>
>> Is it right, or I am missing something?
>>
>> Regards
>>
>>
>> On Mon, Mar 2, 2009 at 3:16 PM, Ramkumar R <ra...@gmail.com> wrote:
>>
>>> Hi Douglas,
>>>
>>> Well yeah the fix is now available for this issue, In Tuscany we are now
>>> trying to support non-JAXB type using JAXB 2.0's XmlJavaTypeAdapter as
>>> mentioned in this article below.
>>>
>>> http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html
>>>
>>> Also you can take a look at the JUnit test available in binding-ws-axis2
>>> module....
>>>
>>> http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
>>>
>>> Please let me know, if you need more clarifications.
>>>
>>>
>>> On Mon, Mar 2, 2009 at 11:05 PM, Douglas Leite <do...@gmail.com>wrote:
>>>
>>>> Hi Ramkumar,
>>>>
>>>> Did you find out something that can be done to workaround this issue?
>>>> Could be used other framework to marshall / unmarshall the data types? Would
>>>> it solve the problem?
>>>>
>>>> Regards
>>>>
>>>>
>>>> On Thu, Feb 5, 2009 at 10:26 AM, Ramkumar R <ra...@gmail.com>wrote:
>>>>
>>>>> Hi Douglas,
>>>>>
>>>>> As Scott mentioned, we depend on the JAXB runtime to marshal/demarshal
>>>>> the data types. I have also noticed this one while using the
>>>>> org.apache.axiom.om.OMElement as the data type with binding.ws as
>>>>> shown below.
>>>>>
>>>>> SEVERE: org.apache.tuscany.sca.databinding.TransformationException:
>>>>> org.apache.tuscany.sca.databinding.TransformationException:
>>>>> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of
>>>>> IllegalAnnotationExceptions
>>>>> org.apache.axiom.om.OMElement is an interface, and JAXB can't handle
>>>>> interfaces.
>>>>> this problem is related to the following location:
>>>>> at org.apache.axiom.om.OMElement
>>>>> at protected org.apache.axiom.om.OMElement
>>>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile.arg0
>>>>> at
>>>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile
>>>>>
>>>>> This issue is raised as TUSCANY-2664. Please add your issue as part of
>>>>> this JIRA OR you can also raise a seperate one.
>>>>>
>>>>> I am currently looking if we can have some workaround for this issue as
>>>>> this feature is very much required to support MTOM with binding.ws.
>>>>
>>>>
>>>>>
>>>>> On Wed, Feb 4, 2009 at 10:01 PM, Scott Kurz <sc...@gmail.com>wrote:
>>>>>
>>>>>> Douglas,
>>>>>>
>>>>>> Since our <binding.ws> impl uses JAXB by default to map from the XML
>>>>>> wireformat to the application Java, the JAXB runtime needs to be able to
>>>>>> deserialize into your input/output types. If the types don't contain JAXB
>>>>>> annotations, they need to follow the pattern that JAXB expects, i.e. they
>>>>>> must contain the no-arg default constructor.
>>>>>>
>>>>>> Also I'll mention that we follow the JAX-WS spec in order to map
>>>>>> between a Java exception and the platform-neutral fault data it carries.
>>>>>> (See "Business Exceptions/Faults" at
>>>>>>
>>>>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
>>>>>> for more info.
>>>>>>
>>>>>> It crossed my mind that maybe your interface is passing
>>>>>> java.lang.Exception as an input parameter because you weren't aware of how
>>>>>> to "throw" it across <binding.ws> .... or maybe you have a good
>>>>>> reason for doing so and it was just a useful example.
>>>>>>
>>>>>> Scott
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>>>>>>
>>>>>>> When I try to use the binding.ws over an interface that has an
>>>>>>> operation that takes a complex type with no-arg default constructor, in some
>>>>>>> part of the hierarchy, as argument, I get an error.
>>>>>>>
>>>>>>> More specifically I have something like this:
>>>>>>> *
>>>>>>> @Remotable
>>>>>>> public interface MyService {
>>>>>>>
>>>>>>> @OneWay
>>>>>>> public void throwsAnException(Exception ex);
>>>>>>> }*
>>>>>>>
>>>>>>> At the SCDL file:
>>>>>>>
>>>>>>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>>>>> targetNamespace="http://myservice"
>>>>>>> name="myservice">
>>>>>>>
>>>>>>> **<component name="MyServiceComponent">
>>>>>>> *
>>>>>>> *
>>>>>>> **<implementation.java class="service.MyServiceImpl"/>
>>>>>>> *
>>>>>>> *
>>>>>>> ** <service name="MyService">
>>>>>>> *
>>>>>>> * <interface.java
>>>>>>> interface="service.MyService"/>
>>>>>>> *
>>>>>>> * <binding.ws uri="
>>>>>>> http://localhost:8086/MyServiceComponent" />
>>>>>>> *
>>>>>>> * </service>
>>>>>>> *
>>>>>>> *</component>
>>>>>>> *
>>>>>>> *</composite>*
>>>>>>>
>>>>>>> I got the following error:
>>>>>>>
>>>>>>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>>>>>>> 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
>>>>>>>
>>>>>>> Although the Exception an Throwable classes have no-arg default
>>>>>>> constructors, the StackTraceElement doesn't have.
>>>>>>> What can I do to avoid this problem?
>>>>>>>
>>>>>>> Thanks in advance,
>>>>>>>
>>>>>>> --
>>>>>>> Douglas Siqueira Leite
>>>>>>> Computer Science Master's degree student of University of Campinas
>>>>>>> (Unicamp), Brazil
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks & Regards,
>>>>> Ramkumar Ramalingam
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Douglas Siqueira Leite
>>>> Graduate student at University of Campinas (Unicamp), Brazil
>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Ramkumar Ramalingam
>>>
>>
>>
>>
>> --
>> Douglas Siqueira Leite
>> Graduate student at University of Campinas (Unicamp), Brazil
>>
>>
>
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>
--
Douglas Siqueira Leite
Graduate student at University of Campinas (Unicamp), Brazil
Re: Doubts related to the binding.ws
Posted by Ramkumar R <ra...@gmail.com>.
Hi Douglas,
I believe, the solution here for the *StackTracElement *class would be same
as the sample* *JUnit test available in binding-ws-axis2 module....
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
To be more specific.... in your case you need to create a class that would
extend the *StackTracElement and create an Adapter for the same. The **
@XmlJavaTypeAdpater* should be used in the service methods as what Adapter
should be used to resolve the class.
//This method uses an user defined interface MyException as parameter type.
public String sendMyException(@XmlJavaTypeAdapter(MyExceptionAdapter.class)
MyException attachment)
throws Exception;
Let me know, if you need more clarification.
On Wed, May 20, 2009 at 6:29 PM, Douglas Leite <do...@gmail.com> wrote:
> Hi Ramkumar,
>
> The article shows that we need to create an adapter to the class that does
> not have a no-arg default constructor, ie, create a class that extends *
> XmlAdapter<>* and implement the inherited methods. Moreover, we need to
> annotate the class that was adapted with *@XmlJavaTypeAdapter* annotation.
>
> However, the problem is that although the *Exception* an *Throwable*classes have no-arg default constructors, the
> *StackTraceElement* doesn't. So, I would need to create an adpater to *
> StackTracElement* and annotate it with *@XmlJavaTypeAdpater*, what is not
> possible.
>
> Is it right, or I am missing something?
>
> Regards
>
>
> On Mon, Mar 2, 2009 at 3:16 PM, Ramkumar R <ra...@gmail.com> wrote:
>
>> Hi Douglas,
>>
>> Well yeah the fix is now available for this issue, In Tuscany we are now
>> trying to support non-JAXB type using JAXB 2.0's XmlJavaTypeAdapter as
>> mentioned in this article below.
>>
>> http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html
>>
>> Also you can take a look at the JUnit test available in binding-ws-axis2
>> module....
>>
>> http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
>>
>> Please let me know, if you need more clarifications.
>>
>>
>> On Mon, Mar 2, 2009 at 11:05 PM, Douglas Leite <do...@gmail.com>wrote:
>>
>>> Hi Ramkumar,
>>>
>>> Did you find out something that can be done to workaround this issue?
>>> Could be used other framework to marshall / unmarshall the data types? Would
>>> it solve the problem?
>>>
>>> Regards
>>>
>>>
>>> On Thu, Feb 5, 2009 at 10:26 AM, Ramkumar R <ra...@gmail.com>wrote:
>>>
>>>> Hi Douglas,
>>>>
>>>> As Scott mentioned, we depend on the JAXB runtime to marshal/demarshal
>>>> the data types. I have also noticed this one while using the
>>>> org.apache.axiom.om.OMElement as the data type with binding.ws as shown
>>>> below.
>>>>
>>>> SEVERE: org.apache.tuscany.sca.databinding.TransformationException:
>>>> org.apache.tuscany.sca.databinding.TransformationException:
>>>> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of
>>>> IllegalAnnotationExceptions
>>>> org.apache.axiom.om.OMElement is an interface, and JAXB can't handle
>>>> interfaces.
>>>> this problem is related to the following location:
>>>> at org.apache.axiom.om.OMElement
>>>> at protected org.apache.axiom.om.OMElement
>>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile.arg0
>>>> at
>>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile
>>>>
>>>> This issue is raised as TUSCANY-2664. Please add your issue as part of
>>>> this JIRA OR you can also raise a seperate one.
>>>>
>>>> I am currently looking if we can have some workaround for this issue as
>>>> this feature is very much required to support MTOM with binding.ws.
>>>
>>>
>>>>
>>>> On Wed, Feb 4, 2009 at 10:01 PM, Scott Kurz <sc...@gmail.com>wrote:
>>>>
>>>>> Douglas,
>>>>>
>>>>> Since our <binding.ws> impl uses JAXB by default to map from the XML
>>>>> wireformat to the application Java, the JAXB runtime needs to be able to
>>>>> deserialize into your input/output types. If the types don't contain JAXB
>>>>> annotations, they need to follow the pattern that JAXB expects, i.e. they
>>>>> must contain the no-arg default constructor.
>>>>>
>>>>> Also I'll mention that we follow the JAX-WS spec in order to map
>>>>> between a Java exception and the platform-neutral fault data it carries.
>>>>> (See "Business Exceptions/Faults" at
>>>>>
>>>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
>>>>> for more info.
>>>>>
>>>>> It crossed my mind that maybe your interface is passing
>>>>> java.lang.Exception as an input parameter because you weren't aware of how
>>>>> to "throw" it across <binding.ws> .... or maybe you have a good reason
>>>>> for doing so and it was just a useful example.
>>>>>
>>>>> Scott
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>>>>>
>>>>>> When I try to use the binding.ws over an interface that has an
>>>>>> operation that takes a complex type with no-arg default constructor, in some
>>>>>> part of the hierarchy, as argument, I get an error.
>>>>>>
>>>>>> More specifically I have something like this:
>>>>>> *
>>>>>> @Remotable
>>>>>> public interface MyService {
>>>>>>
>>>>>> @OneWay
>>>>>> public void throwsAnException(Exception ex);
>>>>>> }*
>>>>>>
>>>>>> At the SCDL file:
>>>>>>
>>>>>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>>>> targetNamespace="http://myservice"
>>>>>> name="myservice">
>>>>>>
>>>>>> **<component name="MyServiceComponent">
>>>>>> *
>>>>>> *
>>>>>> **<implementation.java class="service.MyServiceImpl"/>
>>>>>> *
>>>>>> *
>>>>>> ** <service name="MyService">
>>>>>> *
>>>>>> * <interface.java
>>>>>> interface="service.MyService"/>
>>>>>> *
>>>>>> * <binding.ws uri="
>>>>>> http://localhost:8086/MyServiceComponent" />
>>>>>> *
>>>>>> * </service>
>>>>>> *
>>>>>> *</component>
>>>>>> *
>>>>>> *</composite>*
>>>>>>
>>>>>> I got the following error:
>>>>>>
>>>>>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>>>>>> 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
>>>>>>
>>>>>> Although the Exception an Throwable classes have no-arg default
>>>>>> constructors, the StackTraceElement doesn't have.
>>>>>> What can I do to avoid this problem?
>>>>>>
>>>>>> Thanks in advance,
>>>>>>
>>>>>> --
>>>>>> Douglas Siqueira Leite
>>>>>> Computer Science Master's degree student of University of Campinas
>>>>>> (Unicamp), Brazil
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Thanks & Regards,
>>>> Ramkumar Ramalingam
>>>>
>>>
>>>
>>>
>>> --
>>> Douglas Siqueira Leite
>>> Graduate student at University of Campinas (Unicamp), Brazil
>>>
>>>
>>
>>
>> --
>> Thanks & Regards,
>> Ramkumar Ramalingam
>>
>
>
>
> --
> Douglas Siqueira Leite
> Graduate student at University of Campinas (Unicamp), Brazil
>
>
--
Thanks & Regards,
Ramkumar Ramalingam
Re: Doubts related to the binding.ws
Posted by Douglas Leite <do...@gmail.com>.
Hi Ramkumar,
The article shows that we need to create an adapter to the class that does
not have a no-arg default constructor, ie, create a class that extends *
XmlAdapter<>* and implement the inherited methods. Moreover, we need to
annotate the class that was adapted with *@XmlJavaTypeAdapter* annotation.
However, the problem is that although the *Exception* an *Throwable* classes
have no-arg default constructors, the *StackTraceElement* doesn't. So, I
would need to create an adpater to *StackTracElement* and annotate it with *
@XmlJavaTypeAdpater*, what is not possible.
Is it right, or I am missing something?
Regards
On Mon, Mar 2, 2009 at 3:16 PM, Ramkumar R <ra...@gmail.com> wrote:
> Hi Douglas,
>
> Well yeah the fix is now available for this issue, In Tuscany we are now
> trying to support non-JAXB type using JAXB 2.0's XmlJavaTypeAdapter as
> mentioned in this article below.
>
> http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html
>
> Also you can take a look at the JUnit test available in binding-ws-axis2
> module....
>
> http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
>
> Please let me know, if you need more clarifications.
>
>
> On Mon, Mar 2, 2009 at 11:05 PM, Douglas Leite <do...@gmail.com>wrote:
>
>> Hi Ramkumar,
>>
>> Did you find out something that can be done to workaround this issue?
>> Could be used other framework to marshall / unmarshall the data types? Would
>> it solve the problem?
>>
>> Regards
>>
>>
>> On Thu, Feb 5, 2009 at 10:26 AM, Ramkumar R <ra...@gmail.com>wrote:
>>
>>> Hi Douglas,
>>>
>>> As Scott mentioned, we depend on the JAXB runtime to marshal/demarshal
>>> the data types. I have also noticed this one while using the
>>> org.apache.axiom.om.OMElement as the data type with binding.ws as shown
>>> below.
>>>
>>> SEVERE: org.apache.tuscany.sca.databinding.TransformationException:
>>> org.apache.tuscany.sca.databinding.TransformationException:
>>> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of
>>> IllegalAnnotationExceptions
>>> org.apache.axiom.om.OMElement is an interface, and JAXB can't handle
>>> interfaces.
>>> this problem is related to the following location:
>>> at org.apache.axiom.om.OMElement
>>> at protected org.apache.axiom.om.OMElement
>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile.arg0
>>> at
>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile
>>>
>>> This issue is raised as TUSCANY-2664. Please add your issue as part of
>>> this JIRA OR you can also raise a seperate one.
>>>
>>> I am currently looking if we can have some workaround for this issue as
>>> this feature is very much required to support MTOM with binding.ws.
>>
>>
>>>
>>> On Wed, Feb 4, 2009 at 10:01 PM, Scott Kurz <sc...@gmail.com> wrote:
>>>
>>>> Douglas,
>>>>
>>>> Since our <binding.ws> impl uses JAXB by default to map from the XML
>>>> wireformat to the application Java, the JAXB runtime needs to be able to
>>>> deserialize into your input/output types. If the types don't contain JAXB
>>>> annotations, they need to follow the pattern that JAXB expects, i.e. they
>>>> must contain the no-arg default constructor.
>>>>
>>>> Also I'll mention that we follow the JAX-WS spec in order to map between
>>>> a Java exception and the platform-neutral fault data it carries. (See
>>>> "Business Exceptions/Faults" at
>>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
>>>> for more info.
>>>>
>>>> It crossed my mind that maybe your interface is passing
>>>> java.lang.Exception as an input parameter because you weren't aware of how
>>>> to "throw" it across <binding.ws> .... or maybe you have a good reason
>>>> for doing so and it was just a useful example.
>>>>
>>>> Scott
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>>>>
>>>>> When I try to use the binding.ws over an interface that has an
>>>>> operation that takes a complex type with no-arg default constructor, in some
>>>>> part of the hierarchy, as argument, I get an error.
>>>>>
>>>>> More specifically I have something like this:
>>>>> *
>>>>> @Remotable
>>>>> public interface MyService {
>>>>>
>>>>> @OneWay
>>>>> public void throwsAnException(Exception ex);
>>>>> }*
>>>>>
>>>>> At the SCDL file:
>>>>>
>>>>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>>> targetNamespace="http://myservice"
>>>>> name="myservice">
>>>>>
>>>>> **<component name="MyServiceComponent">
>>>>> *
>>>>> *
>>>>> **<implementation.java class="service.MyServiceImpl"/>
>>>>> *
>>>>> *
>>>>> ** <service name="MyService">
>>>>> *
>>>>> * <interface.java
>>>>> interface="service.MyService"/>
>>>>> *
>>>>> * <binding.ws uri="
>>>>> http://localhost:8086/MyServiceComponent" />
>>>>> *
>>>>> * </service>
>>>>> *
>>>>> *</component>
>>>>> *
>>>>> *</composite>*
>>>>>
>>>>> I got the following error:
>>>>>
>>>>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>>>>> 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
>>>>>
>>>>> Although the Exception an Throwable classes have no-arg default
>>>>> constructors, the StackTraceElement doesn't have.
>>>>> What can I do to avoid this problem?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> --
>>>>> Douglas Siqueira Leite
>>>>> Computer Science Master's degree student of University of Campinas
>>>>> (Unicamp), Brazil
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Ramkumar Ramalingam
>>>
>>
>>
>>
>> --
>> Douglas Siqueira Leite
>> Graduate student at University of Campinas (Unicamp), Brazil
>>
>>
>
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>
--
Douglas Siqueira Leite
Graduate student at University of Campinas (Unicamp), Brazil
Re: Doubts related to the binding.ws
Posted by Douglas Leite <do...@gmail.com>.
Hi Ramkumar,
That's good! Do you think that supporting JAXB 2.0's XmlJavaTypeAdpater in
Tuscany is something that could be resolved in a SoC project, or it is
simpler?
Regards
On Mon, Mar 2, 2009 at 3:16 PM, Ramkumar R <ra...@gmail.com> wrote:
> Hi Douglas,
>
> Well yeah the fix is now available for this issue, In Tuscany we are now
> trying to support non-JAXB type using JAXB 2.0's XmlJavaTypeAdapter as
> mentioned in this article below.
>
> http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html
>
> Also you can take a look at the JUnit test available in binding-ws-axis2
> module....
>
> http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
>
> Please let me know, if you need more clarifications.
>
>
> On Mon, Mar 2, 2009 at 11:05 PM, Douglas Leite <do...@gmail.com>wrote:
>
>> Hi Ramkumar,
>>
>> Did you find out something that can be done to workaround this issue?
>> Could be used other framework to marshall / unmarshall the data types? Would
>> it solve the problem?
>>
>> Regards
>>
>>
>> On Thu, Feb 5, 2009 at 10:26 AM, Ramkumar R <ra...@gmail.com>wrote:
>>
>>> Hi Douglas,
>>>
>>> As Scott mentioned, we depend on the JAXB runtime to marshal/demarshal
>>> the data types. I have also noticed this one while using the
>>> org.apache.axiom.om.OMElement as the data type with binding.ws as shown
>>> below.
>>>
>>> SEVERE: org.apache.tuscany.sca.databinding.TransformationException:
>>> org.apache.tuscany.sca.databinding.TransformationException:
>>> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of
>>> IllegalAnnotationExceptions
>>> org.apache.axiom.om.OMElement is an interface, and JAXB can't handle
>>> interfaces.
>>> this problem is related to the following location:
>>> at org.apache.axiom.om.OMElement
>>> at protected org.apache.axiom.om.OMElement
>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile.arg0
>>> at
>>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile
>>>
>>> This issue is raised as TUSCANY-2664. Please add your issue as part of
>>> this JIRA OR you can also raise a seperate one.
>>>
>>> I am currently looking if we can have some workaround for this issue as
>>> this feature is very much required to support MTOM with binding.ws.
>>
>>
>>>
>>> On Wed, Feb 4, 2009 at 10:01 PM, Scott Kurz <sc...@gmail.com> wrote:
>>>
>>>> Douglas,
>>>>
>>>> Since our <binding.ws> impl uses JAXB by default to map from the XML
>>>> wireformat to the application Java, the JAXB runtime needs to be able to
>>>> deserialize into your input/output types. If the types don't contain JAXB
>>>> annotations, they need to follow the pattern that JAXB expects, i.e. they
>>>> must contain the no-arg default constructor.
>>>>
>>>> Also I'll mention that we follow the JAX-WS spec in order to map between
>>>> a Java exception and the platform-neutral fault data it carries. (See
>>>> "Business Exceptions/Faults" at
>>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
>>>> for more info.
>>>>
>>>> It crossed my mind that maybe your interface is passing
>>>> java.lang.Exception as an input parameter because you weren't aware of how
>>>> to "throw" it across <binding.ws> .... or maybe you have a good reason
>>>> for doing so and it was just a useful example.
>>>>
>>>> Scott
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>>>>
>>>>> When I try to use the binding.ws over an interface that has an
>>>>> operation that takes a complex type with no-arg default constructor, in some
>>>>> part of the hierarchy, as argument, I get an error.
>>>>>
>>>>> More specifically I have something like this:
>>>>> *
>>>>> @Remotable
>>>>> public interface MyService {
>>>>>
>>>>> @OneWay
>>>>> public void throwsAnException(Exception ex);
>>>>> }*
>>>>>
>>>>> At the SCDL file:
>>>>>
>>>>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>>> targetNamespace="http://myservice"
>>>>> name="myservice">
>>>>>
>>>>> **<component name="MyServiceComponent">
>>>>> *
>>>>> *
>>>>> **<implementation.java class="service.MyServiceImpl"/>
>>>>> *
>>>>> *
>>>>> ** <service name="MyService">
>>>>> *
>>>>> * <interface.java
>>>>> interface="service.MyService"/>
>>>>> *
>>>>> * <binding.ws uri="
>>>>> http://localhost:8086/MyServiceComponent" />
>>>>> *
>>>>> * </service>
>>>>> *
>>>>> *</component>
>>>>> *
>>>>> *</composite>*
>>>>>
>>>>> I got the following error:
>>>>>
>>>>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>>>>> 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
>>>>>
>>>>> Although the Exception an Throwable classes have no-arg default
>>>>> constructors, the StackTraceElement doesn't have.
>>>>> What can I do to avoid this problem?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> --
>>>>> Douglas Siqueira Leite
>>>>> Computer Science Master's degree student of University of Campinas
>>>>> (Unicamp), Brazil
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Thanks & Regards,
>>> Ramkumar Ramalingam
>>>
>>
>>
>>
>> --
>> Douglas Siqueira Leite
>> Graduate student at University of Campinas (Unicamp), Brazil
>>
>>
>
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>
--
Douglas Siqueira Leite
Graduate student at University of Campinas (Unicamp), Brazil
Re: Doubts related to the binding.ws
Posted by Ramkumar R <ra...@gmail.com>.
Hi Douglas,
Well yeah the fix is now available for this issue, In Tuscany we are now
trying to support non-JAXB type using JAXB 2.0's XmlJavaTypeAdapter as
mentioned in this article below.
http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html
Also you can take a look at the JUnit test available in binding-ws-axis2
module....
http://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/modules/binding-ws-axis2/src/test/java/org/apache/tuscany/sca/binding/ws/axis2/itests/mtom/FileTransferService.java
Please let me know, if you need more clarifications.
On Mon, Mar 2, 2009 at 11:05 PM, Douglas Leite <do...@gmail.com> wrote:
> Hi Ramkumar,
>
> Did you find out something that can be done to workaround this issue? Could
> be used other framework to marshall / unmarshall the data types? Would it
> solve the problem?
>
> Regards
>
>
> On Thu, Feb 5, 2009 at 10:26 AM, Ramkumar R <ra...@gmail.com> wrote:
>
>> Hi Douglas,
>>
>> As Scott mentioned, we depend on the JAXB runtime to marshal/demarshal the
>> data types. I have also noticed this one while using the
>> org.apache.axiom.om.OMElement as the data type with binding.ws as shown
>> below.
>>
>> SEVERE: org.apache.tuscany.sca.databinding.TransformationException:
>> org.apache.tuscany.sca.databinding.TransformationException:
>> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of
>> IllegalAnnotationExceptions
>> org.apache.axiom.om.OMElement is an interface, and JAXB can't handle
>> interfaces.
>> this problem is related to the following location:
>> at org.apache.axiom.om.OMElement
>> at protected org.apache.axiom.om.OMElement
>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile.arg0
>> at
>> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile
>>
>> This issue is raised as TUSCANY-2664. Please add your issue as part of
>> this JIRA OR you can also raise a seperate one.
>>
>> I am currently looking if we can have some workaround for this issue as
>> this feature is very much required to support MTOM with binding.ws.
>
>
>>
>> On Wed, Feb 4, 2009 at 10:01 PM, Scott Kurz <sc...@gmail.com> wrote:
>>
>>> Douglas,
>>>
>>> Since our <binding.ws> impl uses JAXB by default to map from the XML
>>> wireformat to the application Java, the JAXB runtime needs to be able to
>>> deserialize into your input/output types. If the types don't contain JAXB
>>> annotations, they need to follow the pattern that JAXB expects, i.e. they
>>> must contain the no-arg default constructor.
>>>
>>> Also I'll mention that we follow the JAX-WS spec in order to map between
>>> a Java exception and the platform-neutral fault data it carries. (See
>>> "Business Exceptions/Faults" at
>>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
>>> for more info.
>>>
>>> It crossed my mind that maybe your interface is passing
>>> java.lang.Exception as an input parameter because you weren't aware of how
>>> to "throw" it across <binding.ws> .... or maybe you have a good reason
>>> for doing so and it was just a useful example.
>>>
>>> Scott
>>>
>>>
>>>
>>>
>>> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>>>
>>>> When I try to use the binding.ws over an interface that has an
>>>> operation that takes a complex type with no-arg default constructor, in some
>>>> part of the hierarchy, as argument, I get an error.
>>>>
>>>> More specifically I have something like this:
>>>> *
>>>> @Remotable
>>>> public interface MyService {
>>>>
>>>> @OneWay
>>>> public void throwsAnException(Exception ex);
>>>> }*
>>>>
>>>> At the SCDL file:
>>>>
>>>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>>> targetNamespace="http://myservice"
>>>> name="myservice">
>>>>
>>>> **<component name="MyServiceComponent">
>>>> *
>>>> *
>>>> **<implementation.java class="service.MyServiceImpl"/>
>>>> *
>>>> *
>>>> ** <service name="MyService">
>>>> *
>>>> * <interface.java
>>>> interface="service.MyService"/>
>>>> *
>>>> * <binding.ws uri="
>>>> http://localhost:8086/MyServiceComponent" />
>>>> *
>>>> * </service>
>>>> *
>>>> *</component>
>>>> *
>>>> *</composite>*
>>>>
>>>> I got the following error:
>>>>
>>>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>>>> 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
>>>>
>>>> Although the Exception an Throwable classes have no-arg default
>>>> constructors, the StackTraceElement doesn't have.
>>>> What can I do to avoid this problem?
>>>>
>>>> Thanks in advance,
>>>>
>>>> --
>>>> Douglas Siqueira Leite
>>>> Computer Science Master's degree student of University of Campinas
>>>> (Unicamp), Brazil
>>>>
>>>>
>>>
>>
>>
>> --
>> Thanks & Regards,
>> Ramkumar Ramalingam
>>
>
>
>
> --
> Douglas Siqueira Leite
> Graduate student at University of Campinas (Unicamp), Brazil
>
>
--
Thanks & Regards,
Ramkumar Ramalingam
Re: Doubts related to the binding.ws
Posted by Douglas Leite <do...@gmail.com>.
Hi Ramkumar,
Did you find out something that can be done to workaround this issue? Could
be used other framework to marshall / unmarshall the data types? Would it
solve the problem?
Regards
On Thu, Feb 5, 2009 at 10:26 AM, Ramkumar R <ra...@gmail.com> wrote:
> Hi Douglas,
>
> As Scott mentioned, we depend on the JAXB runtime to marshal/demarshal the
> data types. I have also noticed this one while using the
> org.apache.axiom.om.OMElement as the data type with binding.ws as shown
> below.
>
> SEVERE: org.apache.tuscany.sca.databinding.TransformationException:
> org.apache.tuscany.sca.databinding.TransformationException:
> com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of
> IllegalAnnotationExceptions
> org.apache.axiom.om.OMElement is an interface, and JAXB can't handle
> interfaces.
> this problem is related to the following location:
> at org.apache.axiom.om.OMElement
> at protected org.apache.axiom.om.OMElement
> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile.arg0
> at
> org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile
>
> This issue is raised as TUSCANY-2664. Please add your issue as part of this
> JIRA OR you can also raise a seperate one.
>
> I am currently looking if we can have some workaround for this issue as
> this feature is very much required to support MTOM with binding.ws.
>
> On Wed, Feb 4, 2009 at 10:01 PM, Scott Kurz <sc...@gmail.com> wrote:
>
>> Douglas,
>>
>> Since our <binding.ws> impl uses JAXB by default to map from the XML
>> wireformat to the application Java, the JAXB runtime needs to be able to
>> deserialize into your input/output types. If the types don't contain JAXB
>> annotations, they need to follow the pattern that JAXB expects, i.e. they
>> must contain the no-arg default constructor.
>>
>> Also I'll mention that we follow the JAX-WS spec in order to map between a
>> Java exception and the platform-neutral fault data it carries. (See
>> "Business Exceptions/Faults" at
>> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
>> for more info.
>>
>> It crossed my mind that maybe your interface is passing
>> java.lang.Exception as an input parameter because you weren't aware of how
>> to "throw" it across <binding.ws> .... or maybe you have a good reason
>> for doing so and it was just a useful example.
>>
>> Scott
>>
>>
>>
>>
>> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>>
>>> When I try to use the binding.ws over an interface that has an operation
>>> that takes a complex type with no-arg default constructor, in some part of
>>> the hierarchy, as argument, I get an error.
>>>
>>> More specifically I have something like this:
>>> *
>>> @Remotable
>>> public interface MyService {
>>>
>>> @OneWay
>>> public void throwsAnException(Exception ex);
>>> }*
>>>
>>> At the SCDL file:
>>>
>>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>> targetNamespace="http://myservice"
>>> name="myservice">
>>>
>>> **<component name="MyServiceComponent">
>>> *
>>> *
>>> **<implementation.java class="service.MyServiceImpl"/>
>>> *
>>> *
>>> ** <service name="MyService">
>>> *
>>> * <interface.java
>>> interface="service.MyService"/>
>>> *
>>> * <binding.ws uri="
>>> http://localhost:8086/MyServiceComponent" />
>>> *
>>> * </service>
>>> *
>>> *</component>
>>> *
>>> *</composite>*
>>>
>>> I got the following error:
>>>
>>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>>> 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
>>>
>>> Although the Exception an Throwable classes have no-arg default
>>> constructors, the StackTraceElement doesn't have.
>>> What can I do to avoid this problem?
>>>
>>> Thanks in advance,
>>>
>>> --
>>> Douglas Siqueira Leite
>>> Computer Science Master's degree student of University of Campinas
>>> (Unicamp), Brazil
>>>
>>>
>>
>
>
> --
> Thanks & Regards,
> Ramkumar Ramalingam
>
--
Douglas Siqueira Leite
Graduate student at University of Campinas (Unicamp), Brazil
Re: Doubts related to the binding.ws
Posted by Ramkumar R <ra...@gmail.com>.
Hi Douglas,
As Scott mentioned, we depend on the JAXB runtime to marshal/demarshal the
data types. I have also noticed this one while using the
org.apache.axiom.om.OMElement as the data type with binding.ws as shown
below.
SEVERE: org.apache.tuscany.sca.databinding.TransformationException:
org.apache.tuscany.sca.databinding.TransformationException:
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts of
IllegalAnnotationExceptions
org.apache.axiom.om.OMElement is an interface, and JAXB can't handle
interfaces.
this problem is related to the following location:
at org.apache.axiom.om.OMElement
at protected org.apache.axiom.om.OMElement
org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile.arg0
at
org.apache.tuscany.sca.binding.ws.axis2.itests.mtom.jaxws.UploadOMElementFile
This issue is raised as TUSCANY-2664. Please add your issue as part of this
JIRA OR you can also raise a seperate one.
I am currently looking if we can have some workaround for this issue as this
feature is very much required to support MTOM with binding.ws.
On Wed, Feb 4, 2009 at 10:01 PM, Scott Kurz <sc...@gmail.com> wrote:
> Douglas,
>
> Since our <binding.ws> impl uses JAXB by default to map from the XML
> wireformat to the application Java, the JAXB runtime needs to be able to
> deserialize into your input/output types. If the types don't contain JAXB
> annotations, they need to follow the pattern that JAXB expects, i.e. they
> must contain the no-arg default constructor.
>
> Also I'll mention that we follow the JAX-WS spec in order to map between a
> Java exception and the platform-neutral fault data it carries. (See
> "Business Exceptions/Faults" at
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
> for more info.
>
> It crossed my mind that maybe your interface is passing java.lang.Exception
> as an input parameter because you weren't aware of how to "throw" it across
> <binding.ws> .... or maybe you have a good reason for doing so and it was
> just a useful example.
>
> Scott
>
>
>
>
> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>
>> When I try to use the binding.ws over an interface that has an operation
>> that takes a complex type with no-arg default constructor, in some part of
>> the hierarchy, as argument, I get an error.
>>
>> More specifically I have something like this:
>> *
>> @Remotable
>> public interface MyService {
>>
>> @OneWay
>> public void throwsAnException(Exception ex);
>> }*
>>
>> At the SCDL file:
>>
>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>> targetNamespace="http://myservice"
>> name="myservice">
>>
>> **<component name="MyServiceComponent">
>> *
>> *
>> **<implementation.java class="service.MyServiceImpl"/>
>> *
>> *
>> ** <service name="MyService">
>> *
>> * <interface.java
>> interface="service.MyService"/>
>> *
>> * <binding.ws uri="
>> http://localhost:8086/MyServiceComponent" />
>> *
>> * </service>
>> *
>> *</component>
>> *
>> *</composite>*
>>
>> I got the following error:
>>
>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>> 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
>>
>> Although the Exception an Throwable classes have no-arg default
>> constructors, the StackTraceElement doesn't have.
>> What can I do to avoid this problem?
>>
>> Thanks in advance,
>>
>> --
>> Douglas Siqueira Leite
>> Computer Science Master's degree student of University of Campinas
>> (Unicamp), Brazil
>>
>>
>
--
Thanks & Regards,
Ramkumar Ramalingam
Re: Doubts related to the binding.ws
Posted by Douglas Leite <do...@gmail.com>.
Hi Scott,
About what you said: "It crossed my mind that maybe your interface is
passing java.lang.Exception as an input parameter because you weren't aware
of how to "throw" it across <binding.ws> .... "
In fact, I am using a java.lang.Exception as an input parameter in a
callback interface, in order to simulate the behavior given by the
invocation of an asynchronous method that can throw an exception. I would
like to have something like this:
*@Remotable
public interface MyServiceInterface {
@OneWay
public void aServiceMethod1() throws Exception;
@OneWay
public void aServiceMethod2() throws Exception;
}*
With an interface service like that, I could invoke asynchronously the
methods, and the exceptions would be raised at the proper time. So, the
client would not be waiting for the end of the execution of a method, to
invoke another one.
I am not right if it is the best solution, but I have tried to simulate this
behavior using a callback interface that takes a Exception as an input
parameter. In this way, the client could invoke the methods concurrently,
and when an exception occurs at the service implementation, it is passed to
the client through the callback interface.
However, it does not work remotely because the problem I mentioned before.
On Wed, Feb 4, 2009 at 2:31 PM, Scott Kurz <sc...@gmail.com> wrote:
> Douglas,
>
> Since our <binding.ws> impl uses JAXB by default to map from the XML
> wireformat to the application Java, the JAXB runtime needs to be able to
> deserialize into your input/output types. If the types don't contain JAXB
> annotations, they need to follow the pattern that JAXB expects, i.e. they
> must contain the no-arg default constructor.
>
> Also I'll mention that we follow the JAX-WS spec in order to map between a
> Java exception and the platform-neutral fault data it carries. (See
> "Business Exceptions/Faults" at
> http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
> for more info.
>
> It crossed my mind that maybe your interface is passing java.lang.Exception
> as an input parameter because you weren't aware of how to "throw" it across
> <binding.ws> .... or maybe you have a good reason for doing so and it was
> just a useful example.
>
> Scott
>
>
>
>
> On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com>wrote:
>
>> When I try to use the binding.ws over an interface that has an operation
>> that takes a complex type with no-arg default constructor, in some part of
>> the hierarchy, as argument, I get an error.
>>
>> More specifically I have something like this:
>> *
>> @Remotable
>> public interface MyService {
>>
>> @OneWay
>> public void throwsAnException(Exception ex);
>> }*
>>
>> At the SCDL file:
>>
>> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>> targetNamespace="http://myservice"
>> name="myservice">
>>
>> **<component name="MyServiceComponent">
>> *
>> *
>> **<implementation.java class="service.MyServiceImpl"/>
>> *
>> *
>> ** <service name="MyService">
>> *
>> * <interface.java
>> interface="service.MyService"/>
>> *
>> * <binding.ws uri="
>> http://localhost:8086/MyServiceComponent" />
>> *
>> * </service>
>> *
>> *</component>
>> *
>> *</composite>*
>>
>> I got the following error:
>>
>> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
>> 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
>>
>> Although the Exception an Throwable classes have no-arg default
>> constructors, the StackTraceElement doesn't have.
>> What can I do to avoid this problem?
>>
>> Thanks in advance,
>>
>> --
>> Douglas Siqueira Leite
>> Computer Science Master's degree student of University of Campinas
>> (Unicamp), Brazil
>>
>>
>
--
Douglas Siqueira Leite
Computer Science Master's degree student of University of Campinas
(Unicamp), Brazil
Re: Doubts related to the binding.ws
Posted by Scott Kurz <sc...@gmail.com>.
Douglas,
Since our <binding.ws> impl uses JAXB by default to map from the XML
wireformat to the application Java, the JAXB runtime needs to be able to
deserialize into your input/output types. If the types don't contain JAXB
annotations, they need to follow the pattern that JAXB expects, i.e. they
must contain the no-arg default constructor.
Also I'll mention that we follow the JAX-WS spec in order to map between a
Java exception and the platform-neutral fault data it carries. (See
"Business Exceptions/Faults" at
http://cwiki.apache.org/confluence/display/TUSCANYWIKI/Databinding+Scope
for more info.
It crossed my mind that maybe your interface is passing java.lang.Exception
as an input parameter because you weren't aware of how to "throw" it across
<binding.ws> .... or maybe you have a good reason for doing so and it was
just a useful example.
Scott
On Wed, Feb 4, 2009 at 9:58 AM, Douglas Leite <do...@gmail.com> wrote:
> When I try to use the binding.ws over an interface that has an operation
> that takes a complex type with no-arg default constructor, in some part of
> the hierarchy, as argument, I get an error.
>
> More specifically I have something like this:
> *
> @Remotable
> public interface MyService {
>
> @OneWay
> public void throwsAnException(Exception ex);
> }*
>
> At the SCDL file:
>
> *<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
> targetNamespace="http://myservice"
> name="myservice">
>
> **<component name="MyServiceComponent">
> *
> *
> **<implementation.java class="service.MyServiceImpl"/>
> *
> *
> ** <service name="MyService">
> *
> * <interface.java
> interface="service.MyService"/>
> *
> * <binding.ws uri="
> http://localhost:8086/MyServiceComponent" />
> *
> * </service>
> *
> *</component>
> *
> *</composite>*
>
> I got the following error:
>
> SEVERE: Exception thrown was: org.osoa.sca.ServiceRuntimeException:
> 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
>
> Although the Exception an Throwable classes have no-arg default
> constructors, the StackTraceElement doesn't have.
> What can I do to avoid this problem?
>
> Thanks in advance,
>
> --
> Douglas Siqueira Leite
> Computer Science Master's degree student of University of Campinas
> (Unicamp), Brazil
>
>