You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by cjn <ch...@nappin.com> on 2007/08/06 11:15:44 UTC

Adding local (non-JBI) Spring dependencies

I would like to invoke a Spring bean from a JSR 181 endpoint class, packaged
in the same service unit .zip as a the endpoint, via standard Spring IOC
(setter injection). Since I understand that XBean is an extention to Spring,
I've added the spring definition to my xbean.xml (am I right in doing
this?):

<bean id="anotherService" class="another.AnotherServiceImpl"/>

However the moment I do this the Maven build scripts fail with:

[INFO] Failed to generate jbi.xml

Embedded error: Unable to generate service unit descriptor!
another.AnotherServiceImpl


Note that I haven't declared that bean as a jsr181:endoint or jsr181:pojo!
-- 
View this message in context: http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12013152
Sent from the ServiceMix - User mailing list archive at Nabble.com.


RE: Adding local (non-JBI) Spring dependencies

Posted by cjn <ch...@nappin.com>.
Note that this seems to be related to the maven build for JSR181 service
units. If I add a local (non-JBI) Spring dependency to a servicemix
bean-based service unit, it works without any issues.



Well that's certainly where it's going wrong. I've added the following to
the xbean.xml:

  <classpath>
        <location>.</location>
    </classpath>

but it still fails with ClassNotFoundException. Do I need to change the
maven build file, or anything else?


-- 
View this message in context: http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12030092
Sent from the ServiceMix - User mailing list archive at Nabble.com.


RE: Adding local (non-JBI) Spring dependencies

Posted by cjn <ch...@nappin.com>.
Well that's certainly where it's going wrong. I've added the following to the
xbean.xml:

  <classpath>
        <location>.</location>
    </classpath>

but it still fails with ClassNotFoundException. Do I need to change the
maven build file, or anything else?



rabi wrote:
> 
> 
> ClassNotFoundException is the cause. It is trying to load the class using
> the default classloader.
> 
> ________________________________
> 
> From: cjn [mailto:chris@nappin.com]
> Sent: Mon 8/6/2007 8:09 PM
> To: servicemix-users@geronimo.apache.org
> Subject: RE: Adding local (non-JBI) Spring dependencies
> 
> 
> 
> 
> Full build output is attached. I'm not sure if the ClassNotFound is a
> symptom
> rather than the cause, since it shouldn't be trying to generate any JBI
> settings for that class anyway.
> 
> http://www.nabble.com/file/p12017476/spring%2Bsm%2Berror.txt
> spring+sm+error.txt
> 
> rabi wrote:
>>
>>
>> Can you post the error log with "-e" mvn command option
>>
>> -----Original Message-----
>> From: cjn [mailto:chris@nappin.com]
>> Sent: Monday, August 06, 2007 6:52 PM
>> To: servicemix-users@geronimo.apache.org
>> Subject: RE: Adding local (non-JBI) Spring dependencies
>>
>>
>> Removing that namespace makes no difference - the maven build still
>> fails with the same error.
>>
>>
>> rabi wrote:
>>>
>>>
>>> Can you try and remove the following namespace from your xbean.xml and
>>
>>> try
>>>
>>> xmlns="http://xbean.org/schemas/spring/1.0"
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4
>> 223012s12049.html#a12016127
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
>>
>> The information contained in this electronic message and any attachments
>> to this message are intended for the exclusive use of the addressee(s)
>> and
>> may contain proprietary, confidential or privileged information. If you
>> are not the intended recipient, you should not disseminate, distribute or
>> copy this e-mail. Please notify the sender immediately and destroy all
>> copies of this message and any attachments.
>>
>> WARNING: Computer viruses can be transmitted via email. The recipient
>> should check this email and any attachments for the presence of viruses.
>> The company accepts no liability for any damage caused by any virus
>> transmitted by this email.
>> 
>> www.wipro.com
>>
>>
> 
> --
> View this message in context:
> http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12017476
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> 
> 
> 
> 
> 
> 
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you
> are not the intended recipient, you should not disseminate, distribute or
> copy this e-mail. Please notify the sender immediately and destroy all
> copies of this message and any attachments. 
> 
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>  
> www.wipro.com
> 

-- 
View this message in context: http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12023499
Sent from the ServiceMix - User mailing list archive at Nabble.com.


RE: Adding local (non-JBI) Spring dependencies

Posted by ra...@wipro.com.
ClassNotFoundException is the cause. It is trying to load the class using the default classloader.

________________________________

From: cjn [mailto:chris@nappin.com]
Sent: Mon 8/6/2007 8:09 PM
To: servicemix-users@geronimo.apache.org
Subject: RE: Adding local (non-JBI) Spring dependencies




Full build output is attached. I'm not sure if the ClassNotFound is a symptom
rather than the cause, since it shouldn't be trying to generate any JBI
settings for that class anyway.

http://www.nabble.com/file/p12017476/spring%2Bsm%2Berror.txt
spring+sm+error.txt

rabi wrote:
>
>
> Can you post the error log with "-e" mvn command option
>
> -----Original Message-----
> From: cjn [mailto:chris@nappin.com]
> Sent: Monday, August 06, 2007 6:52 PM
> To: servicemix-users@geronimo.apache.org
> Subject: RE: Adding local (non-JBI) Spring dependencies
>
>
> Removing that namespace makes no difference - the maven build still
> fails with the same error.
>
>
> rabi wrote:
>>
>>
>> Can you try and remove the following namespace from your xbean.xml and
>
>> try
>>
>> xmlns="http://xbean.org/schemas/spring/1.0"
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4
> 223012s12049.html#a12016127
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you
> are not the intended recipient, you should not disseminate, distribute or
> copy this e-mail. Please notify the sender immediately and destroy all
> copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
> 
> www.wipro.com
>
>

--
View this message in context: http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12017476
Sent from the ServiceMix - User mailing list archive at Nabble.com.






The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Adding local (non-JBI) Spring dependencies

Posted by cjn <ch...@nappin.com>.
Full build output is attached. I'm not sure if the ClassNotFound is a symptom
rather than the cause, since it shouldn't be trying to generate any JBI
settings for that class anyway.

http://www.nabble.com/file/p12017476/spring%2Bsm%2Berror.txt
spring+sm+error.txt 

rabi wrote:
> 
> 
> Can you post the error log with "-e" mvn command option 
> 
> -----Original Message-----
> From: cjn [mailto:chris@nappin.com] 
> Sent: Monday, August 06, 2007 6:52 PM
> To: servicemix-users@geronimo.apache.org
> Subject: RE: Adding local (non-JBI) Spring dependencies
> 
> 
> Removing that namespace makes no difference - the maven build still
> fails with the same error. 
> 
> 
> rabi wrote:
>> 
>> 
>> Can you try and remove the following namespace from your xbean.xml and
> 
>> try
>> 
>> xmlns="http://xbean.org/schemas/spring/1.0" 
>> 
>> 
>> 
> 
> --
> View this message in context:
> http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4
> 223012s12049.html#a12016127
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> 
> 
> 
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you
> are not the intended recipient, you should not disseminate, distribute or
> copy this e-mail. Please notify the sender immediately and destroy all
> copies of this message and any attachments. 
> 
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>  
> www.wipro.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12017476
Sent from the ServiceMix - User mailing list archive at Nabble.com.


RE: Adding local (non-JBI) Spring dependencies

Posted by ra...@wipro.com.
Can you post the error log with "-e" mvn command option 

-----Original Message-----
From: cjn [mailto:chris@nappin.com] 
Sent: Monday, August 06, 2007 6:52 PM
To: servicemix-users@geronimo.apache.org
Subject: RE: Adding local (non-JBI) Spring dependencies


Removing that namespace makes no difference - the maven build still
fails with the same error. 


rabi wrote:
> 
> 
> Can you try and remove the following namespace from your xbean.xml and

> try
> 
> xmlns="http://xbean.org/schemas/spring/1.0" 
> 
> 
> 

--
View this message in context:
http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4
223012s12049.html#a12016127
Sent from the ServiceMix - User mailing list archive at Nabble.com.



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Adding local (non-JBI) Spring dependencies

Posted by cjn <ch...@nappin.com>.
Removing that namespace makes no difference - the maven build still fails
with the same error. 


rabi wrote:
> 
> 
> Can you try and remove the following namespace from your xbean.xml and
> try
> 
> xmlns="http://xbean.org/schemas/spring/1.0" 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12016127
Sent from the ServiceMix - User mailing list archive at Nabble.com.


RE: Adding local (non-JBI) Spring dependencies

Posted by ra...@wipro.com.
Can you try and remove the following namespace from your xbean.xml and
try

xmlns="http://xbean.org/schemas/spring/1.0" 


-----Original Message-----
From: cjn [mailto:chris@nappin.com] 
Sent: Monday, August 06, 2007 5:10 PM
To: servicemix-users@geronimo.apache.org
Subject: RE: Adding local (non-JBI) Spring dependencies


Here is my example. It's not all that different to your suggestion.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0"
       xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
    
    <jsr181:endpoint wsdlResource="classpath:service.wsdl"
style="document">
        <jsr181:pojo>
            <bean class="test.PersonImpl">
                <property name="context" ref="context"/>
                <property name="anotherService" ref="anotherService"/>
            </bean>
        </jsr181:pojo>
    </jsr181:endpoint>

    <bean id="anotherService" class="another.AnotherServiceImpl"/>
</beans>




rabi wrote:
> 
> 
> Can you post your complete xbean.xml.
> 
> Btw, you can specify anotherService as a property in your jsr181 
> implementation class and then inject it as usual.
> 
> Ex.
> 
> <jsr181:endpoint  pojo="#mypojo" wsdlResource="classpath:service.wsdl"

>                      typeMapping="jaxb2"
>                      annotations="jsr181"
>                      style="document"/>
>    
>    	<bean id="mypojo"
> 	
> class="org.apache.servicemix.samples.Samplejsr181.MyPojoImpl">
>  			<property name="anotherService">
> 				<bean
> class="another.AnotherServiceImpl"/>
> 		    	</property>
>       </bean>
> 
> Regards,
> Rabi Mishra,
> -----Original Message-----
> From: cjn [mailto:chris@nappin.com]
> Sent: Monday, August 06, 2007 2:46 PM
> To: servicemix-users@geronimo.apache.org
> Subject: Adding local (non-JBI) Spring dependencies
> 
> 
> I would like to invoke a Spring bean from a JSR 181 endpoint class, 
> packaged in the same service unit .zip as a the endpoint, via standard

> Spring IOC (setter injection). Since I understand that XBean is an 
> extention to Spring, I've added the spring definition to my xbean.xml 
> (am I right in doing
> this?):
> 
> <bean id="anotherService" class="another.AnotherServiceImpl"/>
> 
> However the moment I do this the Maven build scripts fail with:
> 
> [INFO] Failed to generate jbi.xml
> 
> Embedded error: Unable to generate service unit descriptor!
> another.AnotherServiceImpl
> 
> 
> Note that I haven't declared that bean as a jsr181:endoint or 
> jsr181:pojo!
> --
> View this message in context:
> http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-t
> f4
> 223012s12049.html#a12013152
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> 
> 
> 
> The information contained in this electronic message and any 
> attachments to this message are intended for the exclusive use of the 
> addressee(s) and may contain proprietary, confidential or privileged 
> information. If you are not the intended recipient, you should not 
> disseminate, distribute or copy this e-mail. Please notify the sender 
> immediately and destroy all copies of this message and any
attachments.
> 
> WARNING: Computer viruses can be transmitted via email. The recipient 
> should check this email and any attachments for the presence of
viruses.
> The company accepts no liability for any damage caused by any virus 
> transmitted by this email.
>  
> www.wipro.com
> 
> 

--
View this message in context:
http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4
223012s12049.html#a12014775
Sent from the ServiceMix - User mailing list archive at Nabble.com.



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com

RE: Adding local (non-JBI) Spring dependencies

Posted by cjn <ch...@nappin.com>.
Here is my example. It's not all that different to your suggestion.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xbean.org/schemas/spring/1.0"
       xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
    
    <jsr181:endpoint wsdlResource="classpath:service.wsdl" style="document">
        <jsr181:pojo>
            <bean class="test.PersonImpl">
                <property name="context" ref="context"/>
                <property name="anotherService" ref="anotherService"/>
            </bean>
        </jsr181:pojo>
    </jsr181:endpoint>

    <bean id="anotherService" class="another.AnotherServiceImpl"/>
