5 Replies Latest reply on Apr 19, 2016 3:16 PM by Arun Yadav

    Exception loading Tomcat environment variables at startup.

    Doug Prostko

      When trying to start the newest version of Sparkler in Tomcat, I get the following error:

       

      2015-10-08 14:36:11,701 ERROR (http-nio-443-exec-185) [com.tsi.bizsys.sparkler.config.TomcatMapper.getEnvironment:46] - Exception loading Tomcat environment variables at startup.

      javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].

              at org.apache.naming.NamingContext.lookup(NamingContext.java:818)

              at org.apache.naming.NamingContext.lookup(NamingContext.java:166)

              at org.apache.naming.SelectorContext.lookup(SelectorContext.java:157)

              at javax.naming.InitialContext.lookup(InitialContext.java:417)

              at com.tsi.bizsys.sparkler.config.TomcatMapper.getEnvironment(TomcatMapper.java:32)

              at com.tsi.bizsys.sparkler.config.SparklerEnv.init(SparklerEnv.java:226)

              at com.tsi.bizsys.sparkler.config.SparklerConfig.<init>(SparklerConfig.java:66)

              at com.tsi.bizsys.sparkler.config.SparklerConfig$$EnhancerBySpringCGLIB$$df3d7abb.<init>(<generated>)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:408)

              at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)

              at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)

              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)

              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)

              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)

              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)

              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)

              at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)

              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)

              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4751)

              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5175)

              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

              at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1265)

              at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:673)

              at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:221)

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

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

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:534)

              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)

              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)

              at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)

              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)

              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

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

      2015-10-08 14:36:11,703 ERROR (http-nio-443-exec-185) [org.springframework.web.context.ContextLoader.initWebApplicationContext:331] - Context initialization failed

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sparklerConfig' defined in file [/opt/tomcat8/webapps/sparkler-t4b/WEB-INF/classes/com/tsi/bizsys/sparkler/config/SparklerConfig.class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.tsi.bizsys.sparkler.config.SparklerConfig$$EnhancerBySpringCGLIB$$df3d7abb]: Constructor threw exception; nested exception is java.lang.RuntimeException: javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1076)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1021)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

              at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)

              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)

              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)

              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)

              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)

              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)

              at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)

              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)

              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4751)

              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5175)

              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

              at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1265)

              at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:673)

              at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:221)

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

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

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)

              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)

              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:615)

              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)

              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

              at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)

              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:534)

              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)

              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)

              at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)

              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1566)

              at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1523)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

              at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

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

      Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.tsi.bizsys.sparkler.config.SparklerConfig$$EnhancerBySpringCGLIB$$df3d7abb]: Constructor threw exception; nested exception is java.lang.RuntimeException: javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].

              at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:164)

              at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1069)

              ... 49 more

      Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].

              at com.tsi.bizsys.sparkler.config.TomcatMapper.getEnvironment(TomcatMapper.java:47)

              at com.tsi.bizsys.sparkler.config.SparklerEnv.init(SparklerEnv.java:226)

              at com.tsi.bizsys.sparkler.config.SparklerConfig.<init>(SparklerConfig.java:66)

              at com.tsi.bizsys.sparkler.config.SparklerConfig$$EnhancerBySpringCGLIB$$df3d7abb.<init>(<generated>)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:408)

              at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)

              ... 51 more

      Caused by: javax.naming.NameNotFoundException: Name [comp/env] is not bound in this Context. Unable to find [comp].

              at org.apache.naming.NamingContext.lookup(NamingContext.java:818)

              at org.apache.naming.NamingContext.lookup(NamingContext.java:166)

              at org.apache.naming.SelectorContext.lookup(SelectorContext.java:157)

              at javax.naming.InitialContext.lookup(InitialContext.java:417)

              at com.tsi.bizsys.sparkler.config.TomcatMapper.getEnvironment(TomcatMapper.java:32)

              ... 59 more

      08-Oct-2015 14:36:11.705 SEVERE [http-nio-443-exec-185] org.apache.catalina.core.StandardContext.startInternal Error listenerStart

      08-Oct-2015 14:36:11.705 SEVERE [http-nio-443-exec-185] org.apache.catalina.core.StandardContext.startInternal Context [/sparkler-t4b] startup failed due to previous errors

       

      Here is my Tomcat and server info:

       

      Tomcat VersionJVM VersionJVM VendorOS NameOS VersionOS ArchitectureHostnameIP Address
      Apache Tomcat/8.0.111.8.0_20-b26Oracle CorporationLinux2.6.32-358.el6.x86_64

       

      Any idea what's wrong?  Also, is it possible to download an older version of Sparkler from somewhere?  Version 0.0.4 worked just fine for me.