But not any name, right?

    @Resource(name="MyJmsConnectionFactory")
    private ConnectionFactory connectionFactory;

gives me

INFO: Creating Resource(id=MyJMSDataSource)
Jun 04, 2013 1:25:20 PM org.apache.openejb.util.OpenEJBErrorHandler
handleUnknownError
SEVERE: FATAL ERROR: Unknown error in Assembler.  Please send the following
stack trace and this message to [email protected] :
 org.apache.xbean.propertyeditor.PropertyEditorException: Unable to resolve
class
    at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
    at
org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
    at
org.apache.xbean.propertyeditor.PropertyEditors.getValue(PropertyEditors.java:284)
    at org.apache.xbean.recipe.RecipeHelper.convert(RecipeHelper.java:172)
    at
org.apache.xbean.recipe.ObjectRecipe.extractConstructorArgs(ObjectRecipe.java:592)
    at
org.apache.xbean.recipe.ObjectRecipe.internalCreate(ObjectRecipe.java:275)
    at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:96)
    at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:61)
    at org.apache.xbean.recipe.AbstractRecipe.create(AbstractRecipe.java:49)
    at
org.apache.openejb.assembler.classic.Assembler.createResource(Assembler.java:1797)
    at
org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:434)
    at
org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:353)
    at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:147)
    at org.apache.openejb.OpenEJB.init(OpenEJB.java:292)
    at
org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:233)
    at org.apache.tomee.catalina.TomcatLoader.init(TomcatLoader.java:130)
    at
org.apache.tomee.catalina.ServerListener.lifecycleEvent(ServerListener.java:121)
    at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:658)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:602)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: java.lang.ClassNotFoundException:
    at java.lang.Class.forName(Class.java:219)
    at
org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:40)
    ... 28 more

looks like I am missing something :-)

TIA

Leo


On Tue, Jun 4, 2013 at 12:19 PM, Romain Manni-Bucau
<[email protected]>wrote:

> You can use a resource attribute called name to match the resource id of
> tomee.xml
> Le 4 juin 2013 16:11, "Leonardo K. Shikida" <[email protected]> a écrit :
>
> > Hi
> >
> > sorry for my ignorance :-)
> >
> > I am trying to put together
> >
> >
> >
> http://tomee.apache.org/examples-trunk/injection-of-connectionfactory/README.html
> >
> > with
> >
> > http://tomee.apache.org/jms-resources-and-mdb-container.html
> >
> > so, if I just add
> >
> >     <Resource id="MyJmsResourceAdapter" type="ActiveMQResourceAdapter">
> >         BrokerXmlConfig = broker:(tcp://localhost:61616)
> >         ServerUrl = tcp://localhost:61616
> >         DataSource = MyJMSDataSource
> >     </Resource>
> >
> >     <Resource id="MyJMSDataSource" type="javax.sql.DataSource">
> >         JdbcDriver = com.mysql.jdbc.Driver
> >         JdbcUrl = jdbc:mysql://localhost:3306/jms
> >         UserName = xxx
> >         Password = xxx
> >     </Resource>
> >
> > to my tomee.xml file, it's supposed to activeMQ automatically create a
> > table into database "jms" and persist all the queue messages there, if I
> > use
> >
> > producer.setDeliveryMode(DeliveryMode.PERSISTENT);
> >
> > ?
> >
> > will
> >
> > @Resource private ConnectionFactory connectionFactory
> >
> > automatically be binded to a impliict
> >
> >     <Resource id="MyJmsConnectionFactory"
> > type="javax.jms.ConnectionFactory">
> >         ResourceAdapter = MyJmsResourceAdapter
> >     </Resource>
> >
> > ?
> >
> > and that's it? or am I missing something?
> >
> >
> > TIA
> >
> > Leo
> >
>

Reply via email to