Solved

Urgent - How to lookup JMS resource from standalone client in Websphere Application Server 7

Posted on 2010-08-17
4
2,334 Views
Last Modified: 2013-12-11
I created a EAR project and an application Client project using RAD 7.5. Client project has been included as a module in EAR. The client project has Main.java (Standalone class).

RAD7.5 has been configured to use local WAS7.0.11 test environment. JMS resources have been configured in WAS7.0.11 test environment and SI bus has already been created in WAS. My final goal is to send a message to SI bus queue using Main.java class. But I am getting the below exception during InitialContext lookup itself.

Exception in RAD7.5 console is below:

InitialContext starts....
Aug 11, 2010 10:07:46 PM com.ibm.ws.naming.util.CommonHelpers
WARNING: jndiproviderProperties
Aug 11, 2010 10:07:47 PM com.ibm.ws.naming.util.CommonHelpers
WARNING: jndiproviderProperties
Aug 11, 2010 10:07:47 PM com.ibm.websphere.naming.WsnInitialContextFactory
WARNING: noInitCtxFactoryImpl
Exception in thread "main" javax.naming.ConfigurationException: The property com.ibm.ws.naming.wsn.factory.initial is not set. The most likely cause is that the jar which contains the file com/ibm/websphere/naming/jndiprovider.properties cannot be found by the class loader.
at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:194)
at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:112)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:675)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:257)
at javax.naming.InitialContext.init(InitialContext.java:233)
at javax.naming.InitialContext.<init>(InitialContext.java:209)
at sender.Main.main(Main.java:29)


Main.java class snippet is below:


24 public static void main(String[] args) throws Exception {  
25 Hashtable env = new Hashtable();  
26 env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");  
27 env.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2810");
28 System.out.println("InitialContext starts....");  
29 InitialContext initCtx = new InitialContext(env);  

Open in new window


I verified Bootstrap_address, it is 2810 in my case in configuration file.

When I googled it, people suggest to include few jars into client class path, if is it so, Can you please advise me, what are those and from where I can get those?. Please advise me, it is very urgent to me.
0
Comment
Question by:MatrixStar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Expert Comment

by:Radek Baranowski
ID: 33462685
if you have assemblied your ear in some improper way. that means, failed to attach all necessary information in deployment descriptor you may need to either correct it (to provide all necessary resour ces on ear level), or try to change classloader policy in WAS to parent first (that means that many common classes will be supplied by the application container of the WAS rather than from ear package.
0
 
LVL 8

Expert Comment

by:AdminRAM
ID: 33465922
Most of the class contains under C:\WebsphereV7.0\plugins or C:\WebsphereV7.0\lib
0
 
LVL 2

Accepted Solution

by:
calboronster earned 500 total points
ID: 33515742
I could make these suggestions

1. If you are going to use java as jms client, remove corbaloc directive.
2. On websphere 6 the libraries are -
\IBM\WebSphere\AppServer\lib\naming.jar;namingserver.jar;namingclient.jar, runtime.jar
Can you check in these?
3.  THIS LOOKS LIKE A CHANGE FROM WAS6 - Use the Java constant, javax.naming.Context.INITIAL_CONTEXT_FACTORY, for the property name, and the constant, com.ibm.websphere.naming.PROPS.INITIAL_CONTEXT_FACTORY, for the property value.

(http://publib.boulder.ibm.com/infocenter/wasinfo/fep/index.jsp?topic=/com.ibm.websphere.javadoc.doc/web/apidocs/com/ibm/websphere/naming/WsnInitialContextFactory.html)

Including more libraries (typically websphere libraries) in application classpath than required causes classloading issues so beware.
0
 

Author Closing Comment

by:MatrixStar
ID: 33550396
Thank you!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
spring maven example issues 3 90
downlod failures 6 90
Need public domain maps 3 69
dao vs facade design patterns 2 64
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question