I'm trying to use JMS 2.0 Automatic Resource Definition Feature. Here is the resources definition in a producer:
@JMSConnectionFactoryDefinition(
name = "java:global/jms/MyConnectionFactory",
user = "guest",
maxPoolSize = 30,
minPoolSize = 20,
properties = {
"addressList=mq://localhost:7676",
"reconnectEnabled=true",
""
}
)
@JMSDestinationDefinition(
name = "java:global/jms/DemoQueue",
interfaceName = "javax.jms.Queue",
destinationName = "demoQueue"
)
...
@Resource(mappedName = "java:global/jms/DemoQueue")
private Queue defaultQueue;
@Inject
@JMSConnectionFactory("java:global/jms/MyConnectionFactory")
JMSContext context;
In a consumer:
@Resource(mappedName = "java:global/jms/DemoQueue")
private Queue defaultQueue;
@Inject
@JMSConnectionFactory("java:global/jms/MyConnectionFactory")
JMSContext context;
I get the error with the previous configuration:
Caused by: HornetQSecurityException[errorType=SECURITY_EXCEPTION message=HQ119031: Unable to validate user: null] ... 166 more
java.lang.RuntimeException: javax.jms.JMSSecurityRuntimeException: HQ119031: Unable to validate user: null
How can I resolve it using annotations?