You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Ekatus Atimoss <ek...@mac.com> on 2011/02/25 14:11:07 UTC

ServiceMix 4 - deploy JCA rar

Dear all,

having learned from the servicemix documentation that XA is available
through JCA, I'm looking for a way to make MQSeries available to ServiceMix
through a resource adapter. The trial for WebSphere MQ 7 comes with a
wmq.jmsra.rar archive file, but I don't know how to deploy it into
ServiceMix 4 and neither did find any explict information in the docs or on
the web. 


Any help is greatly appreciated!

Kind regards
Michael
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-deploy-JCA-rar-tp3400074p3400074.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ServiceMix 4 - deploy JCA rar

Posted by Ekatus Atimoss <ek...@mac.com>.
Dear all,
it looks like there are more classloader hells than just one... I reckon one
root cause was the local MQ install on my laptop where I am doing all these
exercises. I thus unsetted all the MQ_ environment variables in the cmd
window (yess, running on Windows), cleared the CLASSPATH variable, started
servicemix...deployed ibm-mq-series feature (composed according to Björn's
instructions) and.....error. Despite the ibm osgi bundles being deployed
(and "active"), the service assembly deploy now blows up with a
ClassNotFound Error:


Caused by: java.lang.ClassNotFoundException:
com.ibm.mq.jms.MQQueueConnectionFactory in classloader
org.apache.xbean.spring.context.File
SystemXmlApplicationContext@13d2b1c
        at
org.apache.xbean.classloader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:206)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)


Could it be there is anything wrong with the build of my SU and my SA? The
OSGi bundles in SM look like this:

[ 198] [Active     ] [Created     ] [       ] [   60] Apache ServiceMix ::
Components :: Exec Service Engine (2011.01.0.fuse-00-00)
[ 208] [Active     ] [            ] [       ] [   60] geronimo-jms_1.1_spec
(1.1.1)
[ 210] [Active     ] [            ] [       ] [   55] DirectIP Plug-in
(7.0.1.4)
[ 211] [Active     ] [            ] [       ] [   55] NLS Plug-in (7.0.1.4)
                                       Fragments: 212
[ 212] [Resolved   ] [            ] [       ] [   55] WMQ NLS Plug-in
(7.0.1.4)
                                       Hosts: 211
[ 213] [Active     ] [            ] [       ] [   55] Common Services J2SE
Plug-in (7.0.1.4)
[ 214] [Active     ] [            ] [       ] [   55] JMS client Plug-in
(7.0.1.4)
[ 215] [Active     ] [            ] [       ] [   55] WMQ prereq Plug-in
(7.0.1.4)
[ 216] [Active     ] [            ] [       ] [   55] WMQ provider Plug-in
(7.0.1.4)
[ 217] [Active     ] [            ] [       ] [   60] tutorial-sa (0.0.0)


The class com.ibm.mq.jms.MQQueueConnectionFactory sits in the
com.ibm.mqjms.jar which is embedded in the
com.ibm.msg.client.osgi.wmq_7.0.1.4.jar which has been turned into WMQ
provider Plug in. The packages:exports command shows that package
com.ibm.mq.jms.* is exported by Bundle 216 which is the WMQ provider Plug-in
from above.

Life can be really painful...any ideas what could be the cause?

Kind regards
Michael

--
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-deploy-JCA-rar-tp3400074p3408216.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ServiceMix 4 - deploy JCA rar

Posted by Ekatus Atimoss <ek...@mac.com>.
Hello Björn,

thanks for your input - however, the problem remains. What I did so far is:

a) checked in the appropriate IBM OSGi jars with maven

C:\apache-servicemix-4.3.1-fuse-00-00>mvn install:install-file 
-DgroupId=com.ibm -DartifactId=mq-osgi-directip -Dversion=7.0.1.4
-Dpackaging=bundle
-Dfile=C:\frameworks\mq714\lib\OSGi\com.ibm.mq.osgi.directip_7.0.1.4.jar

..and so forth.
b) created a features.xml file like this:


	
	
	mvn:com.ibm/mq-osgi-directip/7.0.1.4

c) added the feature repository using features:addUrl command
d) installed the ibm-mq-series feature.

In my JMS SU project, I've had to add the dependencies to the non-OSGi Jars
to prevent errors in the maven build (MQQueueConnectionFactory not found).
These jars are added in the lib/ directory of the SU.
After deploying to SM 4, the well - known error shows up:


        at
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:241)
Caused by: org.springframework.beans.ConversionNotSupportedException: Failed
to convert property value of type 'com.ibm.mq.jms.MQQueueCo
nnectionFactory' to required type 'javax.jms.ConnectionFactory' for property
'connectionFactory'; nested exception is java.lang.IllegalS
tateException: Cannot convert value of type
[com.ibm.mq.jms.MQQueueConnectionFactory] to required type
[javax.jms.ConnectionFactory] for
 property 'connectionFactory': no matching editors or conversion strategy
