[jboss-user] [JBoss Messaging] - Re: java.lang.IllegalAccessError in 1.2.0.CR1
bnarayan
do-not-reply at jboss.com
Mon Feb 26 06:13:15 EST 2007
Below is a sample MDB that i use
import javax.ejb.EJBException;
| import javax.ejb.MessageDrivenBean;
| import javax.ejb.MessageDrivenContext;
| import javax.jms.Message;
| import javax.jms.MessageListener;
| import javax.jms.TextMessage;
|
|
|
|
| public class MyMDB implements MessageDrivenBean, MessageListener
| {
| private static final String COB_ID = "COB_ID";
| private static final String CONTAINER = "CONTAINER";
| private static final String ITEM_ID = "ITEM_ID";
| private static final String INFO_ID = "INFO_ID";
| private static final String LAST_UPDATED = "LAST_UPDATED";
| private static final String MEM_ID = "MEM_ID";
|
| private MessageDrivenContext mdbContext = null;
|
| public void onMessage(Message message)
| {
| try
| {
| TextMessage textMessage = (TextMessage) message;
| System.out.println("My MDB get called");
| String cobrandId = message.getStringProperty(COB_ID);
| String container = message.getStringProperty(CONTAINER);
| String cacheItemId = message.getStringProperty(ITEM_ID);
| String sumInfoId = message.getStringProperty(INFO_ID);
| String lastUpdated = message.getStringProperty(LAST_UPDATED);
| String memId = message.getStringProperty(MEM_ID);
|
| System.out.println("message contains :" );
| System.out.println("cobId : " + cobId);
| System.out.println("container : " + container);
| System.out.println("ItemId : " + ItemId);
| System.out.println("InfoId : " + InfoId);
| System.out.println("lastUpdated : " + lastUpdated);
| System.out.println("mem id: " + memId);
| //Calling functions to process the message
| }
| catch(Exception e)
| {
| e.printStackTrace();
| }
| }
|
| public void setMessageDrivenContext(MessageDrivenContext context)
| throws EJBException {
| this.mdbContext = context;
| }
|
| public void ejbCreate() {
| }
|
| public void ejbRemove() {
| }
| }
|
jms-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
|
| <connection-factories>
|
| <!-- ==================================================================== -->
| <!-- WSMQ connection factories -->
| <!-- ==================================================================== -->
|
| <!-- non XA provider loader and connection factory -->
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=JMSProvider">
| <attribute name="ProviderName">DefaultJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">
| org.jboss.jms.jndi.JNDIProviderAdapter
| </attribute>
| <attribute name="QueueFactoryRef">MDBDLQCF</attribute>
| <attribute name="TopicFactoryRef">MDBTestQueueCF</attribute>
| <attribute name="Properties">java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory</attribute>
| <attribute name="Properties">java.naming.provider.url=localhost:1099</attribute>
| <attribute name="Properties">java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces</attribute>
| </mbean>
|
| </connection-factories>
|
|
Entries of the above mentioned CFs in connection-factories-service.xml
<mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
| name="jboss.messaging.connectionfactory:service=MDBDLQCF"
| xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
| <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
| <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=socket</depends>
| <depends>jboss.messaging:service=PostOffice</depends>
|
| <attribute name="JNDIBindings">
| <bindings>
| <binding>/MDBDLQCF</binding>
| </bindings>
| </attribute>
|
| <attribute name="Clustered">true</attribute>
| <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>
| </mbean>
|
| <mbean code="org.jboss.jms.server.connectionfactory.ConnectionFactory"
| name="jboss.messaging.connectionfactory:service=MDBTestQueueCF"
| xmbean-dd="xmdesc/ConnectionFactory-xmbean.xml">
| <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
| <depends optional-attribute-name="Connector">jboss.messaging:service=Connector,transport=socket</depends>
| <depends>jboss.messaging:service=PostOffice</depends>
|
| <attribute name="JNDIBindings">
| <bindings>
| <binding>/MDBTestQueueCF</binding>
| </bindings>
| </attribute>
|
| <attribute name="Clustered">true</attribute>
| <attribute name="LoadBalancingFactory">org.jboss.jms.client.plugin.RoundRobinLoadBalancingFactory</attribute>
| </mbean>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4022347#4022347
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4022347
More information about the jboss-user
mailing list