Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: cannot apply default values in @DataSourceDefinition URL via variable expansion/FISH-5676 #5322

Closed
poikilotherm opened this issue Jun 30, 2021 · 5 comments · Fixed by #5604
Assignees
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect

Comments

@poikilotherm
Copy link
Contributor

Description


With IQSS/dataverse#7701 we moved to Payara 5.2021.4 and hoped for the default values for our @DataSourceDefinition.
While testing the deployment, issues where experienced. If you do not set the variable (via system property or env var), the default value is getting applied, but data source allocation & deployment fails.

Expected Outcome

When using a @DataSourceDefinition with

url = "jdbc:postgresql://${MPCONFIG=db.host:localhost}:${MPCONFIG=db.port:5432}/${ENV=DB_NAME:dvn}"

and none of these settings around, the allocation and deployment should work fine with the defaults given.

Current Outcome

For unknown reasons, this fails with

  • RAR5103 : Error setting java bean value : [...]]] (where "..." is the first default value used from the URL string)
  • Exception : javax.resource.ResourceException: Access denied to execute this method : setURL
  • due to illegal access at:
    java.lang.reflect.InvocationTargetException
        [...]
        com.sun.gjc.common.DataSourceObjectBuilder.constructDataSourceObject(DataSourceObjectBuilder.java:118)
    

This is failing with both ${MPCONFIG} and ${ENV}, but again: if you make the referenced keys available, they are getting used flawless.

Steps to reproduce

  1. Goto https://github.com/poikilotherm/reproducer-payara-mpconfig-seturl and clone
  2. Use mvn -Parq-payara-managed verify to execute integration test using Arquillian Payara Managed.
    (Shoutout and kudos to @lprimak for the handy extension)
  3. Logs can be found at target/payara5/glassfish/domains/domain1/logs/server.log
  4. Play around by setting vars in src/main/resources/system-properties.properties and src/main/resources/environment-variables.properties

Note that I also set fish.payara.log-jdbc-calls within the DSD to a nonsense default value. This is not taken into account. No idea if this is due to the failing connection when setting the properties or if non-included #5272 (3 days after Payara 5.2021.4) is causing this to be ignored.

Environment

  • Distribution: Server Full
  • JDK Version: 11, OpenJDK & Adopt
  • Operating System: Linux
@poikilotherm poikilotherm added the Type: Bug Label issue as a bug defect label Jun 30, 2021
@shub8968 shub8968 added the Status: Open Issue has been triaged by the front-line engineers and is being worked on verification label Jul 1, 2021
@shub8968 shub8968 self-assigned this Jul 20, 2021
@shub8968
Copy link
Contributor

Hi, @poikilotherm,

I can reproduce this issue. I have raised an internal issue with JIRA FISH-5676. It may take a while to fix the issue. You are free to submit a PR to fix this issue if you feel confident to do so. Thanks.

@shub8968 shub8968 added Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev and removed Status: Open Issue has been triaged by the front-line engineers and is being worked on verification labels Aug 10, 2021
@shub8968 shub8968 changed the title Bug Report: cannot apply default values in @DataSourceDefinition URL via variable expansion Bug Report: cannot apply default values in @DataSourceDefinition URL via variable expansion/FISH-5676 Aug 10, 2021
@poikilotherm
Copy link
Contributor Author

Hey @shub8968,

it's been a while since I opened this issue including a reproducer. Had someone on the team a chance to take a look at this?

This is quite a blocker for me sending Dataverse application down the MPCONFIG path. It would be great if you folks find some time for this tricky bug.

I know this is community service. Please don't feel pushed or offended. Thank y'all for ya great service!

@poikilotherm
Copy link
Contributor Author

Hey @shub8968 @lprimak @Pandrex247

I pushed an update to the reproducer, updating it to test with latest 5.2021.8 release. The error persists. 😿

Any chance this might be given a look? Thank y'all very much!

Best, Oliver

@shub8968
Copy link
Contributor

Hi, @poikilotherm,

I have updated JIRA FISH-5676 mentioning your concern.

Thanks, Shubham

@poikilotherm
Copy link
Contributor Author

Thank you @kalinchan for fixing this!!! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev Type: Bug Label issue as a bug defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants