Skip to main content

Why is it impossible: JMS, JNDI with CORBA (standalone client)

2 replies [Last post]
mbazs
Offline
Joined: 2005-12-17

Hi!

JMS standalone client:
System.out.println("1");
Properties props = new Properties();
// props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
// props.setProperty(Context.INITIAL_CONTEXT_FACTORY,"com.sun.enterprise.naming.SerialInitContextFactory");
props.setProperty(Context.PROVIDER_URL,"iiop://127.0.0.1:3700");
// props.setProperty("org.omg.CORBA.ORBInitialHost","127.0.0.1");
// props.setProperty("org.omg.CORBA.ORBInitialPort","3700");
System.out.println("2");
InitialContext ctx = new InitialContext(props);
System.out.println("3");
QueueConnectionFactory factory=(QueueConnectionFactory)ctx.lookup("jms/testqueue_factory");
System.out.println("4");
javax.jms.Queue queue=(javax.jms.Queue)ctx.lookup("jms/testqueue");
System.out.println("5");

I tried EVERYTHING, NOTHING works.
Classpath jars: appserv-rt, appserv-ext, imq, imqjmsra, javaee, jms, jsse, rt
Tried to add JVM Corba props with -D.
JMS resources exist.

Result is:
javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]

Thanx.
MB

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
fvu
Offline
Joined: 2007-07-19

Hi MB,

maybe I was just plain lucky, but the code shown here

http://weblogs.java.net/blog/kalali/archive/2006/05/step_by_step_to_2.html

worked straight away. he uses Hashtable, not Properties, the rest of the code looks the same.

Good luck!

fvu

mbazs123
Offline
Joined: 2007-05-14

Thank you! I'll try it :)