I am tring to deploy an application to jBoss 4.2.3 I think I have missed something in jboss configuration. What i have made. I download jboss 4.2.3, place tuxgrh-ws-1.0.x.war in "jboss-4.2.3.GA\server\default\deploy" folder and launch run.bat in a console. I have a mysql server with a database.
I get next errors in jboss console:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring/tuxgrh-applicationContext-jpa.xml]: Cannot resolve reference to bean 'tuxgrhDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tuxgrhDataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: TuxGRHDS not bound
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tuxgrhDataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: TuxGRHDS not bound
Caused by: javax.naming.NameNotFoundException: TuxGRHDS not bound
tuxgrhDataSource is refered in next files
tuxgrh-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>TuxGRHDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/test_tuxgrh</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>newuser</user-name>
<password>newuser</password>
<min-pool-size>0</min-pool-size>
<max-pool-size>3</max-pool-size>
<check-valid-connection-sql>select 1</check-valid-connection-sql>
</local-tx-datasource>
</datasources>
and in tuxgrh-applicationContext-jpa.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:jpa="http://www.springframework.org/schema/data/jpa"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/data/jpa
http://www.springframework.org/schema/data/jpa/spring-jpa-1.0.xsd"
default-autowire="byName">
<jpa:repositories base-package="com.tritux.tuxgrh.logic.repository" />
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="tuxgrhDataSource">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="MYSQL" p:databasePlatform="org.hibernate.dialect.MySQLDialect" />
</property>
<property name="jpaProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
</props>
</property>
<property name="packagesToScan" value="com.tritux.tuxgrh.logic.model"></property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="entityManagerFactory" />
<tx:annotation-driven transaction-manager="transactionManager" />
<jee:jndi-lookup id="tuxgrhDataSource" jndi-name="java:/TuxGRHDS" />
</beans>