Payara: JMS resources from glassfish-resources.xml not usable - JNDI lookup fails

Created on 26 Nov 2018  路  6Comments  路  Source: payara/Payara

# 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

Most helpful comment

All 6 comments

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

@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.

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

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.

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..

Was this page helpful?
0 / 5 - 0 ratings