jueves, 28 de septiembre de 2017

Error creating bean with name 'dataSourceDb' defined in class path...

ERROR:  Error creating bean with name 'dataSourceDb' defined in class path resource [com/ProjectX/conf/spring/spring-datasource.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: java:XXXDbDS


Characteristics: Is not possible to find the datasource in the location provided. Is not posible to use the DAO, is not possible to deploy correctly the aplicación in Jboss.

Situation: Using ANT as a compiler, MYBATIS 3.2.7, JDK 1.7.0_51, Spring 4.0.6.RELEASE, Eclipse Kepler, Windows 7, Jboss EAP 6.1

Possible solution: 
1) Check that the DataSource is defined on theXML ${JBOSS_DIR}/standalone/configuration/standalone.xml
2) The DataSource Name (java:XXXDbDS) should look similar to:
<datasource jndi-name="java:/jboss/datasources/XXXDbDS" pool-name="XXXDbDS" enabled="true" use-java-context="true">

And also must be the same than the DataSource on the aplication "spring-datasource.xml" -> in this case:  "java:/jboss/datasources/XXXDbDS". 

No hay comentarios:

Publicar un comentario