InitialContext in JBoss 3.0b Catalina4.0.2 / missing web.xml
jamal Feb 26, 2002 5:44 AMHello,
after the start of JBoss i get this error:
---error begin------
ERROR [EmbeddedCatalinaServiceSX] Failed to setup web application ENC
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:640)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:280)
...
----error end----
I tried specify the initial context for my web application, but had no success. I copied a jndi.properties to WEB-INF/classes and WEB-INF/lib in my WAR and also copied to %JBOSS_HOME%/conf/default and %JBOSS_HOME%/jakarta-tomcat-4.0.2/conf. No effects.
I tried in my servlet init to set the context with this:
public static Context getInitialContext() throws Exception
{
Properties p = new Properties();
p.setProperty(Context.PROVIDER_URL, "localhost:1099");
p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.setProperty(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
return new InitialContext(p);
}
The result is that I get a "Recieve timeout" if I make a lookup for a JNDI.
So what's here worng?
I'm using JBoss 3.0beta with Catalina 4.0.2 on a Win 2k PC.
Another thing is that catalina doesn't find any web.xml files in the WAR's. Not in my WAR and not even example.war nor ROOT.war. (with JBoss alpha my web.xml was found)
---output begin------
INFO [MainDeployer] Deploying: file:/C:/jboss-3.0.0beta/deploy/examples.war
INFO [EmbeddedCatalinaServiceSX] deploy, ctxPath=/examples, warUrl=file:/C:/jboss-3.0.0beta/tmp/deploy/107
.examples.war
INFO [EmbeddedCatalinaServiceSX] WebappLoader[/examples]: Deploying class repositories to work directory C
:\jboss-3.0.0beta\jakarta-tomcat-4.0.2\work\localhost\examples
INFO [EmbeddedCatalinaServiceSX] StandardManager[/examples]: Seeding random number generator class java.se
curity.SecureRandom
INFO [EmbeddedCatalinaServiceSX] StandardManager[/examples]: Seeding of random number generator has been c
ompleted
INFO [EmbeddedCatalinaServiceSX] ContextConfig[/examples]: Missing application web.xml, using defaults onl
y
INFO [EmbeddedCatalinaServiceSX] ContextConfig[/examples]: Added certificates -> request attribute Valve
WARN [EmbeddedCatalinaServiceSX] No /WEB-INF/web.xml descriptor found
INFO [EmbeddedCatalinaServiceSX] StandardWrapper[/examples:default]: Loading container servlet default
INFO [EmbeddedCatalinaServiceSX] default: init
INFO [EmbeddedCatalinaServiceSX] StandardWrapper[/examples:invoker]: Loading container servlet invoker
INFO [EmbeddedCatalinaServiceSX] invoker: init
INFO [EmbeddedCatalinaServiceSX] jsp: init
INFO [EmbeddedCatalinaServiceSX] Internal Error: File /WEB-INF/web.xml not found
---output end------
thanks in advance for any ideas,
jamal