Skip to main content
adicionou 136 caracteres ao conteúdo
Fonte Link

Parece me que falta registar o data source no web.xml, alem disso não irá funcionar se não se não colocares o Driver à pasta lib do Tomcat tomcat/lib, colar com.mysql.jdbc.Driver.x.x.x.jar

In web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <!-- must identify the data source, to persistence module can get him -->
    <resource-ref>
            <res-ref-name>jdbc/toca_datos</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

In apache-tomcat-x.x.x\conf\context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  
     <!-- Data source configuration : define the data source -->
      <Resource name="jdbc/toca_datos" 
                   auth="Container" 
                   type="javax.sql.DataSource"
                   maxTotal="100" 
                   maxIdle="30" 
                   maxWaitMillis="10000"
                   username="your-username" 
                   password="your-password" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/toca_datos_DataBase"/>
</Context>

And in persistence xml

 <non-jta-data-source>java:comp/env/jdbc/toca_datos</non-jta-data-source>

i have some tuorial about this subject, you can see him: https://github.com/jlmc/marketplace/blob/master/docs/DATA%20SOURCE%20configuration%20in%20Tomcat.md

Parece me que falta registar o data source no web.xml

In web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <!-- must identify the data source, to persistence module can get him -->
    <resource-ref>
            <res-ref-name>jdbc/toca_datos</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

In apache-tomcat-x.x.x\conf\context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  
     <!-- Data source configuration : define the data source -->
      <Resource name="jdbc/toca_datos" 
                   auth="Container" 
                   type="javax.sql.DataSource"
                   maxTotal="100" 
                   maxIdle="30" 
                   maxWaitMillis="10000"
                   username="your-username" 
                   password="your-password" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/toca_datos_DataBase"/>
</Context>

And in persistence xml

 <non-jta-data-source>java:comp/env/jdbc/toca_datos</non-jta-data-source>

i have some tuorial about this subject, you can see him: https://github.com/jlmc/marketplace/blob/master/docs/DATA%20SOURCE%20configuration%20in%20Tomcat.md

Parece me que falta registar o data source no web.xml, alem disso não irá funcionar se não se não colocares o Driver à pasta lib do Tomcat tomcat/lib, colar com.mysql.jdbc.Driver.x.x.x.jar

In web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <!-- must identify the data source, to persistence module can get him -->
    <resource-ref>
            <res-ref-name>jdbc/toca_datos</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

In apache-tomcat-x.x.x\conf\context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  
     <!-- Data source configuration : define the data source -->
      <Resource name="jdbc/toca_datos" 
                   auth="Container" 
                   type="javax.sql.DataSource"
                   maxTotal="100" 
                   maxIdle="30" 
                   maxWaitMillis="10000"
                   username="your-username" 
                   password="your-password" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/toca_datos_DataBase"/>
</Context>

And in persistence xml

 <non-jta-data-source>java:comp/env/jdbc/toca_datos</non-jta-data-source>

i have some tuorial about this subject, you can see him: https://github.com/jlmc/marketplace/blob/master/docs/DATA%20SOURCE%20configuration%20in%20Tomcat.md

adicionou 162 caracteres ao conteúdo
Fonte Link

Parece me que falta registar o data source no web.xml

In web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <!-- must identify the data source, to persistence module can get him -->
    <resource-ref>
            <res-ref-name>jdbc/toca_datos</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

In apache-tomcat-x.x.x\conf\context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  
     <!-- Data source configuration : define the data source -->
      <Resource name="jdbc/toca_datos" 
                   auth="Container" 
                   type="javax.sql.DataSource"
                   maxTotal="100" 
                   maxIdle="30" 
                   maxWaitMillis="10000"
                   username="your-username" 
                   password="your-password" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/toca_datos_DataBase"/>
</Context>

And in persistence xml

 <non-jta-data-source>java:comp/env/jdbc/toca_datos</non-jta-data-source>

i have some tuorial about this subject, you can see him: https://github.com/jlmc/marketplace/blob/master/docs/DATA%20SOURCE%20configuration%20in%20Tomcat.md

Parece me que falta registar o data source no web.xml

In web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <!-- must identify the data source, to persistence module can get him -->
    <resource-ref>
            <res-ref-name>jdbc/toca_datos</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

In apache-tomcat-x.x.x\conf\context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  
     <!-- Data source configuration : define the data source -->
      <Resource name="jdbc/toca_datos" 
                   auth="Container" 
                   type="javax.sql.DataSource"
                   maxTotal="100" 
                   maxIdle="30" 
                   maxWaitMillis="10000"
                   username="your-username" 
                   password="your-password" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/toca_datos_DataBase"/>
</Context>

And in persistence xml

 <non-jta-data-source>java:comp/env/jdbc/toca_datos</non-jta-data-source>

Parece me que falta registar o data source no web.xml

In web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <!-- must identify the data source, to persistence module can get him -->
    <resource-ref>
            <res-ref-name>jdbc/toca_datos</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

In apache-tomcat-x.x.x\conf\context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  
     <!-- Data source configuration : define the data source -->
      <Resource name="jdbc/toca_datos" 
                   auth="Container" 
                   type="javax.sql.DataSource"
                   maxTotal="100" 
                   maxIdle="30" 
                   maxWaitMillis="10000"
                   username="your-username" 
                   password="your-password" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/toca_datos_DataBase"/>
</Context>

And in persistence xml

 <non-jta-data-source>java:comp/env/jdbc/toca_datos</non-jta-data-source>

i have some tuorial about this subject, you can see him: https://github.com/jlmc/marketplace/blob/master/docs/DATA%20SOURCE%20configuration%20in%20Tomcat.md

Fonte Link

Parece me que falta registar o data source no web.xml

In web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
    version="3.1">
    <!-- must identify the data source, to persistence module can get him -->
    <resource-ref>
            <res-ref-name>jdbc/toca_datos</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
    </resource-ref>
</web-app>

In apache-tomcat-x.x.x\conf\context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context>
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
  
     <!-- Data source configuration : define the data source -->
      <Resource name="jdbc/toca_datos" 
                   auth="Container" 
                   type="javax.sql.DataSource"
                   maxTotal="100" 
                   maxIdle="30" 
                   maxWaitMillis="10000"
                   username="your-username" 
                   password="your-password" 
                   driverClassName="com.mysql.jdbc.Driver"
                   url="jdbc:mysql://localhost:3306/toca_datos_DataBase"/>
</Context>

And in persistence xml

 <non-jta-data-source>java:comp/env/jdbc/toca_datos</non-jta-data-source>