JPA (EclipseLink) + Pool de conexão em Tomcat

1 resposta
UpTheIrons

Olá pessoá,

Tentando uma configuração básica de Pool com o Tomcat, tô tendo alguns erros.

No Context.xml (tomcat), contem:

<Resource 
	auth="Container"
	driverClassName="com.mysql.jdbc.Driver"
	maxActive="20"
	maxIdle="10"
	maxWait="-1"
	name="jdbc/orion"
	type="javax.sql.DataSource"
	url="jdbc:mysql://localhost:3306/oriondb"
  	username="root"
      	password="123"
/>

Meu Web.Xml contem:

<resource-ref>
        <description>Orion Datasource</description>
        <res-ref-name>jdbc/orion</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>

Meu Persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 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_2_0.xsd">
  <persistence-unit name="orionPU" transaction-type="RESOURCE_LOCAL">
    <jta-data-source>jdbc/orion</jta-data-source>
    <exclude-unlisted-classes>false</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
</persistence>

E tenho este erro:

Como se n fosse definido nada, mas não é justamente em Context que esse parâmetros que ele acusou ser NULL estão?

Grato,

1 Resposta

UpTheIrons

UpTheIrons:
Olá pessoá,

Tentando uma configuração básica de Pool com o Tomcat, tô tendo alguns erros.

No Context.xml (tomcat), contem:

<Resource 
	auth="Container"
	driverClassName="com.mysql.jdbc.Driver"
	maxActive="20"
	maxIdle="10"
	maxWait="-1"
	name="jdbc/orion"
	type="javax.sql.DataSource"
	url="jdbc:mysql://localhost:3306/oriondb"
  	username="root"
      	password="123"
/>

Meu Web.Xml contem:

<resource-ref>
        <description>Orion Datasource</description>
        <res-ref-name>jdbc/orion</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>

Meu Persistence.xml:

<persistence version="2.0" 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_2_0.xsd">
  <persistence-unit name="orionPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>jdbc/orion</jta-data-source>
    <properties/>
  </persistence-unit>
</persistence>

E tenho este erro:

Como se n fosse definido nada, mas não é justamente em Context que esse parâmetros que ele acusou ser NULL estão?

Grato,

Mudei o Persistence.xml para:

Criado 27 de maio de 2010
Ultima resposta 27 de mai. de 2010
Respostas 1
Participantes 1