You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by surya aditya <su...@gmail.com> on 2011/12/01 20:50:29 UTC

karaf and tibco ems

Hello Friends:

I am trying to setup using the following stack:

1. karaf 2.2.4
2. camel 2.8.2
3. tibco ems 5.0
5. spring 3.0.6

to enable camel route to recieve messages from JMS queue setup on EMS
server, i am trying to instantiate camel jms component.
However, i am getting following error for "ClassNotFoundException"

I had to put tibco jar tibjms-5.0 in deploy folder as it is not osgi
comapatible. karaf wrapped it and shows 'active' status.

I am loading the bundles in correct order to my knowledge and on
bundles:headers i see the packages are being exported/imported correctly.
See below for headers from bundles.

See the following exception and I am stuck at this point, has anyone tried
used  Tibco EMS on OSGI/Karaf ? Please suggest.

Cannot instantiate class: com.tibco.tibjms.naming.TibjmsInitialContextFactory
[Root exception is java.lang.ClassNotFoundException:
com.tibco.tibjms.naming.TibjmsInitialContextFactory]

application code:

 Hashtable<String, String> env = new Hashtable<String, String>();
               env.put(Context.INITIAL_CONTEXT_FACTORY,
                               "com.tibco.tibjms.naming.
TibjmsInitialContextFactory");
               env.put(Context.PROVIDER_URL, "tibjmsnaming://
vm-bda2-d889.nam.nsroot.net:7222");
               // env.put(Context.SECURITY_PRINCIPAL, "user");
               // env.put(Context.SECURITY_CREDENTIALS, "password");
               Context ctx = new InitialContext(env);
               TibjmsConnectionFactory emsConnectionFactory =
(TibjmsConnectionFactory) ctx
                               .lookup("tml2.inbound.ConnectionFactory");

               System.out.println("JMSCOMpononet.....");
               log.info("## Creating JMS Component ##");
               JmsComponent jms = new JmsComponent();
               jms.setConnectionFactory(emsConnectionFactory);
               jms.setConcurrentConsumers(5);

for Tibco Ems Jar:

Import-Package =
       com.tibco.security;resolution:=optional,
       com.tibco.security.ocsp;resolution:=optional,
       com.tibco.security.ssl;resolution:=optional,
       com.tibco.tibjms;resolution:=optional,
       com.tibco.tibjms.naming;resolution:=optional,
       com.tibco.tibjms.naming.tibjmsnaming;resolution:=optional,
       javax.jms;resolution:=optional,
       javax.naming;resolution:=optional,
       javax.naming.directory;resolution:=optional,
       javax.naming.spi;resolution:=optional,
       javax.transaction.xa;resolution:=optional,
       javax.xml.parsers;resolution:=optional,
       javax.xml.transform;resolution:=optional,
       javax.xml.transform.dom;resolution:=optional,
       javax.xml.transform.stream;resolution:=optional,
       org.w3c.dom;resolution:=optional,
       org.xml.sax;resolution:=optional,
       org.xml.sax.helpers;resolution:=optional
Export-Package =
       com.tibco.tibjms;
               uses:="javax.jms,
                       javax.naming,
                       javax.xml.transform,
                       javax.xml.transform.stream,
                       javax.xml.parsers,
                       javax.xml.transform.dom,
                       org.w3c.dom,
                       com.tibco.tibjms.naming,
                       org.xml.sax.helpers,
                       org.xml.sax,
                       com.tibco.security.ssl,
                       com.tibco.security,
                       javax.transaction.xa,
                       com.tibco.security.ocsp",
       com.tibco.tibjms.naming;
               uses:="javax.naming,
                       javax.naming.directory,
                       com.tibco.tibjms,
                       org.xml.sax.helpers,
                       javax.naming.spi,
                       javax.jms",
       com.tibco.tibjms.naming.tibjmsnaming;
               uses:="javax.naming,
                       com.tibco.tibjms.naming,
                       javax.naming.spi"


for my application jar:

Import-Package =
       com.google.inject;version="[1.3,2)",
       com.google.inject.binder;version="[1.3,2)",
       com.google.inject.name;version="[1.3,2)",
       com.tibco.tibjms,
       com.tibco.tibjms.naming,
       com.tibco.tibjms.naming.tibjmsnaming,
       javax.jms,
       javax.naming,
       org.apache.camel;version="[2.8,3)",
       org.apache.camel.builder;version="[2.8,3)",
       org.apache.camel.component.jms;version="[2.8,3)",
       org.apache.camel.core.osgi;version="[2.8,3)",
       org.apache.camel.guice;version="[2.8,3)",
       org.apache.camel.impl;version="[2.8,3)",
       org.apache.camel.model;version="[2.8,3)",
       org.apache.camel.spi;version="[2.8,3)",
       org.guiceyfruit.jndi;version="[2.0,3)",
       org.guiceyfruit.jndi.internal;version="[2.0,3)",
       org.osgi.framework;version="[1.5,2)",
       org.slf4j;version="[1.6,2)"

Re: karaf and tibco ems

Posted by "Roshan A. Punnoose" <rp...@proteuseng.com>.
Hi,

I have been able to use tibco ems in karaf pretty successfully.  I have noticed that ClassNotFound exceptions are very cryptic and do not tell you exactly what the cause is. In this case, it might not be the TibjmsInitialContextFactory that is not being found but another Tibco class in another package that isn't being imported directly.  Try setting a header in your MyApp Manifest to "DynamicImport-Package= *", I think you can even use the dev:dynamic-import command from the karaf command line to change this header on the fly on your bundle.

Another problem might be that tibco is trying to use another class from another bundle (maybe javax.jms isn't available in your bundles), so make sure you have all the dependent jars you may need. Also, you can try setting the dynamic-import on the tibco bundle itself to see if it works.

If it does work, it is simple enough to check the imports and exports of the bundles to see what extra packages were added during the dynamicimport to make it work.

Roshan

On Dec 2, 2011, at 3:43 AM, Andreas Pieber wrote:

Slowly it's getting quite hard to diagnose this without the code available..The code of "MyApp" you've posted in your first mail is called where? In the activator?

Kind regards,
Andreas

On Thu, Dec 1, 2011 at 23:23, surya aditya <su...@gmail.com>> wrote:
Hi:

Tried the following:

1. MyApp bundle does import the "com.tibco.tibjms.naming" package. I still get 'ClassNotFound' exception, double checked if the tibco ems libraray jar has the file in questions and it does. Fyi Tibco Ems jar is copied into /deploy folder. Tibco Ems bundle is active, on doing 'headers' i see everything is ok. no red lines. verified using 'imports' as well.

2. 'headers' on MyApp bundle is clean as well. This bundle has created manifest.mf and looks ok on manual inspection as well.

Problem still persists "Cannot instantiate class: com.tibco.tibjms.naming.TibjmsInitialContextFactory [Root exception is java.lang.ClassNotFoundException: com.tibco.tibjms.naming.TibjmsInitialContextFactory]"

Any other pointers to look into will be helpful? this looks straight forward use case where i am trying to connect to EMS server, sure I guess this is doable in Karaf, just need to get things in right place I hope.

Appreciate any further help.

regards,
Surya





On Thu, Dec 1, 2011 at 3:53 PM, mikevan <mv...@comcast.net>> wrote:


Andreas,



It looks like it should from reading his Import-Package statement. However, if the maven-bundle-plugin isn't working, it wouldn't be creating the MANIFEST.MF file properly.  Perhaps he should look at the .jar file created to verify that the MANIFEST.MF is actually being created. Alternatively, the headers command should show what the bundle thinks it should be looking for.  Additionally, the imports command could be used to verify this also.



----- Original Message -----


From: "Andreas Pieber [via Karaf]" <ml...@n3.nabble.com>>
To: "mikevan" <mv...@comcast.net>>
Sent: Thursday, December 1, 2011 3:49:41 PM
Subject: Re: karaf and tibco ems



Sorry for the standard question, but does the bundle containing the code you've posted in your first mail imports com.tibco.tibjms.naming?

Kind regards Andreas
On Dec 1, 2011 9:31 PM, "surya aditya" < [hidden email] > wrote:


I verified the class exists in jar. on executing the  'exports'. I get the following:


karaf@root> exports | grep com.tibco.tibjms
   45 com.tibco.tibjms; version=0.0.0
   45 com.tibco.tibjms.naming; version=0.0.0
   45 com.tibco.tibjms.naming. tibjmsnaming; version=0.0.0




i see version=0.0.0, but MyApp does not specify any version on imports! should that be the issue here? thanks for helping again.


from bundles:headers on  my application jar:
Import-Package =
       com.google.inject;version="[1. 3,2)",
       com.google.inject.binder; version="[1.3,2)",
         com.google.inject.name<http://com.google.inject.name/>  ; version="[1.3,2)",
       com.tibco.tibjms,
       com.tibco.tibjms.naming,
       com.tibco.tibjms.naming. tibjmsnaming,
       javax.jms,........................


regards,
Surya





On Thu, Dec 1, 2011 at 3:25 PM, mikevan < [hidden email] > wrote:

<blockquote>


First, try to manually verify that the tibco jar file you're using actually contains the correct class: com.tibco.tibjms.naming. TibjmsInitialContextFactory .  Once you've done that, if the class is present, verify that the package has been properly exported into your environment by executing:

karaf@root> exports | grep com.tibco.tibjms.naming



Please let me know what happens.



----- Original Message -----





--
Click here to mark it as spam.<http://mailfilter.proteus-technologies.com/cgi-bin/learn-msg.cgi?id=C2606284AD.AC1DA>


Re: karaf and tibco ems

Posted by Andreas Pieber <an...@gmail.com>.
Slowly it's getting quite hard to diagnose this without the code
available..The code of "MyApp" you've posted in your first mail is called
where? In the activator?

Kind regards,
Andreas

On Thu, Dec 1, 2011 at 23:23, surya aditya <su...@gmail.com> wrote:

> Hi:
>
> Tried the following:
>
> 1. MyApp bundle does import the "com.tibco.tibjms.naming" package. I still
> get 'ClassNotFound' exception, double checked if the tibco ems libraray jar
> has the file in questions and it does. Fyi Tibco Ems jar is copied into
> /deploy folder. Tibco Ems bundle is active, on doing 'headers' i see
> everything is ok. no red lines. verified using 'imports' as well.
>
> 2. 'headers' on MyApp bundle is clean as well. This bundle has created
> manifest.mf and looks ok on manual inspection as well.
>
> Problem still persists "Cannot instantiate class: com.tibco.tibjms.naming.TibjmsInitialContextFactory
> [Root exception is java.lang.ClassNotFoundException:
> com.tibco.tibjms.naming.TibjmsInitialContextFactory]"
>
> Any other pointers to look into will be helpful? this looks straight
> forward use case where i am trying to connect to EMS server, sure I guess
> this is doable in Karaf, just need to get things in right place I hope.
>
> Appreciate any further help.
>
> regards,
> Surya
>
>
>
>
>
> On Thu, Dec 1, 2011 at 3:53 PM, mikevan <mv...@comcast.net> wrote:
>
>>
>>
>> Andreas,
>>
>>
>>
>> It looks like it should from reading his Import-Package statement.
>> However, if the maven-bundle-plugin isn't working, it wouldn't be creating
>> the MANIFEST.MF file properly.  Perhaps he should look at the .jar file
>> created to verify that the MANIFEST.MF is actually being created.
>> Alternatively, the headers command should show what the bundle thinks it
>> should be looking for.  Additionally, the imports command could be used to
>> verify this also.
>>
>>
>>
>> ----- Original Message -----
>>
>>
>> From: "Andreas Pieber [via Karaf]" <
>> ml-node+s922171n3552816h48@n3.nabble.com>
>> To: "mikevan" <mv...@comcast.net>
>> Sent: Thursday, December 1, 2011 3:49:41 PM
>> Subject: Re: karaf and tibco ems
>>
>>
>>
>> Sorry for the standard question, but does the bundle containing the code
>> you've posted in your first mail imports com.tibco.tibjms.naming?
>>
>> Kind regards Andreas
>> On Dec 1, 2011 9:31 PM, "surya aditya" < [hidden email] > wrote:
>>
>>
>> I verified the class exists in jar. on executing the  'exports'. I get
>> the following:
>>
>>
>> karaf@root> exports | grep com.tibco.tibjms
>>    45 com.tibco.tibjms; version=0.0.0
>>    45 com.tibco.tibjms.naming; version=0.0.0
>>    45 com.tibco.tibjms.naming. tibjmsnaming; version=0.0.0
>>
>>
>>
>>
>> i see version=0.0.0, but MyApp does not specify any version on imports!
>> should that be the issue here? thanks for helping again.
>>
>>
>> from bundles:headers on  my application jar:
>> Import-Package =
>>        com.google.inject;version="[1. 3,2)",
>>        com.google.inject.binder; version="[1.3,2)",
>>          com.google.inject.name  ; version="[1.3,2)",
>>        com.tibco.tibjms,
>>        com.tibco.tibjms.naming,
>>        com.tibco.tibjms.naming. tibjmsnaming,
>>        javax.jms,........................
>>
>>
>> regards,
>> Surya
>>
>>
>>
>>
>>
>> On Thu, Dec 1, 2011 at 3:25 PM, mikevan < [hidden email] > wrote:
>>
>> <blockquote>
>>
>>
>> First, try to manually verify that the tibco jar file you're using
>> actually contains the correct class: com.tibco.tibjms.naming.
>> TibjmsInitialContextFactory .  Once you've done that, if the class is
>> present, verify that the package has been properly exported into your
>> environment by executing:
>>
>> karaf@root> exports | grep com.tibco.tibjms.naming
>>
>>
>>
>> Please let me know what happens.
>>
>>
>>
>> ----- Original Message -----
>>
>>
>>
>>

Re: karaf and tibco ems

Posted by "Roshan A. Punnoose" <rp...@proteuseng.com>.
I use the direct ConnectionFactory approach and do not do anything with the ContextFactory, so I might also have the same problem. However, what I did was to deploy an osgi version of my tibco bundle instead of directly just adding it to karaf.

I used bnd, with the following bnd file:

-classpath= target/tibjms.jar,target/tibcrypt.jar
-output= target/tibjms-osgi-6.0.jar
Import-Package= *;resolution:=optional
Export-Package= *
Bundle-Version= 6.0.osgi
Bundle-SymbolicName= tibjms
DynamicImport-Package= *

That did all the work for importing and exporting the right packages, and I haven't had a problem since. Bnd is pretty easy to use too, I would recommend that approach.

Roshan

On Dec 2, 2011, at 1:29 PM, surya46584 wrote:

> Thanks everyone for inputs, I feel sense of community... helping each other
> on the issues.
> 
> Progress Made so far:
> 
> 1. I have changed the way I connect to ems server, I am connecting directly
> and creating ems connection factory as follows, not using jndi look up
> way.... This way I am successful in connecting and receiving messages from
> EMS. This proves that no issues with 'MyApp' bundle and 'Activator' in
> 'MyApp'.
> 
>                Code Snippet used to connect to EMS ( working in Karaf): 
> 
>                TibjmsConnectionFactory emsConnectionFactory  = new
> TibjmsConnectionFactory();
> 		emsConnectionFactory.setServerUrl("tcp://emsserverhost:7222");
> 
> 
> 2. This way does not seems to work. *Roshan *if you can help provide info on
> what Libraries/Bundles from EMS you made available for Karaf?
> 	        
>                Code Snippet used to connect to EMS ( NOT working in Karaf): 
>                Hashtable<String, String> env = new Hashtable<String,
> String>();
> 		env.put(Context.INITIAL_CONTEXT_FACTORY,
> 				"com.tibco.tibjms.naming.TibjmsInitialContextFactory");
> 		env.put(Context.PROVIDER_URL, "tibjmsnaming://emsserverhost:7222");
>                Context ctx = new InitialContext(env);
> 		TibjmsConnectionFactory emsConnectionFactory = (TibjmsConnectionFactory)
> ctx
> 				.lookup("com.myapp.inbound.ConnectionFactory");
> 
> Problem still persists "Cannot instantiate class:
> com.tibco.tibjms.naming.TibjmsInitialContextFactory [Root exception is
> java.lang.ClassNotFoundException:
> com.tibco.tibjms.naming.TibjmsInitialContextFactory]"
> 
> 3. I changed jre.properties settings as suggested by *Andi *and this does
> not seem to help either in resolving the issue.
> 
> The underlying cause for not finding or loading class
> "com.tibco.tibjms.naming.TibjmsInitialContextFactory " is still unresolved.
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3555352.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
> 
> --
> Follow this link to mark it as spam:
> http://mailfilter.proteus-technologies.com/cgi-bin/learn-msg.cgi?id=83CD728486.AAD78
> 
> 


Re: karaf and tibco ems

Posted by surya46584 <su...@gmail.com>.
Thanks everyone for inputs, I feel sense of community... helping each other
on the issues.

Progress Made so far:

1. I have changed the way I connect to ems server, I am connecting directly
and creating ems connection factory as follows, not using jndi look up
way.... This way I am successful in connecting and receiving messages from
EMS. This proves that no issues with 'MyApp' bundle and 'Activator' in
'MyApp'.

                Code Snippet used to connect to EMS ( working in Karaf): 

                TibjmsConnectionFactory emsConnectionFactory  = new
TibjmsConnectionFactory();
		emsConnectionFactory.setServerUrl("tcp://emsserverhost:7222");


2. This way does not seems to work. *Roshan *if you can help provide info on
what Libraries/Bundles from EMS you made available for Karaf?
	        
                Code Snippet used to connect to EMS ( NOT working in Karaf): 
                Hashtable<String, String> env = new Hashtable<String,
String>();
		env.put(Context.INITIAL_CONTEXT_FACTORY,
				"com.tibco.tibjms.naming.TibjmsInitialContextFactory");
		env.put(Context.PROVIDER_URL, "tibjmsnaming://emsserverhost:7222");
                Context ctx = new InitialContext(env);
		TibjmsConnectionFactory emsConnectionFactory = (TibjmsConnectionFactory)
ctx
				.lookup("com.myapp.inbound.ConnectionFactory");

Problem still persists "Cannot instantiate class:
com.tibco.tibjms.naming.TibjmsInitialContextFactory [Root exception is
java.lang.ClassNotFoundException:
com.tibco.tibjms.naming.TibjmsInitialContextFactory]"

3. I changed jre.properties settings as suggested by *Andi *and this does
not seem to help either in resolving the issue.

The underlying cause for not finding or loading class
"com.tibco.tibjms.naming.TibjmsInitialContextFactory " is still unresolved.






--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3555352.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf and tibco ems

Posted by Andreas Kuhtz <an...@gmail.com>.
Hi Surya,

I think I had a similar problem some weeks before (regarding your error
message and not more information ...) and I had to add some packages to
etc/jre.properties:

I think I added some of the packages listed below, but for your problem I
guess others are needed. It could be that you need to add some "com.sun.*"
packages to jre.properties that are used by the TibjmsInitialContextFactory...

 com.sun.org.apache.xerces.internal.dom, \
 com.sun.org.apache.xerces.internal.jaxp, \
 com.sun.jndi.ldap, \
 com.sun.org.apache.xalan.internal.res, \
 com.sun.org.apache.xml.internal.utils, \
 com.sun.org.apache.xpath.internal, \
 com.sun.org.apache.xpath.internal.jaxp, \
 com.sun.org.apache.xpath.internal.objects


Regards,
Andi


2011/12/1 surya aditya <su...@gmail.com>

> Hi:
>
> Tried the following:
>
> 1. MyApp bundle does import the "com.tibco.tibjms.naming" package. I still
> get 'ClassNotFound' exception, double checked if the tibco ems libraray jar
> has the file in questions and it does. Fyi Tibco Ems jar is copied into
> /deploy folder. Tibco Ems bundle is active, on doing 'headers' i see
> everything is ok. no red lines. verified using 'imports' as well.
>
> 2. 'headers' on MyApp bundle is clean as well. This bundle has created
> manifest.mf and looks ok on manual inspection as well.
>
> Problem still persists "Cannot instantiate class: com.tibco.tibjms.naming.TibjmsInitialContextFactory
> [Root exception is java.lang.ClassNotFoundException:
> com.tibco.tibjms.naming.TibjmsInitialContextFactory]"
>
> Any other pointers to look into will be helpful? this looks straight
> forward use case where i am trying to connect to EMS server, sure I guess
> this is doable in Karaf, just need to get things in right place I hope.
>
> Appreciate any further help.
>
> regards,
> Surya
>
>
>
>
>
> On Thu, Dec 1, 2011 at 3:53 PM, mikevan <mv...@comcast.net> wrote:
>
>>
>>
>> Andreas,
>>
>>
>>
>> It looks like it should from reading his Import-Package statement.
>> However, if the maven-bundle-plugin isn't working, it wouldn't be creating
>> the MANIFEST.MF file properly.  Perhaps he should look at the .jar file
>> created to verify that the MANIFEST.MF is actually being created.
>> Alternatively, the headers command should show what the bundle thinks it
>> should be looking for.  Additionally, the imports command could be used to
>> verify this also.
>>
>>
>>
>> ----- Original Message -----
>>
>>
>> From: "Andreas Pieber [via Karaf]" <
>> ml-node+s922171n3552816h48@n3.nabble.com>
>> To: "mikevan" <mv...@comcast.net>
>> Sent: Thursday, December 1, 2011 3:49:41 PM
>> Subject: Re: karaf and tibco ems
>>
>>
>>
>> Sorry for the standard question, but does the bundle containing the code
>> you've posted in your first mail imports com.tibco.tibjms.naming?
>>
>> Kind regards Andreas
>> On Dec 1, 2011 9:31 PM, "surya aditya" < [hidden email] > wrote:
>>
>>
>> I verified the class exists in jar. on executing the  'exports'. I get
>> the following:
>>
>>
>> karaf@root> exports | grep com.tibco.tibjms
>>    45 com.tibco.tibjms; version=0.0.0
>>    45 com.tibco.tibjms.naming; version=0.0.0
>>    45 com.tibco.tibjms.naming. tibjmsnaming; version=0.0.0
>>
>>
>>
>>
>> i see version=0.0.0, but MyApp does not specify any version on imports!
>> should that be the issue here? thanks for helping again.
>>
>>
>> from bundles:headers on  my application jar:
>> Import-Package =
>>        com.google.inject;version="[1. 3,2)",
>>        com.google.inject.binder; version="[1.3,2)",
>>          com.google.inject.name  ; version="[1.3,2)",
>>        com.tibco.tibjms,
>>        com.tibco.tibjms.naming,
>>        com.tibco.tibjms.naming. tibjmsnaming,
>>        javax.jms,........................
>>
>>
>> regards,
>> Surya
>>
>>
>>
>>
>>
>> On Thu, Dec 1, 2011 at 3:25 PM, mikevan < [hidden email] > wrote:
>>
>> <blockquote>
>>
>>
>> First, try to manually verify that the tibco jar file you're using
>> actually contains the correct class: com.tibco.tibjms.naming.
>> TibjmsInitialContextFactory .  Once you've done that, if the class is
>> present, verify that the package has been properly exported into your
>> environment by executing:
>>
>> karaf@root> exports | grep com.tibco.tibjms.naming
>>
>>
>>
>> Please let me know what happens.
>>
>>
>>
>> ----- Original Message -----
>>
>>
>>
>>

Re: karaf and tibco ems

Posted by surya aditya <su...@gmail.com>.
Hi:

Tried the following:

1. MyApp bundle does import the "com.tibco.tibjms.naming" package. I still
get 'ClassNotFound' exception, double checked if the tibco ems libraray jar
has the file in questions and it does. Fyi Tibco Ems jar is copied into
/deploy folder. Tibco Ems bundle is active, on doing 'headers' i see
everything is ok. no red lines. verified using 'imports' as well.

2. 'headers' on MyApp bundle is clean as well. This bundle has created
manifest.mf and looks ok on manual inspection as well.

Problem still persists "Cannot instantiate class:
com.tibco.tibjms.naming.TibjmsInitialContextFactory
[Root exception is java.lang.ClassNotFoundException:
com.tibco.tibjms.naming.TibjmsInitialContextFactory]"

Any other pointers to look into will be helpful? this looks straight
forward use case where i am trying to connect to EMS server, sure I guess
this is doable in Karaf, just need to get things in right place I hope.

Appreciate any further help.

regards,
Surya





On Thu, Dec 1, 2011 at 3:53 PM, mikevan <mv...@comcast.net> wrote:

>
>
> Andreas,
>
>
>
> It looks like it should from reading his Import-Package statement.
> However, if the maven-bundle-plugin isn't working, it wouldn't be creating
> the MANIFEST.MF file properly.  Perhaps he should look at the .jar file
> created to verify that the MANIFEST.MF is actually being created.
> Alternatively, the headers command should show what the bundle thinks it
> should be looking for.  Additionally, the imports command could be used to
> verify this also.
>
>
>
> ----- Original Message -----
>
>
> From: "Andreas Pieber [via Karaf]" <
> ml-node+s922171n3552816h48@n3.nabble.com>
> To: "mikevan" <mv...@comcast.net>
> Sent: Thursday, December 1, 2011 3:49:41 PM
> Subject: Re: karaf and tibco ems
>
>
>
> Sorry for the standard question, but does the bundle containing the code
> you've posted in your first mail imports com.tibco.tibjms.naming?
>
> Kind regards Andreas
> On Dec 1, 2011 9:31 PM, "surya aditya" < [hidden email] > wrote:
>
>
> I verified the class exists in jar. on executing the  'exports'. I get the
> following:
>
>
> karaf@root> exports | grep com.tibco.tibjms
>    45 com.tibco.tibjms; version=0.0.0
>    45 com.tibco.tibjms.naming; version=0.0.0
>    45 com.tibco.tibjms.naming. tibjmsnaming; version=0.0.0
>
>
>
>
> i see version=0.0.0, but MyApp does not specify any version on imports!
> should that be the issue here? thanks for helping again.
>
>
> from bundles:headers on  my application jar:
> Import-Package =
>        com.google.inject;version="[1. 3,2)",
>        com.google.inject.binder; version="[1.3,2)",
>          com.google.inject.name  ; version="[1.3,2)",
>        com.tibco.tibjms,
>        com.tibco.tibjms.naming,
>        com.tibco.tibjms.naming. tibjmsnaming,
>        javax.jms,........................
>
>
> regards,
> Surya
>
>
>
>
>
> On Thu, Dec 1, 2011 at 3:25 PM, mikevan < [hidden email] > wrote:
>
> <blockquote>
>
>
> First, try to manually verify that the tibco jar file you're using
> actually contains the correct class: com.tibco.tibjms.naming.
> TibjmsInitialContextFactory .  Once you've done that, if the class is
> present, verify that the package has been properly exported into your
> environment by executing:
>
> karaf@root> exports | grep com.tibco.tibjms.naming
>
>
>
> Please let me know what happens.
>
>
>
> ----- Original Message -----
>
>
>
>

Re: karaf and tibco ems

Posted by mikevan <mv...@comcast.net>.

Andreas, 



It looks like it should from reading his Import-Package statement. However, if the maven-bundle-plugin isn't working, it wouldn't be creating the MANIFEST.MF file properly.  Perhaps he should look at the .jar file created to verify that the MANIFEST.MF is actually being created. Alternatively, the headers command should show what the bundle thinks it should be looking for.  Additionally, the imports command could be used to verify this also. 



----- Original Message -----


From: "Andreas Pieber [via Karaf]" <ml...@n3.nabble.com> 
To: "mikevan" <mv...@comcast.net> 
Sent: Thursday, December 1, 2011 3:49:41 PM 
Subject: Re: karaf and tibco ems 



Sorry for the standard question, but does the bundle containing the code you've posted in your first mail imports com.tibco.tibjms.naming? 

Kind regards Andreas 
On Dec 1, 2011 9:31 PM, "surya aditya" < [hidden email] > wrote: 


I verified the class exists in jar. on executing the  'exports'. I get the following: 


karaf@root> exports | grep com.tibco.tibjms 
   45 com.tibco.tibjms; version=0.0.0 
   45 com.tibco.tibjms.naming; version=0.0.0 
   45 com.tibco.tibjms.naming. tibjmsnaming; version=0.0.0 




i see version=0.0.0, but MyApp does not specify any version on imports! should that be the issue here? thanks for helping again. 


from bundles:headers on  my application jar: 
Import-Package = 
       com.google.inject;version="[1. 3,2)", 
       com.google.inject.binder; version="[1.3,2)", 
         com.google.inject.name  ; version="[1.3,2)", 
       com.tibco.tibjms, 
       com.tibco.tibjms.naming, 
       com.tibco.tibjms.naming. tibjmsnaming, 
       javax.jms,........................ 


regards, 
Surya 





On Thu, Dec 1, 2011 at 3:25 PM, mikevan < [hidden email] > wrote: 

<blockquote>


First, try to manually verify that the tibco jar file you're using actually contains the correct class: com.tibco.tibjms.naming. TibjmsInitialContextFactory .  Once you've done that, if the class is present, verify that the package has been properly exported into your environment by executing: 

karaf@root> exports | grep com.tibco.tibjms.naming 



Please let me know what happens. 



----- Original Message ----- 


From: "surya aditya [via Karaf]" < [hidden email] > 
To: "mikevan" < [hidden email] > 
Sent: Thursday, December 1, 2011 3:17:46 PM 
Subject: Re: karaf and tibco ems 


Hi Mike: 


Thanks for looking into it. Please see the stack trace. I have this working in non-karaf environment. I am in process of migrating it to Karaf and having this issues. 


javax.naming. NoInitialContextException: Cannot instantiate class: com.tibco.tibj 

ms.naming. TibjmsInitialContextFactory [Root exception is java.lang.ClassNotFound 
Exception: com.tibco.tibjms.naming. TibjmsInitialContextFactory] 
       at javax.naming.spi. NamingManager. getInitialContext( NamingManager.java:6 
57) 
       at javax.naming.InitialContext. getDefaultInitCtx( InitialContext.java:288 
) 
       at javax.naming.InitialContext. init(InitialContext.java:223) 


       at javax.naming.InitialContext.< init>(InitialContext.java:197) 
       at com.myapp..osgi. module.EmsResourceModule.jms( EmsResourceMo 
dule.java:64) 
       at sun.reflect. NativeMethodAccessorImpl. invoke0(Native Method) 
       at sun.reflect. NativeMethodAccessorImpl. invoke( NativeMethodAccessorImpl. 
java:39) 
       at sun.reflect. DelegatingMethodAccessorImpl. invoke(DelegatingMethodAcces 
sorImpl.java:25) 
       at java.lang.reflect.Method. invoke(Method.java:597) 
       at com.google.inject.internal. ProviderMethod.get( ProviderMethod.java:104 
) 
       at com.google.inject.internal. InternalFactoryToProviderAdapt er.get(Inter 
nalFactoryToProviderAdapter. java:40) 
       at com.google.inject.internal. ProviderToInternalFactoryAdapt er$1.call(Pr 
oviderToInternalFactoryAdapter .java:46) 
       at com.google.inject.internal. InjectorImpl.callInContext( InjectorImpl.ja 
va:1031) 
       at com.google.inject.internal. ProviderToInternalFactoryAdapt er.get(Provi 
derToInternalFactoryAdapter. java:40) 
       at com.google.inject.Scopes$1$1. get(Scopes.java:65) 
       at com.google.inject.internal. InternalFactoryToProviderAdapt er.get(Inter 
nalFactoryToProviderAdapter. java:40) 
       at com.google.inject.internal. InjectorImpl$4$1.call( InjectorImpl.java:97 
8) 
       at com.google.inject.internal. InjectorImpl.callInContext( InjectorImpl.ja 
va:1024) 
       at com.google.inject.internal. InjectorImpl$4.get( InjectorImpl.java:974) 
       at org.guiceyfruit.jndi.internal. JndiContext.lookup( JndiContext.java:225 
) 
       at org.apache.camel.impl. JndiRegistry.lookup( JndiRegistry.java:65) 
       at org.apache.camel.impl. PropertyPlaceholderDelegateReg istry.lookup(Prop 
ertyPlaceholderDelegateRegistr y.java:45) 
       at org.apache.camel.core.osgi. OsgiComponentResolver. resolveComponent(Osg 
iComponentResolver.java:42) 
       at org.apache.camel.impl. DefaultCamelContext. getComponent(DefaultCamelCo 
ntext.java:292) 
       at org.apache.camel.impl. DefaultCamelContext. getEndpoint(DefaultCamelCon 
text.java:420) 
       at org.apache.camel.util. CamelContextHelper. getMandatoryEndpoint(CamelCo 
ntextHelper.java:48) 
       at org.apache.camel.model. RouteDefinition. resolveEndpoint(RouteDefinitio 
n.java:180) 
       at org.apache.camel.impl. DefaultRouteContext. resolveEndpoint(DefaultRout 
eContext.java:110) 
       at org.apache.camel.impl. DefaultRouteContext. resolveEndpoint(DefaultRout 
eContext.java:116) 
       at org.apache.camel.model. FromDefinition. resolveEndpoint( FromDefinition. 
java:72) 
       at org.apache.camel.impl. DefaultRouteContext. getEndpoint(DefaultRouteCon 
text.java:88) 
       at org.apache.camel.model. RouteDefinition.addRoutes( RouteDefinition.java 
:798) 
       at org.apache.camel.model. RouteDefinition.addRoutes( RouteDefinition.java 
:165) 
       at org.apache.camel.impl. DefaultCamelContext. startRoute(DefaultCamelCont 
ext.java:697) 
       at org.apache.camel.impl. DefaultCamelContext. startRouteDefinitions(Defau 
ltCamelContext.java:1654) 
       at org.apache.camel.impl. DefaultCamelContext. doStartCamel(DefaultCamelCo 
ntext.java:1441) 
       at org.apache.camel.impl. DefaultCamelContext.doStart( DefaultCamelContext 
.java:1338) 
       at org.apache.camel.impl. ServiceSupport.start( ServiceSupport.java:67) 
       at org.apache.camel.impl. ServiceSupport.start( ServiceSupport.java:54) 
       at org.apache.camel.impl. DefaultCamelContext.start( DefaultCamelContext.j 
ava:1316) 
       at com.myapp.osgi. config.MyAppOsgiActivator. start(MyAppO 
sgiActivator.java:28) 
       at org.apache.felix.framework. util.SecureAction. startActivator(SecureAct 
ion.java:629) 
       at org.apache.felix.framework. Felix.activateBundle(Felix. java:1842) 
       at org.apache.felix.framework. Felix.startBundle(Felix.java: 1759) 
       at org.apache.felix.framework. Felix.updateBundle(Felix.java: 2091) 
       at org.apache.felix.framework. BundleImpl.update(BundleImpl. java:936) 
       at org.apache.felix.framework. BundleImpl.update(BundleImpl. java:923) 
       at org.apache.karaf.shell.osgi. UpdateBundle.doExecute( UpdateBundle.java: 
37) 
       at org.apache.karaf.shell.osgi. BundleCommand.doExecute( BundleCommand.jav 
a:42) 
       at org.apache.karaf.shell. console.OsgiCommandSupport. execute(OsgiCommand 
Support.java:38) 
       at org.apache.felix.gogo. commands.basic. AbstractCommand.execute( Abstract 
Command.java:35) 
       at org.apache.felix.gogo.runtime. CommandProxy.execute( CommandProxy.java: 
78) 
       at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure. java:474) 
       at org.apache.felix.gogo.runtime. Closure.executeStatement( Closure.java:4 
00) 
       at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120) 
       at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure. java:474) 
       at org.apache.felix.gogo.runtime. Closure.executeStatement( Closure.java:4 
00) 
       at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120) 
       at org.apache.felix.gogo.runtime. CommandSessionImpl.execute( CommandSessi 
onImpl.java:89) 
       at org.apache.karaf.shell. console.jline.Console.run( Console.java:218) 
       at java.lang.Thread.run(Thread. java:619) 
