Error in JNDI binding

106 views
Skip to first unread message

Raul

unread,
Oct 27, 2008, 6:57:58 AM10/27/08
to Java Web Application
Hi I am trying to deploy my first web application in JBoss and I am
using MySQL as DB Server. I have configured well my application.xml
file.
The directory structure of my application which I have named as btris
looks like-

META-INF -> application.xml, MANIFEST.MF

btrisApp.jar -> META-INF (jboss-web.xml, ejb-jar.xml), com.classes..

btrisWeb.war -> META-INF (MENIFEST>MF), WEB-INF(web.xml, jstl files),
com.classes..

btrisEJB.jar -> META-INF (jboss-web.xml, ejb-jar.xml), com.classes..

This is my first in developing J2EE aplication.

But I have seen error message in log/server.log file like follows:

Failed to deploy:
1. org.jboss.deployment.scanner.URLDeploymentScanner
$DeployedURL@2a47bbd{ url=file:/C:/jboss-4.2.0.GA/server/default/
deploy/btris.ear, deployedLastModified=0 }
org.jboss.deployment.DeploymentException: Error during deploy; -
nested throwable: (javax.naming.NamingException: resource-ref:
jdbc:mysql has no valid JNDI binding. Check the jboss-web/resource-
ref.)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:
384)

2. Caused by: javax.naming.NamingException: resource-ref: jdbc:mysql
has no valid JNDI binding. Check the jboss-web/resource-ref.

3. Starting failed jboss.web.deployment:war=btrisWeb.war,id=-799309467
org.jboss.deployment.DeploymentException: Error during deploy; -
nested throwable: (javax.naming.NamingException: resource-ref:
jdbc:mysql has no valid JNDI binding. Check the jboss-web/resource-
ref.)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:
384)

4. WARN [org.jboss.system.ServiceController] Problem creating
service jboss.j2ee:service=EjbModule,module=btrisEJB.jar
javax.management.InstanceAlreadyExistsException:
jboss.j2ee:jndiName=User,service=EJB already registered.
at
org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:
761)

5. Initialization failed
jboss.j2ee:service=EjbModule,module=btrisEJB.jar
javax.management.InstanceAlreadyExistsException:
jboss.j2ee:jndiName=User,service=EJB already registered.
at
org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:
761)

6.
2008-10-27 16:09:30,343 WARN [org.jboss.system.ServiceController]
Problem creating service jboss.j2ee:jndiName=User,service=EJB
java.lang.NoSuchMethodException:
org.jboss.ejb.StatelessSessionContainer.findByPrimaryKeyHome(java.lang.String)
at java.lang.Class.getMethod(Class.java:1605)

7. Initialization failed jboss.j2ee:jndiName=User,service=EJB
java.lang.NoSuchMethodException:
org.jboss.ejb.StatelessSessionContainer.findByPrimaryKeyHome(java.lang.String)
at java.lang.Class.getMethod(Class.java:1605)



I have configured the resource refference part in my WEB.XML file
like:

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc:mysql</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

and in jboss-web.xml file:

<jboss-web>

<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/mysql</res-ref-name>
<jndi-name>java:/MySqlDS</jndi-name>
</resource-ref>

</jboss-web>

Kindly help how should I proceed
further !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Thanx in advance.

Regards
Raul




Sujoy Mazumdar

unread,
Oct 28, 2008, 4:06:45 PM10/28/08
to javaw...@googlegroups.com
Hi,
Is that a typo error or the res-ref-name in the web.xml and
jboss-web.xml are different?

Regards,
Sujoy

Reply all
Reply to author
Forward
0 new messages