You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by PM <pr...@bigfoot.com> on 2008/02/15 07:28:54 UTC

xbean injection classpath and shared libraries

Hi,

  I finally got around to trying out the "new" JMS provider enpoints.  I
have a marshaler which is setting the JMSXGroupID (which i think is working
ok).

  Now it just so happens that I can re-use my marshaler in about 4 places in
my system, which is nice, so I moved the marshaller into a shared library. 
Deployed this no problem.  But now when I deploy the SA with the SU that
uses the marshaler in the shared lbrary, spring refuses to find my marshaler
class.  The SA and SU both build correctly so I have the correct
dependencies set in the POM's.

  Is there something that I need to specify in the xbean's that will use the
shared library?  My xbean.xml is below for perusal:

<?xml version="1.0" encoding="UTF-8"?>
<beans	xmlns:jms="http://servicemix.apache.org/jms/1.0"
	xmlns:project="http://www.company.com/project"
	xmlns:amqpool="http://jencks.org/amqpool/2.0"
>

	<jms:provider service="project:aGroupedQueue"
		endpoint="queueEndpoint"
		pubSubDomain="false"
		destinationName="GROUPED-QUEUE"
		connectionFactory="#connectionFactory"
		marshaler="#groupMarshaler"
	/>

	<amqpool:pool
		id="connectionFactory"
		brokerURL="discovery:(multicast://default)"
		maxConnections="8"
	/>

	<bean id="groupMarshaler" class="com.company.project.GroupMarshaler"/>
</beans>

Regards, Paul.

p.s.  this is SMX 3.2.1
-- 
View this message in context: http://www.nabble.com/xbean-injection-classpath-and-shared-libraries-tp15495536s12049p15495536.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: xbean injection classpath and shared libraries

Posted by Freeman Fang <fr...@gmail.com>.
Hi,
Basiclly, if Component A depend on the Shared Lib B, when start A, A 
will suspend until B start successfully, so every SA&SU in Component A 
will find the jar defined in B.

For your case, I guess you deploy your SA&SU into servicemix-jms 
component, but servicemix-jms has no dependency on your shared lib, so 
you encounter the problem, which means your SA&SU start before the 
required shared lib start.

Unfortunately, since servicemix-jms is built-in component, so I don't 
think hack this component is a good way.

One work around I can suggest is, don't put your SA and your shared lib 
into hotdeploy folder firstly, when smx start successfully,  copy your 
shared lib into hotdeploy folder before your SA

Freeman

PM wrote:
> Thanks for the suggestion, which I just tried...
>
> still no luck :-(  What I do notice is that even though my SA and SU both
> declare a dependency on the library, when smx starts, the library install
> does not run until the very end of start up.  Long after the JAR is required
> by the SU, something doesn't look right about this.
>
> I also would have expected that my library wouldn't need deploying
> separately anyway, and should infact have been included in the libs in the
> SU JAR along with all the other dependencies.  But this does't seem to be
> happening.
>
>
>
> Freeman Fang wrote:
>   
>> Hi,
>>
>> Add*
>>          <classpath>
>>                 <library>your-library-name</library>
>>         </classpath> 
>> *into the xbean.xml of your su, this should solve your problem
>>
>> Best Regards
>>
>> Freeman
>> PM wrote:
>>     
>>> Hi,
>>>
>>>   I finally got around to trying out the "new" JMS provider enpoints.  I
>>> have a marshaler which is setting the JMSXGroupID (which i think is
>>> working
>>> ok).
>>>
>>>   Now it just so happens that I can re-use my marshaler in about 4 places
>>> in
>>> my system, which is nice, so I moved the marshaller into a shared
>>> library. 
>>> Deployed this no problem.  But now when I deploy the SA with the SU that
>>> uses the marshaler in the shared lbrary, spring refuses to find my
>>> marshaler
>>> class.  The SA and SU both build correctly so I have the correct
>>> dependencies set in the POM's.
>>>
>>>   Is there something that I need to specify in the xbean's that will use
>>> the
>>> shared library?  My xbean.xml is below for perusal:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <beans	xmlns:jms="http://servicemix.apache.org/jms/1.0"
>>> 	xmlns:project="http://www.company.com/project"
>>> 	xmlns:amqpool="http://jencks.org/amqpool/2.0"
>>>   
>>>
>>> 	<jms:provider service="project:aGroupedQueue"
>>> 		endpoint="queueEndpoint"
>>> 		pubSubDomain="false"
>>> 		destinationName="GROUPED-QUEUE"
>>> 		connectionFactory="#connectionFactory"
>>> 		marshaler="#groupMarshaler"
>>> 	/>
>>>
>>> 	<amqpool:pool
>>> 		id="connectionFactory"
>>> 		brokerURL="discovery:(multicast://default)"
>>> 		maxConnections="8"
>>> 	/>
>>>
>>> 	<bean id="groupMarshaler" class="com.company.project.GroupMarshaler"/>
>>> </beans>
>>>
>>> Regards, Paul.
>>>
>>> p.s.  this is SMX 3.2.1
>>>   
>>>       
>>     
>
>   

Re: xbean injection classpath and shared libraries

Posted by PM <pr...@bigfoot.com>.
Thanks for the suggestion, which I just tried...

still no luck :-(  What I do notice is that even though my SA and SU both
declare a dependency on the library, when smx starts, the library install
does not run until the very end of start up.  Long after the JAR is required
by the SU, something doesn't look right about this.

I also would have expected that my library wouldn't need deploying
separately anyway, and should infact have been included in the libs in the
SU JAR along with all the other dependencies.  But this does't seem to be
happening.



Freeman Fang wrote:
> 
> Hi,
> 
> Add*
>          <classpath>
>                 <library>your-library-name</library>
>         </classpath> 
> *into the xbean.xml of your su, this should solve your problem
> 
> Best Regards
> 
> Freeman
> PM wrote:
>> Hi,
>>
>>   I finally got around to trying out the "new" JMS provider enpoints.  I
>> have a marshaler which is setting the JMSXGroupID (which i think is
>> working
>> ok).
>>
>>   Now it just so happens that I can re-use my marshaler in about 4 places
>> in
>> my system, which is nice, so I moved the marshaller into a shared
>> library. 
>> Deployed this no problem.  But now when I deploy the SA with the SU that
>> uses the marshaler in the shared lbrary, spring refuses to find my
>> marshaler
>> class.  The SA and SU both build correctly so I have the correct
>> dependencies set in the POM's.
>>
>>   Is there something that I need to specify in the xbean's that will use
>> the
>> shared library?  My xbean.xml is below for perusal:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans	xmlns:jms="http://servicemix.apache.org/jms/1.0"
>> 	xmlns:project="http://www.company.com/project"
>> 	xmlns:amqpool="http://jencks.org/amqpool/2.0"
>>   
>>
>> 	<jms:provider service="project:aGroupedQueue"
>> 		endpoint="queueEndpoint"
>> 		pubSubDomain="false"
>> 		destinationName="GROUPED-QUEUE"
>> 		connectionFactory="#connectionFactory"
>> 		marshaler="#groupMarshaler"
>> 	/>
>>
>> 	<amqpool:pool
>> 		id="connectionFactory"
>> 		brokerURL="discovery:(multicast://default)"
>> 		maxConnections="8"
>> 	/>
>>
>> 	<bean id="groupMarshaler" class="com.company.project.GroupMarshaler"/>
>> </beans>
>>
>> Regards, Paul.
>>
>> p.s.  this is SMX 3.2.1
>>   
> 
> 

-- 
View this message in context: http://www.nabble.com/xbean-injection-classpath-and-shared-libraries-tp15495536s12049p15495849.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: xbean injection classpath and shared libraries

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Add*
         <classpath>
                <library>your-library-name</library>
        </classpath> 
*into the xbean.xml of your su, this should solve your problem

Best Regards

Freeman
PM wrote:
> Hi,
>
>   I finally got around to trying out the "new" JMS provider enpoints.  I
> have a marshaler which is setting the JMSXGroupID (which i think is working
> ok).
>
>   Now it just so happens that I can re-use my marshaler in about 4 places in
> my system, which is nice, so I moved the marshaller into a shared library. 
> Deployed this no problem.  But now when I deploy the SA with the SU that
> uses the marshaler in the shared lbrary, spring refuses to find my marshaler
> class.  The SA and SU both build correctly so I have the correct
> dependencies set in the POM's.
>
>   Is there something that I need to specify in the xbean's that will use the
> shared library?  My xbean.xml is below for perusal:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <beans	xmlns:jms="http://servicemix.apache.org/jms/1.0"
> 	xmlns:project="http://www.company.com/project"
> 	xmlns:amqpool="http://jencks.org/amqpool/2.0"
>   
>
> 	<jms:provider service="project:aGroupedQueue"
> 		endpoint="queueEndpoint"
> 		pubSubDomain="false"
> 		destinationName="GROUPED-QUEUE"
> 		connectionFactory="#connectionFactory"
> 		marshaler="#groupMarshaler"
> 	/>
>
> 	<amqpool:pool
> 		id="connectionFactory"
> 		brokerURL="discovery:(multicast://default)"
> 		maxConnections="8"
> 	/>
>
> 	<bean id="groupMarshaler" class="com.company.project.GroupMarshaler"/>
> </beans>
>
> Regards, Paul.
>
> p.s.  this is SMX 3.2.1
>