This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem In Running Clinet Appplication For HelloWorld Bean

 
Pardha Saradhi Janaswami
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I am facing a new problem in running the java clinet application for the Depoyed bean(HelloWorld)... My Code for Client Application is as follows...
package org.acme;
import javax.rmi.*;
import javax.naming.*;
import java.util.*;
public class HelloWorld
{
public static void main( String args[])
{
try
{
Hashtable p = new Hashtable();
p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialConetxtFactory");
p.put(javax.naming.Context.PROVIDER_URL, "t3://196.12.10.75:7001");

InitialContext ctx = new InitialContext( p );

Object obj = ctx.lookup("/Hello");

HelloHome ejbHome = (HelloHome)
PortableRemoteObject.narrow(obj,HelloHome.class);
HelloObject ejbObject = ejbHome.create();

String message = ejbObject.sayHello();

System.out.println( message );

}
catch (Exception e)
{
e.printStackTrace();
}
}
}
This Application is compiling without any errors.. During Run Time the following execption is raised...
javax.naming.NoInitialContextException: Cannot instantiate class: weblogic.jndi.WLInitialConetxtFactory. Root exception is java.lang.ClassNotFoundException: weblogic.jndi.WLInitialConetxtFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:265)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:207)
at com.sun.naming.internal.VersionHelper12.loadClass VersionHelper
at javax.naming.spi.NamingManager.getInitialContextNamingManager
at javax.naming.InitialContext.getDefaultInitCtx InitialContext
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at org.acme.HelloWorld.main(HelloWorld.java:22)
Any Suggestions please.....
 
Rahul Mahindrakar
Ranch Hand
Posts: 1868
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to have weblogic.jar in the classpath of your client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic