How can I create my own Connection Factory?
lmsook Dec 11, 2006 1:00 PMHello,
I'm a beginner in JBoss and I read the related topic to my question, but I can not still find the solution. And I'm sorry I posted the same question to the other category. After posting there, I found this category sounded more relevant to my question.
What I want is that I want to have 2 my own Topic Connection Factory and 1 my own Queue Connection Factory besides the default ConnectionFactory JBoss provides.
What I did was adding below codes to /deploy/jms/uil2-service.xml file
<mbean code="org.jboss.naming.LinkRefPairService" name="jboss.jms:alias=PrimaryTCF"> <attribute name="JndiName">PrimaryTCF</attribute> <attribute name="RemoteJndiName">PrimaryTCF</attribute> <attribute name="LocalJndiName">java:/UserJmsXA</attribute> <depends>jboss:service=Naming</depends> </mbean> <mbean code="org.jboss.naming.LinkRefPairService" name="jboss.jms:alias=SiteSubscriptionTCF"> <attribute name="JndiName">SiteSubscriptionTCF</attribute> <attribute name="RemoteJndiName">SiteSubscriptionTCF</attribute> <attribute name="LocalJndiName">java:/UserJmsXA2</attribute> <depends>jboss:service=Naming</depends> </mbean> <mbean code="org.jboss.naming.LinkRefPairService" name="jboss.jms:alias=SiteSubscriptionQCF"> <attribute name="JndiName">SiteSubscriptionQCF</attribute> <attribute name="RemoteJndiName">SiteSubscriptionQCF</attribute> <attribute name="LocalJndiName">java:/UserJmsXA3</attribute> <depends>jboss:service=Naming</depends> </mbean>
And I also added below codes to the /deploy/jms/jms-ds.xml
<tx-connection-factory> <jndi-name>UserJmsXA</jndi-name> <xa-transaction/> <rar-name>jms-ra.rar</rar-name> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property> <max-pool-size>20</max-pool-size> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory> <tx-connection-factory> <jndi-name>UserJmsXA2</jndi-name> <xa-transaction/> <rar-name>jms-ra.rar</rar-name> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property> <max-pool-size>20</max-pool-size> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory> <tx-connection-factory> <jndi-name>UserJmsXA3</jndi-name> <xa-transaction/> <rar-name>jms-ra.rar</rar-name> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition> <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property> <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property> <max-pool-size>20</max-pool-size> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory>
As I run the application trying to connect those PrimaryTCF,SiteSubscriptionTCF,SiteSubscriptionQCF, it gives me
sometimes "Bus error" and sometimes "java.lang.StackOverflowError"
Would you please point out what's wrong with my codes and how I can fix it?
Thanks for your help.