I have a simple application which defines a JMS connection factory using the following annotation:
It then uses the following annotation to inject a connection factory:
and uses it to create a connection:
This fails with
See attached server log for the full exception.
To reproduce the problem, unzip the attached Netbeans project and deploy in GlassFish (I used build 67). The navigate directly to http://localhost:8080/JMS20Demo/Servlet1?option=JavaEESenderOld and look in the server log.
The code itself is in the session bean JavaEESenderOld. Note that the same business method also creates a connection using a connection factory defined in glassfish-resources.xml. That works fine using the default credentials.
A quick analysis of the exception in the debugger suggests that if the connection factory is created using glassfish-resources.xml then the password used us "guest", but if the connection factory is created using @JMSConnectionFactoryDefinition then the password used is "", which is invalid.
If you explicitly set user and password in @JMSConnectionFactoryDefinition then it works fine. The problem is if user/password is not set. A quick analysis in the debugger suggests that JMSRA is passing a correct user/password to the connection pool (using a javax.resource.spi.ConnectionRequestInfo). However the password is getting overridden somewhere.
This example was demonstrated at JavaOne in October 2012, and so is a regression since then.