I'm new to java, jboss environment. So i wanted to write a simple code to develop something using jboss and java. The objective of the code are following
1. Write java code to extract an employee detail from Oracle database
2. Deploy this code in JBoss appserver
3. Execute the code (using jsp, webbrowser, whatever methods) to display the employee details.
Its so simple, but im having hard time getting this to work. I managed to write 4 java codes and on my servlet i have the following code which errors out
InitialContext context = new InitialContext();
Object objref = context.lookup("java:comp/
env/ejb/te
st/MyTestS
essionBean
");
testSessionBean = (MyTestSessionHome)Portabl
eRemoteObj
ect.narrow
(objref,MyTestSessionHome.
class);
when i compile using ant utility, no errors, but when i deploy in JBoss it errors out
javax.naming.NameNotFoundE
xception: ejb not bound. It errors out on the context.lookup. There was another thread with this question and i was hopeful that i will find answer, but in vain.
I have attached all the java code and also the xml files that i created. Any help is greatly appreciated as im about to pull all my hair which is left (im almost bald).
I have attached the 4 java files and the 3 xml files that i used for this project. I had to name them as .txt because of extension restrictions to attach.
Start Free Trial