Caused by: java.lang. ClassNotFoundException: com.tibco.tibjms.naming. TibjmsIniti 
alContextFactory 
       at java.lang.Class.forName0( Native Method) 
       at java.lang.Class.forName(Class. java:247) 
       at com.sun.naming.internal. VersionHelper12.loadClass( VersionHelper12.jav 
a:46) 
       at javax.naming.spi. NamingManager. getInitialContext( NamingManager.java:6 
54) 
       ... 64 more 



On Thu, Dec 1, 2011 at 2:54 PM, mikevan < [hidden email] > wrote: 




surya, 



I think I know what the issue is, but to confirm it, could you please send the full exception you are getting to this user-group? 



----- Original Message ----- 


From: "surya aditya [via Karaf]" < [hidden email] > 
To: "mikevan" < [hidden email] > 


Sent: Thursday, December 1, 2011 2:51:02 PM 
Subject: karaf and tibco ems 


Hello Friends: 


I am trying to setup using the following stack: 


1. karaf 2.2.4 
2. camel 2.8.2 
3. tibco ems 5.0 
5. spring 3.0.6 


to enable camel route to recieve messages from JMS queue setup on EMS server, i am trying to instantiate camel jms component. 
However, i am getting following error for "ClassNotFoundException" 


I had to put tibco jar  tibjms-5.0 in deploy folder as it is not osgi comapatible. karaf wrapped it and shows 'active' status. 


I am loading the bundles in correct order to my knowledge and on bundles:headers i see the packages are being exported/imported correctly. See below for headers from bundles. 


See the following exception and I am stuck at this point, has anyone tried used  Tibco EMS on OSGI/Karaf ? Please suggest. 


Cannot instantiate class: com.tibco.tibjms.naming. TibjmsInitialContextFactory [Root exception is java.lang. ClassNotFoundException: com.tibco.tibjms.naming. TibjmsInitialContextFactory] 


application code: 


 Hashtable<String, String> env = new Hashtable<String, String>(); 
               env.put(Context.INITIAL_ CONTEXT_FACTORY, 
                               "com.tibco.tibjms.naming. TibjmsInitialContextFactory"); 
               env.put(Context.PROVIDER_URL, "tibjmsnaming:// vm-bda2-d889.nam.nsroot.net:7222 "); 
               // env.put(Context.SECURITY_ PRINCIPAL, "user"); 
               // env.put(Context.SECURITY_ CREDENTIALS, "password"); 

               Context ctx = new InitialContext(env); 
               TibjmsConnectionFactory emsConnectionFactory = (TibjmsConnectionFactory) ctx 
                               .lookup("tml2.inbound. ConnectionFactory"); 

               System.out.println(" JMSCOMpononet....."); 
                log.info ("## Creating JMS Component ##"); 


               JmsComponent jms = new JmsComponent(); 
               jms.setConnectionFactory( emsConnectionFactory); 
               jms.setConcurrentConsumers(5); 


for Tibco Ems Jar: 


Import-Package = 
       com.tibco.security;resolution: =optional, 
       com.tibco.security.ocsp; resolution:=optional, 
       com.tibco.security.ssl; resolution:=optional, 
       com.tibco.tibjms;resolution:= optional, 
       com.tibco.tibjms.naming; resolution:=optional, 
       com.tibco.tibjms.naming. tibjmsnaming;resolution:= optional, 
       javax.jms;resolution:= optional, 
       javax.naming;resolution:= optional, 
       javax.naming.directory; resolution:=optional, 
       javax.naming.spi;resolution:= optional, 
       javax.transaction.xa; resolution:=optional, 
       javax.xml.parsers;resolution:= optional, 
       javax.xml.transform; resolution:=optional, 
       javax.xml.transform.dom; resolution:=optional, 
       javax.xml.transform.stream; resolution:=optional, 
       org.w3c.dom;resolution:= optional, 
       org.xml.sax;resolution:= optional, 
       org.xml.sax.helpers; resolution:=optional 
Export-Package = 
       com.tibco.tibjms; 
               uses:="javax.jms, 
                       javax.naming, 
                       javax.xml.transform, 
                       javax.xml.transform.stream, 
                       javax.xml.parsers, 
                       javax.xml.transform.dom, 
                       org.w3c.dom, 
                       com.tibco.tibjms.naming, 
                       org.xml.sax.helpers, 
                       org.xml.sax, 
                       com.tibco.security.ssl, 
                       com.tibco.security, 
                       javax.transaction.xa, 
                       com.tibco.security.ocsp", 
       com.tibco.tibjms.naming; 
               uses:="javax.naming, 
                       javax.naming.directory, 
                       com.tibco.tibjms, 
                       org.xml.sax.helpers, 
                       javax.naming.spi, 
                       javax.jms", 
       com.tibco.tibjms.naming. tibjmsnaming; 
               uses:="javax.naming, 
                       com.tibco.tibjms.naming, 
                       javax.naming.spi" 




for my application jar: 


Import-Package = 
       com.google.inject;version="[1. 3,2)", 

       com.google.inject.binder; version="[1.3,2)", 
        com.google.inject.name ; version="[1.3,2)", 
       com.tibco.tibjms, 
       com.tibco.tibjms.naming, 
       com.tibco.tibjms.naming. tibjmsnaming, 
       javax.jms, 
       javax.naming, 
       org.apache.camel;version="[2. 8,3)", 
       org.apache.camel.builder; version="[2.8,3)", 
       org.apache.camel.component. jms;version="[2.8,3)", 

       org.apache.camel.core.osgi; version="[2.8,3)", 
       org.apache.camel.guice; version="[2.8,3)", 
       org.apache.camel.impl;version= "[2.8,3)", 
       org.apache.camel.model; version="[2.8,3)", 
       org.apache.camel.spi;version=" [2.8,3)", 
       org.guiceyfruit.jndi;version=" [2.0,3)", 
       org.guiceyfruit.jndi.internal; version="[2.0,3)", 
       org.osgi.framework;version="[ 1.5,2)", 
       org.slf4j;version="[1.6,2)" 




If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552646.html 
To start a new topic under Karaf - User, email [hidden email] 

To unsubscribe from Karaf - User, click here . 
NAML 

----- 
Mike Van  (All links open in new tabs) 
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
-- 
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552656.html 
Sent from the Karaf - User mailing list archive at Nabble.com. 








If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552722.html 

To start a new topic under Karaf - User, email [hidden email] 
To unsubscribe from Karaf - User, click here . 
NAML 

----- 
Mike Van  (All links open in new tabs) 
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
-- 
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552742.html 


Sent from the Karaf - User mailing list archive at Nabble.com. 




</blockquote>





If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552816.html 
To start a new topic under Karaf - User, email ml-node+s922171n930749h71@n3.nabble.com 
To unsubscribe from Karaf - User, click here . 
NAML

-----
Mike Van  (All links open in new tabs)
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552830.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf and tibco ems

Posted by Andreas Pieber <an...@gmail.com>.
Sorry for the standard question, but does the bundle containing the code
you've posted in your first mail imports com.tibco.tibjms.naming?

Kind regards Andreas
On Dec 1, 2011 9:31 PM, "surya aditya" <su...@gmail.com> wrote:

> I verified the class exists in jar. on executing the  'exports'. I get the
> following:
>
> karaf@root> exports | grep com.tibco.tibjms
>    45 com.tibco.tibjms; version=0.0.0
>    45 com.tibco.tibjms.naming; version=0.0.0
>    45 com.tibco.tibjms.naming.tibjmsnaming; version=0.0.0
>
>
> i see version=0.0.0, but MyApp does not specify any version on imports!
> should that be the issue here? thanks for helping again.
>
> from bundles:headers on  my application jar:
> Import-Package =
>        com.google.inject;version="[1. 3,2)",
>        com.google.inject.binder; version="[1.3,2)",
>         com.google.inject.name ; version="[1.3,2)",
>        com.tibco.tibjms,
>        com.tibco.tibjms.naming,
>        com.tibco.tibjms.naming. tibjmsnaming,
>        javax.jms,........................
>
> regards,
> Surya
>
>
>
> On Thu, Dec 1, 2011 at 3:25 PM, mikevan <mv...@comcast.net> wrote:
>
>>
>>
>> First, try to manually verify that the tibco jar file you're using
>> actually contains the correct class: com.tibco.tibjms.naming.
>> TibjmsInitialContextFactory .  Once you've done that, if the class is
>> present, verify that the package has been properly exported into your
>> environment by executing:
>>
>> karaf@root> exports | grep com.tibco.tibjms.naming
>>
>>
>>
>> Please let me know what happens.
>>
>>
>>
>> ----- Original Message -----
>>
>>
>> From: "surya aditya [via Karaf]" <
>> ml-node+s922171n3552722h34@n3.nabble.com>
>> To: "mikevan" <mv...@comcast.net>
>> Sent: Thursday, December 1, 2011 3:17:46 PM
>> Subject: Re: karaf and tibco ems
>>
>> Hi Mike:
>>
>>
>> Thanks for looking into it. Please see the stack trace. I have this
>> working in non-karaf environment. I am in process of migrating it to Karaf
>> and having this issues.
>>
>>
>> javax.naming. NoInitialContextException: Cannot instantiate class:
>> com.tibco.tibj
>> ms.naming. TibjmsInitialContextFactory [Root exception is
>> java.lang.ClassNotFound
>> Exception: com.tibco.tibjms.naming. TibjmsInitialContextFactory]
>>        at javax.naming.spi. NamingManager. getInitialContext(
>> NamingManager.java:6
>> 57)
>>        at javax.naming.InitialContext. getDefaultInitCtx(
>> InitialContext.java:288
>> )
>>        at javax.naming.InitialContext. init(InitialContext.java:223)
>>        at javax.naming.InitialContext.< init>(InitialContext.java:197)
>>        at com.myapp..osgi. module.EmsResourceModule.jms( EmsResourceMo
>> dule.java:64)
>>        at sun.reflect. NativeMethodAccessorImpl. invoke0(Native Method)
>>        at sun.reflect. NativeMethodAccessorImpl. invoke(
>> NativeMethodAccessorImpl.
>> java:39)
>>        at sun.reflect. DelegatingMethodAccessorImpl.
>> invoke(DelegatingMethodAcces
>> sorImpl.java:25)
>>        at java.lang.reflect.Method. invoke(Method.java:597)
>>        at com.google.inject.internal. ProviderMethod.get(
>> ProviderMethod.java:104
>> )
>>        at com.google.inject.internal. InternalFactoryToProviderAdapt
>> er.get(Inter
>> nalFactoryToProviderAdapter. java:40)
>>        at com.google.inject.internal. ProviderToInternalFactoryAdapt
>> er$1.call(Pr
>> oviderToInternalFactoryAdapter .java:46)
>>        at com.google.inject.internal. InjectorImpl.callInContext(
>> InjectorImpl.ja
>> va:1031)
>>        at com.google.inject.internal. ProviderToInternalFactoryAdapt
>> er.get(Provi
>> derToInternalFactoryAdapter. java:40)
>>        at com.google.inject.Scopes$1$1. get(Scopes.java:65)
>>        at com.google.inject.internal. InternalFactoryToProviderAdapt
>> er.get(Inter
>> nalFactoryToProviderAdapter. java:40)
>>        at com.google.inject.internal. InjectorImpl$4$1.call(
>> InjectorImpl.java:97
>> 8)
>>        at com.google.inject.internal. InjectorImpl.callInContext(
>> InjectorImpl.ja
>> va:1024)
>>        at com.google.inject.internal. InjectorImpl$4.get(
>> InjectorImpl.java:974)
>>        at org.guiceyfruit.jndi.internal. JndiContext.lookup(
>> JndiContext.java:225
>> )
>>        at org.apache.camel.impl. JndiRegistry.lookup(
>> JndiRegistry.java:65)
>>        at org.apache.camel.impl. PropertyPlaceholderDelegateReg
>> istry.lookup(Prop
>> ertyPlaceholderDelegateRegistr y.java:45)
>>        at org.apache.camel.core.osgi. OsgiComponentResolver.
>> resolveComponent(Osg
>> iComponentResolver.java:42)
>>        at org.apache.camel.impl. DefaultCamelContext.
>> getComponent(DefaultCamelCo
>> ntext.java:292)
>>        at org.apache.camel.impl. DefaultCamelContext.
>> getEndpoint(DefaultCamelCon
>> text.java:420)
>>        at org.apache.camel.util. CamelContextHelper.
>> getMandatoryEndpoint(CamelCo
>> ntextHelper.java:48)
>>        at org.apache.camel.model. RouteDefinition.
>> resolveEndpoint(RouteDefinitio
>> n.java:180)
>>        at org.apache.camel.impl. DefaultRouteContext.
>> resolveEndpoint(DefaultRout
>> eContext.java:110)
>>        at org.apache.camel.impl. DefaultRouteContext.
>> resolveEndpoint(DefaultRout
>> eContext.java:116)
>>        at org.apache.camel.model. FromDefinition. resolveEndpoint(
>> FromDefinition.
>> java:72)
>>        at org.apache.camel.impl. DefaultRouteContext.
>> getEndpoint(DefaultRouteCon
>> text.java:88)
>>        at org.apache.camel.model. RouteDefinition.addRoutes(
>> RouteDefinition.java
>> :798)
>>        at org.apache.camel.model. RouteDefinition.addRoutes(
>> RouteDefinition.java
>> :165)
>>        at org.apache.camel.impl. DefaultCamelContext.
>> startRoute(DefaultCamelCont
>> ext.java:697)
>>        at org.apache.camel.impl. DefaultCamelContext.
>> startRouteDefinitions(Defau
>> ltCamelContext.java:1654)
>>        at org.apache.camel.impl. DefaultCamelContext.
>> doStartCamel(DefaultCamelCo
>> ntext.java:1441)
>>        at org.apache.camel.impl. DefaultCamelContext.doStart(
>> DefaultCamelContext
>> .java:1338)
>>        at org.apache.camel.impl. ServiceSupport.start(
>> ServiceSupport.java:67)
>>        at org.apache.camel.impl. ServiceSupport.start(
>> ServiceSupport.java:54)
>>        at org.apache.camel.impl. DefaultCamelContext.start(
>> DefaultCamelContext.j
>> ava:1316)
>>        at com.myapp.osgi. config.MyAppOsgiActivator. start(MyAppO
>> sgiActivator.java:28)
>>        at org.apache.felix.framework. util.SecureAction.
>> startActivator(SecureAct
>> ion.java:629)
>>        at org.apache.felix.framework. Felix.activateBundle(Felix.
>> java:1842)
>>        at org.apache.felix.framework. Felix.startBundle(Felix.java: 1759)
>>        at org.apache.felix.framework. Felix.updateBundle(Felix.java: 2091)
>>        at org.apache.felix.framework. BundleImpl.update(BundleImpl.
>> java:936)
>>        at org.apache.felix.framework. BundleImpl.update(BundleImpl.
>> java:923)
>>        at org.apache.karaf.shell.osgi. UpdateBundle.doExecute(
>> UpdateBundle.java:
>> 37)
>>        at org.apache.karaf.shell.osgi. BundleCommand.doExecute(
>> BundleCommand.jav
>> a:42)
>>        at org.apache.karaf.shell. console.OsgiCommandSupport.
>> execute(OsgiCommand
>> Support.java:38)
>>        at org.apache.felix.gogo. commands.basic. AbstractCommand.execute(
>> Abstract
>> Command.java:35)
>>        at org.apache.felix.gogo.runtime. CommandProxy.execute(
>> CommandProxy.java:
>> 78)
>>        at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure.
>> java:474)
>>        at org.apache.felix.gogo.runtime. Closure.executeStatement(
>> Closure.java:4
>> 00)
>>        at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108)
>>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java:
>> 183)
>>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java:
>> 120)
>>        at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure.
>> java:474)
>>        at org.apache.felix.gogo.runtime. Closure.executeStatement(
>> Closure.java:4
>> 00)
>>        at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108)
>>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java:
>> 183)
>>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java:
>> 120)
>>        at org.apache.felix.gogo.runtime. CommandSessionImpl.execute(
>> CommandSessi
>> onImpl.java:89)
>>        at org.apache.karaf.shell. console.jline.Console.run(
>> Console.java:218)
>>        at java.lang.Thread.run(Thread. java:619)
>> Caused by: java.lang. ClassNotFoundException: com.tibco.tibjms.naming.
>> TibjmsIniti
>> alContextFactory
>>        at java.lang.Class.forName0( Native Method)
>>        at java.lang.Class.forName(Class. java:247)
>>        at com.sun.naming.internal. VersionHelper12.loadClass(
>> VersionHelper12.jav
>> a:46)
>>        at javax.naming.spi. NamingManager. getInitialContext(
>> NamingManager.java:6
>> 54)
>>        ... 64 more
>>
>>
>> On Thu, Dec 1, 2011 at 2:54 PM, mikevan < [hidden email] > wrote:
>>
>>
>>
>>
>> surya,
>>
>>
>>
>> I think I know what the issue is, but to confirm it, could you please
>> send the full exception you are getting to this user-group?
>>
>>
>>
>> ----- Original Message -----
>>
>>
>> From: "surya aditya [via Karaf]" < [hidden email] >
>> To: "mikevan" < [hidden email] >
>> Sent: Thursday, December 1, 2011 2:51:02 PM
>> Subject: karaf and tibco ems
>>
>>
>> Hello Friends:
>>
>>
>> I am trying to setup using the following stack:
>>
>>
>> 1. karaf 2.2.4
>> 2. camel 2.8.2
>> 3. tibco ems 5.0
>> 5. spring 3.0.6
>>
>>
>> to enable camel route to recieve messages from JMS queue setup on EMS
>> server, i am trying to instantiate camel jms component.
>> However, i am getting following error for "ClassNotFoundException"
>>
>>
>> I had to put tibco jar  tibjms-5.0 in deploy folder as it is not osgi
>> comapatible. karaf wrapped it and shows 'active' status.
>>
>>
>> I am loading the bundles in correct order to my knowledge and on
>> bundles:headers i see the packages are being exported/imported correctly.
>> See below for headers from bundles.
>>
>>
>> See the following exception and I am stuck at this point, has anyone
>> tried used  Tibco EMS on OSGI/Karaf ? Please suggest.
>>
>>
>> Cannot instantiate class: com.tibco.tibjms.naming.
>> TibjmsInitialContextFactory [Root exception is java.lang.
>> ClassNotFoundException: com.tibco.tibjms.naming.
>> TibjmsInitialContextFactory]
>>
>>
>> application code:
>>
>>
>>  Hashtable<String, String> env = new Hashtable<String, String>();
>>                env.put(Context.INITIAL_ CONTEXT_FACTORY,
>>                                "com.tibco.tibjms.naming.
>> TibjmsInitialContextFactory");
>>                env.put(Context.PROVIDER_URL, "tibjmsnaming://
>> vm-bda2-d889.nam.nsroot.net:7222 ");
>>                // env.put(Context.SECURITY_ PRINCIPAL, "user");
>>                // env.put(Context.SECURITY_ CREDENTIALS, "password");
>>
>>                Context ctx = new InitialContext(env);
>>                TibjmsConnectionFactory emsConnectionFactory =
>> (TibjmsConnectionFactory) ctx
>>                                .lookup("tml2.inbound. ConnectionFactory");
>>
>>                System.out.println(" JMSCOMpononet.....");
>>                 log.info ("## Creating JMS Component ##");
>>
>>
>>                JmsComponent jms = new JmsComponent();
>>                jms.setConnectionFactory( emsConnectionFactory);
>>                jms.setConcurrentConsumers(5);
>>
>>
>> for Tibco Ems Jar:
>>
>>
>> Import-Package =
>>        com.tibco.security;resolution: =optional,
>>        com.tibco.security.ocsp; resolution:=optional,
>>        com.tibco.security.ssl; resolution:=optional,
>>        com.tibco.tibjms;resolution:= optional,
>>        com.tibco.tibjms.naming; resolution:=optional,
>>        com.tibco.tibjms.naming. tibjmsnaming;resolution:= optional,
>>        javax.jms;resolution:= optional,
>>        javax.naming;resolution:= optional,
>>        javax.naming.directory; resolution:=optional,
>>        javax.naming.spi;resolution:= optional,
>>        javax.transaction.xa; resolution:=optional,
>>        javax.xml.parsers;resolution:= optional,
>>        javax.xml.transform; resolution:=optional,
>>        javax.xml.transform.dom; resolution:=optional,
>>        javax.xml.transform.stream; resolution:=optional,
>>        org.w3c.dom;resolution:= optional,
>>        org.xml.sax;resolution:= optional,
>>        org.xml.sax.helpers; resolution:=optional
>> Export-Package =
>>        com.tibco.tibjms;
>>                uses:="javax.jms,
>>                        javax.naming,
>>                        javax.xml.transform,
>>                        javax.xml.transform.stream,
>>                        javax.xml.parsers,
>>                        javax.xml.transform.dom,
>>                        org.w3c.dom,
>>                        com.tibco.tibjms.naming,
>>                        org.xml.sax.helpers,
>>                        org.xml.sax,
>>                        com.tibco.security.ssl,
>>                        com.tibco.security,
>>                        javax.transaction.xa,
>>                        com.tibco.security.ocsp",
>>        com.tibco.tibjms.naming;
>>                uses:="javax.naming,
>>                        javax.naming.directory,
>>                        com.tibco.tibjms,
>>                        org.xml.sax.helpers,
>>                        javax.naming.spi,
>>                        javax.jms",
>>        com.tibco.tibjms.naming. tibjmsnaming;
>>                uses:="javax.naming,
>>                        com.tibco.tibjms.naming,
>>                        javax.naming.spi"
>>
>>
>>
>>
>> for my application jar:
>>
>>
>> Import-Package =
>>        com.google.inject;version="[1. 3,2)",
>>
>>        com.google.inject.binder; version="[1.3,2)",
>>         com.google.inject.name ; version="[1.3,2)",
>>        com.tibco.tibjms,
>>        com.tibco.tibjms.naming,
>>        com.tibco.tibjms.naming. tibjmsnaming,
>>        javax.jms,
>>        javax.naming,
>>        org.apache.camel;version="[2. 8,3)",
>>        org.apache.camel.builder; version="[2.8,3)",
>>        org.apache.camel.component. jms;version="[2.8,3)",
>>
>>        org.apache.camel.core.osgi; version="[2.8,3)",
>>        org.apache.camel.guice; version="[2.8,3)",
>>        org.apache.camel.impl;version= "[2.8,3)",
>>        org.apache.camel.model; version="[2.8,3)",
>>        org.apache.camel.spi;version=" [2.8,3)",
>>        org.guiceyfruit.jndi;version=" [2.0,3)",
>>        org.guiceyfruit.jndi.internal; version="[2.0,3)",
>>        org.osgi.framework;version="[ 1.5,2)",
>>        org.slf4j;version="[1.6,2)"
>>
>>
>>
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552646.html
>> To start a new topic under Karaf - User, email [hidden email]
>> To unsubscribe from Karaf - User, click here .
>> NAML
>>
>> -----
>> Mike Van  (All links open in new tabs)
>> Committer - Kalumet
>>
>> Atraxia Technologies
>>
>> NCI Inc
>>
>> Mike Van's Open Source Technologies Blog
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552656.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>>
>>
>>
>>
>>
>>
>>
>> If you reply to this email, your message will be added to the discussion
>> below:
>> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552722.html
>> To start a new topic under Karaf - User, email
>> ml-node+s922171n930749h71@n3.nabble.com
>> To unsubscribe from Karaf - User, click here .
>> NAML
>>
>> -----
>> Mike Van  (All links open in new tabs)
>> Committer - Kalumet
>>
>> Atraxia Technologies
>>
>> NCI Inc
>>
>> Mike Van's Open Source Technologies Blog
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552742.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>

Re: karaf and tibco ems

Posted by mikevan <mv...@comcast.net>.

Surya, 



The version number isn't the issue. When you put a package without a version number in your Import-Packages section, and then deploy it into OSGi, per the spec, the OSGi container will look for version 0.0.0 and then increment up until it finds the first instance of that package.  Then, wiring will occur. 



So, the next thing we need to do is verify that wiring is occuring between your bundle and tibco.  To do this, locate the bundleId of your bundle (not tibco), and then type: 

karaf@root> headers <bundleId> 



This will tell you all of the wiring that's occuring. Doing this, you will see the bundles that aren't wired in red.  Also, have you looked into your tibco jar file to verify if that class exists in the location you're looking for it? I know some applications are shipped with multiple jar files that contain similar package structures. Its possible that the .jar file you're using may have the correct package, but may not have that specific class. 



----- Original Message -----


From: "surya aditya [via Karaf]" <ml...@n3.nabble.com> 
To: "mikevan" <mv...@comcast.net> 
Sent: Thursday, December 1, 2011 3:31:32 PM 
Subject: Re: karaf and tibco ems 

I verified the class exists in jar. on executing the  'exports'. I get the following: 


karaf@root> exports | grep com.tibco.tibjms 
   45 com.tibco.tibjms; version=0.0.0 
   45 com.tibco.tibjms.naming; version=0.0.0 
   45 com.tibco.tibjms.naming. tibjmsnaming; version=0.0.0 




i see version=0.0.0, but MyApp does not specify any version on imports! should that be the issue here? thanks for helping again. 


from bundles:headers on  my application jar: 
Import-Package = 
       com.google.inject;version="[1. 3,2)", 
       com.google.inject.binder; version="[1.3,2)", 
         com.google.inject.name  ; version="[1.3,2)", 
       com.tibco.tibjms, 
       com.tibco.tibjms.naming, 
       com.tibco.tibjms.naming. tibjmsnaming, 
       javax.jms,........................ 


regards, 
Surya 





On Thu, Dec 1, 2011 at 3:25 PM, mikevan < [hidden email] > wrote: 




First, try to manually verify that the tibco jar file you're using actually contains the correct class: com.tibco.tibjms.naming. TibjmsInitialContextFactory .  Once you've done that, if the class is present, verify that the package has been properly exported into your environment by executing: 

karaf@root> exports | grep com.tibco.tibjms.naming 



Please let me know what happens. 



----- Original Message ----- 


From: "surya aditya [via Karaf]" < [hidden email] > 
To: "mikevan" < [hidden email] > 
Sent: Thursday, December 1, 2011 3:17:46 PM 
Subject: Re: karaf and tibco ems 


Hi Mike: 


Thanks for looking into it. Please see the stack trace. I have this working in non-karaf environment. I am in process of migrating it to Karaf and having this issues. 


javax.naming. NoInitialContextException: Cannot instantiate class: com.tibco.tibj 

ms.naming. TibjmsInitialContextFactory [Root exception is java.lang.ClassNotFound 
Exception: com.tibco.tibjms.naming. TibjmsInitialContextFactory] 
       at javax.naming.spi. NamingManager. getInitialContext( NamingManager.java:6 
57) 
       at javax.naming.InitialContext. getDefaultInitCtx( InitialContext.java:288 
) 
       at javax.naming.InitialContext. init(InitialContext.java:223) 


       at javax.naming.InitialContext.< init>(InitialContext.java:197) 
       at com.myapp..osgi. module.EmsResourceModule.jms( EmsResourceMo 
dule.java:64) 
       at sun.reflect. NativeMethodAccessorImpl. invoke0(Native Method) 
       at sun.reflect. NativeMethodAccessorImpl. invoke( NativeMethodAccessorImpl. 
java:39) 
       at sun.reflect. DelegatingMethodAccessorImpl. invoke(DelegatingMethodAcces 
sorImpl.java:25) 
       at java.lang.reflect.Method. invoke(Method.java:597) 
       at com.google.inject.internal. ProviderMethod.get( ProviderMethod.java:104 
) 
       at com.google.inject.internal. InternalFactoryToProviderAdapt er.get(Inter 
nalFactoryToProviderAdapter. java:40) 
       at com.google.inject.internal. ProviderToInternalFactoryAdapt er$1.call(Pr 
oviderToInternalFactoryAdapter .java:46) 
       at com.google.inject.internal. InjectorImpl.callInContext( InjectorImpl.ja 
va:1031) 
       at com.google.inject.internal. ProviderToInternalFactoryAdapt er.get(Provi 
derToInternalFactoryAdapter. java:40) 
       at com.google.inject.Scopes$1$1. get(Scopes.java:65) 
       at com.google.inject.internal. InternalFactoryToProviderAdapt er.get(Inter 
nalFactoryToProviderAdapter. java:40) 
       at com.google.inject.internal. InjectorImpl$4$1.call( InjectorImpl.java:97 
8) 
       at com.google.inject.internal. InjectorImpl.callInContext( InjectorImpl.ja 
va:1024) 
       at com.google.inject.internal. InjectorImpl$4.get( InjectorImpl.java:974) 
       at org.guiceyfruit.jndi.internal. JndiContext.lookup( JndiContext.java:225 
) 
       at org.apache.camel.impl. JndiRegistry.lookup( JndiRegistry.java:65) 
       at org.apache.camel.impl. PropertyPlaceholderDelegateReg istry.lookup(Prop 
ertyPlaceholderDelegateRegistr y.java:45) 
       at org.apache.camel.core.osgi. OsgiComponentResolver. resolveComponent(Osg 
iComponentResolver.java:42) 
       at org.apache.camel.impl. DefaultCamelContext. getComponent(DefaultCamelCo 
ntext.java:292) 
       at org.apache.camel.impl. DefaultCamelContext. getEndpoint(DefaultCamelCon 
text.java:420) 
       at org.apache.camel.util. CamelContextHelper. getMandatoryEndpoint(CamelCo 
ntextHelper.java:48) 
       at org.apache.camel.model. RouteDefinition. resolveEndpoint(RouteDefinitio 
n.java:180) 
       at org.apache.camel.impl. DefaultRouteContext. resolveEndpoint(DefaultRout 
eContext.java:110) 
       at org.apache.camel.impl. DefaultRouteContext. resolveEndpoint(DefaultRout 
eContext.java:116) 
       at org.apache.camel.model. FromDefinition. resolveEndpoint( FromDefinition. 
java:72) 
       at org.apache.camel.impl. DefaultRouteContext. getEndpoint(DefaultRouteCon 
text.java:88) 
       at org.apache.camel.model. RouteDefinition.addRoutes( RouteDefinition.java 
:798) 
       at org.apache.camel.model. RouteDefinition.addRoutes( RouteDefinition.java 
:165) 
       at org.apache.camel.impl. DefaultCamelContext. startRoute(DefaultCamelCont 
ext.java:697) 
       at org.apache.camel.impl. DefaultCamelContext. startRouteDefinitions(Defau 
ltCamelContext.java:1654) 
       at org.apache.camel.impl. DefaultCamelContext. doStartCamel(DefaultCamelCo 
ntext.java:1441) 
       at org.apache.camel.impl. DefaultCamelContext.doStart( DefaultCamelContext 
.java:1338) 
       at org.apache.camel.impl. ServiceSupport.start( ServiceSupport.java:67) 
       at org.apache.camel.impl. ServiceSupport.start( ServiceSupport.java:54) 
       at org.apache.camel.impl. DefaultCamelContext.start( DefaultCamelContext.j 
ava:1316) 
       at com.myapp.osgi. config.MyAppOsgiActivator. start(MyAppO 
sgiActivator.java:28) 
       at org.apache.felix.framework. util.SecureAction. startActivator(SecureAct 
ion.java:629) 
       at org.apache.felix.framework. Felix.activateBundle(Felix. java:1842) 
       at org.apache.felix.framework. Felix.startBundle(Felix.java: 1759) 
       at org.apache.felix.framework. Felix.updateBundle(Felix.java: 2091) 
       at org.apache.felix.framework. BundleImpl.update(BundleImpl. java:936) 
       at org.apache.felix.framework. BundleImpl.update(BundleImpl. java:923) 
       at org.apache.karaf.shell.osgi. UpdateBundle.doExecute( UpdateBundle.java: 
37) 
       at org.apache.karaf.shell.osgi. BundleCommand.doExecute( BundleCommand.jav 
a:42) 
       at org.apache.karaf.shell. console.OsgiCommandSupport. execute(OsgiCommand 
Support.java:38) 
       at org.apache.felix.gogo. commands.basic. AbstractCommand.execute( Abstract 
Command.java:35) 
       at org.apache.felix.gogo.runtime. CommandProxy.execute( CommandProxy.java: 
78) 
       at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure. java:474) 
       at org.apache.felix.gogo.runtime. Closure.executeStatement( Closure.java:4 
00) 
       at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120) 
       at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure. java:474) 
       at org.apache.felix.gogo.runtime. Closure.executeStatement( Closure.java:4 
00) 
       at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120) 
       at org.apache.felix.gogo.runtime. CommandSessionImpl.execute( CommandSessi 
onImpl.java:89) 
       at org.apache.karaf.shell. console.jline.Console.run( Console.java:218) 
       at java.lang.Thread.run(Thread. java:619) 
Caused by: java.lang. ClassNotFoundException: com.tibco.tibjms.naming. TibjmsIniti 
alContextFactory 
       at java.lang.Class.forName0( Native Method) 
       at java.lang.Class.forName(Class. java:247) 
       at com.sun.naming.internal. VersionHelper12.loadClass( VersionHelper12.jav 
a:46) 
       at javax.naming.spi. NamingManager. getInitialContext( NamingManager.java:6 
54) 
       ... 64 more 



On Thu, Dec 1, 2011 at 2:54 PM, mikevan < [hidden email] > wrote: 




surya, 



I think I know what the issue is, but to confirm it, could you please send the full exception you are getting to this user-group? 



----- Original Message ----- 


From: "surya aditya [via Karaf]" < [hidden email] > 
To: "mikevan" < [hidden email] > 


Sent: Thursday, December 1, 2011 2:51:02 PM 
Subject: karaf and tibco ems 


Hello Friends: 


I am trying to setup using the following stack: 


1. karaf 2.2.4 
2. camel 2.8.2 
3. tibco ems 5.0 
5. spring 3.0.6 


to enable camel route to recieve messages from JMS queue setup on EMS server, i am trying to instantiate camel jms component. 
However, i am getting following error for "ClassNotFoundException" 


I had to put tibco jar  tibjms-5.0 in deploy folder as it is not osgi comapatible. karaf wrapped it and shows 'active' status. 


I am loading the bundles in correct order to my knowledge and on bundles:headers i see the packages are being exported/imported correctly. See below for headers from bundles. 


See the following exception and I am stuck at this point, has anyone tried used  Tibco EMS on OSGI/Karaf ? Please suggest. 


Cannot instantiate class: com.tibco.tibjms.naming. TibjmsInitialContextFactory [Root exception is java.lang. ClassNotFoundException: com.tibco.tibjms.naming. TibjmsInitialContextFactory] 


application code: 


 Hashtable<String, String> env = new Hashtable<String, String>(); 
               env.put(Context.INITIAL_ CONTEXT_FACTORY, 
                               "com.tibco.tibjms.naming. TibjmsInitialContextFactory"); 
               env.put(Context.PROVIDER_URL, "tibjmsnaming:// vm-bda2-d889.nam.nsroot.net:7222 "); 
               // env.put(Context.SECURITY_ PRINCIPAL, "user"); 
               // env.put(Context.SECURITY_ CREDENTIALS, "password"); 

               Context ctx = new InitialContext(env); 
               TibjmsConnectionFactory emsConnectionFactory = (TibjmsConnectionFactory) ctx 
                               .lookup("tml2.inbound. ConnectionFactory"); 

               System.out.println(" JMSCOMpononet....."); 
                log.info ("## Creating JMS Component ##"); 


               JmsComponent jms = new JmsComponent(); 
               jms.setConnectionFactory( emsConnectionFactory); 
               jms.setConcurrentConsumers(5); 


for Tibco Ems Jar: 


Import-Package = 
       com.tibco.security;resolution: =optional, 
       com.tibco.security.ocsp; resolution:=optional, 
       com.tibco.security.ssl; resolution:=optional, 
       com.tibco.tibjms;resolution:= optional, 
       com.tibco.tibjms.naming; resolution:=optional, 
       com.tibco.tibjms.naming. tibjmsnaming;resolution:= optional, 
       javax.jms;resolution:= optional, 
       javax.naming;resolution:= optional, 
       javax.naming.directory; resolution:=optional, 
       javax.naming.spi;resolution:= optional, 
       javax.transaction.xa; resolution:=optional, 
       javax.xml.parsers;resolution:= optional, 
       javax.xml.transform; resolution:=optional, 
       javax.xml.transform.dom; resolution:=optional, 
       javax.xml.transform.stream; resolution:=optional, 
       org.w3c.dom;resolution:= optional, 
       org.xml.sax;resolution:= optional, 
       org.xml.sax.helpers; resolution:=optional 
Export-Package = 
       com.tibco.tibjms; 
               uses:="javax.jms, 
                       javax.naming, 
                       javax.xml.transform, 
                       javax.xml.transform.stream, 
                       javax.xml.parsers, 
                       javax.xml.transform.dom, 
                       org.w3c.dom, 
                       com.tibco.tibjms.naming, 
                       org.xml.sax.helpers, 
                       org.xml.sax, 
                       com.tibco.security.ssl, 
                       com.tibco.security, 
                       javax.transaction.xa, 
                       com.tibco.security.ocsp", 
       com.tibco.tibjms.naming; 
               uses:="javax.naming, 
                       javax.naming.directory, 
                       com.tibco.tibjms, 
                       org.xml.sax.helpers, 
                       javax.naming.spi, 
                       javax.jms", 
       com.tibco.tibjms.naming. tibjmsnaming; 
               uses:="javax.naming, 
                       com.tibco.tibjms.naming, 
                       javax.naming.spi" 




for my application jar: 


Import-Package = 
       com.google.inject;version="[1. 3,2)", 

       com.google.inject.binder; version="[1.3,2)", 
        com.google.inject.name ; version="[1.3,2)", 
       com.tibco.tibjms, 
       com.tibco.tibjms.naming, 
       com.tibco.tibjms.naming. tibjmsnaming, 
       javax.jms, 
       javax.naming, 
       org.apache.camel;version="[2. 8,3)", 
       org.apache.camel.builder; version="[2.8,3)", 
       org.apache.camel.component. jms;version="[2.8,3)", 

       org.apache.camel.core.osgi; version="[2.8,3)", 
       org.apache.camel.guice; version="[2.8,3)", 
       org.apache.camel.impl;version= "[2.8,3)", 
       org.apache.camel.model; version="[2.8,3)", 
       org.apache.camel.spi;version=" [2.8,3)", 
       org.guiceyfruit.jndi;version=" [2.0,3)", 
       org.guiceyfruit.jndi.internal; version="[2.0,3)", 
       org.osgi.framework;version="[ 1.5,2)", 
       org.slf4j;version="[1.6,2)" 




If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552646.html 
To start a new topic under Karaf - User, email [hidden email] 

To unsubscribe from Karaf - User, click here . 
NAML 

----- 
Mike Van  (All links open in new tabs) 
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
-- 
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552656.html 
Sent from the Karaf - User mailing list archive at Nabble.com. 








If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552722.html 

To start a new topic under Karaf - User, email [hidden email] 
To unsubscribe from Karaf - User, click here . 
NAML 

----- 
Mike Van  (All links open in new tabs) 
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
-- 
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552742.html 


Sent from the Karaf - User mailing list archive at Nabble.com. 








If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552760.html 
To start a new topic under Karaf - User, email ml-node+s922171n930749h71@n3.nabble.com 
To unsubscribe from Karaf - User, click here . 
NAML

-----
Mike Van  (All links open in new tabs)
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552803.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf and tibco ems

Posted by surya aditya <su...@gmail.com>.
I verified the class exists in jar. on executing the  'exports'. I get the
following:

karaf@root> exports | grep com.tibco.tibjms
   45 com.tibco.tibjms; version=0.0.0
   45 com.tibco.tibjms.naming; version=0.0.0
   45 com.tibco.tibjms.naming.tibjmsnaming; version=0.0.0


i see version=0.0.0, but MyApp does not specify any version on imports!
should that be the issue here? thanks for helping again.

from bundles:headers on  my application jar:
Import-Package =
       com.google.inject;version="[1. 3,2)",
       com.google.inject.binder; version="[1.3,2)",
        com.google.inject.name ; version="[1.3,2)",
       com.tibco.tibjms,
       com.tibco.tibjms.naming,
       com.tibco.tibjms.naming. tibjmsnaming,
       javax.jms,........................

regards,
Surya



On Thu, Dec 1, 2011 at 3:25 PM, mikevan <mv...@comcast.net> wrote:

>
>
> First, try to manually verify that the tibco jar file you're using
> actually contains the correct class: com.tibco.tibjms.naming.
> TibjmsInitialContextFactory .  Once you've done that, if the class is
> present, verify that the package has been properly exported into your
> environment by executing:
>
> karaf@root> exports | grep com.tibco.tibjms.naming
>
>
>
> Please let me know what happens.
>
>
>
> ----- Original Message -----
>
>
> From: "surya aditya [via Karaf]" <ml-node+s922171n3552722h34@n3.nabble.com
> >
> To: "mikevan" <mv...@comcast.net>
> Sent: Thursday, December 1, 2011 3:17:46 PM
> Subject: Re: karaf and tibco ems
>
> Hi Mike:
>
>
> Thanks for looking into it. Please see the stack trace. I have this
> working in non-karaf environment. I am in process of migrating it to Karaf
> and having this issues.
>
>
> javax.naming. NoInitialContextException: Cannot instantiate class:
> com.tibco.tibj
> ms.naming. TibjmsInitialContextFactory [Root exception is
> java.lang.ClassNotFound
> Exception: com.tibco.tibjms.naming. TibjmsInitialContextFactory]
>        at javax.naming.spi. NamingManager. getInitialContext(
> NamingManager.java:6
> 57)
>        at javax.naming.InitialContext. getDefaultInitCtx(
> InitialContext.java:288
> )
>        at javax.naming.InitialContext. init(InitialContext.java:223)
>        at javax.naming.InitialContext.< init>(InitialContext.java:197)
>        at com.myapp..osgi. module.EmsResourceModule.jms( EmsResourceMo
> dule.java:64)
>        at sun.reflect. NativeMethodAccessorImpl. invoke0(Native Method)
>        at sun.reflect. NativeMethodAccessorImpl. invoke(
> NativeMethodAccessorImpl.
> java:39)
>        at sun.reflect. DelegatingMethodAccessorImpl.
> invoke(DelegatingMethodAcces
> sorImpl.java:25)
>        at java.lang.reflect.Method. invoke(Method.java:597)
>        at com.google.inject.internal. ProviderMethod.get(
> ProviderMethod.java:104
> )
>        at com.google.inject.internal. InternalFactoryToProviderAdapt
> er.get(Inter
> nalFactoryToProviderAdapter. java:40)
>        at com.google.inject.internal. ProviderToInternalFactoryAdapt
> er$1.call(Pr
> oviderToInternalFactoryAdapter .java:46)
>        at com.google.inject.internal. InjectorImpl.callInContext(
> InjectorImpl.ja
> va:1031)
>        at com.google.inject.internal. ProviderToInternalFactoryAdapt
> er.get(Provi
> derToInternalFactoryAdapter. java:40)
>        at com.google.inject.Scopes$1$1. get(Scopes.java:65)
>        at com.google.inject.internal. InternalFactoryToProviderAdapt
> er.get(Inter
> nalFactoryToProviderAdapter. java:40)
>        at com.google.inject.internal. InjectorImpl$4$1.call(
> InjectorImpl.java:97
> 8)
>        at com.google.inject.internal. InjectorImpl.callInContext(
> InjectorImpl.ja
> va:1024)
>        at com.google.inject.internal. InjectorImpl$4.get(
> InjectorImpl.java:974)
>        at org.guiceyfruit.jndi.internal. JndiContext.lookup(
> JndiContext.java:225
> )
>        at org.apache.camel.impl. JndiRegistry.lookup( JndiRegistry.java:65)
>        at org.apache.camel.impl. PropertyPlaceholderDelegateReg
> istry.lookup(Prop
> ertyPlaceholderDelegateRegistr y.java:45)
>        at org.apache.camel.core.osgi. OsgiComponentResolver.
> resolveComponent(Osg
> iComponentResolver.java:42)
>        at org.apache.camel.impl. DefaultCamelContext.
> getComponent(DefaultCamelCo
> ntext.java:292)
>        at org.apache.camel.impl. DefaultCamelContext.
> getEndpoint(DefaultCamelCon
> text.java:420)
>        at org.apache.camel.util. CamelContextHelper.
> getMandatoryEndpoint(CamelCo
> ntextHelper.java:48)
>        at org.apache.camel.model. RouteDefinition.
> resolveEndpoint(RouteDefinitio
> n.java:180)
>        at org.apache.camel.impl. DefaultRouteContext.
> resolveEndpoint(DefaultRout
> eContext.java:110)
>        at org.apache.camel.impl. DefaultRouteContext.
> resolveEndpoint(DefaultRout
> eContext.java:116)
>        at org.apache.camel.model. FromDefinition. resolveEndpoint(
> FromDefinition.
> java:72)
>        at org.apache.camel.impl. DefaultRouteContext.
> getEndpoint(DefaultRouteCon
> text.java:88)
>        at org.apache.camel.model. RouteDefinition.addRoutes(
> RouteDefinition.java
> :798)
>        at org.apache.camel.model. RouteDefinition.addRoutes(
> RouteDefinition.java
> :165)
>        at org.apache.camel.impl. DefaultCamelContext.
> startRoute(DefaultCamelCont
> ext.java:697)
>        at org.apache.camel.impl. DefaultCamelContext.
> startRouteDefinitions(Defau
> ltCamelContext.java:1654)
>        at org.apache.camel.impl. DefaultCamelContext.
> doStartCamel(DefaultCamelCo
> ntext.java:1441)
>        at org.apache.camel.impl. DefaultCamelContext.doStart(
> DefaultCamelContext
> .java:1338)
>        at org.apache.camel.impl. ServiceSupport.start(
> ServiceSupport.java:67)
>        at org.apache.camel.impl. ServiceSupport.start(
> ServiceSupport.java:54)
>        at org.apache.camel.impl. DefaultCamelContext.start(
> DefaultCamelContext.j
> ava:1316)
>        at com.myapp.osgi. config.MyAppOsgiActivator. start(MyAppO
> sgiActivator.java:28)
>        at org.apache.felix.framework. util.SecureAction.
> startActivator(SecureAct
> ion.java:629)
>        at org.apache.felix.framework. Felix.activateBundle(Felix.
> java:1842)
>        at org.apache.felix.framework. Felix.startBundle(Felix.java: 1759)
>        at org.apache.felix.framework. Felix.updateBundle(Felix.java: 2091)
>        at org.apache.felix.framework. BundleImpl.update(BundleImpl.
> java:936)
>        at org.apache.felix.framework. BundleImpl.update(BundleImpl.
> java:923)
>        at org.apache.karaf.shell.osgi. UpdateBundle.doExecute(
> UpdateBundle.java:
> 37)
>        at org.apache.karaf.shell.osgi. BundleCommand.doExecute(
> BundleCommand.jav
> a:42)
>        at org.apache.karaf.shell. console.OsgiCommandSupport.
> execute(OsgiCommand
> Support.java:38)
>        at org.apache.felix.gogo. commands.basic. AbstractCommand.execute(
> Abstract
> Command.java:35)
>        at org.apache.felix.gogo.runtime. CommandProxy.execute(
> CommandProxy.java:
> 78)
>        at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure.
> java:474)
>        at org.apache.felix.gogo.runtime. Closure.executeStatement(
> Closure.java:4
> 00)
>        at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108)
>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183)
>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120)
>        at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure.
> java:474)
>        at org.apache.felix.gogo.runtime. Closure.executeStatement(
> Closure.java:4
> 00)
>        at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108)
>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183)
>        at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120)
>        at org.apache.felix.gogo.runtime. CommandSessionImpl.execute(
> CommandSessi
> onImpl.java:89)
>        at org.apache.karaf.shell. console.jline.Console.run(
> Console.java:218)
>        at java.lang.Thread.run(Thread. java:619)
> Caused by: java.lang. ClassNotFoundException: com.tibco.tibjms.naming.
> TibjmsIniti
> alContextFactory
>        at java.lang.Class.forName0( Native Method)
>        at java.lang.Class.forName(Class. java:247)
>        at com.sun.naming.internal. VersionHelper12.loadClass(
> VersionHelper12.jav
> a:46)
>        at javax.naming.spi. NamingManager. getInitialContext(
> NamingManager.java:6
> 54)
>        ... 64 more
>
>
> On Thu, Dec 1, 2011 at 2:54 PM, mikevan < [hidden email] > wrote:
>
>
>
>
> surya,
>
>
>
> I think I know what the issue is, but to confirm it, could you please send
> the full exception you are getting to this user-group?
>
>
>
> ----- Original Message -----
>
>
> From: "surya aditya [via Karaf]" < [hidden email] >
> To: "mikevan" < [hidden email] >
> Sent: Thursday, December 1, 2011 2:51:02 PM
> Subject: karaf and tibco ems
>
>
> Hello Friends:
>
>
> I am trying to setup using the following stack:
>
>
> 1. karaf 2.2.4
> 2. camel 2.8.2
> 3. tibco ems 5.0
> 5. spring 3.0.6
>
>
> to enable camel route to recieve messages from JMS queue setup on EMS
> server, i am trying to instantiate camel jms component.
> However, i am getting following error for "ClassNotFoundException"
>
>
> I had to put tibco jar  tibjms-5.0 in deploy folder as it is not osgi
> comapatible. karaf wrapped it and shows 'active' status.
>
>
> I am loading the bundles in correct order to my knowledge and on
> bundles:headers i see the packages are being exported/imported correctly.
> See below for headers from bundles.
>
>
> See the following exception and I am stuck at this point, has anyone tried
> used  Tibco EMS on OSGI/Karaf ? Please suggest.
>
>
> Cannot instantiate class: com.tibco.tibjms.naming.
> TibjmsInitialContextFactory [Root exception is java.lang.
> ClassNotFoundException: com.tibco.tibjms.naming.
> TibjmsInitialContextFactory]
>
>
> application code:
>
>
>  Hashtable<String, String> env = new Hashtable<String, String>();
>                env.put(Context.INITIAL_ CONTEXT_FACTORY,
>                                "com.tibco.tibjms.naming.
> TibjmsInitialContextFactory");
>                env.put(Context.PROVIDER_URL, "tibjmsnaming://
> vm-bda2-d889.nam.nsroot.net:7222 ");
>                // env.put(Context.SECURITY_ PRINCIPAL, "user");
>                // env.put(Context.SECURITY_ CREDENTIALS, "password");
>
>                Context ctx = new InitialContext(env);
>                TibjmsConnectionFactory emsConnectionFactory =
> (TibjmsConnectionFactory) ctx
>                                .lookup("tml2.inbound. ConnectionFactory");
>
>                System.out.println(" JMSCOMpononet.....");
>                 log.info ("## Creating JMS Component ##");
>
>
>                JmsComponent jms = new JmsComponent();
>                jms.setConnectionFactory( emsConnectionFactory);
>                jms.setConcurrentConsumers(5);
>
>
> for Tibco Ems Jar:
>
>
> Import-Package =
>        com.tibco.security;resolution: =optional,
>        com.tibco.security.ocsp; resolution:=optional,
>        com.tibco.security.ssl; resolution:=optional,
>        com.tibco.tibjms;resolution:= optional,
>        com.tibco.tibjms.naming; resolution:=optional,
>        com.tibco.tibjms.naming. tibjmsnaming;resolution:= optional,
>        javax.jms;resolution:= optional,
>        javax.naming;resolution:= optional,
>        javax.naming.directory; resolution:=optional,
>        javax.naming.spi;resolution:= optional,
>        javax.transaction.xa; resolution:=optional,
>        javax.xml.parsers;resolution:= optional,
>        javax.xml.transform; resolution:=optional,
>        javax.xml.transform.dom; resolution:=optional,
>        javax.xml.transform.stream; resolution:=optional,
>        org.w3c.dom;resolution:= optional,
>        org.xml.sax;resolution:= optional,
>        org.xml.sax.helpers; resolution:=optional
> Export-Package =
>        com.tibco.tibjms;
>                uses:="javax.jms,
>                        javax.naming,
>                        javax.xml.transform,
>                        javax.xml.transform.stream,
>                        javax.xml.parsers,
>                        javax.xml.transform.dom,
>                        org.w3c.dom,
>                        com.tibco.tibjms.naming,
>                        org.xml.sax.helpers,
>                        org.xml.sax,
>                        com.tibco.security.ssl,
>                        com.tibco.security,
>                        javax.transaction.xa,
>                        com.tibco.security.ocsp",
>        com.tibco.tibjms.naming;
>                uses:="javax.naming,
>                        javax.naming.directory,
>                        com.tibco.tibjms,
>                        org.xml.sax.helpers,
>                        javax.naming.spi,
>                        javax.jms",
>        com.tibco.tibjms.naming. tibjmsnaming;
>                uses:="javax.naming,
>                        com.tibco.tibjms.naming,
>                        javax.naming.spi"
>
>
>
>
> for my application jar:
>
>
> Import-Package =
>        com.google.inject;version="[1. 3,2)",
>
>        com.google.inject.binder; version="[1.3,2)",
>         com.google.inject.name ; version="[1.3,2)",
>        com.tibco.tibjms,
>        com.tibco.tibjms.naming,
>        com.tibco.tibjms.naming. tibjmsnaming,
>        javax.jms,
>        javax.naming,
>        org.apache.camel;version="[2. 8,3)",
>        org.apache.camel.builder; version="[2.8,3)",
>        org.apache.camel.component. jms;version="[2.8,3)",
>
>        org.apache.camel.core.osgi; version="[2.8,3)",
>        org.apache.camel.guice; version="[2.8,3)",
>        org.apache.camel.impl;version= "[2.8,3)",
>        org.apache.camel.model; version="[2.8,3)",
>        org.apache.camel.spi;version=" [2.8,3)",
>        org.guiceyfruit.jndi;version=" [2.0,3)",
>        org.guiceyfruit.jndi.internal; version="[2.0,3)",
>        org.osgi.framework;version="[ 1.5,2)",
>        org.slf4j;version="[1.6,2)"
>
>
>
>
> If you reply to this email, your message will be added to the discussion
> below:
> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552646.html
> To start a new topic under Karaf - User, email [hidden email]
> To unsubscribe from Karaf - User, click here .
> NAML
>
> -----
> Mike Van  (All links open in new tabs)
> Committer - Kalumet
>
> Atraxia Technologies
>
> NCI Inc
>
> Mike Van's Open Source Technologies Blog
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552656.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>
>
>
>
>
>
> If you reply to this email, your message will be added to the discussion
> below:
> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552722.html
> To start a new topic under Karaf - User, email
> ml-node+s922171n930749h71@n3.nabble.com
> To unsubscribe from Karaf - User, click here .
> NAML
>
> -----
> Mike Van  (All links open in new tabs)
> Committer - Kalumet
>
> Atraxia Technologies
>
> NCI Inc
>
> Mike Van's Open Source Technologies Blog
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552742.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: karaf and tibco ems

Posted by mikevan <mv...@comcast.net>.

First, try to manually verify that the tibco jar file you're using actually contains the correct class: com.tibco.tibjms.naming. TibjmsInitialContextFactory .  Once you've done that, if the class is present, verify that the package has been properly exported into your environment by executing: 

karaf@root> exports | grep com.tibco.tibjms.naming 



Please let me know what happens. 



----- Original Message -----


From: "surya aditya [via Karaf]" <ml...@n3.nabble.com> 
To: "mikevan" <mv...@comcast.net> 
Sent: Thursday, December 1, 2011 3:17:46 PM 
Subject: Re: karaf and tibco ems 

Hi Mike: 


Thanks for looking into it. Please see the stack trace. I have this working in non-karaf environment. I am in process of migrating it to Karaf and having this issues. 


javax.naming. NoInitialContextException: Cannot instantiate class: com.tibco.tibj 
ms.naming. TibjmsInitialContextFactory [Root exception is java.lang.ClassNotFound 
Exception: com.tibco.tibjms.naming. TibjmsInitialContextFactory] 
       at javax.naming.spi. NamingManager. getInitialContext( NamingManager.java:6 
57) 
       at javax.naming.InitialContext. getDefaultInitCtx( InitialContext.java:288 
) 
       at javax.naming.InitialContext. init(InitialContext.java:223) 
       at javax.naming.InitialContext.< init>(InitialContext.java:197) 
       at com.myapp..osgi. module.EmsResourceModule.jms( EmsResourceMo 
dule.java:64) 
       at sun.reflect. NativeMethodAccessorImpl. invoke0(Native Method) 
       at sun.reflect. NativeMethodAccessorImpl. invoke( NativeMethodAccessorImpl. 
java:39) 
       at sun.reflect. DelegatingMethodAccessorImpl. invoke(DelegatingMethodAcces 
sorImpl.java:25) 
       at java.lang.reflect.Method. invoke(Method.java:597) 
       at com.google.inject.internal. ProviderMethod.get( ProviderMethod.java:104 
) 
       at com.google.inject.internal. InternalFactoryToProviderAdapt er.get(Inter 
nalFactoryToProviderAdapter. java:40) 
       at com.google.inject.internal. ProviderToInternalFactoryAdapt er$1.call(Pr 
oviderToInternalFactoryAdapter .java:46) 
       at com.google.inject.internal. InjectorImpl.callInContext( InjectorImpl.ja 
va:1031) 
       at com.google.inject.internal. ProviderToInternalFactoryAdapt er.get(Provi 
derToInternalFactoryAdapter. java:40) 
       at com.google.inject.Scopes$1$1. get(Scopes.java:65) 
       at com.google.inject.internal. InternalFactoryToProviderAdapt er.get(Inter 
nalFactoryToProviderAdapter. java:40) 
       at com.google.inject.internal. InjectorImpl$4$1.call( InjectorImpl.java:97 
8) 
       at com.google.inject.internal. InjectorImpl.callInContext( InjectorImpl.ja 
va:1024) 
       at com.google.inject.internal. InjectorImpl$4.get( InjectorImpl.java:974) 
       at org.guiceyfruit.jndi.internal. JndiContext.lookup( JndiContext.java:225 
) 
       at org.apache.camel.impl. JndiRegistry.lookup( JndiRegistry.java:65) 
       at org.apache.camel.impl. PropertyPlaceholderDelegateReg istry.lookup(Prop 
ertyPlaceholderDelegateRegistr y.java:45) 
       at org.apache.camel.core.osgi. OsgiComponentResolver. resolveComponent(Osg 
iComponentResolver.java:42) 
       at org.apache.camel.impl. DefaultCamelContext. getComponent(DefaultCamelCo 
ntext.java:292) 
       at org.apache.camel.impl. DefaultCamelContext. getEndpoint(DefaultCamelCon 
text.java:420) 
       at org.apache.camel.util. CamelContextHelper. getMandatoryEndpoint(CamelCo 
ntextHelper.java:48) 
       at org.apache.camel.model. RouteDefinition. resolveEndpoint(RouteDefinitio 
n.java:180) 
       at org.apache.camel.impl. DefaultRouteContext. resolveEndpoint(DefaultRout 
eContext.java:110) 
       at org.apache.camel.impl. DefaultRouteContext. resolveEndpoint(DefaultRout 
eContext.java:116) 
       at org.apache.camel.model. FromDefinition. resolveEndpoint( FromDefinition. 
java:72) 
       at org.apache.camel.impl. DefaultRouteContext. getEndpoint(DefaultRouteCon 
text.java:88) 
       at org.apache.camel.model. RouteDefinition.addRoutes( RouteDefinition.java 
:798) 
       at org.apache.camel.model. RouteDefinition.addRoutes( RouteDefinition.java 
:165) 
       at org.apache.camel.impl. DefaultCamelContext. startRoute(DefaultCamelCont 
ext.java:697) 
       at org.apache.camel.impl. DefaultCamelContext. startRouteDefinitions(Defau 
ltCamelContext.java:1654) 
       at org.apache.camel.impl. DefaultCamelContext. doStartCamel(DefaultCamelCo 
ntext.java:1441) 
       at org.apache.camel.impl. DefaultCamelContext.doStart( DefaultCamelContext 
.java:1338) 
       at org.apache.camel.impl. ServiceSupport.start( ServiceSupport.java:67) 
       at org.apache.camel.impl. ServiceSupport.start( ServiceSupport.java:54) 
       at org.apache.camel.impl. DefaultCamelContext.start( DefaultCamelContext.j 
ava:1316) 
       at com.myapp.osgi. config.MyAppOsgiActivator. start(MyAppO 
sgiActivator.java:28) 
       at org.apache.felix.framework. util.SecureAction. startActivator(SecureAct 
ion.java:629) 
       at org.apache.felix.framework. Felix.activateBundle(Felix. java:1842) 
       at org.apache.felix.framework. Felix.startBundle(Felix.java: 1759) 
       at org.apache.felix.framework. Felix.updateBundle(Felix.java: 2091) 
       at org.apache.felix.framework. BundleImpl.update(BundleImpl. java:936) 
       at org.apache.felix.framework. BundleImpl.update(BundleImpl. java:923) 
       at org.apache.karaf.shell.osgi. UpdateBundle.doExecute( UpdateBundle.java: 
37) 
       at org.apache.karaf.shell.osgi. BundleCommand.doExecute( BundleCommand.jav 
a:42) 
       at org.apache.karaf.shell. console.OsgiCommandSupport. execute(OsgiCommand 
Support.java:38) 
       at org.apache.felix.gogo. commands.basic. AbstractCommand.execute( Abstract 
Command.java:35) 
       at org.apache.felix.gogo.runtime. CommandProxy.execute( CommandProxy.java: 
78) 
       at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure. java:474) 
       at org.apache.felix.gogo.runtime. Closure.executeStatement( Closure.java:4 
00) 
       at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120) 
       at org.apache.felix.gogo.runtime. Closure.executeCmd(Closure. java:474) 
       at org.apache.felix.gogo.runtime. Closure.executeStatement( Closure.java:4 
00) 
       at org.apache.felix.gogo.runtime. Pipe.run(Pipe.java:108) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 183) 
       at org.apache.felix.gogo.runtime. Closure.execute(Closure.java: 120) 
       at org.apache.felix.gogo.runtime. CommandSessionImpl.execute( CommandSessi 
onImpl.java:89) 
       at org.apache.karaf.shell. console.jline.Console.run( Console.java:218) 
       at java.lang.Thread.run(Thread. java:619) 
