You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by catshout <ge...@web.de> on 2015/07/15 17:50:13 UTC

WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Dear community,

I've installed the brand new SM 6.0.0 (thanks to all developers and
committers!). As I did before successfully I wanted to establish a
connection to a locally running WMQ 7.5.0.1 server. The steps are

1. copy all files from //opt/mqm/java/lib/OSGi/ folder (the OSGi wrapped WMQ
classes) to the /smhome/deploy/ directory. All bundles could be resolved and
started.
2. copy the wmqbridge.xml to the /smhome/deploy/ directory, this looks like



With this deployed I'm getting an error



The bundle itself seems to be able to resolve/import the package
/com.ibm.mq.jms/, see below.



As I mentioned at the beginning, this approach did work like a charm in SM
5.4.0, just tested it for reference.

Does anybody have an idea what might have been changed in SM 6.0.0 so far?
Any hints are highly appreciated.



--
View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by Krzysztof Sobkowiak <kr...@gmail.com>.
It's more difficult. The problem is probably caused by export of the javax.jms package by one of the WMQ jars:

karaf@root>exports | grep javax.jms
javax.jms                                                                                              | 0.0.0                              | 237 | com.ibm.mq.osgi.allclientprereqs                          
javax.jms                                                                                              | 1.1.0                              | 235 | com.ibm.msg.client.osgi.jms.prereq                        
javax.jms                                                                                              | 1.1.0                              | 148 | org.apache.geronimo.specs.geronimo-jms_1.1_spec

Refresh of the org.apache.geronimo.specs.geronimo-jms_1.1_spec (148) helped in my case, but after ServiceMix restart the problem returns. The same problem happens in ServiceMix 5.4.x. Probably enforcing the start of the bundle 235 before 148 would help.

I think you should consider to create a feature installing all your WMQ dependencies. Do you use any private instance of Maven repository (Nexus/Artifactory)? You could install all the dependencies there and create a feature file referencing the jars from the Maven Repository. Feature can refernce jars also from other
locations (e.g. using the file or http protocol). You could make the WMQ libraries available somewhere and reference them in the feature file.

As another solution you could copy the jars into the system subdirectory, e.g. under com/ibm/mq/... and configure the start level of the bundles in startup.properties (placed in etc subdirectory). I don't have too much time until next week to play with this but you can try.

Regards
Krzysztof



On 16.07.2015 11:07, catshout wrote:
> Thanks Krzysztof,
>
> I've tried this out and it worked for me.
>
>
>> On 15.07.2015 23:35, Krzysztof Sobkowiak wrote:
>>
>>> sorry, my mistake
>>>
>>>
>>> exports | grep com.ibm.mq
>>> imports | grep com.ibm.mq
>>>
>>>
>>>
>>> On 15.07.2015 23:29, catshout wrote: 
> Mine too, I should have been realizing the typo ..
>
> Furthermore I've tried to leverage WebSphere MQ Client 8.0.0.3 (the latest
> one). Seems that IBM has changed something in there. But now I'm getting
> another error after deploying wmqbridge.xml ..
>
>
>
> Do you have any idea about that?
>
> Best
> - Gerald
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815p5722822.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

-- 
Krzysztof Sobkowiak (@ksobkowiak)

JEE & OSS Architect, Integration Architect
Apache Software Foundation Member
Apache ServiceMix <http://servicemix.apache.org/> Committer & PMC
Senior Solution Architect @ Capgemini SSC <http://www.pl.capgemini-sdm.com/en/>

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by catshout <ge...@web.de>.
Thanks Krzysztof,

I've tried this out and it worked for me.


> On 15.07.2015 23:35, Krzysztof Sobkowiak wrote:
> 
>> sorry, my mistake
>>
>>
>> exports | grep com.ibm.mq
>> imports | grep com.ibm.mq
>>
>>
>>
>> On 15.07.2015 23:29, catshout wrote: 

Mine too, I should have been realizing the typo ..

Furthermore I've tried to leverage WebSphere MQ Client 8.0.0.3 (the latest
one). Seems that IBM has changed something in there. But now I'm getting
another error after deploying wmqbridge.xml ..



