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
Solved

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

Posted on 2010-08-17
4
2,323 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet example 11 49
hibernate example for saving data 19 53
mysql jsp example issue 32 48
Moving files from folder to folder 8 42
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
All of the resources available today make learning a new digital media easier than ever-- if you know where to begin. This is a clear, simple guide to a few of the basic digital art mediums and how to begin learning them on your own.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

860 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