</beans>




rabi wrote:
> 
> 
> Can you post your complete xbean.xml.
> 
> Btw, you can specify anotherService as a property in your jsr181
> implementation class and then inject it as usual.
> 
> Ex.
> 
> <jsr181:endpoint  pojo="#mypojo" wsdlResource="classpath:service.wsdl" 
>                      typeMapping="jaxb2"
>                      annotations="jsr181"
>                      style="document"/>
>    
>    	<bean id="mypojo"
> 	
> class="org.apache.servicemix.samples.Samplejsr181.MyPojoImpl">
>  			<property name="anotherService">
> 				<bean
> class="another.AnotherServiceImpl"/>
> 		    	</property>
>       </bean>
> 
> Regards,
> Rabi Mishra, 
> -----Original Message-----
> From: cjn [mailto:chris@nappin.com] 
> Sent: Monday, August 06, 2007 2:46 PM
> To: servicemix-users@geronimo.apache.org
> Subject: Adding local (non-JBI) Spring dependencies
> 
> 
> I would like to invoke a Spring bean from a JSR 181 endpoint class,
> packaged in the same service unit .zip as a the endpoint, via standard
> Spring IOC (setter injection). Since I understand that XBean is an
> extention to Spring, I've added the spring definition to my xbean.xml
> (am I right in doing
> this?):
> 
> <bean id="anotherService" class="another.AnotherServiceImpl"/>
> 
> However the moment I do this the Maven build scripts fail with:
> 
> [INFO] Failed to generate jbi.xml
> 
> Embedded error: Unable to generate service unit descriptor!
> another.AnotherServiceImpl
> 
> 
> Note that I haven't declared that bean as a jsr181:endoint or
> jsr181:pojo!
> --
> View this message in context:
> http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4
> 223012s12049.html#a12013152
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> 
> 
> 
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you
> are not the intended recipient, you should not disseminate, distribute or
> copy this e-mail. Please notify the sender immediately and destroy all
> copies of this message and any attachments. 
> 
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>  
> www.wipro.com
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4223012s12049.html#a12014775
Sent from the ServiceMix - User mailing list archive at Nabble.com.


RE: Adding local (non-JBI) Spring dependencies

Posted by ra...@wipro.com.
Can you post your complete xbean.xml.

Btw, you can specify anotherService as a property in your jsr181
implementation class and then inject it as usual.

Ex.

<jsr181:endpoint  pojo="#mypojo" wsdlResource="classpath:service.wsdl" 
                     typeMapping="jaxb2"
                     annotations="jsr181"
                     style="document"/>
   
   	<bean id="mypojo"
	
class="org.apache.servicemix.samples.Samplejsr181.MyPojoImpl">
 			<property name="anotherService">
				<bean
class="another.AnotherServiceImpl"/>
		    	</property>
      </bean>

Regards,
Rabi Mishra, 
-----Original Message-----
From: cjn [mailto:chris@nappin.com] 
Sent: Monday, August 06, 2007 2:46 PM
To: servicemix-users@geronimo.apache.org
Subject: Adding local (non-JBI) Spring dependencies


I would like to invoke a Spring bean from a JSR 181 endpoint class,
packaged in the same service unit .zip as a the endpoint, via standard
Spring IOC (setter injection). Since I understand that XBean is an
extention to Spring, I've added the spring definition to my xbean.xml
(am I right in doing
this?):

<bean id="anotherService" class="another.AnotherServiceImpl"/>

However the moment I do this the Maven build scripts fail with:

[INFO] Failed to generate jbi.xml

Embedded error: Unable to generate service unit descriptor!
another.AnotherServiceImpl


Note that I haven't declared that bean as a jsr181:endoint or
jsr181:pojo!
--
View this message in context:
http://www.nabble.com/Adding-local-%28non-JBI%29-Spring-dependencies-tf4
223012s12049.html#a12013152
Sent from the ServiceMix - User mailing list archive at Nabble.com.



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
 
www.wipro.com