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

JMS resources from glassfish-resources.xml not usable - JNDI lookup fails #3449

Closed
poikilotherm opened this issue Nov 26, 2018 · 6 comments
Closed
Assignees

Comments

@poikilotherm
Copy link
Contributor

poikilotherm commented Nov 26, 2018

Description


While trying to build a docker image for IQSS/dataverse, I experienced difficulties to deploy application scoped JMS resources. JNDI lookup fails, see logs below.

This seems to be a bug, as I am pretty sure I created a configuration inline with the Glassfish docs. Couldn't find specific docs for Payara, only some issues, that didn't seem related.

Expected Outcome

The application should deploy (maybe fail at later stages when creating the db tables - this is a WIP).

Current Outcome

Deployment fails with the following error:

dv> [#|2018-11-26T13:11:38.751+0000|SEVERE|Payara 5.183|javax.enterprise.system.core|_ThreadID=1;_ThreadName=main;_TimeMillis=1543237898751;_LevelValue=1000;_MessageID=NCLS-CORE-00026;|
dv>   Exception during lifecycle processing
dv> org.glassfish.deployment.common.DeploymentException: JNDI lookup failed for the resource: Name: [java:module/env/edu.harvard.iq.dataverse.ingest.IngestServiceBean/factory], Lookup: [jms/IngestQueueConnectionFactory], Type: [javax.jms.QueueConnectionFactory]
dv>     at com.sun.enterprise.deployment.util.ResourceValidator.validateJNDIRefs(ResourceValidator.java:896)
dv>     at com.sun.enterprise.deployment.util.ResourceValidator.validateResources(ResourceValidator.java:742)
dv>     at com.sun.enterprise.deployment.util.ResourceValidator.event(ResourceValidator.java:146)
dv>     at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
...

Steps to reproduce (Only for bug reports)

You can simply run mvn -Pcontainer -DskipTests clean package docker:build docker:run to reproduce:

git clone https://github.com/poikilotherm/dataverse.git -b 5292-small-container dataverse
cd dataverse
mvn -Pcontainer -DskipTests clean package docker:build docker:run

(You obviously need to be on Mac/Linux and have Git, Maven plus Docker readily available.)

Context (Optional)

This is an effort to create a ready-to-use Docker image of Dataverse, see IQSS/dataverse#5292. I try to make the current installer obsolete and it seemed a good idea to put the JMS config within the application code.

Some links to relevant parts:

Please be aware that this Docker image already integrates payara/docker-payaraserver-full#61.

Environment

  • Payara Version: 5.183
  • Edition: Full
  • JDK Version: 8 u171 OpenJDK (see Payara Docker Full)
  • Operating System: Linux + Docker
  • Database: PostGres
@smillidge
Copy link
Contributor

try setting the system property -Ddeployment.resource.validation=false

@poikilotherm
Copy link
Contributor Author

@smillidge that was the issue! Thank you very much, it would have taken me ages to find this.

Would you like me to add some text about this to the docs? Happy to create a PR.

poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Nov 27, 2018
Adding a special JVM option "-Ddeployment.resource.validation=false"
at container build time, so the resources may be created in application scope.
This needs to be present BEFORE the app server starts, it cannot be added
during startup via prebootcmd.

See also:
* payara/Payara#3449
* https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf#G3.1590480

TODO: this needs to be documented and added to classic installer, too!
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Nov 28, 2018
Adding a special JVM option "-Ddeployment.resource.validation=false" so the
resources may be created in application scope.

See also:
* payara/Payara#3449
* https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf#G3.1590480

TODO: this needs to be documented and added to classic installer, too!
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Nov 28, 2018
Adding a special JVM option "-Ddeployment.resource.validation=false" so the
resources may be created in application scope.

See also:
* payara/Payara#3449
* https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf#G3.1590480

TODO: this needs to be documented and added to classic installer, too!
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Nov 29, 2018
Adding a special JVM option "-Ddeployment.resource.validation=false" so the
resources may be created in application scope.

See also:
* payara/Payara#3449
* https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf#G3.1590480

TODO: this needs to be documented and added to classic installer, too!
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 3, 2018
Adding a special JVM option "-Ddeployment.resource.validation=false" so the
resources may be created in application scope.

See also:
* payara/Payara#3449
* https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf#G3.1590480

TODO: this needs to be documented and added to classic installer, too!
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 7, 2018
Adding a special JVM option "-Ddeployment.resource.validation=false" so the
resources may be created in application scope.

See also:
* payara/Payara#3449
* https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf#G3.1590480

TODO: this needs to be documented and added to classic installer, too!
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 10, 2018
Adding a special JVM option "-Ddeployment.resource.validation=false" so the
resources may be created in application scope.

See also:
* payara/Payara#3449
* https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf#G3.1590480

TODO: this needs to be documented and added to classic installer, too!
@smillidge
Copy link
Contributor

Sorry missed your update yes please make a PR we will merge it.

@johnmanko
Copy link
Contributor

try setting the system property -Ddeployment.resource.validation=false

Can you add some clarification as to why this is needed? What does setting this flag to false actually do in Payara? In the Payara source I noticed references to both glassfish-resources.xml and payara-resources.xml; does this flag only affect the those files? etc, etc.

I'm just trying to better understand what's happening here. Thanks.

@smillidge
Copy link
Contributor

It stops the check during deployment that all resources referenced by the deployment are available. The implementation is currently simplistic in that it tries to look up the referenced resource in the JNDI tree and if not present fails deployment. In the case of application scoped resources then this check can be too aggressive as the resource has not been fully deployed yet..

@smillidge smillidge changed the title JSM resources from glassfish-resources.xml not usable - JNDI lookup fails JMS resources from glassfish-resources.xml not usable - JNDI lookup fails Nov 3, 2019
@rdebusscher rdebusscher self-assigned this Dec 18, 2019
@rdebusscher
Copy link

Documentation PR made. https://github.com/payara/Payara-Server-Documentation/pull/686

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants