You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Pietroforte <pi...@gmail.com> on 2009/08/13 20:28:17 UTC

Does Jaxb With Spring Remoting (proxy) work ?

1) When i configure client to use the producer template with jaxb, it works
fine.

2) When i change to proxy configuration, it doesn't work.

The (un)marshal, in the camel-server.xml, works with Template, but doesn't
work with Proxy.
...

      
      
      
      


If i want my Proxy working, i have to remove the (un)marshal of the route
and utilize a method in my inteface that receives a common type, such a
integer or a string, but not a type generated by jaxb.

Some clues?


-- 
View this message in context: http://www.nabble.com/Does-Jaxb-With-Spring-Remoting-%28proxy%29-work---tp24956379p24956379.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Re: Does Jaxb With Spring Remoting (proxy) work ?

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Can you show us how your create the producer template and your routing 
rule ?

Willem

Pietroforte wrote:
> Hi.
> 
> I don't know exactly why, but when i use camel producer template with jaxb,
> i don't have to serialize the classes and i can marshal and unmarshal with
> jaxb dataformat normaly.
> 
> But, when i introduce de proxy and remove the producer template, start the
> serialization problem and marshal and unmarshal do not work.
> 
> Did you do something like this?
> 
> Tks!
> 
> akuhtz wrote:
>> Hi,
>>
>> If I get you right the problem is that the classes generated by jaxb do
>> not implement Serializable?! This can be changed by adding custom binding
>> for jaxb. I haven't tried out how to use this with Camel but I guess this
>> should be a starting point. You can also google for jaxb java class
>> serializable.<br>
>>
>> Should be something like this:<br>
>> <pre>
>> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
>> &lt;jxb:bindings version="2.0" 
>>               xmlns:jxb="http://java.sun.com/xml/ns/jaxb" 
>>               xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; 
>>   &lt;jxb:bindings &gt; 
>>     &lt;jxb:globalBindings&gt; 
>>        &lt;jxb:serializable uid="1" /&gt;
>>     &lt;/jxb:globalBindings&gt; 
>>   &lt;/jxb:bindings&gt; 
>> &lt;/jxb:bindings&gt;
>> </pre>
>>
>> Save the snippet above e.g. as my_binding.xjb in the resource directory
>> where the xsd schema files are located (*.xjb is the default extension
>> that is picked up by the maven-jaxb2-plugin, see
>> https://maven-jaxb2-plugin.dev.java.net/docs/guide.html for more
>> information).
>> Hope this helps.
>>
> 


Re: Does Jaxb With Spring Remoting (proxy) work ?

Posted by Pietroforte <pi...@gmail.com>.
Hi.

I don't know exactly why, but when i use camel producer template with jaxb,
i don't have to serialize the classes and i can marshal and unmarshal with
jaxb dataformat normaly.

But, when i introduce de proxy and remove the producer template, start the
serialization problem and marshal and unmarshal do not work.

Did you do something like this?

Tks!

akuhtz wrote:
> 
> Hi,
> 
> If I get you right the problem is that the classes generated by jaxb do
> not implement Serializable?! This can be changed by adding custom binding
> for jaxb. I haven't tried out how to use this with Camel but I guess this
> should be a starting point. You can also google for jaxb java class
> serializable.<br>
> 
> Should be something like this:<br>
> <pre>
> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
> &lt;jxb:bindings version="2.0" 
>               xmlns:jxb="http://java.sun.com/xml/ns/jaxb" 
>               xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; 
>   &lt;jxb:bindings &gt; 
>     &lt;jxb:globalBindings&gt; 
>        &lt;jxb:serializable uid="1" /&gt;
>     &lt;/jxb:globalBindings&gt; 
>   &lt;/jxb:bindings&gt; 
> &lt;/jxb:bindings&gt;
> </pre>
> 
> Save the snippet above e.g. as my_binding.xjb in the resource directory
> where the xsd schema files are located (*.xjb is the default extension
> that is picked up by the maven-jaxb2-plugin, see
> https://maven-jaxb2-plugin.dev.java.net/docs/guide.html for more
> information).
> Hope this helps.
> 

-- 
View this message in context: http://www.nabble.com/Does-Jaxb-With-Spring-Remoting-%28proxy%29-work---tp24956379p25011472.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Does Jaxb With Spring Remoting (proxy) work ?

Posted by akuhtz <an...@siemens.com>.
Hi,

If I get you right the problem is that the classes generated by jaxb do not
implement Serializable?! This can be changed by adding custom binding for
jaxb. I haven't tried out how to use this with Camel but I guess this should
be a starting point. You can also google for jaxb java class serializable.


Should be something like this:


&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;jxb:bindings version="2.0" 
              xmlns:jxb="http://java.sun.com/xml/ns/jaxb" 
              xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; 
  &lt;jxb:bindings &gt; 
    &lt;jxb:globalBindings&gt; 
       &lt;jxb:serializable uid="1" /&gt;
    &lt;/jxb:globalBindings&gt; 
  &lt;/jxb:bindings&gt; 
&lt;/jxb:bindings&gt;


Hope this helps.
-- 
View this message in context: http://www.nabble.com/Does-Jaxb-With-Spring-Remoting-%28proxy%29-work---tp24956379p24982316.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.

Re: Does Jaxb With Spring Remoting (proxy) work ?

Posted by Pietroforte <pi...@gmail.com>.
Hi Claus,

I made my tests based on the tutorial on spring remoting with JMS by Martin
Gilday.

Version of Camel: apache-camel-1.6.1
OS: windows xp
JDK: 1.5
JAXB:
message broker: apache-activemq-5.2.0 (i've tryied with mqseries but had the
same behavior

The problem happens when, after i start the server (camel-server.xml) and
the client(
camel-client-remoting.xml), i try to comunicate with an interface of the
server that receives an object generated by jaxb. The comunication in the
side of client stops here, with a message in console: [DEBUG] joining on
thread Thread[Thread: 1
org.apache.camel.component.jms.JmsComponent@ac0b08,5,

and, in the side of server, with the apache camel already started, nothing
happens.

I think that the route subtags (un)marshall are causing this non expected
behavior.

To the transport of the object works fine, i have to remove the (un)marshal
and manually serialize the classes generated by jaxb, so i don't tranport
xml but objects serialized. Working this way, i have a limited use of jaxb.

my dependencies are basically:

com.ibm.mqjms 5.3.13 com.ibm.mq 5.3.13
org.apache.camel camel-core 1.6.1 camel-jms 1.6.1 camel-jaxb 1.6.1
camel-spring 1.6.1
org.apache.activemq activemq-core 5.2.0
org.apache.xbean xbean-spring 3.5
cglib cglib-nodep 2.1_3
org.springframework spring-core 2.5.6 org.spring-orm 2.5.6
javax.xml.bind jaxb-api 2.0 
com.sun.xml.bind jaxb-impl 2.0.3 com.sun.jdmk jmxtools1.2.1
org.jvnet.jaxb2.maven2 maven-jaxb2-plugin 0.7.1





Claus Ibsen-2 wrote:
> 
> Hi
> 
> I think you need to provide a bit more details such as
> 
> - Version of Camel, OS, JDK, JAXB etc.
> - What goes wrong, stacktrace / error etc.
> - Configuration of working vs. non working
> 
> 
> On Thu, Aug 13, 2009 at 8:28 PM, Pietroforte<pi...@gmail.com> wrote:
>>
>> 1) When i configure client to use the producer template with jaxb, it
>> works
>> fine.
>>
>> 2) When i change to proxy configuration, it doesn't work.
>>
>> The (un)marshal, in the camel-server.xml, works with Template, but
>> doesn't
>> work with Proxy.
>> ...
>>
>>
>>
>>
>>
>>
>>
>> If i want my Proxy working, i have to remove the (un)marshal of the route
>> and utilize a method in my inteface that receives a common type, such a
>> integer or a string, but not a type generated by jaxb.
>>
>> Some clues?
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Does-Jaxb-With-Spring-Remoting-%28proxy%29-work---tp24956379p24956379.html
>> Sent from the Camel - Users (activemq) mailing list archive at
>> Nabble.com.
>>
> 
> 
> 
> -- 
> Claus Ibsen
> Apache Camel Committer
> 
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
> 
> 
http://www.nabble.com/file/p24973053/camel-client-remoting.xml
camel-client-remoting.xml 
http://www.nabble.com/file/p24973053/camel-server.xml camel-server.xml 
http://www.nabble.com/file/p24973053/camel-server.xml camel-server.xml 
-- 
View this message in context: http://www.nabble.com/Does-Jaxb-With-Spring-Remoting-%28proxy%29-work---tp24956379p24973053.html
Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.


Re: Does Jaxb With Spring Remoting (proxy) work ?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

And it may also be a pure spring related issue how to work with JAXB
over it using its proxy features.
Although you can use Camel as well to expose such a proxy.

On Fri, Aug 14, 2009 at 8:42 AM, Claus Ibsen<cl...@gmail.com> wrote:
> Hi
>
> I think you need to provide a bit more details such as
>
> - Version of Camel, OS, JDK, JAXB etc.
> - What goes wrong, stacktrace / error etc.
> - Configuration of working vs. non working
>
>
> On Thu, Aug 13, 2009 at 8:28 PM, Pietroforte<pi...@gmail.com> wrote:
>>
>> 1) When i configure client to use the producer template with jaxb, it works
>> fine.
>>
>> 2) When i change to proxy configuration, it doesn't work.
>>
>> The (un)marshal, in the camel-server.xml, works with Template, but doesn't
>> work with Proxy.
>> ...
>>
>>
>>
>>
>>
>>
>>
>> If i want my Proxy working, i have to remove the (un)marshal of the route
>> and utilize a method in my inteface that receives a common type, such a
>> integer or a string, but not a type generated by jaxb.
>>
>> Some clues?
>>
>>
>> --
>> View this message in context: http://www.nabble.com/Does-Jaxb-With-Spring-Remoting-%28proxy%29-work---tp24956379p24956379.html
>> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Does Jaxb With Spring Remoting (proxy) work ?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

I think you need to provide a bit more details such as

- Version of Camel, OS, JDK, JAXB etc.
- What goes wrong, stacktrace / error etc.
- Configuration of working vs. non working


On Thu, Aug 13, 2009 at 8:28 PM, Pietroforte<pi...@gmail.com> wrote:
>
> 1) When i configure client to use the producer template with jaxb, it works
> fine.
>
> 2) When i change to proxy configuration, it doesn't work.
>
> The (un)marshal, in the camel-server.xml, works with Template, but doesn't
> work with Proxy.
> ...
>
>
>
>
>
>
>
> If i want my Proxy working, i have to remove the (un)marshal of the route
> and utilize a method in my inteface that receives a common type, such a
> integer or a string, but not a type generated by jaxb.
>
> Some clues?
>
>
> --
> View this message in context: http://www.nabble.com/Does-Jaxb-With-Spring-Remoting-%28proxy%29-work---tp24956379p24956379.html
> Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus