You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by snehal surti <ss...@407etr.com> on 2010/07/28 18:13:41 UTC

Servicemix-jms component with websphere MQ could not find jms.jar

Hi,

I am trying to create jms provider to pass xml messages to Websphere
mq(version5.3). I have following provider configurations in my xbean.xml

<jms:endpoint service="esb:MQProvider" 							endpoint="MQProviderEndPoint" 						
connectionFactory="#mqConnectionFactory"							role="provider" />

I have following dependencies in my pom.xml declared 

<dependency>
      <groupId>com.ibm.mq.connector</groupId>
      <artifactId>connector</artifactId>
      <version>5.3</version>
      <type>jar</type>
      
    </dependency>
     <dependency>
      <groupId>com.ibm.mqjms</groupId>
      <artifactId>com.ibm.mqjms</artifactId>
      <version>5.3</version>
      <type>jar</type>
      
    </dependency>
    <dependency>
      <groupId>com.ibm.mq</groupId>
      <artifactId>com.ibm.mq</artifactId>
      <version>5.3</version>
      <type>jar</type>
      
    </dependency>

When it builds service assembly it complaints following:
Bean 'mqConnectionFactory'; nested exception is
java.lang.NoClassDefFoundError: javax/jms/QueueConnectionFactory

I have tried to keep jms.jar in smx/lib/optional too but it result into same
error. I tried to deploy it on smx3.2.3 and it successfully deployed on it.
Is there someone else faced this issue with smx3.3.2? 




-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-jms-component-with-websphere-MQ-could-not-find-jms-jar-tp2256692p2256692.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servicemix-jms component with websphere MQ could not find jms.jar

Posted by snehal surti <ss...@407etr.com>.
Hi,

Thanks for giving right direction.I went through class loader document on
servicemix site and accordingly i added following class classpath in my
xbean. I am pointing jms jar provided with websphere mq's installation. I
have copied these jars in ext folder under lib.


<location>/apache-servicemix-3.3.2/apache-servicemix-3.3.2/lib/ext/com.ibm.mq.jar</location>
   
<location>/apache-servicemix-3.3.2/apache-servicemix-3.3.2/lib/ext/com.ibm.mqjms.jar</location>
   
<location>/apache-servicemix-3.3.2/apache-servicemix-3.3.2/lib/ext/jms.jar</location>

Here is my provider's configuration:
<jms:provider service="esb:MQProvider" 
							endpoint="MQProviderEndPoint" 
							connectionFactory="#mqConnectionFactory"
							destinationName="FMC.MAESTRO.QUEUE.INFO"
							
							/>

Now when i deploy this assembly it gives me following error:
                                <nesting-level>1</nesting-level>
                                <msg-loc-info>
                                        <loc-token/>
                                        <loc-message>Error creating bean
with name 'org.apache.servicemix.jms.endpoints.JmsProviderEndpoint#0'
defined in file [C:\Alok\apa
che-servicemix-3.3.2\apache-servicemix-3.3.2\data\smx\service-assemblies\testjms-sa\version_33\sus\servicemix-jms\testjmsmq-su\xbean.xml]:
Initialization of bean failed; n
ested exception is org.springframework.beans.TypeMismatchException: Failed
to convert property value of type [com.ibm.mq.jms.MQQueueConnectionFactory]
to required type [ja
vax.jms.ConnectionFactory] for property 'connectionFactory'; nested
exception is java.lang.IllegalArgumentException: Cannot convert value of
type [com.ibm.mq.jms.MQQueueCo
nnectionFactory] to required type [javax.jms.ConnectionFactory] for property
'connectionFactory': no matching editors or conversion strategy
found</loc-message>
                                       
