user5830202
user5830202

Reputation:

Wildfly 10 / NetBeans 8.2: Issue creating Message-driven Bean

I have a problem after adding a message queue to Wildfly 10.1 (I'm using NetBeans 8.2). The message queue appears under the Resources/JMS Resources/JMS Destinations node in Wildfly Application Server, but when I create a message-driven bean using the NetBeans wizard, the Server Destinations drop-down is blank. (see screenshot).

NetBeans Dialog

It should show the jms queue I created. I've tried restarting Wildfly and NetBeans, but to no avail. Can anyone advise a solution?

Upvotes: 0

Views: 501

Answers (1)

fvu
fvu

Reputation: 32953

That certainly looks like a bug (or at least a relic from the Glassfish support code), you may want to file a bug report for that. But in the mean time, it's not hard to work around. Assuming you created (via the Wildfly console) a queue named testq with jndi name java:/jms/testq you can just enter jms/testq as a "Project Destination" in the wizard and it will work. This will lead to the following (minimal) code

@MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationLookup", propertyValue = "jms/testq")
    ,@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
})
public class SomeMessageBean implements MessageListener {

and the onMessage handler:

@Override
public void onMessage(Message message) {
}

You could as well create a regular class and add the @MessageDriven annotation, there's really nothing magical about mdb's

Upvotes: 1

Related Questions