Here's my glassfish-resources.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems, Inc.//DTD Application
Server 9.0 Resource Definitions //EN"
"
http://www.sun.com/software/appserver/dtds/glassfish-resources_1_5.dtd">
<resources>
<admin-object-resource enabled="true" jndi-name="jms/AgentMDB"
object-type="user" res-adapter="jmsra"
res-type="javax.jms.Queue">
<description></description>
<property name="Name" value="AgentMDB"/>
</admin-object-resource>
<admin-object-resource enabled="true"
jndi-name="jms/DeliveryEvaluationMDB" object-type="user" res-adapter="jmsra"
res-type="javax.jms.Queue">
<description></description>
<property name="Name" value="DeliveryEvaluationMDB"/>
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/DeliverySendMDB"
object-type="user" res-adapter="jmsra"
res-type="javax.jms.Queue">
<description></description>
<property name="Name" value="DeliverySendMDB"/>
</admin-object-resource>
<admin-object-resource enabled="true" jndi-name="jms/AttachmentMDB"
object-type="user" res-adapter="jmsra"
res-type="javax.jms.Queue">
<description></description>
<property name="Name" value="AttachmentMDB"/>
</admin-object-resource>
</resources>
This is being read, but it's not be used. I know it's being read, because
if I put an xml syntax error in this file, glassfish will complain:
[2014-03-12T14:46:50.405-0700] [glassfish 4.0] [SEVERE] [NCLS-CORE-00026]
[javax.enterprise.system.core] [tid: _ThreadID=481
_ThreadName=admin-listener(15)] [timeMillis: 1394660810405] [levelValue:
1000] [[
Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: Failue while
processing glassfish-resources.xml(s) in the archive -- Element type
"admin-object-resource" must be followed by either attribute
specifications, ">" or "/>".
at
org.glassfish.resources.admin.cli.ResourcesXMLParser.initProperties(ResourcesXMLParser.java:277)
But, the file is not used as described here:
https://blogs.oracle.com/JagadishPrasath/entry/application_scoped_resources_in_glassfish
I'm expecting glassfish to create these resources and it does not.
Eventually I get a failure on deploy about how it can't find them. EG:
[2014-03-12T14:53:34.746-0700] [glassfish 4.0] [SEVERE] []
[javax.enterprise.system.container.ejb.mdb.org.glassfish.ejb.mdb] [tid:
_ThreadID=99 _ThreadName=admin-listener(4)] [timeMillis: 1394661214746]
[levelValue: 1000] [[
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid
destination jms/DeliveryEvaluationMDB for MDB: JNDI name not found
at
com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.getPhysicalDestinationFromConfiguration(ActiveJmsResourceAdapter.java:2157)
at
com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.updateMDBRuntimeInfo(ActiveJmsResourceAdapter.java:1991)
But I know this file is valid because if I use asadmin add-resources on it,
it works as I expect it to. I've tried putting the file in my ejb's
META-INF and my ear's META-INF, and it doesn't make a difference. My
coworker has also tried on a sample project and it doesn't work for him
either. Why isn't glassfish creating these resources?
I'm starting to think this is a glassfish bug. FWIW, it doesn't seem to
work in GF3 either, but it does work in GF2.
--
Thanks,
Dan
--
CONFIDENTIALITY NOTICE: The information contained in this electronic
transmission may be confidential. If you are not an intended recipient, be
aware that any disclosure, copying, distribution or use of the information
contained in this transmission is prohibited and may be unlawful. If you
have received this transmission in error, please notify us by email reply
and then erase it from your computer system.