I have the following code to export some of my services into JNDI:
When I deploy this as a WAR within Weblogic, I get the following exception:Code:public class RTMJndiBinder { private final JndiTemplate jndiTemplate = new JndiTemplate(); private Map<String, Object> jndiObjects; public void setJndiObjects(Map<String, Object> jndiObjects) { this.jndiObjects = jndiObjects; } @PostConstruct public void init() throws Exception { for (Map.Entry<String, Object> toBind : jndiObjects.entrySet()) { jndiTemplate.bind(toBind.getKey(), toBind.getValue()); } } @PreDestroy public void destroy() throws Exception { for (String jndiName : jndiObjects.keySet()) { if (jndiName != null && jndiTemplate.lookup(jndiName) != null) { jndiTemplate.unbind(jndiName); } } } }
Any thoughts?Code:<Nov 12, 2009 4:34:36 PM EST> <Warning> <HTTP> <BEA-101162> <User defined listen er org.springframework.web.context.ContextLoaderListener failed: org.springframe work.beans.factory.BeanCreationException: Error creating bean with name 'control SystemBinder': Invocation of init method failed; nested exception is javax.namin g.NameNotFoundException: While trying to lookup 'rtm.cacheManager' didn't find s ubcontext 'rtm'. Resolved ''; remaining name 'rtm/cacheManager'. org.springframework.beans.factory.BeanCreationException: Error creating bean wit h name 'controlSystemBinder': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: While trying to lookup 'rtm.cacheManager ' didn't find subcontext 'rtm'. Resolved ''; remaining name 'rtm/cacheManager' at org.springframework.beans.factory.annotation.InitDestroyAnnotationBea nPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProc essor.java:147) at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanF actory.java:350) at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331) at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBean Factory$1.run(AbstractAutowireCapableBeanFactory.java:409) Truncated. see log file for complete stacktrace javax.naming.NameNotFoundException: While trying to lookup 'rtm.cacheManager' di dn't find subcontext 'rtm'. Resolved ''; remaining name 'rtm/cacheManager' at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basic NamingNode.java:1139) at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.jav a:247) at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.j ava:182) at weblogic.jndi.internal.BasicNamingNode.lookupHereOrCreate(BasicNaming Node.java:270) at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:41 2) Truncated. see log file for complete stacktrace >


Reply With Quote