I am defining each of the Environment Variables in an <Environment> Tag inside of the context.xml like: <Context> ... <Environment name="email.abc.signup.subject" value="Sign Up for the ABC Plan" type="java.lang.String" override="false" /> ... </Context>
I am getting an nullpoint exception when doing something with information returned from Context.lookup("java:comp/env/EnvironmentVariables") method here is the exact stack trace: Oct 22, 2010 9:44:07 AM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:/Program Files/Java/jre6/lib/i386;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Intel\DMIX;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave Systems Corp\Gemalto\Access Client\v5\;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\9.0\DLLShared\;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Reflection\ Oct 22, 2010 9:44:07 AM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:MGE' did not find a matching property. Oct 22, 2010 9:44:07 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Oct 22, 2010 9:44:07 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 290 ms Oct 22, 2010 9:44:07 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Oct 22, 2010 9:44:07 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.26 Oct 22, 2010 9:44:08 AM org.apache.catalina.core.NamingContextListener addEnvironment SEVERE: Environment entry javax.naming.NamingException: Cannot create resource instance has an invalid value log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources). log4j:WARN Please initialize the log4j system properly. Oct 22, 2010 9:44:08 AM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'MGEWebAdminClient' test11111111111111111111111 Oct 22, 2010 9:44:09 AM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'propInstance' defined in ServletContext resource [/WEB-INF/mge-main-cfg.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.mge.rma.main.SingleInstanceVariable]: Constructor threw exception; nested exception is java.lang.NullPointerException Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.mge.rma.main.SingleInstanceVariable]: Constructor threw exception; nested exception is java.lang.NullPointerException Caused by: java.lang.NullPointerException at com.mge.shared.util.ResourceUtils.getPropertyValue(ResourceUtils.java:59) at com.mge.shared.util.ResourceUtils.getProperty(ResourceUtils.java:54) at com.mge.rma.main.SingleInstanceVariable.<init>(SingleInstanceVariable.java:116) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:732) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:720) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:279) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:360) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:329) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:265) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:235) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126) at javax.servlet.GenericServlet.init(GenericServlet.java:212) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Oct 22, 2010 9:44:09 AM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /MGE threw load() exception -----Original Message----- From: Pid [mailto:p...@pidster.com] Sent: Friday, October 22, 2010 11:27 AM To: Tomcat Users List Subject: Re: Question On 22/10/2010 16:27, Marshall, Marc wrote: > Hi, > > I am a new user to Tomcat and am converting from Websphere server to a Tomcat > 6.0 server running out of eclipse. The Websphere server has Environment > variables in "java:comp/env/EnvironmentVariables". After looking at the > context.xml documentation I had assumed that I could place them in the > individual <Environment> tags. My application does a lookup using a > Context.lookup("java:comp/env/EnvironmentVariables") method to find the > Environment variables so when I startup Tomcat I get errors because it is > looking at the "java:comp/env/EnvironmentVariables" for my Environment > variables. Does anyone have suggestions on what I am doing wrong or am I > completely on the wrong track? Thank in advance for any help you may give. How are you defining the resource in Tomcat, exactly? What is the full stacktrace of the error in the logs? p > Thanks, > > Marc Marshall > > Private and confidential as detailed here: > http://www.sug.com/disclaimers/default.htm#Mail . If you cannot access the > link, please e-mail sender. > Private and confidential as detailed here: http://www.sug.com/disclaimers/default.htm#Mail . If you cannot access the link, please e-mail sender. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org