Re: Specifying source queue for message driven bean (MDB)
Sounds like you are happy with the MDB configuration but want the queue/FE_QUEUE resource-env-ref in FEInternalServicesEJB to point to queue/FE_QUEUE instead of "Default Queue". This error seem very strange because the code that processes resource- env-ref should never create an queue with ID "Default Queue" unless your JNDI reference was named "Default Queue". I'm gonna guess that you have a resource-ref instead of a resouce-env-ref. Can you double check you ejb-jar.xml to see if you have the wrong ref type? In the mean time, I've committed a patch the changes these log messages to include the exact reference type. I'll also look at logging an error or throwing an exception if you use a resource-ref to auto create a queue or topic. -dain BTW, If my assumptions are correct, I'm surprised you didn't get a null pointer exception when the container attempted to construct an ActimeMQ Queue without a destination name. On Oct 16, 2007, at 7:55 AM, Martin Vysny wrote: Hi guys, can you help me again? ;) We have a MDB named CallAgentMDB, which is a message consumer (MessageListener), and FEInternalServicesBean, which is a stateless bean. The problem is, that the MDB is not receiving messages which are sent by the internal services bean. When openejb starts, it prints the following: 2007-10-16 16:37:32,401 - INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container) 2007-10-16 16:37:32,406 - INFO - Auto-creating a container for bean FEClientEJB: Container(type=STATELESS, id=Default Stateless Container) 2007-10-16 16:37:32,407 - INFO - Auto-linking resource reference 'jdbc/DB2DS' in bean FEInternalServicesEJB to Resource(id=Default JDBC Database) 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Connection Factory, type=Resource, provider-id=Default JMS Connection Factory) 2007-10-16 16:37:32,407 - INFO - Auto-creating a resource with id 'Default JMS Connection Factory' of type 'javax.jms.QueueConnectionFactory for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Resource Adapter, type=Resource, provider-id=Default JMS Resource Adapter) 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'jms/FE_QCF' in bean FEInternalServicesEJB to Resource(id=Default JMS Connection Factory) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default Queue, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Auto-creating a resource with id 'Default Queue' of type 'javax.jms.Queue for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean FEInternalServicesEJB to Resource(id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default MDB Container, type=Container, provider-id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Auto-creating a container for bean CallAgentMDB: Container(type=MESSAGE, id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=queue/ FE_QUEUE, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,409 - INFO - Auto-creating a resource with id 'queue/FE_QUEUE' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,409 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean CallAgentMDB to Resource(id=queue/FE_QUEUE) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=CallAgentMDB, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,410 - INFO - Auto-creating a resource with id 'CallAgentMDB' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,708 - INFO - Loaded Module: /home/vyzivus/work/chrysler/fe-trunk/fe-ejb/eclipse-target/ classes So, we can see that FEInternalServicesEJB posts messages to "Default Queue", while CallAgentMDB expects messages in "queue/FE_QUEUE" queue. How can I set the CallAgentMDB to listen on "Default Queue"? Can you please provide me with some MDB examples on OpenEJB? Thanks! Martin -- Mgr. Martin Vysny | [EMAIL PROTECTED] Software Engineer Whitestein Technologies s.r.o | www.whitestein.com Panenska 28 | 811 03 Bratislava | Slovak Republic Main +421 2 5443-5502 | Direct +421 2 5930-0717
Re: OpenEJB and Hibernate
On 10/16/07, Martin Vysny <[EMAIL PROTECTED]> wrote: > Okay, it's java:comp/TransactionManager from within a bean, or > java:openejb/TransactionManager from outside a bean ;) We are using > Hibernate via the JPA interface as follows: > > package com.whitestein.fe.impl.config; > > import org.hibernate.transaction.JNDITransactionManagerLookup; > > /** > * Hibernate Transaction manager lookup strategy for OpenEJB. > * > * @author mvy > */ > public class OpenEJBTransactionManagerLookup extends > JNDITransactionManagerLookup { > > @Override > protected String getName() { > return "java:comp/TransactionManager"; //$NON-NLS-1$ > } > > public String getUserTransactionName() { > return "java:comp/UserTransaction"; //$NON-NLS-1$ > } > > } > > > properties.put(Environment.DIALECT, dbDialect); > properties.put(Environment.TRANSACTION_MANAGER_STRATEGY, > OpenEJBTransactionManagerLookup.class.getName()); > properties.put(Environment.TRANSACTION_STRATEGY, > CMTTransactionFactory.class.getName()); > properties.put(Environment.JNDI_CLASS, > "org.apache.openejb.client.LocalInitialContextFactory"); > entityManagerFactory = Persistence.createEntityManagerFactory( > persistenceUnitName, properties); > > This way, Hibernate joins the container transactions. Awesome. I wouldn't imagine such stuff is possible in/with OpenEJB. Even after so long with openejb I can learn new stuff. It'd be great if you could share the app or better yet write a doc how to work with hibernate and openejb together. Would you mind? ;-) Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
Specifying source queue for message driven bean (MDB)
Hi guys, can you help me again? ;) We have a MDB named CallAgentMDB, which is a message consumer (MessageListener), and FEInternalServicesBean, which is a stateless bean. The problem is, that the MDB is not receiving messages which are sent by the internal services bean. When openejb starts, it prints the following: 2007-10-16 16:37:32,401 - INFO - Configuring Service(id=Default Stateless Container, type=Container, provider-id=Default Stateless Container) 2007-10-16 16:37:32,406 - INFO - Auto-creating a container for bean FEClientEJB: Container(type=STATELESS, id=Default Stateless Container) 2007-10-16 16:37:32,407 - INFO - Auto-linking resource reference 'jdbc/DB2DS' in bean FEInternalServicesEJB to Resource(id=Default JDBC Database) 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Connection Factory, type=Resource, provider-id=Default JMS Connection Factory) 2007-10-16 16:37:32,407 - INFO - Auto-creating a resource with id 'Default JMS Connection Factory' of type 'javax.jms.QueueConnectionFactory for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,407 - INFO - Configuring Service(id=Default JMS Resource Adapter, type=Resource, provider-id=Default JMS Resource Adapter) 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'jms/FE_QCF' in bean FEInternalServicesEJB to Resource(id=Default JMS Connection Factory) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default Queue, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Auto-creating a resource with id 'Default Queue' of type 'javax.jms.Queue for 'FEInternalServicesEJB'. 2007-10-16 16:37:32,408 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean FEInternalServicesEJB to Resource(id=Default Queue) 2007-10-16 16:37:32,408 - INFO - Configuring Service(id=Default MDB Container, type=Container, provider-id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Auto-creating a container for bean CallAgentMDB: Container(type=MESSAGE, id=Default MDB Container) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=queue/FE_QUEUE, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,409 - INFO - Auto-creating a resource with id 'queue/FE_QUEUE' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,409 - INFO - Auto-linking resource reference 'queue/FE_QUEUE' in bean CallAgentMDB to Resource(id=queue/FE_QUEUE) 2007-10-16 16:37:32,409 - INFO - Configuring Service(id=CallAgentMDB, type=Resource, provider-id=Default Queue) 2007-10-16 16:37:32,410 - INFO - Auto-creating a resource with id 'CallAgentMDB' of type 'javax.jms.Queue for 'CallAgentMDB'. 2007-10-16 16:37:32,708 - INFO - Loaded Module: /home/vyzivus/work/chrysler/fe-trunk/fe-ejb/eclipse-target/classes So, we can see that FEInternalServicesEJB posts messages to "Default Queue", while CallAgentMDB expects messages in "queue/FE_QUEUE" queue. How can I set the CallAgentMDB to listen on "Default Queue"? Can you please provide me with some MDB examples on OpenEJB? Thanks! Martin -- Mgr. Martin Vysny | [EMAIL PROTECTED] Software Engineer Whitestein Technologies s.r.o | www.whitestein.com Panenska 28 | 811 03 Bratislava | Slovak Republic Main +421 2 5443-5502 | Direct +421 2 5930-0717 signature.asc Description: This is a digitally signed message part
Re: OpenEJB and Hibernate
On Mon, 2007-10-15 at 11:06 +0200, Martin Vysny wrote: > On Fri, 2007-10-12 at 13:54 -0700, Dain Sundstrom wrote: > > On Oct 12, 2007, at 2:41 AM, Martin Vysny wrote: > > > > > Hi guys, > > > I tried to use Hibernate in OpenEJB (our application unfortunately > > > still does not use JPA - it uses Hibernate directly instead). However, > > > it seems there is a version clash: OpenEJB requires ASM 2.2.3 while > > > Hibernate 3.2.4 requires ASM 1.5.3 and they seem to be incompatible: > > > > > > ... > > > > > > Have you guys tried to use OpenEJB with Hibernate? Can you please > > > provide me with some hints? Which one is harder: modify Hibernate > > > to use 2.2.3 or OpenEJB to use 1.5.3? :-) > > > > I wouldn't try to modify either; I'd repackage. Most projects seem > > to repackage asm to avoid such conflicts, and I'd guess they do it > > because Hibernate is not repackaging :) > > > > The ASM FAQ suggests (http://asm.objectweb.org/doc/faq.html) jarjar. > > If you can figure out how to do this, that would be awesome. We can > > simply add the repackaged jar to our svn repository. > > > > -dain > > > > Thanks very much for the idea, but we found an easier way to resolve > this issue: [1]. Now can you help us where to look for > TransactionManager in JNDI? Hibernate requires it when using CMP > persistency. Thanks! Okay, it's java:comp/TransactionManager from within a bean, or java:openejb/TransactionManager from outside a bean ;) We are using Hibernate via the JPA interface as follows: package com.whitestein.fe.impl.config; import org.hibernate.transaction.JNDITransactionManagerLookup; /** * Hibernate Transaction manager lookup strategy for OpenEJB. * * @author mvy */ public class OpenEJBTransactionManagerLookup extends JNDITransactionManagerLookup { @Override protected String getName() { return "java:comp/TransactionManager"; //$NON-NLS-1$ } public String getUserTransactionName() { return "java:comp/UserTransaction"; //$NON-NLS-1$ } } properties.put(Environment.DIALECT, dbDialect); properties.put(Environment.TRANSACTION_MANAGER_STRATEGY, OpenEJBTransactionManagerLookup.class.getName()); properties.put(Environment.TRANSACTION_STRATEGY, CMTTransactionFactory.class.getName()); properties.put(Environment.JNDI_CLASS, "org.apache.openejb.client.LocalInitialContextFactory"); entityManagerFactory = Persistence.createEntityManagerFactory( persistenceUnitName, properties); This way, Hibernate joins the container transactions. Martin Vysny signature.asc Description: This is a digitally signed message part
Re: allowHosts in OpenEjb3.0
Hi Jackek, I am using it in Apache Geronimo. I was able to use the same in AG 1.2 which has OpenEjb 2.1 as its EJB module. 0.0.0.0 4201 127.0.0.1 But with AG 2.0 which has OpenEjb 3.0. When I try the same operation I get a not allowed attribute error. So was not sure whether this attribute has been removed from OpenEjb 3.0 or there is an alternative available for the same functionality. Thanks Ashish On 10/16/07, Jacek Laskowski <[EMAIL PROTECTED]> wrote: > > On 10/16/07, Ashish Jain <[EMAIL PROTECTED]> wrote: > > Hi, > > Is the attribute allowHosts removed in OpenEjb3.0? Is there any other > > alternative for this attribute? > > I don't know, but openejb3 was about adding features not removing them > so it is available, unintentionally removed or we missed adding > porting it to openejb3. Could you describe how you're using the > feature? > > Jacek > > -- > Jacek Laskowski > http://www.JacekLaskowski.pl >
Re: allowHosts in OpenEjb3.0
On 10/16/07, Ashish Jain <[EMAIL PROTECTED]> wrote: > Hi, > Is the attribute allowHosts removed in OpenEjb3.0? Is there any other > alternative for this attribute? I don't know, but openejb3 was about adding features not removing them so it is available, unintentionally removed or we missed adding porting it to openejb3. Could you describe how you're using the feature? Jacek -- Jacek Laskowski http://www.JacekLaskowski.pl
allowHosts in OpenEjb3.0
Hi, Is the attribute allowHosts removed in OpenEjb3.0? Is there any other alternative for this attribute? Thanks Ashish