File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes deploying session bean on jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "deploying session bean on jboss" Watch "deploying session bean on jboss" New topic

deploying session bean on jboss

suchi verma

Joined: Apr 06, 2004
Posts: 9
Hi i am new to jboss.
I have a session bean which I am invoking through a servlet.
The .jar file and . war file is packaged in the same .ear file.
but after deploying the .ear file on jboss server ...the error i get is
javax.naming.NamingException: resource-ref: org.jnp.interfaces.NamingContextFactory has no valid JNDI binding. Check the jboss-web/resource-ref.
is there a problem in the deployment descriptor??
i would also like to know where yhe vendor specific file for eg jboss.xml i s put.
please help.
Amit Ghai
Ranch Hand

Joined: Mar 24, 2004
Posts: 35
Check that your deployment descriptor(ejb-jar.xml) it should be in the META-INF folder along with your jboss.xml
ejb-jar.xml should be like
<ejb-jar >
<description>Helloworld example EJB</description>
<display-name>Helloworld EJB</display-name>
<session >
jboss.xml should be like--->

Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people.
suchi verma

Joined: Apr 06, 2004
Posts: 9
hi amit
thnx for the help.My ejb-jar.xml n jboss.xml are fine as according to your format.
my web.xml is as follows
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE web-app>
- <web-app id="WebApp_ID">
- <servlet id="Servlet_1081713238854">
- <servlet-mapping id="ServletMapping_1081713305468">
- <welcome-file-list id="WelcomeFileList_1081713238855">
- <ejb-ref id="EjbRef_1081713238858">
where all the beans are in beans folder.
after deployment when i try to invoke the servlet client it gives me an error
.....Could there be some problem in the jndi settings???
Also is the <ejb-link> tag neccesary in web.xml when both .war n .jar files are in the same .ear file
Amit Ghai
Ranch Hand

Joined: Mar 24, 2004
Posts: 35
You dont need ejb-link in web.xml.
Hope you are clear that an ear should have .jar to keep all the class files and .war to have all jsp's
i'll give you an example.
suppose i have example.ear in the end for deployment.
its structure would be something like-
3 folders
now my ejb-app.jar has my class files in a folder hierarchy
and a META-INF which has jboss.xml and ejb-jar.xml
The META-INF has an application.xml which defines the link between war and jar. which is as follows--
<display-name>My Application</display-name>
The web-app.war has again 2 folders namely
JSP having all jsp's and WEB-INF which has and tld's along with struts-config.xml and tiles-def.xml if you are using struts and tiles.
and ofcourse web.xml
web.xml should only have servlet mapping.
hope this helps.
wood burning stoves
subject: deploying session bean on jboss
It's not a secret anymore!