Wesley Wu wrote:
> Hi Scott,
>
> Thanks for the checking.
>
> My deployment causing the problem:
>   

Thanks.

I think that configuration should work, so I'm looking to see if it's a 
timing issue. For example, the beans.xml might be trying to inject too 
early before the @Alternative is processed.

-- Scott
> XaPooledConnectionFactory  was in a jar called buysou-jms.jar which
> contains a beans.xml.
> buysou_cms.jar was deployed in WEB-INF/lib.
>
> ===========the beans.xml in buysou_cms.jar==============
> <beans 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/beans_1_0.xsd";
>        xmlns:config="urn:java:com.buysou.cms.config">
>       <config:BeanRewriteConfig/>
> </beans>
>
> Note: The purpose of <config:BeanRewriteConfig/> line is to load
> com.buysou.cms.config.BeanRewriteConfig at startup.
>
> After I removed the line <config:BeanRewriteConfig/> the @Alternative
> worked as a charm.
>
> The problem was solved by annotate a @Startup on BeanRewriteConfig
> instead of put it in the beans.xml.
>
> Thanks.
>
> -Wesley
>
>
>
> 2010/11/2 Scott Ferguson <f...@caucho.com>:
>   
>> I just checked with that example and it's working fine. Where are the
>> files/classes located, and how is JmsTemplate instantiated?
>>
>> -- Scott
>>
>> Wesley Wu wrote:
>>     
>>> ======beans.xml===================
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <beans 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/beans_1_0.xsd";>
>>>       <alternatives>
>>>               
>>> <class>com.buysou.cms.jms.qpid.pool.XaPooledConnectionFactory</class>
>>>       </alternatives>
>>> </beans>
>>>
>>>
>>> ========the alternative implementation======
>>> @Alternative
>>> @ApplicationScoped
>>> public class XaPooledConnectionFactory implements 
>>> javax.jms.ConnectionFactory {
>>>
>>> ...
>>> }
>>>
>>> ========usage======
>>>
>>> public class JmsTemplate {
>>>       @Inject
>>>       ConnectionFactory factory;
>>>         ...
>>> }
>>>
>>> - Wesley
>>>
>>>
>>> _______________________________________________
>>> resin-interest mailing list
>>> resin-interest@caucho.com
>>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>>
>>>
>>>       
>>
>> _______________________________________________
>> resin-interest mailing list
>> resin-interest@caucho.com
>> http://maillist.caucho.com/mailman/listinfo/resin-interest
>>
>>     
>
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>
>   



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to