[JBoss-user] [Messaging, JMS & JBossMQ] - Can't use EJB3 MDB to retrieve messages one by one.
Hello! I'll be as short as possible. Thank you. Jboss version: 4.0.4RC1 EJB3 version: rc5-PFD JRE: 1.5.0_06 My persistent queue config: | jboss.mq:service=DestinationManager | -1 | | My MDB class annotated: @MessageDriven(activationConfig = { | @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), | @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/myQueue1"), | @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Client-acknowledge") | }) | public class BlogKsgMDBean implements MessageListener { I'm using several threads to post messages to myQueue1 simultaneously. Looking over my debug log I see that several instances of my MDB also starts simultaneously. I would like to get it work to handle messages one by one. No get next message from queue until current handle finish. But still using MessageListener instead of .receive() method. Is it possible? How do I have to configure it? Here's how I post message: conn = jmsConnectionFactory.createConnection(); | //sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE); | sess = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE); | producer = sess.createProducer((Destination) namingContext.lookup("queue/myQueue1")); | ObjectMessage msg = sess.createObjectMessage(message); | producer.send(msg); | producer.close(); | sess.close(); | conn.close(); View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3943903#3943903 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3943903 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS & JBossMQ] - Re: Can't use EJB3 MDB to retrieve messages one by one.
"mskonda" wrote : use the Singleton configuration: | | | | | Singleton Message Driven Bean | | XARecovery2ResMDB | | queue/@QUEUE_NAME@ | | | | Thanks to all. I explicitly added name to annotation: @MessageDriven(name = "MyMDBean", Created jboss.xml: | | | MyMDBean | queue/myQueue1 | Singleton Message Driven Bean | | | | Got error: 2006-05-17 15:05:28,448 WARN [org.jboss.system.ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=dvase-mdb.blog.ksg.jar | org.jboss.xb.binding.JBossXBException: Failed to parse source | at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:138) | ... | Caused by: java.lang.ClassCastException: org.jboss.ejb3.dd.SessionEnterpriseBean | at org.jboss.ejb3.dd.EnterpriseBeans.setDestinationJndiName(EnterpriseBeans.java:98) | at org.jboss.ejb3.dd.JBossDDObjectFactory.setValue(JBossDDObjectFactory.java:697) | ... | at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) | at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:134) | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3944218#3944218 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3944218 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS & JBossMQ] - Re: Can't use EJB3 MDB to retrieve messages one by one.
"ManneF" wrote : Did you figure out why you got this message, because I'm getting the exact same problem with an MDB on 4.0.4RC1. | | Looks like a bug in the SaxJBossXBParser, because this is obviously no session EJB. Is this a known issue? Not yet. Just have no time to dig it. Currently I'm using ugly solution to synchronize onMessage method on static object. Thus I no need to reprogram message reading but have something close to what I need. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3945653#3945653 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3945653 --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: ejb-jar.xml must either obey the right xml schema or def
Start your file with: | http://java.sun.com/xml/ns/j2ee";> I have concluded the solution reading this: http://www.theserverside.com/discussions/thread.tss?thread_id=38282 At least it helped me to resolve your (and my) issue under jboss-4.0.4.GA. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3946561#3946561 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3946561 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS & JBossMQ] - Re: Can't use EJB3 MDB to retrieve messages one by one.
"ManneF" wrote : You may want to consider using a database lock instead. | | Using statics is inherently risky in a J2EE environment, because your class may be loaded many times by different class loaders. I got my MDBs to be always one per queue reducing their pool sizes: | @ActivationConfigProperty(propertyName = "MaxPoolSize", propertyValue = "1"), Is it valid solution? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3946590#3946590 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3946590 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Messaging, JMS & JBossMQ] - Re: Can't use EJB3 MDB to retrieve messages one by one.
"mskonda" wrote : use the Singleton configuration: | | | | | Singleton Message Driven Bean | | XARecovery2ResMDB | | queue/@QUEUE_NAME@ | | | | I got my MDBs to be always one per queue reducing their pool sizes: @ActivationConfigProperty(propertyName = "MaxPoolSize", propertyValue = "1"), Is it a valid solution? View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3947125#3947125 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3947125 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB 3.0] - Is there any way to define derived entity class for database
Hello, all! Sounds easy but not appear so in practice... Let's say I have entity class User with @id Long id; and @Column String name;. And I have other table with user profile data. The columns: user_id, name, value. One of profile names is 'NICKNAME'. So to store nickname Brutt of user with id 1 I create profile record: 1, "NICKNAME", "Brutt". Now what if I need to show some users with nicknames ordered by nickname? I created a view as SELECT u.*, p.value as nickname FROM u users, p profiles WHERE p.user_id = u.id AND p.name = 'NICKNAME' I defined entity class for the view like this: class UserNicknameView extends User { And for User I'm using inheritance type TABLE_PER_CLASS. It works fine until... After I fetch a List of UserNicknameView, the UserNicknameView instances are remembered by Entity Manager with some @Id's (derived from User). Then after try to update User with the same @Id that was already remembered I have exception about I want to merge wrong instance. Also I can't override @id in the UserNicknameView by @id nor @EmbeddedId. Any suggestion? I'd like to keep the User <- UserNicknameView derivation. Great thanks to any attention. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3947128#3947128 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3947128 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Is there any way to define derived entity class to represent
Hello all! I wonder if with Hibername + EJB3 I can use two entity classes: B derived from A, when A represents a table T and B represents a view of the table T. Here's my case: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=83890 I'm using jboss4.0.4.rc1 + EJB3rc5. Thank you! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3947353#3947353 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3947353 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [Persistence,JBoss/CMP, Hibernate, Database] - Re: Is there any way to define derived entity class to repre
Excuse me for I entered to long subject. I mean: Is there any way to define derived entity class to represent database view. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3947354#3947354 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3947354 --- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user