1

I have following: web.xml:

<web-app...>
<servlet>
        <servlet-name>Jersey Web Application</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <init-param>
            <param-name>listings</param-name>
            <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Jersey Web Application</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
<resource-ref>
        <res-ref-name>datasource.mceAPPDb</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
        <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
    <resource-ref>
</web-app>

glassfish-resource.xml:

<?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 name="app_emailverification"
                          res-type="javax.sql.DataSource"
                          datasource-classname="oracle.jdbc.pool.OracleDataSource"
                          pool-resize-quantity="2"
                          max-pool-size="32"
                          steady-pool-size="8">
        <property name="URL" value="jdbc:oracle:thin:@localhost:1522:MCE0_D1"/>
        <property name="user" value="app_emailverification"/>
        <property name="datasourceName" value="OracleDataSource"/>
        <property name="serverName" value="localhost"/>
        <property name="password" value="app_emailverification"/>
    </jdbc-connection-pool>

    <jdbc-resource enabled="true" jndi-name="datasource.mceAPPDb" object-type="user" pool-name="app_emailverification">
        <description>Test DataSource jdbc/testDS for Connection Pool jdbc/testConnPool</description>
    </jdbc-resource>

</resources>

and persistence.xml:

<persistence-unit name="mceapp-app-database-model"
        transaction-type="JTA">
        <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
        <jta-data-source>datasource.mceAPPDb</jta-data-source>
        ...
    </persistence-unit>
</persistence>

But when i try to deploy the war in payara server gui....i get an error : SEVERE: java.lang.RuntimeException: Invalid resource :datasource.mceAPPDb

Whats wrong woth this setup ????

MiGo
  • 551
  • 2
  • 7
  • 17
  • Did you take a look at this similar question: https://stackoverflow.com/questions/56365417/payaramicro-is-not-adding-jdbc-details-in-glassfish-resources-xml-from-war? Otherwise you can also configure the JDBC datasource with CLI commands (tutorial here: https://rieckpil.de/cheatsheet-java-jakarta-ee-application-servers/) – rieckpil Dec 13 '19 at 04:45

0 Answers0