@DataSourceDefinition(
name = "java:global/dbDocumentMetadata",
className = "${ENV=DB_DRIVER}",
url = "${ENV=DB_JDBC_URL}",
user = "${ENV=DB_USER}",
password = "${ENV=DB_PASSWORD}"
)
And set and export these env vars in my shell.
During startup of payara micro I get
RAR5099 : Wrong class name or classpath for Datasource Object
java.lang.ClassNotFoundException: ${ENV=DB_DRIVER}
If I replace ${ENV=DB_DRIVER} with the actual driver it works ok.If I remove the DataSourceDefinition and use a web.xml:
<data-source>
<name>java:global/dbDocumentMetadata</name>
<class-name>${ENV=DB_DRIVER}</class-name>
<server-name>${ENV=DB_SERVER}</server-name>
<port-number>5432</port-number>
<database-name>${ENV=DB_DATABASE}</database-name>
<user>${ENV=DB_USER}</user>
<password>${ENV=DB_PASSWORD}</password>
</data-source>Then it does work ok (port must be numeric so cannot use ENV)So my question is why the ENV=DB_DRIVER doesn't work in the DataSourceDefinitiongr. Hans
<persistence-unit name="oat_unit" transaction-type="JTA">
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<jta-data-source>jdbc/oatresource</jta-data-source>
RUN --mount=type=secret,id=pwdprd,required,mode=0444 \
--mount=type=secret,id=ldap,required,mode=0444 \
--mount=type=secret,id=payarainit,required,mode=0444 \
--mount=type=secret,id=ldapinit,required,mode=0444 \
${PAYARA_DIR}/bin/asadmin -u admin -W /run/secrets/pwdprd start-domain &&\
${PAYARA_DIR}/bin/asadmin -u admin -W /run/secrets/pwdprd multimode --file /run/secrets/payarainit &&\
${PAYARA_DIR}/bin/asadmin -u admin -W /run/secrets/ldap multimode --file /run/secrets/ldapinit &&\
${PAYARA_DIR}/bin/asadmin -u admin -W /run/secrets/pwdprd multimode --file deploy.txt &&\
rm *payarainit snippet:
create-password-alias oatdbpw
create-jdbc-connection-pool --datasourceclassname org.postgresql.ds.PGConnectionPoolDataSource --isolationlevel=read-committed --restype javax.sql.ConnectionPoolDataSource --property user=oatweb:password=${ALIAS=oatdbpw}:serverName=pgdboat:databaseName=oat:portNumber=5432:driverClass=org.postgresql.Driver oatpool
create-jdbc-resource --connectionpoolid oatpool jdbc/oatresource
docker-compose snippet:networks:
oat:
aliases:
- pgdb${APPNAME}Hope this helps, Eduard
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/4B20402B-7CF5-4692-85FE-E787AD9E20D2%40gmail.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/4c5e1145-07be-42cc-904e-b4c6e4b30198n%40googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/f2bf7069-ed6b-427e-af2f-cd8a712a9065n%40googlegroups.com.