<stack-trace><![CDATA[org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.apache.servicemix
.jms.endpoints.JmsProviderEndpoint#0' defined in file
[C:\Alok\apache-servicemix-3.3.2\apache-servicemix-3.3.2\data\smx\service-assemblies\testjms-sa\version_33\sus\servic
emix-jms\testjmsmq-su\xbean.xml]: Initialization of bean failed; nested
exception is org.springframework.beans.TypeMismatchException: Failed to
convert property value of t
ype [com.ibm.mq.jms.MQQueueConnectionFactory] to required type
[javax.jms.ConnectionFactory] for property 'connectionFactory'; nested
exception is java.lang.IllegalArgumen
tException: Cannot convert value of type
[com.ibm.mq.jms.MQQueueConnectionFactory] to required type
[javax.jms.ConnectionFactory] for property 'connectionFactory': no matc
hing editors or conversion strategy found

Its not able to convert mqconnectionfactory to type of jms connection
factory. Is there any issue with my xbean configuration?

Thanks in advance



-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-jms-component-with-websphere-MQ-could-not-find-jms-jar-tp2256692p2260053.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servicemix-jms component with websphere MQ could not find jms.jar

Posted by Matias Urbieta <mu...@gpi.com.ar>.
Hi, i already have worked with servicemix-jms and websphere mq 5.4. As
Freeman said, it is an issue related to jms spec version due to mq 5.3
is jms version 1.0.2 compliant.
In order to make it work you use jms spec version 1.0.2b. This last is
not available at maven repositories so you must download it from SUN's
site and install it in your repository by yourself.
Regards


2010/7/29 Freeman Fang <fr...@gmail.com>:
> Hi,
>
> This java.lang.NoClassDefFoundError generally means your SA/SU has different
> jms spec version dependency with that used by SMX,  smx3.3.2 use
> geronimo-jms_1.1_spec-1.1.1.jar. Probably use self-first delegate mode can
> resolve this problem, take a look at [1] to get more details about how
> classloader works in SMX.
>
> [1]http://servicemix.apache.org/classloaders.html
>
> Freeman
> On 2010-7-29, at 上午12:13, snehal surti wrote:
>
>>
>> Hi,
>>
>> I am trying to create jms provider to pass xml messages to Websphere
>> mq(version5.3). I have following provider configurations in my xbean.xml
>>
>> <jms:endpoint service="esb:MQProvider"
>>              endpoint="MQProviderEndPoint"
>>
>> connectionFactory="#mqConnectionFactory"
>>                      role="provider" />
>>
>> I have following dependencies in my pom.xml declared
>>
>> <dependency>
>>     <groupId>com.ibm.mq.connector</groupId>
>>     <artifactId>connector</artifactId>
>>     <version>5.3</version>
>>     <type>jar</type>
>>
>>   </dependency>
>>    <dependency>
>>     <groupId>com.ibm.mqjms</groupId>
>>     <artifactId>com.ibm.mqjms</artifactId>
>>     <version>5.3</version>
>>     <type>jar</type>
>>
>>   </dependency>
>>   <dependency>
>>     <groupId>com.ibm.mq</groupId>
>>     <artifactId>com.ibm.mq</artifactId>
>>     <version>5.3</version>
>>     <type>jar</type>
>>
>>   </dependency>
>>
>> When it builds service assembly it complaints following:
>> Bean 'mqConnectionFactory'; nested exception is
>> java.lang.NoClassDefFoundError: javax/jms/QueueConnectionFactory
>>
>> I have tried to keep jms.jar in smx/lib/optional too but it result into
>> same
>> error. I tried to deploy it on smx3.2.3 and it successfully deployed on
>> it.
>> Is there someone else faced this issue with smx3.3.2?
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://servicemix.396122.n5.nabble.com/Servicemix-jms-component-with-websphere-MQ-could-not-find-jms-jar-tp2256692p2256692.html
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
> --
> Freeman Fang
>
> ------------------------
> Open Source SOA: http://fusesource.com
> Apache Servicemix:http://servicemix.apache.org
> Apache Cxf: http://cxf.apache.org
> Apache Karaf: http://karaf.apache.org
> Apache Felix: http://felix.apache.org
>
>



-- 
Matias Urbieta
GPI Argentina SA - www.gpi.com.ar
Calle 53 N 366 - Piso 9 / La Plata - Buenos Aires - Argentina
Teléfono (+54) 221 4275781

Re: Servicemix-jms component with websphere MQ could not find jms.jar

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

This java.lang.NoClassDefFoundError generally means your SA/SU has  
different jms spec version dependency with that used by SMX,  smx3.3.2  
use geronimo-jms_1.1_spec-1.1.1.jar. Probably use self-first delegate  
mode can resolve this problem, take a look at [1] to get more details  
about how classloader works in SMX.

[1]http://servicemix.apache.org/classloaders.html

Freeman
On 2010-7-29, at 上午12:13, snehal surti wrote:

>
> Hi,
>
> I am trying to create jms provider to pass xml messages to Websphere
> mq(version5.3). I have following provider configurations in my  
> xbean.xml
>
> <jms:endpoint service="esb:MQProvider" 							 
> endpoint="MQProviderEndPoint" 						
> connectionFactory="#mqConnectionFactory"							role="provider" />
>
> I have following dependencies in my pom.xml declared
>
> <dependency>
>      <groupId>com.ibm.mq.connector</groupId>
>      <artifactId>connector</artifactId>
>      <version>5.3</version>
>      <type>jar</type>
>
>    </dependency>
>     <dependency>
>      <groupId>com.ibm.mqjms</groupId>
>      <artifactId>com.ibm.mqjms</artifactId>
>      <version>5.3</version>
>      <type>jar</type>
>
>    </dependency>
>    <dependency>
>      <groupId>com.ibm.mq</groupId>
>      <artifactId>com.ibm.mq</artifactId>
>      <version>5.3</version>
>      <type>jar</type>
>
>    </dependency>
>
> When it builds service assembly it complaints following:
> Bean 'mqConnectionFactory'; nested exception is
> java.lang.NoClassDefFoundError: javax/jms/QueueConnectionFactory
>
> I have tried to keep jms.jar in smx/lib/optional too but it result  
> into same
> error. I tried to deploy it on smx3.2.3 and it successfully deployed  
> on it.
> Is there someone else faced this issue with smx3.3.2?
>
>
>
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/Servicemix-jms-component-with-websphere-MQ-could-not-find-jms-jar-tp2256692p2256692.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org