Error while deploy in app resources

43 views
Skip to first unread message

Cristhiam Gabriel Fernández

unread,
Dec 17, 2017, 9:47:48 AM12/17/17
to Payara Forum
Hi everyone
I'm trying to make an ear application with Netbeans IDE. My application may to have an db connection with Maria DB Server.
I can set up JDBC Connection Pool and JDBC Resource in Payara's admin console, but I'm wanna deploy resources automatically from my application source code.
So, I created the glassfish-resources.xml file in ejb module but when I try run the application the server shows next error:
Grave:   Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method
Grave:   Exception while invoking class org.glassfish.javaee.full.deployment.EarDeployer prepare method
Grave:   org.glassfish.deployment.common.DeploymentException: Invalid resource : java:module/jdbc/InAppConn__pm

My glassfish-resources.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
  <jdbc-connection-pool allow-non-component-callers="false" 
                        associate-with-thread="false" 
                        connection-creation-retry-attempts="0" 
                        connection-creation-retry-interval-in-seconds="10" 
                        connection-leak-reclaim="false" 
                        connection-leak-timeout-in-seconds="0" 
                        connection-validation-method="auto-commit" 
                        datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" 
                        fail-all-connections="false" 
                        idle-timeout-in-seconds="300" 
                        is-connection-validation-required="false" 
                        is-isolation-level-guaranteed="true" 
                        lazy-connection-association="false" 
                        lazy-connection-enlistment="false" 
                        match-connections="false" 
                        max-connection-usage-count="0" 
                        max-pool-size="32" 
                        max-wait-time-in-millis="60000" 
                        name="InAppConn" 
                        non-transactional-connections="false" 
                        pool-resize-quantity="2" 
                        res-type="javax.sql.DataSource" 
                        statement-timeout-in-seconds="-1" 
                        steady-pool-size="8" 
                        validate-atmost-once-period-in-seconds="0" 
                        wrap-jdbc-objects="false">
    <property name="URL" value="jdbc:mysql://localhost:3306/test?zeroDateTimeBehavior=convertToNull"/>
    <property name="User" value="root"/>
    <property name="Password" value="root"/>
    <property name="serverName" value="localhost"/>
    <property name="databaseName" value="test"/>
    <property name="portNumber" value="3306"/>
  </jdbc-connection-pool>
  <jdbc-resource enabled="true" 
                 jndi-name="jdbc/InAppConn" 
                 object-type="user" 
                 pool-name="InAppConn">
    <description/>
  </jdbc-resource>
</resources>




Reply all
Reply to author
Forward
0 new messages