Voulzy Voulzy - 2 years ago 106
Java Question

Missing dependency JBoss AS 7.1.1

I know there is a lots of topics on this error, but I am still having some troubles with it.

I'm actually trying to deploy a war on JBoss 7.1.1 and unfortunately i'm getting this error again and again :

JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.module.myapplication.myapplication.env.jdbc_app (missing) dependents: [service jboss.naming.context.java.module.myapplication.myapplication.env.jdbc.PKBNM01]

This is how my DS is defined in standalone.xml (I'm well connected to my DB) :

<datasource jta="false" jndi-name="java:/jdbc/jdbc_app" pool-name="jdbc_app" enabled="true" use-ccm="false">

This is the jboss-web.xml :


And this is my web.xml :


If someone could explain me what I did wrong or even just give me a clue, it would be very welcomed...

Thank you

Answer Source

Bit hard to give a definitive answer, but I can make some observations.

1) I've never had to configure anything in a jboss-web.xml or web.xml to make a datasource available to an application module in JBoss. The datasource declaration in the standalone.xml is enough

2) The official documentation states you should create a driver module; I suggest you follow that. https://community.jboss.org/wiki/DataSourceConfigurationInAS7

3) This is what my datasources look like (MySQL database example):

<datasource jndi-name="java:jboss/datasources/MyDS" pool-name="MyDS" enabled="true" use-java-context="true">
  <driver name="mysql" module="com.mysql"/>

Basically I just copied and adapted the 'ExampleDS' that is in the standalone.xml by default.

For completion, a JPA persistence.xml could then look like this; I removed some junk from it to make it to the point:

<persistence ... version="2.0">  
   <persistence-unit name="MyPU">  

So just the JNDI name of the datasource as it is defined in the standalone.xml.

Hope one of these observations helps you to get a step further.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download