Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

sravan mandala

Greenhorn
+ Follow
since Mar 13, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sravan mandala

Hi Adil,

Thank you so much for your explination, but I am still confused about the shift operators.

How do we calculate if it is (b<<31) and (b >>31) I would really appreciate if you can explain this to me.

Thanks
Sham
Hi ,
I am using a Sax2.0 api for parsing an xml file and source code of that is
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import java.io.*;
public class Example1 extends DefaultHandler {

// Override methods of the DefaultHandler class
// to gain notification of SAX Events.
//
// See org.xml.sax.ContentHandler for all available events.
//
public void startDocument( ) throws SAXException {
System.out.println( "SAX Event: START DOCUMENT" );
}
public void endDocument( ) throws SAXException {
System.out.println( "SAX Event: END DOCUMENT" );
}
public void startElement( String namespaceURI,
String localName,
String qName,
Attributes attr ) throws SAXException {
System.out.println( "SAX Event: START ELEMENT[ " + localName + " ]" );
// Also, let's print the attributes if
// there are any...
for ( int i = 0; i < attr.getLength(); i++ ){
System.out.println( " ATTRIBUTE: " + attr.getLocalName(i) + " VALUE: " +
attr.getValue(i) );
}
}
public void endElement( String namespaceURI,
String localName,
String qName ) throws SAXException {
System.out.println( "SAX Event: END ELEMENT[ " + localName + " ]" );
}
public void characters( char[] ch, int start, int length )
throws SAXException {
System.out.print( "SAX Event: CHARACTERS[ " );
try {
OutputStreamWriter outw = new OutputStreamWriter(System.out);
outw.write( ch, start,length );
outw.flush();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println( " ]" );
}

public static void main( String[] argv ){
System.out.println( "Example1 SAX Events:" );
try {
// Create SAX 2 parser...
XMLReader xr = XMLReaderFactory.createXMLReader();
// Set the ContentHandler...
xr.setContentHandler( new Example1() );
// Parse the file...
xr.parse( new InputSource(
new FileReader( "Example1.xml" )) );

}
catch (SAXException e1) {
System.out.println("the messageis:"+e1.getMessage());
}

catch ( Exception e ) {
e.printStackTrace();
}
}
}

and when i run the above example with giving a .xml file as argument its giving the following error can anyoone tell me what the error could be and how to solve it
Exception is : org.xml.sax.driver not specified
but i dont find any class by name driver in the package please tell me
Hi Suneel,
I had commented the provide_url line but still its giving the same problem i dont know why i am getting such error please tell me what are all the classpath you have set after installing the Wesbphere3.5, the error is
E:\WebSphere\samples>java package1.CartClient
1
2
3
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:477)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$1(URLClassLoader.java:216)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:285)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:314)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:199)
at org.omg.CORBA.ORB.create_impl(ORB.java:303)
at org.omg.CORBA.ORB.init(ORB.java:352)
at com.ibm.CORBA.iiop.GlobalORBFactory.init(GlobalORBFactory.java:42)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:196)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java, Compiled Code)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:65)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:47)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:343)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.initORB(CNInitialContextFactory.java:355)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:196)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:242)
at javax.naming.InitialContext.init(InitialContext.java:218)
at javax.naming.InitialContext.<init>(InitialContext.java:194)
at package1.CartClient.<init>(CartClient.java:22)
at package1.CartClient.main(CartClient.java:11)
and i modified the client program as
package package1;
import java.util.*;
import java.rmi.*;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
public class CartClient
{
public static void main(String args[])
{
new CartClient();
}
CartClient()
{
try {
System.out.println("1");
Properties properties = new Properties();
System.out.println("2");
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
System.out.println("3");
Context initial= new InitialContext(properties);
System.out.println("4");
Object homeObject=initial.lookup("sample1");
System.out.println("5");
HelloHome home =(HelloHome)PortableRemoteObject.narrow(homeObject,HelloHome.class);
System.out.println("6");
Hello shoppingCart = home.create();
System.out.println("the output is :"+shoppingCart.getMessage());
}
catch (Exception ex)
{
System.err.println("Caught an unexpected exception!");
ex.printStackTrace();
}
}
}
Please kindly help me suneel
waiting for your reply
Regards
shravan
19 years ago
Hi Prashanth,
Can you help please i have deployed a bean using jetace tool and then when i am running the client program its giving the following error
E:\WebSphere\samples>java HelloClient
1
2
3
iiop://192.168.0.11
com.ibm.ejs.ns.jndi.CNInitialContextFactory
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:477)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$1(URLClassLoader.java:216)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:285)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:314)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:199)
at org.omg.CORBA.ORB.create_impl(ORB.java:303)
at org.omg.CORBA.ORB.init(ORB.java:352)
at com.ibm.CORBA.iiop.GlobalORBFactory.init(GlobalORBFactory.java:42)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:196)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java, Compiled Code)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:65)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:47)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:343)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.initORB(CNInitialContextFactory.java:355)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:196)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
at javax.naming.InitialContext.init(InitialContext.java:226)
at javax.naming.InitialContext.<init>(InitialContext.java:202)
at HelloClient.main(HelloClient.java:25)
and my client program is
HelloClient.java

import com.ibm.ejb.cb.samples.hello.tier2.Hello; // Hello EJB
import com.ibm.ejb.cb.samples.hello.tier2.HelloHome; // Hello EJB's Home
import java.util.*;
import java.rmi.*;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
public class HelloClient{
public static void main(String [] args) {
try {
// Properties props = System.getProperties() ;
// Context ctx = new InitialContext(props) ;
System.out.println("1");
Properties properties = new Properties();
System.out.println("2");
properties.put(javax.naming.Context.PROVIDER_URL,"iiop://192.168.0.11";);
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
System.out.println("3");
System.out.println(properties.get(javax.naming.Context.PROVIDER_URL));
System.out.println(properties.get(javax.naming.Context.INITIAL_CONTEXT_FACTORY));
InitialContext initial= new InitialContext(properties);
System.out.println("4");
Object homeObject=initial.lookup("HelloHome");
System.out.println("5");
HelloHome home =(HelloHome) PortableRemoteObject.narrow(homeObject,HelloHome.class);
System.out.println("6");

//Context ctx = new InitialContext() ;
//HelloHome home = (HelloHome) ctx.lookup("HelloHome") ;
Hello hello = home.create() ;
System.out.println(hello.getMessage()) ;
hello.remove() ;
}catch(Exception excp) {
System.out.println("the message is:"+excp.getMessage());
}
}
}
waiting for your reply
REgards
shravan
19 years ago
Hi Sunil,
I have created a jar file as per what you have said i am able to deploy the bean but when i am running the client i am getting the following error
E:\WebSphere\samples>java HelloClient
1
2
3
iiop://192.168.0.11
com.ibm.ejs.ns.jndi.CNInitialContextFactory
Exception in thread "main" java.lang.NoClassDefFoundError: com/ibm/rmi/iiop/ORB
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:477)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:109)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$1(URLClassLoader.java:216)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
at java.lang.ClassLoader.loadClass(ClassLoader.java, Compiled Code)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:285)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:314)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:199)
at org.omg.CORBA.ORB.create_impl(ORB.java:303)
at org.omg.CORBA.ORB.init(ORB.java:352)
at com.ibm.CORBA.iiop.GlobalORBFactory.init(GlobalORBFactory.java:42)
at com.ibm.ejs.oa.EJSORBImpl.initializeORB(EJSORBImpl.java:196)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java, Compiled Code)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:65)
at com.ibm.ejs.oa.EJSClientORBImpl.<init>(EJSClientORBImpl.java:47)
at com.ibm.ejs.oa.EJSORB.init(EJSORB.java:343)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.initORB(CNInitialContextFactory.java:355)
at com.ibm.ejs.ns.jndi.CNInitialContextFactory.getInitialContext(CNInitialContextFactory.java:196)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:672)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
at javax.naming.InitialContext.init(InitialContext.java:226)
at javax.naming.InitialContext.<init>(InitialContext.java:202)
at HelloClient.main(HelloClient.java:25)
and my client program is
HelloClient.java
import package1.*;
import java.util.*;
import java.rmi.*;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
public class HelloClient{
public static void main(String [] args) {
try {
System.out.println("1");
Properties properties = new Properties();
System.out.println("2");
properties.put(javax.naming.Context.PROVIDER_URL,"iiop://192.168.0.11";);
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
System.out.println("3");
System.out.println(properties.get(javax.naming.Context.PROVIDER_URL));
System.out.println(properties.get(javax.naming.Context.INITIAL_CONTEXT_FACTORY));
InitialContext initial= new InitialContext(properties);
System.out.println("4");
Object homeObject=initial.lookup("sample1");
System.out.println("5");
HelloHome home =(HelloHome) PortableRemoteObject.narrow(homeObject,HelloHome.class);
System.out.println("6");
Hello hello = home.create() ;
System.out.println(hello.getMessage()) ;
hello.remove() ;
}catch(Exception excp) {
excp.printStackTrace() ;
}
}
}
please can you help me sunil, in the Websphere console its showing in the running status but still i am unable to run the above client program please can you look into that and do i have to set any classpath etc.
Waiting for your reply eagerly
Regards
shravan
19 years ago
Hi Suneel Setlur,
I am new to Websphere3.5 and i am trying to deploy a Stateless session bean just hello program i have written the following program
Hello.java
package package1;
import javax.ejb.EJBObject;
import java.lang.String;
import java.rmi.RemoteException;

public interface Hello extends EJBObject {
public String getMessage() throws RemoteException;
}
HelloHome.java
package package1;
import javax.ejb.EJBHome;
public interface HelloHome extends EJBHome {
public Hello create() throws java.rmi.RemoteException,
javax.ejb.CreateException;
}
HelloBean.java
package package1;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.EJBException;
import java.rmi.RemoteException;
import java.util.ResourceBundle;
import java.util.ListResourceBundle;

public class HelloBean extends Object implements SessionBean {
public HelloBean ()
{
super();
}
public void ejbCreate () {
}
public void ejbActivate () throws RemoteException
{
}
public void ejbPassivate () throws RemoteException
{
// nothing needed to be done by me
}
public void ejbRemove () throws RemoteException
{

}
public void setSessionContext (SessionContext ctx) throws RemoteException
{
// we don't need the context, so we don't remember it
}
public String getMessage () throws RemoteException
{
return ("Hello World!");
}
}

and i have compiles it and i have written a xml file for deployment descriptor
ejb-jar.xml
<?xml version="1.0"?>
< !DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>

<enterprise-beans>
<session>
<ejb-name>statelessSession</ejb-name>
<home>package1.HelloHome</home>
<remote>package1.Hello</remote>
<ejb-class>package1.HelloBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>statelessSession</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
and these files i have compiled and i have created meta-inf folder and i have created a jar file using
jar cf sample.jar package1/*.class meta-inf/*.xml
and i got the sample.jar file and
i had followed the procedure which you have said i loaded this jar file in jetace tool and i have created a sample1.ser file and in the options i have given the .class files and i deployed it and after that i have saved it but when i am deploying in the admin console its saying
Exception:
java.util.zip.ZipException: error in opening zip fileat java.util.zip.ZipFile.open(Native Method)at java.util.zip.ZipFile.<init>(ZipFile.java:71)at com.ibm.ejs.util.jar.EJBZip.<init>(EJBZip.java:25)at com.ibm.ejs.util.jar.EJBJar.<init>(EJBJar.java:41)at com.ibm.ejs.util.jar.ClasspathManager.addJarFile(ClasspathManager.java:93)at com.ibm.ejs.sm.active.ActiveFileBrowserService.listFiles(ActiveFileBrowserService.java:261)at java.lang.reflect.Method.invoke(Native Method)at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:115)at com.ibm.ejs.sm.active.ActiveObject.invokeContainedObject(ActiveObject.java:468)at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:115)at com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject(AdminAgentImpl.java:62)at com.ibm.ejs.sm.agent._AdminAgent_Stub.invokeActiveObject(Unknown Source)at com.ibm.ejs.sm.beans.ServiceBaseImpl.invokeActiveObject(ServiceBaseImpl.java:50)at com.ibm.ejs.sm.beans.FileBrowserServiceBean.invoke(FileBrowserServiceBean.java:254)at com.ibm.ejs.sm.beans.FileBrowserServiceBean.listFiles(FileBrowserServiceBean.java:163)at com.ibm.ejs.sm.beans.EJSRemoteFileBrowserService.listFiles(EJSRemoteFileBrowserService.java:197)at com.ibm.ejs.sm.beans._EJSRemoteFileBrowserService_Tie._invoke(Unknown Source)at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(Unknown Source)at com.ibm.CORBA.iiop.ORB.process(Unknown Source)at com.ibm.CORBA.iiop.WorkerThread.run(Unknown Source)at com.ibm.ejs.oa.pool.ThreadPool$PooledThread.run(ThreadPool.java:528)com.ibm.ejs.sm.exception.DeploymentException: java.util.zip.ZipException: error in opening zip fileat java.util.zip.ZipFile.open(Native Method)at java.util.zip.ZipFile.<init>(ZipFile.java:71)at com.ibm.ejs.util.jar.EJBZip.<init>(EJBZip.java:25)at com.ibm.ejs.util.jar.EJBJar.<init>(EJBJar.java:41)at com.ibm.ejs.util.jar.ClasspathManager.addJarFile(ClasspathManager.java:93)at com.ibm.ejs.sm.active.ActiveFileBrowserService.listFiles(ActiveFileBrowserService.java:261)at java.lang.reflect.Method.invoke(Native Method)at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:115)at com.ibm.ejs.sm.active.ActiveObject.invokeContainedObject(ActiveObject.java:468)at com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.java:115)at com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject(AdminAgentImpl.java:62)at com.ibm.ejs.sm.agent._AdminAgent_Stub.invokeActiveObject(Unknown Source)at com.ibm.ejs.sm.beans.ServiceBaseImpl.invokeActiveObject(ServiceBaseImpl.java:50)at com.ibm.ejs.sm.beans.FileBrowserServiceBean.invoke(FileBrowserServiceBean.java:254)at com.ibm.ejs.sm.beans.FileBrowserServiceBean.listFiles(FileBrowserServiceBean.java:163)at com.ibm.ejs.sm.beans.EJSRemoteFileBrowserService.listFiles(EJSRemoteFileBrowserService.java:197)at com.ibm.ejs.sm.beans._EJSRemoteFileBrowserService_Tie._invoke(Unknown Source)at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(Unknown Source)at com.ibm.CORBA.iiop.ORB.process(Unknown Source)at com.ibm.CORBA.iiop.WorkerThread.run(Unknown Source)at com.ibm.ejs.oa.pool.ThreadPool$PooledThread.run(ThreadPool.java:528)
--------
com.ibm.ejs.sm.client.ClientException: Exception occurredat com.ibm.ejs.sm.client.ClientException.<init>(ClientException.java:41)at com.ibm.ejs.sm.client.ExceptionManager.handleExc(ExceptionManager.java:74)at com.ibm.ejs.sm.client.ui.editor.JarFileGUI.getJarFileChoice(JarFileGUI.java:467)at com.ibm.ejs.sm.client.ui.editor.JarFileGUI.<init>(JarFileGUI.java:287)at com.ibm.ejs.sm.client.ui.editor.EnterpriseBeanPropertySheet.handleJarBrowsing(EnterpriseBeanPropertySheet.java:1172)at com.ibm.ejs.sm.client.ui.editor.EnterpriseBeanPropertySheet.access$5(EnterpriseBeanPropertySheet.java:1099)at com.ibm.ejs.sm.client.ui.editor.EnterpriseBeanPropertySheet$PropertySheetListener.actionPerformed(EnterpriseBeanPropertySheet.java:1411)at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1068)at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1103)at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:380)at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:252)at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:222)at java.awt.Component.processMouseEvent(Component.java:3169)at java.awt.Component.processEvent(Component.java:2995)at java.awt.Container.processEvent(Container.java:990)at java.awt.Component.dispatchEventImpl(Component.java:2319)at java.awt.Container.dispatchEventImpl(Container.java:1026)at java.awt.Component.dispatchEvent(Component.java:2315)at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:2021)at java.awt.LightweightDispatcher.processMouseEvent(Container.java:1868)at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1761)at java.awt.Container.dispatchEventImpl(Container.java:1026)at java.awt.Window.dispatchEventImpl(Window.java:738)at java.awt.Component.dispatchEvent(Component.java:2315)at java.awt.EventQueue.dispatchEvent(EventQueue.java:359)at java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:118)at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:94)at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)

Please can you tell me how to deploy a bean
Regards
shravan
19 years ago
Hi Prashanth
I have deployed the bean one which is there in the examples of Websphere 3.5 Application server using the Admin Console and it says the Hello Bean is deployed but when i am running the Client program i am getting the following error
N
[Root Exception is java.lang.ClassNotFoundException:com.ibm.ejs.ns.jndi.CNInitialContextFactory]javax.Naming.NoInitialContextException:cannot Instantiate class:com.ibm.ejs.ns.jndi.CNInitialContextFactory
at java.naming.spi.NamingManager.getDefaultInitialContextFactory(NamingManager.java:720)
at java.naming.spi.NamingManager.getInitialContext(NamingManager.java:768)
at java.naming.InitialContext.getDefaultInitialContextFactory(InitialContext.java:169)
at java.naming.InitialContext.<init><InitialContext.java:148)>
at HelloClient.main(HelloClient.java:25)
Please can you help me out i am providing the following client code

import com.ibm.ejb.cb.samples.hello.tier2.Hello; // Hello EJB
import com.ibm.ejb.cb.samples.hello.tier2.HelloHome; // Hello EJB's Home
import java.util.*;
import java.rmi.*;
import javax.naming.*;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
public class HelloClient{
public static void main(String [] args) {
try {
// Properties props = System.getProperties() ;
// Context ctx = new InitialContext(props) ;
System.out.println("1");
Properties properties = new Properties();
System.out.println("2");
properties.put(javax.naming.Context.PROVIDER_URL,"iiop://192.168.3.134";);
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
System.out.println("3");
System.out.println(properties.get(javax.naming.Context.PROVIDER_URL));
System.out.println(properties.get(javax.naming.Context.INITIAL_CONTEXT_FACTORY));
InitialContext initial= new InitialContext(properties);
System.out.println("4");
Object homeObject=initial.lookup("HelloHome");
System.out.println("5");
HelloHome home =(HelloHome) PortableRemoteObject.narrow(homeObject,HelloHome.class);
System.out.println("6");

//Context ctx = new InitialContext() ;
//HelloHome home = (HelloHome) ctx.lookup("HelloHome") ;
Hello hello = home.create() ;
System.out.println(hello.getMessage()) ;
hello.remove() ;
}catch(Exception excp) {
excp.printStackTrace() ;
}
}
Can you tell me what the problem could be
Regards
shravan

[This message has been edited by sravan mandala (edited March 13, 2001).]
19 years ago