[Microcontainer] - Microcontainer and JMX meta-data
by genman
I know I can expose a series of POJOs as MBeans using the Microcontainer. But, I wonder how is it possible to include some of the same information from my xmbean.xml files?
For example, I'd like to be able to annotate all my methods and attributes with descriptions. I haven't seen POJO decription annotations in the SVN codebase. (Really, Sun should have added standard annotations for things like MBean descriptions etc...)
I would also like to indicate persistence policy. I want to be able to plug-in some sort of mechanism that populates a POJO's attributes from disk or a database.
To be honest, from what I've seen of some of the .xml files, and I almost rather use a legacy -service.xml as they are easier to follow...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990169#3990169
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990169
18Â years
[Messaging, JMS & JBossMQ] - Re: connectionFactoryJndiName config property
by tobinibot
Ok, well I was able to get the sample project (EJB2) up and running successfully. Now to try and get it running with EJB3.
Using the same JBoss setup, I created a new EJB3 project and one MDB:
package ejb;
|
| import javax.ejb.ActivationConfigProperty;
| import javax.ejb.MessageDriven;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import org.jboss.logging.Logger;
|
| /**
| * @author tjuday
| */
| @MessageDriven(mappedName = "jms/SimpleMessageReceiverBean", activationConfig = {
| @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
| @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
| @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue.outbound")
| })
| public class SimpleMessageReceiverBean implements MessageListener {
| private Logger logger = Logger.getLogger(SimpleMessageReceiverBean.class);
|
| public void onMessage(Message message) {
| logger.info("received message");
| }
| }
And this is with the panacya-ds.xml, here:
<?xml version="1.0" encoding="UTF-8"?>
|
| <!DOCTYPE connection-factories
| PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
| "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
|
| <connection-factories>
|
| <tx-connection-factory>
| <jndi-name>activemq/QueueConnectionFactory</jndi-name>
| <xa-transaction/>
| <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing this one out! -->
| <rar-name>activemq-ra-4.0.2.rar</rar-name>
| <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| </tx-connection-factory>
|
| <tx-connection-factory>
| <jndi-name>activemq/TopicConnectionFactory</jndi-name>
| <xa-transaction/>
| <track-connection-by-tx/> <!-- Thanks to Adrian Brock for pointing this one out too! -->
| <rar-name>activemq-ra-4.0.2.rar</rar-name>
| <connection-definition>javax.jms.TopicConnectionFactory</connection-definition>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| </tx-connection-factory>
|
| <mbean code="org.jboss.resource.deployment.AdminObject" name="activemq.queue:name=outboundQueue">
| <attribute name="JNDIName">activemq/queue/outbound</attribute>
| <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='activemq-ra-4.0.2.rar'</depends>
| <attribute name="Type">javax.jms.Queue</attribute>
| <attribute name="Properties">
| PhysicalName=queue.outbound
| </attribute>
| </mbean>
|
| </connection-factories>
When I run that, I get this in the log file:
anonymous wrote : 11:33:31,562 INFO [EJBContainer] STARTED EJB: ejb.SimpleMessageReceiverBean ejbName: SimpleMessageReceiverBean
| 11:33:31,578 WARN [MessagingContainer] Could not find the queue destination-jndi-name=queue.outbound
| 11:33:31,578 WARN [MessagingContainer] destination not found: queue/queue.outbound reason: javax.naming.NameNotFoundException: queue.outbound not bound
| 11:33:31,765 WARN [MessagingContainer] creating a new temporary destination: queue/queue.outbound
| 11:33:31,765 INFO [outbound] Bound to JNDI name: queue/queue.outbound
| 11:33:31,812 INFO [EJB3Deployer] Deployed: file:/C:/Program Files/Fresh_JBoss/server/default/deploy/Panacya_EJB3.jar
| 11:33:31,921 WARN [JmsActivation] Failure in jms activation org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@1b57890(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter(a)6972f1 destination=queue.outbound isTopic=false tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=0)
| javax.naming.NameNotFoundException: queue.outbound not bound
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
| at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
| at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
| at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
| at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
| at javax.naming.InitialContext.lookup(InitialContext.java:351)
| at org.jboss.util.naming.Util.lookup(Util.java:215)
| at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:399)
| at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:306)
| at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:589)
| at org.jboss.resource.work.WorkWrapper.execute(WorkWrapper.java:204)
| at org.jboss.util.threadpool.BasicTaskWrapper.run(BasicTaskWrapper.java:275)
| at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743)
| at java.lang.Thread.run(Thread.java:595)
|
|
You can see that I'm using the physical name of the queue for my destination, but it's not working. I've tried all sorts of things in that destination field, and I can't get anything to work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3990164#3990164
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3990164
18Â years