What factory do I use?

L

laredotornado

Hi,

I'm writing some JUnit (4.3) tests on a Java 1.5 VM. I'm trying to
add a JNDI reference for an EJB service running locally. So far, I
have

Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"the");
env.put("java.naming.provider.url",
"http://localhost:8082/apps/dor/online/interlock/hessian/");
Context initialContext = new InitialContext(env);

However, I'm getting a ClassNotFoundException for the class
"com.sun.enterprise.naming.SerialInitContextFactory". My question is,
does each JVM have a standard factory it uses for the initial context,
and where would I find such a class? (I just cut-and-pasted the
example from another site, so I'm not surpised it threw an exception).

Thanks, - Dave
 
A

Arne Vajhøj

I'm writing some JUnit (4.3) tests on a Java 1.5 VM. I'm trying to
add a JNDI reference for an EJB service running locally. So far, I
have

Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"the");
env.put("java.naming.provider.url",
"http://localhost:8082/apps/dor/online/interlock/hessian/");
Context initialContext = new InitialContext(env);

However, I'm getting a ClassNotFoundException for the class
"com.sun.enterprise.naming.SerialInitContextFactory". My question is,
does each JVM have a standard factory it uses for the initial context,
and where would I find such a class? (I just cut-and-pasted the
example from another site, so I'm not surpised it threw an exception).

You always need to have the JNDI implementation classes in classpath.

They are usually in a jar file that comes with your application server.

Some googling indicates that for Glassfish it is appserv-rt.jar !

Arne
 
L

laredotornado

You always need to have the JNDI implementation classes in classpath.

They are usually in a jar file that comes with your application server.

Some googling indicates that for Glassfish it is appserv-rt.jar !

Arne



My application server is Resin 3.0.19. With regards to the JNDI
implementation classes, how do I figure out what those are, and thus
be able to search for the JAR file to include in my classpath?

Thanks, - Dave
 
A

Arne Vajhøj

My application server is Resin 3.0.19. With regards to the JNDI
implementation classes, how do I figure out what those are, and thus
be able to search for the JAR file to include in my classpath?

I know practically nothing about Resin and EJB's.

If I am to guess then you have not configured the JNDI lookup
properly so it is looking for the SUN default classes instead
of the Resin Hessian ones.

Maybe these links can help:

http://www.caucho.com/resin-3.0/ejb/hessian-client.xtp
http://maillist.caucho.com/pipermail/resin-interest/2008-February/002037.html

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top