hemapriya raag

Greenhorn
+ Follow
since Jul 09, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by hemapriya raag

Hi,
I am trying to run the project given in headfirst ejb 1 chapter by using netbeans where my client file is not able to recognise the bean by using JNDI
My client file is:
----------------------------------------------
package adviceclient;
import Headfirst1.*;
import java.rmi.RemoteException;
import javax.ejb.EJB;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;

public class Main {

@EJB
private static Advice2Remote advice2Bean;
public static void main(String[] args) {
try{
InitialContext ic = new InitialContext();
Object o=ic.lookup("ejb/Advice2Bean");
Advice2Home home=(Advice2Home)PortableRemoteObject.narrow(o,Advice2Home.class);
Advice2Remote advisor=home.create();
System.out.print(advisor.getResult2());
}
catch(Exception ex)
{
ex.printStackTrace();
}

}
}
And errors are:
----------------------------------------------------------------

javax.naming.NameNotFoundException: Advice2Bean not found
at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:203)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:175)
at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:179)
at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)

please some one help me.........
EJB
I have loaded the latest one 5.5..
I go file--> new project--->EJB module then it creates ejb module
then right on ejb module-->new session bean(adive)-->stateless-->remote then it creates only a adviceBean and AdviceRemote
EJB
Hi All,
I have a doubt on EJB Home interfaces,And I am new to EJB ,I am refering Headfirst EJB and using Netbean IDE for learning.I am able to create a session bean and remote interface but not able to create Home interface, I also refered http://www.netbeans.org/files/documents/4/442/J2EE-NBTutorial.pdf and I followed the instruction as said
=============================================================
Creating the ConverterBean Enterprise Bean
The enterprise bean templates automatically create all of the classes and interfaces

necessary for the enterprise bean and register the enterprise bean in the

EJB module's deployment descriptor.

1. In the Projects window, right-click the ConverterApp-EJBModule node

and choose New

→Session Bean.
2. In the EJB Name field, type

Converter. In the Package field, type converter.
Set the bean to be stateless and remote and click Finish.

C

REATING THE CONVERTER BEAN ENTERPRISE B EAN 129
The IDE creates the following classes:



ConverterBean.java. The enterprise bean class. All of the EJB infrastructure
methods are generated automatically and are hidden in a code

fold.



ConverterRemote.java. The remote interface . The remote interface usually
defines the business methods that a client can call. The business methods

are implemented in the enterprise bean code. Because the IDE enforces

best coding practices, it actually registers all of the business methods in a

remote business interface, which the remote interface extends.



ConverterRemoteBusiness.java. The business interface . Presently this
class is empty, but as we add business methods to the bean this class will

be populated.



ConverterRemoteHome.java. The home interface. A home interface
defines the methods that allow a client to create, find, or remove an enterprise

bean.

================================================

but not able to create ConverterRemoteBusiness.java and ConverterRemoteHome.java .
Hi,
I am new to EJB ,I am refering Headfirst EJB and using Netbean IDE
I am able to create a session bean remote interface but not able to create Home interface, please help me out