I am getting this error while starting the spring application. I am new to Spring. Please help
E SRVE0020E: [Servlet Error]-[ECRTestWeb]: Failed to load servlet: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'OrderExceptionDestination' defined in class path resource [com/support/orderflowmanager/common/util/config/ofmmessaging-context.xml]: Initialization of bean failed; nested exception is javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: jms/OFM_OE: First component in name jms/OFM_OE not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0] javax.naming.NameNotFoundException: Context: localhost/nodes/localhost/servers/server1, name: jms/OFM_OE: First component in name jms/OFM_OE not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL mg.org/CosNaming/NamingContext/NotFound:1.0 at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.handleNameNotFound(WsnOptimizedNamingImpl.java:1983) at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.getNextWsnOptimizedNamingContext(WsnOptimizedNamingImpl.java:1320) at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.getTargetContext(WsnOptimizedNamingImplBase.java:2425) at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase$LeafOperationData.<init>(WsnOptimizedNamingImplBase.java:2890) at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:1391) at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(Unknown Source) at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:3491) at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1519) at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1480) at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1187) at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:1067) at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:144) at javax.naming.InitialContext.lookup(InitialContext.java:361) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:124) at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:86) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:122)
[ April 03, 2007: Message edited by: Rajkishore Pujari ] [ April 03, 2007: Message edited by: Rajkishore Pujari ]
In a nutshell what Spring does first is to initialize the application context loading the beans from your configuration file. There are several type of application context instances you can use with spring, but I could only assume that in your case you have a web context that you probably try to initialize it usin the servlet listener and the contextConfigLocation context parameter settings. Remember unless you don't explicitly tell to Spring it will load all your beans as singletons (hence you don't necessarily have to build java singletons with Spring since they are already there, but this is another story...)
What Spring is telling you is that it cannot initialize the OrderExceptionDestination bean define within the ofmmessaging-context.xml configuration file. As far as I could tell this bean in turn tries to do some jndi lookup in order to get a reference to a jms artifact, maybe a jms destination (queue or topic) or probably a queue/topic factory. Nevertheless the lookup fails and here there is why your application could not start up. Basically you don't necessarily have a Spring issue here, but rather a jndi configuration issue.
My next question is this: are you using IMB MQ? If that's the case then I may help you to lookup up your jms artifacts, but I would need the entire configuration settings.