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
> 
> 

Reply via email to