This discussion is archived
3 Replies Latest reply: Dec 23, 2011 1:42 AM by 902696 RSS

javax.naming.NameNotFoundException

902696 Newbie
Currently Being Moderated
Hi everybody,

I have a Queue and a connection factory created both in a Weblogic Server. I have a producer which sends messages to the queue and a consumer which has to consume these messages. I can see in the web console that messages arrive to the queue so that the producer runs properly, but when I try to run my CEP application in the CEP server, I can see in the Weblogic Server console that it connects to the queue and gets the messages, but it launches an exception and does not print the message's String property.

The queue is named      eventsmes.Queue and the connexion factory is named eventsmes.EventsQueueConnectionFactory (in JNDI notation both).

The trace is the following:

javax.naming.NameNotFoundException; remaining name 'eventsmes.EventsQueueConnectionFactory'
     at com.bea.core.jndi.context.internal.MemContextImpl.makeNNFE(MemContextImpl.java:102)
     at com.bea.core.jndi.context.internal.MemContextImpl.lookupObject(MemContextImpl.java:234)
     at com.bea.core.jndi.context.internal.MemContextImpl.lookupImpl(MemContextImpl.java:195)
     at com.bea.core.jndi.context.internal.AbstractContextImpl.lookup(AbstractContextImpl.java:149)
     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     at com.bea.wlevs.adapter.example.mesevents.MeSEventsAdapter.run(MeSEventsAdapter.java:43)
     at com.bea.wlevs.adapter.example.mesevents.MeSEventsAdapter$$FastClassByCGLIB$$92231f76.invoke(<generated>)
     at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
     at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
     at com.bea.wlevs.ede.impl.EventManagerAccessorProxy.invoke(EventManagerAccessorProxy.java:30)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
     at com.bea.wlevs.ede.impl.EventBeanProxy.invoke(EventBeanProxy.java:38)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
     at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
     at com.bea.wlevs.adapter.example.mesevents.MeSEventsAdapter$$EnhancerByCGLIB$$1a576a0d.run(<generated>)
     at com.bea.wlevs.spring.RunnableBeanPostProcessor$RunnableWrapper.run(RunnableBeanPostProcessor.java:117)
     at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:203)
     at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
<22-dic-2011 19H03' CET> <Warning> <Spring> <BEA-2047006> <Trabajo '[2878] executing: com.bea.wlevs.spring.RunnableBeanPostProcessor$RunnableWrapper@150c8e25' terminado con excepción = commonj.work.WorkException: java.lang.NullPointerException
commonj.work.WorkException: java.lang.NullPointerException
     at weblogic.work.commonj.CommonjWorkManagerImpl$WorkStatus.setThrowable(CommonjWorkManagerImpl.java:267)
     at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:205)
     at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused By: java.lang.NullPointerException
     at com.bea.wlevs.adapter.example.mesevents.MeSEventsAdapter.run(MeSEventsAdapter.java:61)
     at com.bea.wlevs.adapter.example.mesevents.MeSEventsAdapter$$FastClassByCGLIB$$92231f76.invoke(<generated>)
     at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
     at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
     at com.bea.wlevs.ede.impl.EventManagerAccessorProxy.invoke(EventManagerAccessorProxy.java:30)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
     at com.bea.wlevs.ede.impl.EventBeanProxy.invoke(EventBeanProxy.java:38)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
     at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
     at com.bea.wlevs.adapter.example.mesevents.MeSEventsAdapter$$EnhancerByCGLIB$$1a576a0d.run(<generated>)
     at com.bea.wlevs.spring.RunnableBeanPostProcessor$RunnableWrapper.run(RunnableBeanPostProcessor.java:117)
     at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:203)
     at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)

My consumer code is the following:

          try {
               
               InitialContext ctx = new InitialContext();
               
               connFactory = (QueueConnectionFactory) ctx.lookup("eventsmes.EventsQueueConnectionFactory");
               queue = (Queue) ctx.lookup("eventsmes.Queue");
               queueConn = connFactory.createQueueConnection();
               queueSession = queueConn.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
               
          } catch (NamingException e) {
               
               e.printStackTrace();
               
          } catch (JMSException e) {
               
               e.printStackTrace();
          }
          
          JMSClient jmsclient = new JMSClient();
          
          try {
               
               mC = queueSession.createConsumer(queue);
               mC.setMessageListener(jmsclient);
               queueConn.start();
          }
          
          catch (JMSException e1) {
               
               e1.printStackTrace();
          }

JMSClient class implements MessageListener interface and onMessage method, in which there is a System.out.println() code line to print message's String property.


What do you think it is happening?


Thanks everybody!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points