tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Touzery <emmanuel.touz...@lit-transit.com>
Subject registering a JMS MDB works through annotations, not through ejb-jar.xml
Date Thu, 23 Mar 2017 09:27:23 GMT
Hello,

     I'm having trouble registering an MDB through the ejb-jar.xml.

     If I have the annotations on the MDB, like so:

@MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationType", 
propertyValue = "javax.jms.Queue"),
    @ActivationConfigProperty(propertyName = "destination", 
propertyValue = "tmsAlertQueue")},
        mappedName = "jms/tmsAlertQueue")
public class AlertMessageHandler extends 
BaseMessageHandler<AlertBatchDto> implements MessageListener {

     Everything works fine. But I'd rather have the annotations in the 
ejb-jar.xml (so I can turn them on or off through config). I have this 
(and those exact annotations worked on glassfish 3.1.2.2) =>

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"
          version = "3.1"
          xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">
     <enterprise-beans>
         <message-driven>
<display-name>AlertMessageHandler</display-name>
             <ejb-name>AlertMessageHandler</ejb-name>
<mapped-name>jms/tmsAlertQueue</mapped-name>
<ejb-class>tms.tms_core.handlers.alerts.AlertMessageHandler</ejb-class>
<message-destination-type>javax.jms.Queue</message-destination-type>
             <activation-config>
                 <activation-config-property>
<activation-config-property-name>destination</activation-config-property-name>


<activation-config-property-value>tmsAlertQueue</activation-config-property-value>


                 </activation-config-property>
                 <activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>


<activation-config-property-value>javax.jms.Queue</activation-config-property-value>


                 </activation-config-property>
             </activation-config>
         </message-driven>
</ejb-jar>

     But that doesn't work. I know tomee parses the ejb-jar.xml, because 
if I put garbage in it, I get an error. I'm testing in arquillian right 
now actually, and registering the ejb-jar through shrinkwrap like so:

                 .addAsWebInfResource("WEB-INF/ejb-jar.xml", "ejb-jar.xml")

     I've tried modifying the ejb-jar root element for JEE7, like so:

<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         version="3.2"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">

     And also adding the metadata-complete attribute (both to true and 
false), to no avail. The log file doesn't tell me much.

     Any idea what I can do next?

     Thank you!

emmanuel


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message