tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schlichtherle <christian-b...@schlichtherle.de>
Subject Re: ejb-jar.xml ignored for some EJB JAR in EAR
Date Thu, 29 Aug 2013 08:12:01 GMT
Hi,

no, I didn't mean to use this, but it appeared to be the only combination that worked with
TomEE+ 1.5.2. With all other approaches, I got exception messages telling me that OpenEJB
cannot inject the dependency using a null resource factory or so. Please tell me a combination
that actually works with OpenEJB and I'll be a happy man.

Regards,
Christian

Am 29.08.2013 um 09:33 schrieb Romain Manni-Bucau <rmannibucau@gmail.com>:

> Hi
> 
> you use lookup and mapped-name, are you sure that's what you want?
> 
> typically using mapped-name (container dependent) you should prefix
> resources with openejb:Resource/
> 
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
> *Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
> *LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
> *Github: https://github.com/rmannibucau*
> 
> 
> 
> 2013/8/29 Christian Schlichtherle <christian@schlichtherle.de>
> 
>> Hi,
>> 
>> I have two EJB JARs in my EAR. Each of them has an ejb-jar.xml which
>> configures the type of destination for messaging like this:
>> 
>>    <?xml version="1.0" encoding="UTF-8"?>
>>    <ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee"
>>             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"
>>             version = "3.1">
>>        <enterprise-beans>
>>            <session>
>>                <ejb-name>UpdateManagerBean</ejb-name>
>>                <resource-env-ref>
>> 
>> <resource-env-ref-name>destination</resource-env-ref-name>
>> 
>> <resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
>>                    <mapped-name>jms/TrueUpdate Agent</mapped-name>
>>                </resource-env-ref>
>>            </session>
>>        </enterprise-beans>
>>    </ejb-jar>
>> 
>> and the corresponding code looks like this:
>> 
>>    @Singleton
>>    public class UpdateManagerBean extends ... {
>> 
>>        @Resource(name = "destination", lookup = "jms/TrueUpdate Agent")
>>        private Destination destination;
>> 
>>        …
>>    }
>> 
>> The purpose here is to define the type of Destination (Queue or Topic) at
>> deployment time.
>> 
>> This works fine with the other bean in the EAR, but not the bean shown
>> here. An example EAR can be found in the ticket I created yesterday.
>> 
>> This used to work in 1.5.2, so I suppose it's a regression.
>> 
>> Regards,
>> Christian
>> 
>> 


Mime
View raw message