Pessoal to com um problema na configuração do DataSource utilizando o jetty-env.xml.
Ta dando javax.naming.NameNotFoundException; remaining name ‘env/jdbc/testeDS’
Segue minhas configurações:
jetty-env.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<New id="testeDS" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/testeDS</Arg>
<Arg>
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="Url">jdbc:mysql://localhost:3306/TESTE</Set>
<Set name="DriverClassName">com.mysql.jdbc.Driver</Set>
<Set name="Username">root</Set>
<Set name="Password">root</Set>
<Set name="MaxActive">30</Set>
<Set name="MaxIdle">10</Set>
<Set name="MinIdle">2</Set>
<Set name="MaxWait">5000</Set>
<Set name="MinEvictableIdleTimeMillis">25000</Set>
<Set name="TimeBetweenEvictionRunsMillis">30000</Set>
</New>
</Arg>
</New>
</Configure>
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="Teste" transaction-type="JTA">
<jta-data-source>java:comp/env/jdbc/testeDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect " />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.format_sql" value="true" />
<property name="hibernate.jdbc.batch_size" value="0" />
<property name="hibernate.connection.autocommit" value="true" />
</properties>
</persistence-unit>
</persistence>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID"
version="2.5">
...
<resource-ref>
<res-ref-name>jdbc/testeDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
...
</web-app>
Alguem pode me ajudar?