ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » javax.naming.NameNotFoundException

Post new topic  Reply to topic Goto page 1, 2  Next
 javax.naming.NameNotFoundException « View previous topic :: View next topic » 
Author Message
nuernbergms
PostPosted: Tue Mar 24, 2015 7:40 am    Post subject: javax.naming.NameNotFoundException Reply with quote

Novice

Joined: 24 Mar 2015
Posts: 11

Hello,
I'm learning about Websphere Application Server, MQ Server, and how to communicate from my EAR.

I setup WAS 8.5.5, MQ Server 7.5 (both developers editions) on SuSE 11 and verified they work as expected. I can deploy and run EARs on the WAS and can use the MQ Server using the MQExplorer.

Now I worked through an excellent tutorial. The tutorial URL follows with the next posting, because URLs seem to be not allowed for the first posting.

All configuration screens and tests looked for my setup exactly like in the document. However, in the WAS stdout log I found this error:

[see next posting]

I double checked all configuration steps but cannot find an error in my setup. I found some postings dealing with this error, but they either didn't help me or I couldn't understand them.

Can you help?

Best regards

Michael
Back to top
View user's profile Send private message
nuernbergms
PostPosted: Tue Mar 24, 2015 7:41 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2015
Posts: 11

Here is tuturial URL

http://www-01.ibm.com/support/docview.wss?uid=swg27016505.


Here is the stacktrace
Code:

[3/24/15 11:01:01:232 EDT] 0000003c MDBListenerIm W   WMSG0017E: Unable to lookup JMS resources, JNDI lookup exception: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
[3/24/15 11:01:01:233 EDT] 0000003c MDBListenerIm W   WMSG0019E: Unable to start MDB Listener SampleMDB, JMSDestination jms/SampleMDBQueue : javax.naming.NameNotFoundException: Context: linux-i4d0Node01Cell/nodes/linux-i4d0Node01/servers/server1, name: SampleMDBConnectionFactory: First component in name SampleMDBConnectionFactory not found. [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
   at com.ibm.ws.naming.jndicos.CNContextImpl.mapNotFoundException(CNContextImpl.java:4563)
   at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1821)
   at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1776)
   at com.ibm.ws.naming.jndicos.CNContextImpl.lookupExt(CNContextImpl.java:1433)
   at com.ibm.ws.naming.jndicos.CNContextImpl.lookup(CNContextImpl.java:615)
   at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:165)
   at com.ibm.ws.naming.util.WsnInitCtx.lookup(WsnInitCtx.java:179)
   at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
   at javax.naming.InitialContext.lookup(InitialContext.java:436)
   at com.ibm.ejs.jms.listener.MDBListenerImpl.createResources(MDBListenerImpl.java:267)
   at com.ibm.ejs.jms.listener.MDBListenerImpl.internalStart(MDBListenerImpl.java:738)
   at com.ibm.ejs.jms.listener.MDBListenerImpl.restart(MDBListenerImpl.java:711)
   at com.ibm.ejs.jms.listener.MDBListenerImpl.alarm(MDBListenerImpl.java:1134)
   at com.ibm.ejs.util.am._Alarm.runImpl(_Alarm.java:151)
   at com.ibm.ejs.util.am._Alarm.run(_Alarm.java:136)
   at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
   at com.ibm.ws.naming.ipcos.WsnOptimizedNamingImpl.do_resolve_complete_info(WsnOptimizedNamingImpl.java:568)
   at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.resolve_complete_info(WsnOptimizedNamingImplBase.java:2169)
   at com.ibm.WsnOptimizedNaming._NamingContextStub.resolve_complete_info(_NamingContextStub.java:538)
   at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2957)
   at com.ibm.ws.naming.jndicos.CNContextImpl$2.run(CNContextImpl.java:2953)
   at com.ibm.ws.naming.util.CommonHelpers.retry(CommonHelpers.java:801)
   at com.ibm.ws.naming.jndicos.CNContextImpl.cosResolve(CNContextImpl.java:2951)
   at com.ibm.ws.naming.jndicos.CNContextImpl.doLookup(CNContextImpl.java:1817)
   ... 14 more

[3/24/15 11:01:01:234 EDT] 0000003c MDBListenerIm I   WMSG0058I: Listener Port SampleMDBQueueLP will attempt to restart in 60 seconds
Back to top
View user's profile Send private message
Gaya3
PostPosted: Tue Mar 24, 2015 7:47 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

SampleMDBConnectionFactory is not found - ?
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Mar 24, 2015 8:29 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Looks to me like none of the naming context was found
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
nuernbergms
PostPosted: Tue Mar 24, 2015 11:34 pm    Post subject: Reply with quote

Novice

Joined: 24 Mar 2015
Posts: 11

So what can I do to analyze the problem? I'm not only new to MQ but also to JNDI in general.

> SampleMDBConnectionFactory is not found
When I created it using the wizard, at the end there was a successful connection test. What else could I missing?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 25, 2015 4:40 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Well there is that part where you match up the application's use of a JNDI reference to an actually existing JNDI reference in the app server.
I believe this is part of your deployment descriptor.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Gaya3
PostPosted: Wed Mar 25, 2015 6:06 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

nuernbergms wrote:
So what can I do to analyze the problem? I'm not only new to MQ but also to JNDI in general.

> SampleMDBConnectionFactory is not found
When I created it using the wizard, at the end there was a successful connection test. What else could I missing?


the context factory and jndi lookup in your apps is having some problem

The link that you posted is not working,
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
nuernbergms
PostPosted: Wed Mar 25, 2015 7:17 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2015
Posts: 11

> The link that you posted is not working

Sorry, there was a point at the end which made it invalid. Here's the corrected link.

http://www-01.ibm.com/support/docview.wss?uid=swg27016505

Attached to the page is the sample EAR including source. I think this the JNDI related configuration (from file ibm-ejb-jar-bnd.xmi).

Code:
<?xml version="1.0" encoding="UTF-8"?>
<ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi" xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1245334984127">
  <ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/>
  <ejbBindings xmi:type="ejbbnd:MessageDrivenBeanBinding" xmi:id="MessageDrivenBeanBinding_1245334984129" listenerInputPortName="SampleMDBQueueLP">
    <enterpriseBean xmi:type="ejb:MessageDriven" href="META-INF/ejb-jar.xml#SampleMDB"/>
  </ejbBindings>
</ejbbnd:EJBJarBinding>
Back to top
View user's profile Send private message
Gaya3
PostPosted: Wed Mar 25, 2015 7:41 am    Post subject: Reply with quote

Jedi

Joined: 12 Sep 2006
Posts: 2493
Location: Boston, US

1] did you restart the server after the configuration changes?
2] did you select the right scope for the jms providers in apps Server
3] Hope there are no space in the jms names / queues/listeners in apps server.
4] are you sure the listeners are up and running - stop the listener and see whats the error coming in systmout
5] Hope all MQ jars are properly updated in CLASSPATH
_________________
Regards
Gayathri
-----------------------------------------------
Do Something Before you Die
Back to top
View user's profile Send private message
nuernbergms
PostPosted: Wed Mar 25, 2015 8:06 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2015
Posts: 11

I'm sure about questions 1-4.

What is about question 5? Do I have to copy JARs from the MQ installation to the WAS classpath?
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 25, 2015 8:52 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

nuernbergms wrote:
I'm sure about questions 1-4.

What is about question 5? Do I have to copy JARs from the MQ installation to the WAS classpath?


I thought you were supposed to deploy the MQ Resource Adapter...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
nuernbergms
PostPosted: Wed Mar 25, 2015 11:48 pm    Post subject: Reply with quote

Novice

Joined: 24 Mar 2015
Posts: 11

> I thought you were supposed to deploy the MQ Resource Adapter...

I looked up this requirement but found that it should be only required for the Liberty profile. My understanding is that the Developers version I use ships with this adapter. Here's the output of versionInfo.sh

WVER0010I: Copyright (c) IBM Corporation 2002, 2012; All rights reserved.
WVER0012I: VersionInfo reporter version 1.15.1.48, dated 2/8/12

--------------------------------------------------------------------------------
IBM WebSphere Product Installation Status Report
--------------------------------------------------------------------------------

Report at date and time March 26, 2015 3:45:10 AM EDT

Installation
--------------------------------------------------------------------------------
Product Directory /mnt/sda3/opt/IBM/WebSphere/AppServer
Version Directory /mnt/sda3/opt/IBM/WebSphere/AppServer/properties/version
DTD Directory /mnt/sda3/opt/IBM/WebSphere/AppServer/properties/version/dtd
Log Directory /var/ibm/InstallationManager/logs

Product List
--------------------------------------------------------------------------------
BASE installed

Installed Product
--------------------------------------------------------------------------------
Name IBM WebSphere Application Server
Version 8.5.5.0
ID BASE
Build Level gm1319.01
Build Date 5/14/13
Package com.ibm.websphere.DEVELOPERSILAN.v85_8.5.5000.20130514_1044
Architecture x86-64 (64 bit)
Installed Features IBM 64-bit WebSphere SDK for Java
WebSphere Application Server Full Profile
EJBDeploy tool for pre-EJB 3.0 modules
Embeddable EJB container
Stand-alone thin clients and resource adapters
Optional Languages German

--------------------------------------------------------------------------------
End Installation Status Report
--------------------------------------------------------------------------------
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 26, 2015 5:06 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

Well did you specify the ${MQ_JAVA_INSTALL_PATH}/lib to the WAS variables when you set up WAS so that it can find the MQ jars, or are you relying on the internal WAS MQ Client?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
nuernbergms
PostPosted: Thu Mar 26, 2015 5:09 am    Post subject: Reply with quote

Novice

Joined: 24 Mar 2015
Posts: 11

> or are you relying on the internal WAS MQ Client?

Yes, this was my understanding that I can rely on this.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Mar 26, 2015 5:53 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

So what kind of JNDI setup did you do to define a connection factory and some destinations? Did you carefully choose to make certain you are defining them not only in the correct scope, but also for the correct provider? What choice of providers are you presented with and which one did you select?

You do realize that after the definition has been made (and saved), you need to reboot the was instance before it can take effect ...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » javax.naming.NameNotFoundException
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.