tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Roest <tom...@blahz.org>
Subject Question about context-param
Date Thu, 16 Jan 2003 18:49:24 GMT
Hi all,
	I'm trying to initialize a few parameters from my web.xml to be 
available to my context.

I'm just wondering when they become available.  As I'm attempting to 
access them during my Context constructor and I'm getting to following 
exception trace.

(This call was just trying to get the names not actually access the 
values but trying to access the values give similar results)

java.lang.NullPointerException
at 
javax.servlet.GenericServlet.getInitParameterNames(GenericServlet.java:167)
at polaris.servlet.PolarisContext.<init>(PolarisContext.java:54)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:296)
at java.lang.Class.newInstance(Class.java:249)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:902)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3420)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
608)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347
)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
97)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:218
9)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

The only thing I can think of is that the context-param isn't accessable 
  until after the context constructor is finished. Which makes it not 
very helpfull for me.

If anyone has another way of doing this without putting it into a 
properties file I'm interested.

(The whole point of this is we're trying to migrate our properties to DB 
tables and need to give the app the DB user and password)

Thanks


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message