Caused by: java.lang. ClassNotFoundException: com.tibco.tibjms.naming. TibjmsIniti 
alContextFactory 
       at java.lang.Class.forName0( Native Method) 
       at java.lang.Class.forName(Class. java:247) 
       at com.sun.naming.internal. VersionHelper12.loadClass( VersionHelper12.jav 
a:46) 
       at javax.naming.spi. NamingManager. getInitialContext( NamingManager.java:6 
54) 
       ... 64 more 


On Thu, Dec 1, 2011 at 2:54 PM, mikevan < [hidden email] > wrote: 




surya, 



I think I know what the issue is, but to confirm it, could you please send the full exception you are getting to this user-group? 



----- Original Message ----- 


From: "surya aditya [via Karaf]" < [hidden email] > 
To: "mikevan" < [hidden email] > 
Sent: Thursday, December 1, 2011 2:51:02 PM 
Subject: karaf and tibco ems 


Hello Friends: 


I am trying to setup using the following stack: 


1. karaf 2.2.4 
2. camel 2.8.2 
3. tibco ems 5.0 
5. spring 3.0.6 


to enable camel route to recieve messages from JMS queue setup on EMS server, i am trying to instantiate camel jms component. 
However, i am getting following error for "ClassNotFoundException" 


I had to put tibco jar  tibjms-5.0 in deploy folder as it is not osgi comapatible. karaf wrapped it and shows 'active' status. 


I am loading the bundles in correct order to my knowledge and on bundles:headers i see the packages are being exported/imported correctly. See below for headers from bundles. 


See the following exception and I am stuck at this point, has anyone tried used  Tibco EMS on OSGI/Karaf ? Please suggest. 


Cannot instantiate class: com.tibco.tibjms.naming. TibjmsInitialContextFactory [Root exception is java.lang. ClassNotFoundException: com.tibco.tibjms.naming. TibjmsInitialContextFactory] 


application code: 


 Hashtable<String, String> env = new Hashtable<String, String>(); 
               env.put(Context.INITIAL_ CONTEXT_FACTORY, 
                               "com.tibco.tibjms.naming. TibjmsInitialContextFactory"); 
               env.put(Context.PROVIDER_URL, "tibjmsnaming:// vm-bda2-d889.nam.nsroot.net:7222 "); 
               // env.put(Context.SECURITY_ PRINCIPAL, "user"); 
               // env.put(Context.SECURITY_ CREDENTIALS, "password"); 

               Context ctx = new InitialContext(env); 
               TibjmsConnectionFactory emsConnectionFactory = (TibjmsConnectionFactory) ctx 
                               .lookup("tml2.inbound. ConnectionFactory"); 

               System.out.println(" JMSCOMpononet....."); 
                log.info ("## Creating JMS Component ##"); 


               JmsComponent jms = new JmsComponent(); 
               jms.setConnectionFactory( emsConnectionFactory); 
               jms.setConcurrentConsumers(5); 


for Tibco Ems Jar: 


Import-Package = 
       com.tibco.security;resolution: =optional, 
       com.tibco.security.ocsp; resolution:=optional, 
       com.tibco.security.ssl; resolution:=optional, 
       com.tibco.tibjms;resolution:= optional, 
       com.tibco.tibjms.naming; resolution:=optional, 
       com.tibco.tibjms.naming. tibjmsnaming;resolution:= optional, 
       javax.jms;resolution:= optional, 
       javax.naming;resolution:= optional, 
       javax.naming.directory; resolution:=optional, 
       javax.naming.spi;resolution:= optional, 
       javax.transaction.xa; resolution:=optional, 
       javax.xml.parsers;resolution:= optional, 
       javax.xml.transform; resolution:=optional, 
       javax.xml.transform.dom; resolution:=optional, 
       javax.xml.transform.stream; resolution:=optional, 
       org.w3c.dom;resolution:= optional, 
       org.xml.sax;resolution:= optional, 
       org.xml.sax.helpers; resolution:=optional 
Export-Package = 
       com.tibco.tibjms; 
               uses:="javax.jms, 
                       javax.naming, 
                       javax.xml.transform, 
                       javax.xml.transform.stream, 
                       javax.xml.parsers, 
                       javax.xml.transform.dom, 
                       org.w3c.dom, 
                       com.tibco.tibjms.naming, 
                       org.xml.sax.helpers, 
                       org.xml.sax, 
                       com.tibco.security.ssl, 
                       com.tibco.security, 
                       javax.transaction.xa, 
                       com.tibco.security.ocsp", 
       com.tibco.tibjms.naming; 
               uses:="javax.naming, 
                       javax.naming.directory, 
                       com.tibco.tibjms, 
                       org.xml.sax.helpers, 
                       javax.naming.spi, 
                       javax.jms", 
       com.tibco.tibjms.naming. tibjmsnaming; 
               uses:="javax.naming, 
                       com.tibco.tibjms.naming, 
                       javax.naming.spi" 




for my application jar: 


Import-Package = 
       com.google.inject;version="[1. 3,2)", 

       com.google.inject.binder; version="[1.3,2)", 
        com.google.inject.name ; version="[1.3,2)", 
       com.tibco.tibjms, 
       com.tibco.tibjms.naming, 
       com.tibco.tibjms.naming. tibjmsnaming, 
       javax.jms, 
       javax.naming, 
       org.apache.camel;version="[2. 8,3)", 
       org.apache.camel.builder; version="[2.8,3)", 
       org.apache.camel.component. jms;version="[2.8,3)", 

       org.apache.camel.core.osgi; version="[2.8,3)", 
       org.apache.camel.guice; version="[2.8,3)", 
       org.apache.camel.impl;version= "[2.8,3)", 
       org.apache.camel.model; version="[2.8,3)", 
       org.apache.camel.spi;version=" [2.8,3)", 
       org.guiceyfruit.jndi;version=" [2.0,3)", 
       org.guiceyfruit.jndi.internal; version="[2.0,3)", 
       org.osgi.framework;version="[ 1.5,2)", 
       org.slf4j;version="[1.6,2)" 




If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552646.html 
To start a new topic under Karaf - User, email [hidden email] 
To unsubscribe from Karaf - User, click here . 
NAML 

----- 
Mike Van  (All links open in new tabs) 
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
-- 
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552656.html 
Sent from the Karaf - User mailing list archive at Nabble.com. 








If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552722.html 
To start a new topic under Karaf - User, email ml-node+s922171n930749h71@n3.nabble.com 
To unsubscribe from Karaf - User, click here . 
NAML

-----
Mike Van  (All links open in new tabs)
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552742.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: karaf and tibco ems

Posted by surya aditya <su...@gmail.com>.
Hi Mike:

Thanks for looking into it. Please see the stack trace. I have this working
in non-karaf environment. I am in process of migrating it to Karaf and
having this issues.

javax.naming.NoInitialContextException: Cannot instantiate class:
com.tibco.tibj
ms.naming.TibjmsInitialContextFactory [Root exception is
java.lang.ClassNotFound
Exception: com.tibco.tibjms.naming.TibjmsInitialContextFactory]
       at javax.naming.spi.NamingManager.getInitialContext(
NamingManager.java:6
57)
       at javax.naming.InitialContext.getDefaultInitCtx(
InitialContext.java:288
)
       at javax.naming.InitialContext.init(InitialContext.java:223)
       at javax.naming.InitialContext.<init>(InitialContext.java:197)
       at com.myapp..osgi.module.EmsResourceModule.jms(EmsResourceMo
dule.java:64)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.
java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.
invoke(DelegatingMethodAcces
sorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:597)
       at com.google.inject.internal.ProviderMethod.get(
ProviderMethod.java:104
)
       at com.google.inject.internal.InternalFactoryToProviderAdapt
er.get(Inter
nalFactoryToProviderAdapter.java:40)
       at com.google.inject.internal.ProviderToInternalFactoryAdapt
er$1.call(Pr
oviderToInternalFactoryAdapter.java:46)
       at com.google.inject.internal.InjectorImpl.callInContext(
InjectorImpl.ja
va:1031)
       at com.google.inject.internal.ProviderToInternalFactoryAdapt
er.get(Provi
derToInternalFactoryAdapter.java:40)
       at com.google.inject.Scopes$1$1.get(Scopes.java:65)
       at com.google.inject.internal.InternalFactoryToProviderAdapt
er.get(Inter
nalFactoryToProviderAdapter.java:40)
       at com.google.inject.internal.InjectorImpl$4$1.call(
InjectorImpl.java:97
8)
       at com.google.inject.internal.InjectorImpl.callInContext(
InjectorImpl.ja
va:1024)
       at com.google.inject.internal.InjectorImpl$4.get(
InjectorImpl.java:974)
       at org.guiceyfruit.jndi.internal.JndiContext.lookup(
JndiContext.java:225
)
       at org.apache.camel.impl.JndiRegistry.lookup(JndiRegistry.java:65)
       at org.apache.camel.impl.PropertyPlaceholderDelegateReg
istry.lookup(Prop
ertyPlaceholderDelegateRegistry.java:45)
       at org.apache.camel.core.osgi.OsgiComponentResolver.
resolveComponent(Osg
iComponentResolver.java:42)
       at org.apache.camel.impl.DefaultCamelContext.
getComponent(DefaultCamelCo
ntext.java:292)
       at org.apache.camel.impl.DefaultCamelContext.
getEndpoint(DefaultCamelCon
text.java:420)
       at org.apache.camel.util.CamelContextHelper.
getMandatoryEndpoint(CamelCo
ntextHelper.java:48)
       at org.apache.camel.model.RouteDefinition.
resolveEndpoint(RouteDefinitio
n.java:180)
       at org.apache.camel.impl.DefaultRouteContext.
resolveEndpoint(DefaultRout
eContext.java:110)
       at org.apache.camel.impl.DefaultRouteContext.
resolveEndpoint(DefaultRout
eContext.java:116)
       at org.apache.camel.model.FromDefinition.resolveEndpoint(
FromDefinition.
java:72)
       at org.apache.camel.impl.DefaultRouteContext.
getEndpoint(DefaultRouteCon
text.java:88)
       at org.apache.camel.model.RouteDefinition.addRoutes(
RouteDefinition.java
:798)
       at org.apache.camel.model.RouteDefinition.addRoutes(
RouteDefinition.java
:165)
       at org.apache.camel.impl.DefaultCamelContext.
startRoute(DefaultCamelCont
ext.java:697)
       at org.apache.camel.impl.DefaultCamelContext.
startRouteDefinitions(Defau
ltCamelContext.java:1654)
       at org.apache.camel.impl.DefaultCamelContext.
doStartCamel(DefaultCamelCo
ntext.java:1441)
       at org.apache.camel.impl.DefaultCamelContext.doStart(
DefaultCamelContext
.java:1338)
       at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
       at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
       at org.apache.camel.impl.DefaultCamelContext.start(
DefaultCamelContext.j
ava:1316)
       at com.myapp.osgi.config.MyAppOsgiActivator.start(MyAppO
sgiActivator.java:28)
       at org.apache.felix.framework.util.SecureAction.
startActivator(SecureAct
ion.java:629)
       at org.apache.felix.framework.Felix.activateBundle(Felix.java:1842)
       at org.apache.felix.framework.Felix.startBundle(Felix.java:1759)
       at org.apache.felix.framework.Felix.updateBundle(Felix.java:2091)
       at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:936)
       at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:923)
       at org.apache.karaf.shell.osgi.UpdateBundle.doExecute(
UpdateBundle.java:
37)
       at org.apache.karaf.shell.osgi.BundleCommand.doExecute(
BundleCommand.jav
a:42)
       at org.apache.karaf.shell.console.OsgiCommandSupport.
execute(OsgiCommand
Support.java:38)
       at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(
Abstract
Command.java:35)
       at org.apache.felix.gogo.runtime.CommandProxy.execute(
CommandProxy.java:
78)
       at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)
       at org.apache.felix.gogo.runtime.Closure.executeStatement(
Closure.java:4
00)
       at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
       at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)
       at org.apache.felix.gogo.runtime.Closure.executeStatement(
Closure.java:4
00)
       at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
       at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
       at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(
CommandSessi
onImpl.java:89)
       at org.apache.karaf.shell.console.jline.Console.run(Console.java:218)
       at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: com.tibco.tibjms.naming.
TibjmsIniti
alContextFactory
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:247)
       at com.sun.naming.internal.VersionHelper12.loadClass(
VersionHelper12.jav
a:46)
       at javax.naming.spi.NamingManager.getInitialContext(
NamingManager.java:6
54)
       ... 64 more

On Thu, Dec 1, 2011 at 2:54 PM, mikevan <mv...@comcast.net> wrote:

>
>
> surya,
>
>
>
> I think I know what the issue is, but to confirm it, could you please send
> the full exception you are getting to this user-group?
>
>
>
> ----- Original Message -----
>
>
> From: "surya aditya [via Karaf]" <ml-node+s922171n3552646h78@n3.nabble.com
> >
> To: "mikevan" <mv...@comcast.net>
> Sent: Thursday, December 1, 2011 2:51:02 PM
> Subject: karaf and tibco ems
>
> Hello Friends:
>
>
> I am trying to setup using the following stack:
>
>
> 1. karaf 2.2.4
> 2. camel 2.8.2
> 3. tibco ems 5.0
> 5. spring 3.0.6
>
>
> to enable camel route to recieve messages from JMS queue setup on EMS
> server, i am trying to instantiate camel jms component.
> However, i am getting following error for "ClassNotFoundException"
>
>
> I had to put tibco jar  tibjms-5.0 in deploy folder as it is not osgi
> comapatible. karaf wrapped it and shows 'active' status.
>
>
> I am loading the bundles in correct order to my knowledge and on
> bundles:headers i see the packages are being exported/imported correctly.
> See below for headers from bundles.
>
>
> See the following exception and I am stuck at this point, has anyone tried
> used  Tibco EMS on OSGI/Karaf ? Please suggest.
>
>
> Cannot instantiate class: com.tibco.tibjms.naming.
> TibjmsInitialContextFactory [Root exception is java.lang.
> ClassNotFoundException: com.tibco.tibjms.naming.
> TibjmsInitialContextFactory]
>
>
> application code:
>
>
>  Hashtable<String, String> env = new Hashtable<String, String>();
>                env.put(Context.INITIAL_ CONTEXT_FACTORY,
>                                "com.tibco.tibjms.naming.
> TibjmsInitialContextFactory");
>                env.put(Context.PROVIDER_URL, "tibjmsnaming://
> vm-bda2-d889.nam.nsroot.net:7222 ");
>                // env.put(Context.SECURITY_ PRINCIPAL, "user");
>                // env.put(Context.SECURITY_ CREDENTIALS, "password");
>                Context ctx = new InitialContext(env);
>                TibjmsConnectionFactory emsConnectionFactory =
> (TibjmsConnectionFactory) ctx
>                                .lookup("tml2.inbound. ConnectionFactory");
>
>                System.out.println(" JMSCOMpononet.....");
>                 log.info ("## Creating JMS Component ##");
>                JmsComponent jms = new JmsComponent();
>                jms.setConnectionFactory( emsConnectionFactory);
>                jms.setConcurrentConsumers(5);
>
>
> for Tibco Ems Jar:
>
>
> Import-Package =
>        com.tibco.security;resolution: =optional,
>        com.tibco.security.ocsp; resolution:=optional,
>        com.tibco.security.ssl; resolution:=optional,
>        com.tibco.tibjms;resolution:= optional,
>        com.tibco.tibjms.naming; resolution:=optional,
>        com.tibco.tibjms.naming. tibjmsnaming;resolution:= optional,
>        javax.jms;resolution:= optional,
>        javax.naming;resolution:= optional,
>        javax.naming.directory; resolution:=optional,
>        javax.naming.spi;resolution:= optional,
>        javax.transaction.xa; resolution:=optional,
>        javax.xml.parsers;resolution:= optional,
>        javax.xml.transform; resolution:=optional,
>        javax.xml.transform.dom; resolution:=optional,
>        javax.xml.transform.stream; resolution:=optional,
>        org.w3c.dom;resolution:= optional,
>        org.xml.sax;resolution:= optional,
>        org.xml.sax.helpers; resolution:=optional
> Export-Package =
>        com.tibco.tibjms;
>                uses:="javax.jms,
>                        javax.naming,
>                        javax.xml.transform,
>                        javax.xml.transform.stream,
>                        javax.xml.parsers,
>                        javax.xml.transform.dom,
>                        org.w3c.dom,
>                        com.tibco.tibjms.naming,
>                        org.xml.sax.helpers,
>                        org.xml.sax,
>                        com.tibco.security.ssl,
>                        com.tibco.security,
>                        javax.transaction.xa,
>                        com.tibco.security.ocsp",
>        com.tibco.tibjms.naming;
>                uses:="javax.naming,
>                        javax.naming.directory,
>                        com.tibco.tibjms,
>                        org.xml.sax.helpers,
>                        javax.naming.spi,
>                        javax.jms",
>        com.tibco.tibjms.naming. tibjmsnaming;
>                uses:="javax.naming,
>                        com.tibco.tibjms.naming,
>                        javax.naming.spi"
>
>
>
>
> for my application jar:
>
>
> Import-Package =
>        com.google.inject;version="[1. 3,2)",
>        com.google.inject.binder; version="[1.3,2)",
>         com.google.inject.name ; version="[1.3,2)",
>        com.tibco.tibjms,
>        com.tibco.tibjms.naming,
>        com.tibco.tibjms.naming. tibjmsnaming,
>        javax.jms,
>        javax.naming,
>        org.apache.camel;version="[2. 8,3)",
>        org.apache.camel.builder; version="[2.8,3)",
>        org.apache.camel.component. jms;version="[2.8,3)",
>        org.apache.camel.core.osgi; version="[2.8,3)",
>        org.apache.camel.guice; version="[2.8,3)",
>        org.apache.camel.impl;version= "[2.8,3)",
>        org.apache.camel.model; version="[2.8,3)",
>        org.apache.camel.spi;version=" [2.8,3)",
>        org.guiceyfruit.jndi;version=" [2.0,3)",
>        org.guiceyfruit.jndi.internal; version="[2.0,3)",
>        org.osgi.framework;version="[ 1.5,2)",
>        org.slf4j;version="[1.6,2)"
>
>
>
>
> If you reply to this email, your message will be added to the discussion
> below:
> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552646.html
> To start a new topic under Karaf - User, email
> ml-node+s922171n930749h71@n3.nabble.com
> To unsubscribe from Karaf - User, click here .
> NAML
>
> -----
> Mike Van  (All links open in new tabs)
> Committer - Kalumet
>
> Atraxia Technologies
>
> NCI Inc
>
> Mike Van's Open Source Technologies Blog
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552656.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: karaf and tibco ems

Posted by mikevan <mv...@comcast.net>.

surya, 



I think I know what the issue is, but to confirm it, could you please send the full exception you are getting to this user-group? 



----- Original Message -----


From: "surya aditya [via Karaf]" <ml...@n3.nabble.com> 
To: "mikevan" <mv...@comcast.net> 
Sent: Thursday, December 1, 2011 2:51:02 PM 
Subject: karaf and tibco ems 

Hello Friends: 


I am trying to setup using the following stack: 


1. karaf 2.2.4 
2. camel 2.8.2 
3. tibco ems 5.0 
5. spring 3.0.6 


to enable camel route to recieve messages from JMS queue setup on EMS server, i am trying to instantiate camel jms component. 
However, i am getting following error for "ClassNotFoundException" 


I had to put tibco jar  tibjms-5.0 in deploy folder as it is not osgi comapatible. karaf wrapped it and shows 'active' status. 


I am loading the bundles in correct order to my knowledge and on bundles:headers i see the packages are being exported/imported correctly. See below for headers from bundles. 


See the following exception and I am stuck at this point, has anyone tried used  Tibco EMS on OSGI/Karaf ? Please suggest. 


Cannot instantiate class: com.tibco.tibjms.naming. TibjmsInitialContextFactory [Root exception is java.lang. ClassNotFoundException: com.tibco.tibjms.naming. TibjmsInitialContextFactory] 


application code: 


 Hashtable<String, String> env = new Hashtable<String, String>(); 
               env.put(Context.INITIAL_ CONTEXT_FACTORY, 
                               "com.tibco.tibjms.naming. TibjmsInitialContextFactory"); 
               env.put(Context.PROVIDER_URL, "tibjmsnaming:// vm-bda2-d889.nam.nsroot.net:7222 "); 
               // env.put(Context.SECURITY_ PRINCIPAL, "user"); 
               // env.put(Context.SECURITY_ CREDENTIALS, "password"); 
               Context ctx = new InitialContext(env); 
               TibjmsConnectionFactory emsConnectionFactory = (TibjmsConnectionFactory) ctx 
                               .lookup("tml2.inbound. ConnectionFactory"); 

               System.out.println(" JMSCOMpononet....."); 
                log.info ("## Creating JMS Component ##"); 
               JmsComponent jms = new JmsComponent(); 
               jms.setConnectionFactory( emsConnectionFactory); 
               jms.setConcurrentConsumers(5); 


for Tibco Ems Jar: 


Import-Package = 
       com.tibco.security;resolution: =optional, 
       com.tibco.security.ocsp; resolution:=optional, 
       com.tibco.security.ssl; resolution:=optional, 
       com.tibco.tibjms;resolution:= optional, 
       com.tibco.tibjms.naming; resolution:=optional, 
       com.tibco.tibjms.naming. tibjmsnaming;resolution:= optional, 
       javax.jms;resolution:= optional, 
       javax.naming;resolution:= optional, 
       javax.naming.directory; resolution:=optional, 
       javax.naming.spi;resolution:= optional, 
       javax.transaction.xa; resolution:=optional, 
       javax.xml.parsers;resolution:= optional, 
       javax.xml.transform; resolution:=optional, 
       javax.xml.transform.dom; resolution:=optional, 
       javax.xml.transform.stream; resolution:=optional, 
       org.w3c.dom;resolution:= optional, 
       org.xml.sax;resolution:= optional, 
       org.xml.sax.helpers; resolution:=optional 
Export-Package = 
       com.tibco.tibjms; 
               uses:="javax.jms, 
                       javax.naming, 
                       javax.xml.transform, 
                       javax.xml.transform.stream, 
                       javax.xml.parsers, 
                       javax.xml.transform.dom, 
                       org.w3c.dom, 
                       com.tibco.tibjms.naming, 
                       org.xml.sax.helpers, 
                       org.xml.sax, 
                       com.tibco.security.ssl, 
                       com.tibco.security, 
                       javax.transaction.xa, 
                       com.tibco.security.ocsp", 
       com.tibco.tibjms.naming; 
               uses:="javax.naming, 
                       javax.naming.directory, 
                       com.tibco.tibjms, 
                       org.xml.sax.helpers, 
                       javax.naming.spi, 
                       javax.jms", 
       com.tibco.tibjms.naming. tibjmsnaming; 
               uses:="javax.naming, 
                       com.tibco.tibjms.naming, 
                       javax.naming.spi" 




for my application jar: 


Import-Package = 
       com.google.inject;version="[1. 3,2)", 
       com.google.inject.binder; version="[1.3,2)", 
        com.google.inject.name ; version="[1.3,2)", 
       com.tibco.tibjms, 
       com.tibco.tibjms.naming, 
       com.tibco.tibjms.naming. tibjmsnaming, 
       javax.jms, 
       javax.naming, 
       org.apache.camel;version="[2. 8,3)", 
       org.apache.camel.builder; version="[2.8,3)", 
       org.apache.camel.component. jms;version="[2.8,3)", 
       org.apache.camel.core.osgi; version="[2.8,3)", 
       org.apache.camel.guice; version="[2.8,3)", 
       org.apache.camel.impl;version= "[2.8,3)", 
       org.apache.camel.model; version="[2.8,3)", 
       org.apache.camel.spi;version=" [2.8,3)", 
       org.guiceyfruit.jndi;version=" [2.0,3)", 
       org.guiceyfruit.jndi.internal; version="[2.0,3)", 
       org.osgi.framework;version="[ 1.5,2)", 
       org.slf4j;version="[1.6,2)" 




If you reply to this email, your message will be added to the discussion below: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552646.html 
To start a new topic under Karaf - User, email ml-node+s922171n930749h71@n3.nabble.com 
To unsubscribe from Karaf - User, click here . 
NAML

-----
Mike Van  (All links open in new tabs)
Committer - Kalumet 

Atraxia Technologies 

NCI Inc 

Mike Van's Open Source Technologies Blog 
--
View this message in context: http://karaf.922171.n3.nabble.com/karaf-and-tibco-ems-tp3552646p3552656.html
Sent from the Karaf - User mailing list archive at Nabble.com.