aspose file tools*
The moose likes BEA/Weblogic and the fly likes Problem In Running Clinet Appplication For HelloWorld Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Problem In Running Clinet Appplication For HelloWorld Bean" Watch "Problem In Running Clinet Appplication For HelloWorld Bean" New topic
Author

Problem In Running Clinet Appplication For HelloWorld Bean

Pardha Saradhi Janaswami
Greenhorn

Joined: Sep 05, 2003
Posts: 7
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

Joined: Jul 28, 2000
Posts: 1851
You need to have weblogic.jar in the classpath of your client.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem In Running Clinet Appplication For HelloWorld Bean