You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Guillaume Nodet <gn...@gmail.com> on 2007/04/11 21:16:19 UTC

Re: connecting to jsr-181 jaxb2

This feature has been implemented for 3.2.
See http://issues.apache.org/activemq/browse/SM-918

On 11/15/06, Guillaume Nodet <gn...@gmail.com> wrote:
>
> Unfortunately, there's no way to share some code between SU
> (other than putting this jar in the container classpath).  The main
> reason is that JBI has been designed around xml based interactions,
> but if you need to put some classes inside properties for example,
> you need a common jar :(
> I think this would be a great addition to ServiceMix if service units
> could reference some kind of shared libraries somehow ...
>
> On 11/15/06, moraleslos <mo...@hotmail.com> wrote:
> >
> > Ok, I'll give separation a shot.  I do have a question related to this
> > though.  Suppose I have two SUs that are dependent on a common jar, and
> both
> > of these SUs are packaged into one SA.  Each SU has this common jar
> packaged
> > into its /lib directory.  Wouldn't there be some kind of class loading
> > issue?  Therefore how would you define this one common jar to be shared
> > across the SUs?  Would you define it in the SA or must this common jar
> be
> > placed into a shared directory ala smx's lib/optional directory?  Thanks
> in
> > advance.
> >
> > -los
> >
> >
> >
> > gnodet wrote:
> > >
> > > The xbean.xml for the jsr81 should be packaged in its
> > > own SU and referenced from the SA jbi.xml.
> > >
> > > On 11/15/06, moraleslos <mo...@hotmail.com> wrote:
> > >>
> > >> Could it be that I'm placing the xbean.xml file in the wrong
> location?
> > >> Currently I have it packaged in my SU at the same location to where
> my
> > >> servicemix.xml is located.  This SU is deployed to on top of the
> > >> servicemix-lwcontainer.  The generated jbi.xml looks like this:
> > >>
> > >> #################
> > >> <jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
> > >>   <service-assembly>
> > >>     <identification>
> > >>       <name>test-integration-servicemix-jbi</name>
> > >>       <description></description>
> > >>     </identification>
> > >>     <service-unit>
> > >>       <identification>
> > >>         <name>test-integration-servicemix</name>
> > >>       </identification>
> > >>       <target>
> > >>
> > >> <artifacts-zip>test-integration-servicemix-1.0-SNAPSHOT.zip
> </artifacts-zip>
> > >>         <component-name>servicemix-lwcontainer</component-name>
> > >>       </target>
> > >>     </service-unit>
> > >>   </service-assembly>
> > >> </jbi>
> > >> #######################
> > >>
> > >>
> > >>
> > >> gnodet wrote:
> > >> >
> > >> > Maybe your servicemix.xml config file is bad.
> > >> > Could you post the complete one ?
> > >> >
> > >> > On 11/15/06, moraleslos <mo...@hotmail.com> wrote:
> > >> >>
> > >> >> Thanks Guillaume.
> > >> >>
> > >> >> I launched JConsole, went to
> > >> >> org.apache.servicemix-->ServiceMix-->Component
> > >> >> as well as Endpoint, and my xmlUnmarshaller component is nowhere
> to be
> > >> >> found.  Now, knowing why the component can't be found, how do I
> have
> > >> smx
> > >> >> register my xmlUnmarshaller?  Thanks.
> > >> >>
> > >> >> -los
> > >> >>
> > >> >>
> > >> >>
> > >> >> gnodet wrote:
> > >> >> >
> > >> >> > I don't see why it does not work.
> > >> >> > Check what endpoints are activated using the log file at DEBUG
> level
> > >> >> > or a jmx console and ensure the needed endpoint is activate and
> > >> match
> > >> >> > the defined route.
> > >> >> >
> > >> >> > On 11/14/06, moraleslos <mo...@hotmail.com> wrote:
> > >> >> >>
> > >> >> >> I currently have my SU defined to do some XSLT.  This is my
> > >> >> >> servicemix.xml:
> > >> >> >>
> > >> >> >> #################
> > >> >> >> <sm:activationSpec
> > >> >> >>         componentName="xmlTransformer"
> > >> >> >>         service="foo:xmlTransformer"
> > >> >> >>         destinationService="foo:xmlUnmarshaller">
> > >> >> >>         <sm:component>
> > >> >> >>                 <bean
> > >> >> >> class="org.apache.servicemix.components.xslt.XsltComponent">
> > >> >> >>                         <property
> > >> >> >>                         name="xsltResource"
> > >> >> >>
> value="classpath:com/test/integration/servicemix/xmlTemplate.xsl"/>
> > >> >> >>                                         </bean>
> > >> >> >>                                 </sm:component>
> > >> >> >>                         </sm:activationSpec>
> > >> >> >> ###############################
> > >> >> >>
> > >> >> >> Now, I want the output from the transformation sent to a Jaxb2
> > >> >> >> unmarshaller.
> > >> >> >> Looking at the examples, I created an xbean definition like
> this:
> > >> >> >>
> > >> >> >> ##############################
> > >> >> >> <beans
> > >> >> >>         xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0"
> > >> >> >>         xmlns:foo="http://com.test.integration.servicemix">
> > >> >> >>
> > >> >> >>     <classpath>
> > >> >> >>                 <location>.</location>
> > >> >> >>     </classpath>
> > >> >> >>
> > >> >> >>         <jsr181:endpoint
> > >> >> >>                 service="foo:xmlUnmarshaller"
> > >> >> >>                 endpoint="xmlUnmarshaller"
> > >> >> >>
> > >> pojoClass="com.test.integration.servicemix.pojo.Root"
> > >> >> >>                 typeMapping="jaxb2"/>
> > >> >> >>
> > >> >> >> </beans>
> > >> >> >> ###############################
> > >> >> >>
> > >> >> >> When deploying the SU that contains the xbean.xml and
> > >> servicemix.xml,
> > >> >> I
> > >> >> >> get
> > >> >> >> this error:
> > >> >> >>
> > >> >> >> WARN  - DefaultBroker                  - ServiceName
> > >> >> >> ({http://com.test.integration.servicemix}xmlUnmarshaller)
> specified
> > >> >> for
> > >> >> >> routing, but can't find it registered
> > >> >> >>
> > >> >> >>
> > >> >> >> So I'm not sure how to connect the output from the
> transformation
> > >> into
> > >> >> >> the
> > >> >> >> jaxb2 unmarshaller.  Thanks in advance.
> > >> >> >>
> > >> >> >> -los
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >> >> gnodet wrote:
> > >> >> >> >
> > >> >> >> > If you want to send the output of the XSLT component to your
> > >> >> >> > jsr181 pojo, you can just use the destinationService
> attribute
> > >> >> >> > on the activationSpec for the xslt component and specify
> > >> >> >> > the jsr181 pojo service name.
> > >> >> >> > I guess I miss your problem ...
> > >> >> >> >
> > >> >> >> > On 10/27/06, moraleslos <mo...@hotmail.com> wrote:
> > >> >> >> >>
> > >> >> >> >> I've developed a test domain that has JAXB2-annotated POJOs
> and
> > >> the
> > >> >> >> >> generation of the schema from these pojos.  Now in my SU,
> I've
> > >> >> >> retrieved
> > >> >> >> >> a
> > >> >> >> >> file and used the XSLT translator to transform the XML into
> > >> >> something
> > >> >> >> >> that
> > >> >> >> >> can be unmarshalled into my domain POJOs.  My question is,
> how
> > >> do I
> > >> >> >> >> connect
> > >> >> >> >> the output from the XSLT transformation to the jsr-181
> endpoint
> > >> >> that
> > >> >> >> will
> > >> >> >> >> unmarshal this xml document into my jaxb2 pojos?  I'm used
> to
> > >> >> seeing
> > >> >> >> the
> > >> >> >> >> "destination service":
> > >> >> >> >>
> > >> >> >> >> <sm:activationSpec
> > >> >> >> >>   componentName="XSLTTransformer"
> > >> >> >> >>   service="foo:XSLTTransformer"
> > >> >> >> >>   destinationService="foo:JAXB2Unmarshaller">
> > >> >> >> >>   ....
> > >> >> >> >>
> > >> >> >> >> Now how do I define this destination using the jsr-181
> endpoint?
> > >> I
> > >> >> >> know
> > >> >> >> >> this did not work:
> > >> >> >> >>
> > >> >> >> >> <jsr181:endpoint endpoint="foo:JAXB2Unmarshaller"
> > >> >> >> >>                  typeMapping="jaxb2">
> > >> >> >> >>   <jsr181:pojo>
> > >> >> >> >>     <bean class="test.UnmarshalService" />
> > >> >> >> >>   </jsr181:pojo>
> > >> >> >> >> </jsr181:endpoint>
> > >> >> >> >>
> > >> >> >> >> thanks in advance!
> > >> >> >> >>
> > >> >> >> >> -los
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >> --
> > >> >> >> >> View this message in context:
> > >> >> >> >>
> > >> >> >>
> > >> >>
> > >>
> http://www.nabble.com/connecting-to-jsr-181-jaxb2-tf2523299.html#a7038693
> > >> >> >> >> Sent from the ServiceMix - User mailing list archive at
> > >> Nabble.com.
> > >> >> >> >>
> > >> >> >> >>
> > >> >> >> >
> > >> >> >> >
> > >> >> >> > --
> > >> >> >> > Cheers,
> > >> >> >> > Guillaume Nodet
> > >> >> >> >
> > >> >> >> >
> > >> >> >>
> > >> >> >> --
> > >> >> >> View this message in context:
> > >> >> >>
> > >> >>
> > >>
> http://www.nabble.com/connecting-to-jsr-181-jaxb2-tf2523299s12049.html#a7347837
> > >> >> >> Sent from the ServiceMix - User mailing list archive at
> Nabble.com.
> > >> >> >>
> > >> >> >>
> > >> >> >
> > >> >> >
> > >> >> > --
> > >> >> > Cheers,
> > >> >> > Guillaume Nodet
> > >> >> >
> > >> >> >
> > >> >>
> > >> >> --
> > >> >> View this message in context:
> > >> >>
> > >>
> http://www.nabble.com/connecting-to-jsr-181-jaxb2-tf2523299s12049.html#a7359654
> > >> >> Sent from the ServiceMix - User mailing list archive at Nabble.com
> .
> > >> >>
> > >> >>
> > >> >
> > >> >
> > >> > --
> > >> > Cheers,
> > >> > Guillaume Nodet
> > >> >
> > >> >
> > >>
> > >> --
> > >> View this message in context:
> > >>
> http://www.nabble.com/connecting-to-jsr-181-jaxb2-tf2523299s12049.html#a7362326
> > >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> > >>
> > >>
> > >
> > >
> > > --
> > > Cheers,
> > > Guillaume Nodet
> > >
> > >
> >
> > --
> > View this message in context:
> http://www.nabble.com/connecting-to-jsr-181-jaxb2-tf2523299s12049.html#a7364880
> > Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >
> >
>
>
> --
> Cheers,
> Guillaume Nodet
>



-- 
Cheers,
Guillaume Nodet
------------------------
Principal Engineer, IONA
Blog: http://gnodet.blogspot.com/