[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2010-08-17
4
Medium Priority
?
2,381 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 12

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 1500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A solution for Fortify Path Manipulation.
In this article I discuss my selections of the Top Four free Outlook OST File Viewers available. Open, view and read even damaged OST files by using these tools. They all provide a clear preview of all data such as emails, notes, tasks, calendars, e…
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

649 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