found

My MQ OSGI bundles seem to be installed properly:

[ 369] [Active     ] [            ] [       ] [   55] DirectIP Plug-in
(7.0.1.4)
[ 370] [Active     ] [            ] [       ] [   55] NLS Plug-in (7.0.1.4)
                                       Fragments: 371
[ 371] [Resolved   ] [            ] [       ] [   55] WMQ NLS Plug-in
(7.0.1.4)
                                       Hosts: 370
[ 372] [Resolved   ] [            ] [       ] [   55] Common Services J2SE
Plug-in (7.0.1.4)
[ 373] [Resolved   ] [            ] [       ] [   55] JMS client Plug-in
(7.0.1.4)
[ 374] [Active     ] [            ] [       ] [   55] WMQ prereq Plug-in
(7.0.1.4)
[ 375] [Resolved   ] [            ] [       ] [   55] WMQ provider Plug-in
(7.0.1.4)


Now to me the question is, if the error is with the IBM jars, the bundling,
the feature or with the JMS SU.

Kind regards
Miichael


--
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-deploy-JCA-rar-tp3400074p3406274.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ServiceMix 4 - deploy JCA rar

Posted by Björn Bength <bj...@gmail.com>.
On Tue, 2011-03-01 at 00:37 -0800, Ekatus Atimoss wrote:
> Hello Claus,
> 
> yes, indeed. I've tried them but it made no difference - will try that for
> 7.0.1.4 again. It also make no difference (regarding the error that shows
> up) if I stuff all the IBM jars into lib\ext 
> 
> 

We have deployed IBM's OSGi-jars like this:


<feature name="ibm-mq-series" version="7.0.1.0">
<!-- Creates a feature of the IBM MQ Series dependencies -->
<bundle start-level="55">mvn:com.ibm.mq/osgi-direct-ip/7.0.1.0</bundle>
		
<!-- pull geronimo instead of ibm jms spec. 
    works better in this karaf -->
<!-- <bundle
start-level="55">mvn:com.ibm.msg.client/osgi-jms-prereq/7.0.1.0</bundle>
-->
<bundle start-level="55">
   mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1
</bundle>
<bundle start-level="55">
   mvn:com.ibm.msg.client/osgi-nls/7.0.1.0
</bundle>
<bundle start-level="55">
   mvn:com.ibm.msg.client/osgi-wmq-nls/7.0.1.0
</bundle>
<bundle start-level="55" start='false'>
   mvn:com.ibm.msg.client/osgi-commonservices/7.0.1.0
</bundle>
<bundle start-level="55">
   mvn:com.ibm.msg.client/osgi-jms/7.0.1.0
</bundle>
<bundle start-level="55">
   mvn:com.ibm.msg.client/osgi-wmq-prereq/7.0.1.0
</bundle>
<bundle start-level="55">
   mvn:com.ibm.msg.client/osgi-wmq/7.0.1.0
</bundle>
</feature>	





i.e. omit the osgi-jms-prereq as geronimo conflicts with it.
hence the class cast exception.


/bjorn


> 
>                                         <loc-message>Error creating bean
> with name 'org.apache.servicemix.jms.JmsEndpoint#0' defined in
> file
> [C:\apache-servicemix-4.3.1-fuse-00-00\data\jbi\tutorial-sa\sus\tutorial-jms-su\xbean.xml]:
> Initialization of bean failed; nested e
> xception is org.springframework.beans.ConversionNotSupportedException:
> Failed to convert property value of type 'com.ibm.mq.jms.MQQueueC
> onnectionFactory' to required type 'javax.jms.ConnectionFactory' for
> property 'connectionFactory'; nested exception is java.lang.Illegal
> StateException: Cannot convert value of type
> [com.ibm.mq.jms.MQQueueConnectionFactory] to required type
> [javax.jms.ConnectionFactory] fo
> r property 'connectionFactory': no matching editors or conversion strategy
> found</loc-message>
> 
> 
> 
> Infos on the web state that this kind of error in Spring is (often) due to a
> class existing twice - how can I check if this is the case? 
> 
> In the dependencies section of the pom of the JBI project I've had to add
> the IBM classes as well to avoid build errors, so the IBM & jms jars go in
> to the SU as well.
> 
> kind regards
> Michael
> 



Re: ServiceMix 4 - deploy JCA rar

Posted by Ekatus Atimoss <ek...@mac.com>.
Hello Claus,

yes, indeed. I've tried them but it made no difference - will try that for
7.0.1.4 again. It also make no difference (regarding the error that shows
up) if I stuff all the IBM jars into lib\ext 



                                        <loc-message>Error creating bean
with name 'org.apache.servicemix.jms.JmsEndpoint#0' defined in
file
[C:\apache-servicemix-4.3.1-fuse-00-00\data\jbi\tutorial-sa\sus\tutorial-jms-su\xbean.xml]:
Initialization of bean failed; nested e
xception is org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type 'com.ibm.mq.jms.MQQueueC
onnectionFactory' to required type 'javax.jms.ConnectionFactory' for
property 'connectionFactory'; nested exception is java.lang.Illegal
StateException: Cannot convert value of type
[com.ibm.mq.jms.MQQueueConnectionFactory] to required type
[javax.jms.ConnectionFactory] fo
r property 'connectionFactory': no matching editors or conversion strategy
found</loc-message>



Infos on the web state that this kind of error in Spring is (often) due to a
class existing twice - how can I check if this is the case? 

In the dependencies section of the pom of the JBI project I've had to add
the IBM classes as well to avoid build errors, so the IBM & jms jars go in
to the SU as well.

kind regards
Michael

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-deploy-JCA-rar-tp3400074p3404561.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ServiceMix 4 - deploy JCA rar

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Feb 28, 2011 at 10:01 AM, Ekatus Atimoss <ek...@mac.com> wrote:
> Hi again,
>
> looks like it's not that easy with unzipping everything from the WMQ rar
> into lib\ext - looks like I'm in classloader hell now. I've tried different
> combinations: when putting everything under lib\ext, the log complained
> about javax/jms/QueueConnectionFactory not being found, when adding jms.jar
> to lib\ext, the complaint was "ConversionNotSupportedException: Failed to
> convert property value of type 'com.ibm.mq.jms.MQQueueConnectionFactory' to
> required type" - even when stuffing the WMQ jarsinto an OSGi bundle using
> Eclipse...no such luck.
>
> If necessary, I could post the stack traces.
>
> Could it be that using SM 4 together with a recent WMQ is a rather exotic
> use case? I'm working in the German financial industry where WMQ is a
> de-facto standard.
>

As a sidenote: I have seen people on the Camel mailing list deploying
WMQ and Camel in SMX 4 and having it working.
I think IBM provides OSGI jars of their JMS client.



> kind regards
> Michael
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-deploy-JCA-rar-tp3400074p3402960.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: ServiceMix 4 - deploy JCA rar

Posted by Ekatus Atimoss <ek...@mac.com>.
Hi again,

looks like it's not that easy with unzipping everything from the WMQ rar
into lib\ext - looks like I'm in classloader hell now. I've tried different
combinations: when putting everything under lib\ext, the log complained
about javax/jms/QueueConnectionFactory not being found, when adding jms.jar
to lib\ext, the complaint was "ConversionNotSupportedException: Failed to
convert property value of type 'com.ibm.mq.jms.MQQueueConnectionFactory' to
required type" - even when stuffing the WMQ jarsinto an OSGi bundle using
Eclipse...no such luck.

If necessary, I could post the stack traces. 

Could it be that using SM 4 together with a recent WMQ is a rather exotic
use case? I'm working in the German financial industry where WMQ is a
de-facto standard.

kind regards
Michael

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-deploy-JCA-rar-tp3400074p3402960.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ServiceMix 4 - deploy JCA rar

Posted by Ekatus Atimoss <ek...@mac.com>.
Hi!
Many thanks for the prompt reply - I'll let the list know how far I've got.
WebSphere MQ can be a pain.. 

Thanks again
Michael
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/ServiceMix-4-deploy-JCA-rar-tp3400074p3400144.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: ServiceMix 4 - deploy JCA rar

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Michael,

A RAR is an archive containing jar files.

Basically, you can make a jar xvf on the rar file and copy these jar 
files in lib/ext folder.

Regards
JB

On 02/25/2011 02:11 PM, Ekatus Atimoss wrote:
>
> Dear all,
>
> having learned from the servicemix documentation that XA is available
> through JCA, I'm looking for a way to make MQSeries available to ServiceMix
> through a resource adapter. The trial for WebSphere MQ 7 comes with a
> wmq.jmsra.rar archive file, but I don't know how to deploy it into
> ServiceMix 4 and neither did find any explict information in the docs or on
> the web.
>
>
> Any help is greatly appreciated!
>
> Kind regards
> Michael