Apache - Tomcat - JBoss

Hi,

I'm trying to run Apache + Tomcat + JBoss.

JBoss/Tomcat embedded is working fine, but I can't run Tomcat standalone, I've got the following error :

javax.naming.CommunicationException: Can't find SerialContextProvider

at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:60)

at com.sun.enterprise.naming.SerialContext.<init>(SerialContext.java:79)

at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:54)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)

at javax.naming.InitialContext.init(InitialContext.java:222)

at javax.naming.InitialContext.<init>(InitialContext.java:178)

at ejb.sbtest.SBTest1Servlet.doGet(SBTest1Servlet.java:96)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)

at org.apache.tomcat.core.Handler.service(Handler.java:287)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)

at java.lang.Thread.run(Thread.java:484)

Someone has a tutorial on Tomcat configuration with an application server ?

Thanks,

jerome.

[1893 byte] By [delattrj] at [2007-9-26 3:38:02]
# 1

At your SBTest1Servlet.java:96, you must have a call

new InitialContext(); // no parameter

It only works if tomcat is running with jboss. Also this call is for JNDI, if your jboss is not running, who is your JNDI server? Anyway, assuming you have jboss running on "anotherHost" as JNDI server, the use the following code. If your JNDI server is not jboss, the property values are diff depending on that server.

Properties env = new Properties();

env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

env.put(Context.PROVIDER_URL, "anotherHost:1099");

env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");

ctx = new InitialContext(env);

yilin at 2007-6-29 12:11:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

I agree with yilin. When a standalone client calls a bean within the bean provider server, use:

new InitialContext();

Or use:

Properties env = new Properties();

env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");

env.put(Context.PROVIDER_URL, "anotherHost:1099");

...

new InitialContext(env);

above codes define who is the provider, NamingContextFactory interface, etc.

Oytan022 at 2007-6-29 12:11:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
ok, it works fine.thanks
delattrj at 2007-6-29 12:11:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4

Hi delattrj,

could u redirect me some links on how to use JBOSS-TOMCAT...?

we have developed a small web app and tested on apache-tomcat, we r evaluating the jboss for possible use of ejbs.

but dont know where to start...

It will be great help if u give some input...

Regards,

Susheel

sushilvj at 2007-6-29 12:11:10 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...