java:comp/env/ environment is read-only - Could not start ClientFactory javax.naming.NamingException -----------------------------------------------------------------------------------------------------
Key: SM-857 URL: https://issues.apache.org/activemq/browse/SM-857 Project: ServiceMix Issue Type: Bug Components: servicemix-core Affects Versions: 3.1 Environment: both Tomcat 5.5 and WAS 6.1 Reporter: Alper Sogukpinar As far as I know java:comp/env/ environment is read-only at runtime according to J2EE spec. Because of that it generates errror on start and stop methods of org.apache.servicemix.jbi.framework.ClientFactory class. I use Servicemix 3.1 in a web application and its configuration is very similar to configuration of "servicemix-web" example. When application starts I see exceptions which are taken from start and stop methods of org.apache.servicemix.jbi.framework.ClientFactory class. ClientFactory fails while binding itself to the namingContext and while unbinding from the context. I tested my application both in Tomcat 5.5 and Websphere 6.1. I see the similar logs for both. I also tested "servicemix-web" example with Tomcat 5.5 and I see the logs for "servicemix-web" example, too. In addition to these, warning messages in the stop and start methods are misspelled: (org.apache.servicemix.jbi.framework.ClientFactory) logger.warn("Cound not start ClientFactory: " + e); ----> logger.warn("Could not start ClientFactory: " + e); logger.warn("Cound not stop ClientFactory: " + e); ---->logger.warn("Could not stop ClientFactory: " + e); **************************WAS 6.1********************************************** Context name: java: Target name: java:comp/env/jbi/ClientFactory Other data: Object to bind: [EMAIL PROTECTED] Exception stack trace: javax.naming.OperationNotSupportedException: The operation on the context "java:comp/env/jbi/ClientFactory" cannot be completed. All contexts under java:comp/env are environment contexts and are read-only. at com.ibm.ws.naming.java.javaURLContextImpl.isThisContextUpdatable(javaURLContextImpl.java:238) at com.ibm.ws.naming.urlbase.UrlContextImpl.bind(UrlContextImpl.java:210) at com.ibm.ws.naming.urlbase.UrlContextImpl.bind(UrlContextImpl.java:344) at javax.naming.InitialContext.bind(InitialContext.java:371) at org.apache.servicemix.jbi.framework.ClientFactory.start(ClientFactory.java:84) at org.apache.servicemix.jbi.container.JBIContainer.start(JBIContainer.java:597) at org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:79) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1024) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:621) at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:275) at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:273) at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:88) at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157) at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:655) at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:608) at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:333) at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:549) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1312) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1129) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:814) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:965) at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2131) at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:340) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469) ********************************** TOMCAT 5.5 ****************************** 12587 WARN [main] org.apache.servicemix.jbi.framework.ClientFactory - Cound not start ClientFactory: javax.naming.NamingException: Context is read only 12587 DEBUG [main] org.apache.servicemix.jbi.framework.ClientFactory - Could not start ClientFactory javax.naming.NamingException: Context is read only at org.apache.naming.NamingContext.checkWritable(NamingContext.java:902) at org.apache.naming.NamingContext.bind(NamingContext.java:830) at org.apache.naming.NamingContext.bind(NamingContext.java:170) at org.apache.naming.NamingContext.bind(NamingContext.java:186) at org.apache.naming.SelectorContext.bind(SelectorContext.java:170) at javax.naming.InitialContext.bind(InitialContext.java:359) at org.apache.servicemix.jbi.framework.ClientFactory.start(ClientFactory.java:84) at org.apache.servicemix.jbi.container.JBIContainer.start(JBIContainer.java:597) at org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:79) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1057) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1024) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:421) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:140) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:273) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:346) at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3729) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4187) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:709) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.