1 Reply Latest reply on Apr 6, 2007 9:08 AM by kurtstam

    Problem with JNDI Context

    hmrizin

      Hi,

      I am having problems with the javax.naming.InitialContext that the JBossESB refers to. In one of my action classes i am creating a new Context and setting it to refer to Oracle 10g Server for EJB lookup.
      After the action class returns I am trying to perform Static Router Action. But now the ESB tries to retrieve the registry information with the Context information that I set for the Oracle 10g Server.

      I even tried resetting the Context back in the Action class once my EJB lookup is over. But I am still getting the same error.

      The following is the jboss-esb.xml that i am using.
      I am having two services, Service #1 and Service#2.
      The Service #1 has four actions and Service #2 has only one action.
      The execution goes like this.
      Service #1 Action #1 : No Change in context
      Service #1 Action #2 : Static Router Works Fine
      Service #1 Action #3 : Context changed. EJB lookup done. Context restored.
      Service #1 Action #4 : Static Router throws error

      <?xml version = "1.0" encoding = "UTF-8"?>
      <jbossesb
       xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.xsd"
       parameterReloadSecs="5">
      
       <providers>
       <jms-provider name="JBossMQ"
       connection-factory="ConnectionFactory"
       jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
       jndi-URL="localhost">
      
       <jms-bus busid="ESBRequestGw">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/ESBRequestGwQ" />
       </jms-bus>
       <jms-bus busid="ESBRequestEsb">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/ESBRequestEsbQ" />
       </jms-bus>
       <jms-bus busid="ESBResponseBusGw">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/ESBResponseGwQ" />
       </jms-bus>
       <jms-bus busid="ESBResponseBusEsb">
       <jms-message-filter dest-type="QUEUE" dest-name="queue/ESBResponseEsbQ" />
       </jms-bus>
       </jms-provider>
       </providers>
      
       <services>
       <!-- SERVICE #1-->
       <service category="ESupplyOMSEndPoint" name="ESupplyOMSService" description="ESupply OMS Service">
       <listeners>
       <jms-listener name="ESBRequestGw" busidref="ESBRequestGw" maxThreads="1" is-gateway="true"/>
       <jms-listener name="ESBRequestEsb" busidref="ESBRequestEsb" maxThreads="1"/>
       </listeners>
       <actions>
       <!-- SERVICE #1 ACTION #1 -->
       <action
       name="processSOAction"
       class="fs.proto.esupply.service.ESupplyProcessSOAction"
       process="processSO">
       <property name="exceptionMethod" value="exceptionHandler"/>
       </action>
       <!-- SERVICE #1 ACTION #2 -->
       <action name="routeToNotifyEndPoint" class="org.jboss.soa.esb.actions.StaticRouter">
       <property name="destinations">
       <route-to service-category="NotifyEndPoint" service-name="NotifyService" />
       </property>
       </action>
       <!-- SERVICE #1 ACTION #3 -->
       <action
       name="uploadSOAction"
       class="fsproto.esb.elog.service.ELogUploadSOAction"
       process="uploadSO">
       <property name="exceptionMethod" value="exceptionHandler"/>
       </action>
       <!-- SERVICE #1 ACTION #4 -->
       <action name="routeToNotifyEndPoint" class="org.jboss.soa.esb.actions.StaticRouter">
       <property name="destinations">
       <route-to service-category="NotifyEndPoint" service-name="NotifyService" />
       </property>
       </action>
       </actions>
       </service>
      
       <!-- SERVICE #2 -->
       <service category="NotifyEndPoint" name="NotifyService" description="Notify Service">
       <listeners>
       <jms-listener name="ESBResponseBusEsb" busidref="ESBResponseBusEsb" maxThreads="1" />
       <jms-listener name="ESBResponseBusGw" busidref="ESBResponseBusGw" maxThreads="1" is-gateway="true"/>
       </listeners>
       <actions>
       <!-- SERVICE #2 ACTION #1 -->
       <action
       name="replyJMSClient"
       class="fs.proto.esb.service.ReplyJMSClient"
       process="replyClient">
       <property name="destination" value="ESBResponseGwQ" />
       <property name="exceptionMethod" value="exceptionHandler"/>
       </action>
       </actions>
       </service>
      
       </services>
      
      </jbossesb>
      


      The Error message is

      2007-03-22 21:02:48,663 ERROR [pool-4-thread-1][org.jboss.soa.esb.services.routing.MessageRouter] Co
      uld not obtain an EPR from the Registry. Message is not routed. javax.naming.NamingException: Error
      reading application-client descriptor: No location specified and no suitable instance of the type 'c
      om.foursoft.elog.salesorder.ejb.sls.SalesManager' found for the ejb-ref ejb/EJB_com.foursoft.elog.sa
      lesorder.ejb.sls.SalesManagerBean
      org.jboss.soa.esb.services.registry.RegistryException: javax.naming.NamingException: Error reading a
      pplication-client descriptor: No location specified and no suitable instance of the type 'com.fourso
      ft.elog.salesorder.ejb.sls.SalesManager' found for the ejb-ref ejb/EJB_com.foursoft.elog.salesorder.
      ejb.sls.SalesManagerBean
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:332
      )
       at org.jboss.soa.esb.services.routing.MessageRouter.deliverMessages(MessageRouter.java:103)
       at org.jboss.soa.esb.actions.StaticRouter.process(StaticRouter.java:66)
       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.jboss.soa.esb.listeners.message.ActionProcessingPipeline.run(ActionProcessingPipeline.java:9
      0)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.xml.registry.JAXRException: javax.naming.NamingException: Error reading application
      -client descriptor: No location specified and no suitable instance of the type 'com.foursoft.elog.sa
      lesorder.ejb.sls.SalesManager' found for the ejb-ref ejb/EJB_com.foursoft.elog.salesorder.ejb.sls.Sa
      lesManagerBean
       at org.apache.ws.scout.registry.BusinessQueryManagerImpl.findServices(BusinessQueryManagerImpl.java
      :663)
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:
      440)
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:317
      )
       ... 10 more
      2007-03-22 21:02:48,679 ERROR [pool-4-thread-1][org.jboss.soa.esb.listeners.message.ActionProcessing
      Pipeline] Process method threw Exception
      java.lang.reflect.InvocationTargetException
       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.jboss.soa.esb.listeners.message.ActionProcessingPipeline.run(ActionProcessingPipeline.java:9
      0)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: org.jboss.soa.esb.addressing.MalformedEPRException: org.jboss.soa.esb.services.routing.Me
      ssageRouterException: Message Could not be delivered due to issues with the Registry. javax.naming.N
      amingException: Error reading application-client descriptor: No location specified and no suitable i
      nstance of the type 'com.foursoft.elog.salesorder.ejb.sls.SalesManager' found for the ejb-ref ejb/EJ
      B_com.foursoft.elog.salesorder.ejb.sls.SalesManagerBean
       at org.jboss.soa.esb.actions.StaticRouter.process(StaticRouter.java:71)
       ... 8 more
      Caused by: org.jboss.soa.esb.services.routing.MessageRouterException: Message Could not be delivered
       due to issues with the Registry. javax.naming.NamingException: Error reading application-client des
      criptor: No location specified and no suitable instance of the type 'com.foursoft.elog.salesorder.ej
      b.sls.SalesManager' found for the ejb-ref ejb/EJB_com.foursoft.elog.salesorder.ejb.sls.SalesManagerB
      ean
       at org.jboss.soa.esb.services.routing.MessageRouter.deliverMessages(MessageRouter.java:160)
       at org.jboss.soa.esb.actions.StaticRouter.process(StaticRouter.java:66)
       ... 8 more
      Caused by: org.jboss.soa.esb.services.registry.RegistryException: javax.naming.NamingException: Erro
      r reading application-client descriptor: No location specified and no suitable instance of the type
      'com.foursoft.elog.salesorder.ejb.sls.SalesManager' found for the ejb-ref ejb/EJB_com.foursoft.elog.
      salesorder.ejb.sls.SalesManagerBean
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:332
      )
       at org.jboss.soa.esb.services.routing.MessageRouter.deliverMessages(MessageRouter.java:103)
       ... 9 more
      Caused by: javax.xml.registry.JAXRException: javax.naming.NamingException: Error reading application
      -client descriptor: No location specified and no suitable instance of the type 'com.foursoft.elog.sa
      lesorder.ejb.sls.SalesManager' found for the ejb-ref ejb/EJB_com.foursoft.elog.salesorder.ejb.sls.Sa
      lesManagerBean
       at org.apache.ws.scout.registry.BusinessQueryManagerImpl.findServices(BusinessQueryManagerImpl.java
      :663)
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findService(JAXRRegistryImpl.java:
      440)
       at org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl.findEPRs(JAXRRegistryImpl.java:317
      )
       ... 10 more
      


      Pls Help
      Hmrizin

        • 1. Re: Problem with JNDI Context
          kurtstam

          Hi hmrizin,

          Can you try this again with the latest 4.2MR1 release, and if this is still an issue, can you open a JIRA for it, and attach the action class that is doing the lookup, as well as your jbossesb.xml. This should not be too hard to fix for us.

          Thanks!

          --Kurt