Do you have any idea about that?

Best
- Gerald



--
View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815p5722822.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by Krzysztof Sobkowiak <kr...@gmail.com>.
I think I have found the reason of this problem and a workaround. I'll start with my stacktrace, my bundles have other ids

org.springframework.beans.factory.BeanCreationException: Error creating bean with name
'org.springframework.beans.factory.config.MethodInvokingFactoryBean#0' defined in URL
[bundle://240.0:0/META-INF/spring/wmqbridge.xml]: Invocation of init method failed; nested exception is
java.lang.ClassNotFoundException: com.ibm.mq.MQEnvironment not found from bundle [wmqbridge.xml]
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1514)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:618)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934)[124:org.apache.servicemix.bundles.spring-context:3.2.11.RELEASE_1]
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[128:org.springframework.osgi.core:1.2.1]
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[128:org.springframework.osgi.core:1.2.1]
    at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[128:org.springframework.osgi.core:1.2.1]
    at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[128:org.springframework.osgi.core:1.2.1]
    at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[129:org.springframework.osgi.extender:1.2.1]
    at java.lang.Thread.run(Thread.java:745)[:1.7.0_80]
Caused by: java.lang.ClassNotFoundException: com.ibm.mq.MQEnvironment not found from bundle [wmqbridge.xml]
    at
org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:103)[128:org.springframework.osgi.core:1.2.1]
    at
org.springframework.osgi.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:156)[128:org.springframework.osgi.core:1.2.1]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_80]
    at
org.springframework.util.ClassUtils.forName(ClassUtils.java:265)[120:org.apache.servicemix.bundles.spring-core:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.config.MethodInvokingFactoryBean.resolveClassName(MethodInvokingFactoryBean.java:123)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.util.MethodInvoker.prepare(MethodInvoker.java:153)[120:org.apache.servicemix.bundles.spring-core:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet(MethodInvokingFactoryBean.java:149)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511)[122:org.apache.servicemix.bundles.spring-beans:3.2.11.RELEASE_1]
    ... 14 more
Caused by: java.lang.ClassNotFoundException: com.ibm.mq.MQEnvironment not found by com.ibm.msg.client.osgi.wmq [234]
    at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
    at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
    at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_80]
    at
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1374)[org.apache.felix.framework-4.2.1.jar:]
    at
org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1553)[org.apache.felix.framework-4.2.1.jar:]
    at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1484)[org.apache.felix.framework-4.2.1.jar:]
    at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
    at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_80]
    at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:]
    at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:]
    at
org.springframework.osgi.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:99)[128:org.springframework.osgi.core:1.2.1]

And output form list

234 | Active   |  80 | 7.5.0.1                            | WMQ provider Plug-in                     
235 | Active   |  80 | 7.5.0.1                            | WebSphere MQ classes for Java Plug-in    
236 | Active   |  80 | 7.5.0.1                            | Common Services J2SE Plug-in             
237 | Active   |  80 | 7.5.0.1                            | JMS client Plug-in                       
238 | Active   |  80 | 7.5.0.1                            | NLS Plug-in, Fragments: 242              
239 | Active   |  80 | 7.5.0.1                            | JMS prereq Plug-in                       
240 | Failure  |  80 | 0.0.0                              | wmqbridge.xml                            
241 | Active   |  80 | 7.5.0.1                            | WMQ prereq Plug-in                       
242 | Resolved |  80 | 7.5.0.1                            | WMQ NLS Plug-in, Hosts: 238              
243 | Active   |  80 | 7.5.0.1                            | DirectIP Plug-in

The bundle 234 cannot find the class com.ibm.mq.MQEnvironment. Indeed, the package com.ibm.mq is exported by 2 bundles:

com.ibm.mq                                                                                             |
0.0.0                              | 235 | com.ibm.mq.osgi.java                                      
com.ibm.mq                                                                                             |
0.0.0                              | 234 | com.ibm.msg.client.osgi.wmq

Let's try to find the class MQEnvironment

karaf@root>classes 234 | grep MQEnvironment
com/ibm/msg/client/wmq/v6/base/internal/MQEnvironment.class
com/ibm/msg/client/wmq/v6/base/internal/MQEnvironmentPropertiesHashtable.class
karaf@root>classes 235 | grep MQEnvironment
com/ibm/mq/MQEnvironment$1.class
com/ibm/mq/MQEnvironment$PrivilegedActionImpl.class
com/ibm/mq/MQEnvironment.class
com/ibm/mq/MQEnvironmentPropertiesHashtable.class

We have a package split. The class com.ibm.mq.MQEnvironment can be found only in the bundle 235, but the bundle 234 has
been resolved first, so Karaf uses the package com.ibm.mq from bundle 234 which doesn't contain this class.

234 | Active   |  80 | 7.5.0.1                            | WMQ provider Plug-in                     
235 | Active   |  80 | 7.5.0.1                            | WebSphere MQ classes for Java Plug-in

I have tested the same in ServiceMix 5.4.0 and there the bundle containing this class is resolved first, so you were
lucky and you didn't have this problem.

[ 211] [Active     ] [            ] [       ] [   80] WebSphere MQ classes for Java Plug-in (7.5.0.1)
[ 212] [Active     ] [            ] [       ] [   80] WMQ provider Plug-in (7.5.0.1)

You must force the bundle "WebSphere MQ classes for Java Plug-in" to be installed before "WMQ provider Plug-in". If you
had a feature containing these bundles (instead deploying them directly to deploy directory) you could use start-level.
I tried to change the start level for bundles installed in deploy and it didn't help.

My workaround:

  * deploy first all WMQ libraries but not the com.ibm.msg.client.osgi.wmq_7.5.0.1.jar (you should remove the data
    directory when you don't start with fresh ServiceMix)
  * start ServiceMix if not started yet --> the deployed libraries including WebSphere MQ classes for Java Plug-in will
    be resolved first
  * deploy the com.ibm.msg.client.osgi.wmq_7.5.0.1.jar (WMQ provider Plug-in)
  * deploy your xml file

It helped me. Perhaps someone more experienced in Karaf/OSGi has another solution how to force the correct resolve order.

Regards
Krzysztof 



On 15.07.2015 23:35, Krzysztof Sobkowiak wrote:
> sorry, my mistake
>
>
> exports | grep com.ibm.mq
> imports | grep com.ibm.mq
>
>
>
> On 15.07.2015 23:29, catshout wrote:
>> Thanks a lot for your support, Krzysztof.
>>
>> The first both commands, export and import, return nothing.
>>
>> Than ..
>>
>>
>>
>>
>>
>>
>>
>> Finally, you may try this out. It's a fresh SM 6.0.0 instance, only with the
>> WMQ OSGi jars and the wmqbridge.xml I've provided above. These could be find
>> at http://www-01.ibm.com/support/docview.wss?uid=swg24032744 for free.
>>
>>
>>
>> --
>> View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815p5722819.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.

-- 
Krzysztof Sobkowiak (@ksobkowiak)

JEE & OSS Architect, Integration Architect
Apache Software Foundation Member
Apache ServiceMix <http://servicemix.apache.org/> Committer & PMC
Senior Solution Architect @ Capgemini SSC <http://www.pl.capgemini-sdm.com/en/>

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by Krzysztof Sobkowiak <kr...@gmail.com>.
sorry, my mistake


exports | grep com.ibm.mq
imports | grep com.ibm.mq



On 15.07.2015 23:29, catshout wrote:
> Thanks a lot for your support, Krzysztof.
>
> The first both commands, export and import, return nothing.
>
> Than ..
>
>
>
>
>
>
>
> Finally, you may try this out. It's a fresh SM 6.0.0 instance, only with the
> WMQ OSGi jars and the wmqbridge.xml I've provided above. These could be find
> at http://www-01.ibm.com/support/docview.wss?uid=swg24032744 for free.
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815p5722819.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

-- 
Krzysztof Sobkowiak (@ksobkowiak)

JEE & OSS Architect, Integration Architect
Apache Software Foundation Member
Apache ServiceMix <http://servicemix.apache.org/> Committer & PMC
Senior Solution Architect @ Capgemini SSC <http://www.pl.capgemini-sdm.com/en/>

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by catshout <ge...@web.de>.
Thanks a lot for your support, Krzysztof.

The first both commands, export and import, return nothing.

Than ..







Finally, you may try this out. It's a fresh SM 6.0.0 instance, only with the
WMQ OSGi jars and the wmqbridge.xml I've provided above. These could be find
at http://www-01.ibm.com/support/docview.wss?uid=swg24032744 for free.



--
View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815p5722819.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by Krzysztof Sobkowiak <kr...@gmail.com>.
I'm trying to understand the problem. The bundle 254 cannot find the class com.ibm.mq.MQEnvironment:

Caused by: java.lang.ClassNotFoundException: com.ibm.mq.MQEnvironment not found by com.ibm.msg.client.osgi.wmq [254]

It would suggest, the bundle 254 doesn't import the package com.ibm.mq or there is no bundle in your system which
provides this package. But you write, the bundle xmlwmbridge.xml (256) imports the package com.ibm.mq and imports it
from the bundle 254

Imported Packages	com.ibm.mq,version=0.0.0 from com.ibm.msg.client.osgi.wmq (254)

It looks like the bundle 254 imports and exports the package com.ibm.msq, but something wrong happens while import.
Could you please send following outputs?

exports | grep com.ibm.msq
imports | grep com.ibm.msq
headers 254
headers 256
headers xyz   (where xyz is bundle id of each bundle listed by the first command, exports...)
list -t 0

Regards
Krzysztof





On 15.07.2015 20:07, catshout wrote:
> Thanks for the reply. I've refreshed the bundle 254 as suggested. Same error
> while restarting the ​w​m​q​b​r​i​d​g​e​.​x​m​l​ bundle.
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815p5722817.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

-- 
Krzysztof Sobkowiak (@ksobkowiak)

JEE & OSS Architect, Integration Architect
Apache Software Foundation Member
Apache ServiceMix <http://servicemix.apache.org/> Committer & PMC
Senior Solution Architect @ Capgemini SSC <http://www.pl.capgemini-sdm.com/en/>

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by catshout <ge...@web.de>.
Thanks for the reply. I've refreshed the bundle 254 as suggested. Same error
while restarting the ​w​m​q​b​r​i​d​g​e​.​x​m​l​ bundle.



--
View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815p5722817.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: WMQ JMS Provider OSGi classes cause an error since SM 6.0.0

Posted by Krzysztof Sobkowiak <kr...@gmail.com>.
Hi

It looks like in ServiceMix 6.0.0 the bundles in deploy directory are resolved in other order then in 5.4.0. Could you
try to refresh the bundle 254 (com.ibm.msg.client.osgi.wmq)?

Regards
Krzysztof


On 15.07.2015 17:50, catshout wrote:
> Dear community,
>
> I've installed the brand new SM 6.0.0 (thanks to all developers and
> committers!). As I did before successfully I wanted to establish a
> connection to a locally running WMQ 7.5.0.1 server. The steps are
>
> 1. copy all files from //opt/mqm/java/lib/OSGi/ folder (the OSGi wrapped WMQ
> classes) to the /smhome/deploy/ directory. All bundles could be resolved and
> started.
> 2. copy the wmqbridge.xml to the /smhome/deploy/ directory, this looks like
>
>
>
> With this deployed I'm getting an error
>
>
>
> The bundle itself seems to be able to resolve/import the package
> /com.ibm.mq.jms/, see below.
>
>
>
> As I mentioned at the beginning, this approach did work like a charm in SM
> 5.4.0, just tested it for reference.
>
> Does anybody have an idea what might have been changed in SM 6.0.0 so far?
> Any hints are highly appreciated.
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/WMQ-JMS-Provider-OSGi-classes-cause-an-error-since-SM-6-0-0-tp5722815.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

-- 
Krzysztof Sobkowiak (@ksobkowiak)

JEE & OSS Architect, Integration Architect
Apache Software Foundation Member
Apache ServiceMix <http://servicemix.apache.org/> Committer & PMC
Senior Solution Architect @ Capgemini SSC <http://www.pl.capgemini-sdm.com/en/>