[jboss-user] [JBoss Messaging] - Securing JBoss Messaging and EJB3
Alexander Hartner
do-not-reply at jboss.com
Fri Jul 23 07:08:16 EDT 2010
Alexander Hartner [http://community.jboss.org/people/ejb3workshop] replied to the discussion
"Securing JBoss Messaging and EJB3"
To view the discussion, visit: http://community.jboss.org/message/554139#554139
--------------------------------------------------------------
I added a abc-jms-ds.xml file to my ear in which i define a JMS Provider and two connection factories, one with XA/TX support and one without
> <?xml version="1.0" encoding="UTF-8"?>
> <connection-factories>
>
> <!-- The JMS provider loader -->
> <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
> name="jboss.messaging:service=JMSProviderLoader,name=ABCJMSProvider">
> <attribute name="ProviderName">ABCJMSProvider</attribute>
> <attribute name="ProviderAdapterClass">
> org.jboss.jms.jndi.JNDIProviderAdapter
> </attribute>
> <!-- The combined connection factory -->
> <attribute name="FactoryRef">jms/ABCJMSConnectionFactoryClustered</attribute>
> <!-- The queue connection factory -->
> <attribute name="QueueFactoryRef">jms/ABCJMSConnectionFactoryClustered</attribute>
> <!-- The topic factory -->
> <attribute name="TopicFactoryRef">jms/ABCJMSConnectionFactoryClustered</attribute>
> <!-- Access JMS via HAJNDI -->
> <attribute name="Properties">
> java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
> java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
> java.naming.provider.url=${jboss.bind.address:localhost}:1100
> jnp.disableDiscovery=false
> jnp.partitionName=${jboss.partition.name:DefaultPartition}
> jnp.discoveryGroup=${jboss.partition.udpGroup:230.0.0.4}
> jnp.discoveryPort=1102
> jnp.discoveryTTL=16
> jnp.discoveryTimeout=5000
> jnp.maxRetries=1
> </attribute>
> </mbean>
>
> <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
> <tx-connection-factory>
> <jndi-name>jms/ABCJMSConnectionFactory</jndi-name>
> <xa-transaction/>
> <rar-name>jms-ra.rar</rar-name>
> <track-connection-by-tx/>
> <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:/ABCJMSProvider</config-property>
> <max-pool-size>20</max-pool-size>
> <security-domain-and-application>EncryptJMSPassword</security-domain-and-application>
> <use-java-context>false</use-java-context>
> </tx-connection-factory>
>
> <no-tx-connection-factory>
> <jndi-name>jms/ABCJMSConnectionFactoryClustered</jndi-name>
> <rar-name>jms-ra.rar</rar-name>
> <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
> <min-pool-size>0</min-pool-size>
> <max-pool-size>20</max-pool-size>
> <blocking-timeout-millis>50000</blocking-timeout-millis>
> <idle-timeout-minutes>15</idle-timeout-minutes>
> <security-domain-and-application>EncryptJMSPassword</security-domain-and-application>
> <use-java-context>false</use-java-context>
> </no-tx-connection-factory>
>
> </connection-factories>
I also specify the provide in my ejb-jar.xml file as follows:
> <message-driven>
> <ejb-name>JobRequestListener</ejb-name>
> <ejb-class>com.abc.backend.jobs.JobRequestListener</ejb-class>
> <message-destination-link>JobRequests</message-destination-link>
> <activation-config>
> <activation-config-property>
> <activation-config-property-name>providerAdapterJNDI</activation-config-property-name>
> <activation-config-property-value>java:ABCJMSProvider</activation-config-property-value>
> </activation-config-property>
> </activation-config>
and map the injected connection factory to the new JNDI name in jboss.xml as follows:
> <resource-ref>
> <res-ref-name>jms/ConnectionFactory</res-ref-name>
> <jndi-name>jms/ABCJMSConnectionFactoryClustered</jndi-name>
> </resource-ref>
However when I deploy I get the following exception
>
> 18:56:12,988 INFO [JmsActivation] Attempting to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec at 7736b039(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter at 61a48515 destination=queue/abc/SendEmails isTopic=false tx=true durable=false reconnect=10 provider=javaABCJMSProvider user=jmsuser pass=<not shown> maxMessages=1 minSession=1 maxSession=1 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
> 18:56:12,990 ERROR [JmsActivation] Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec at 7736b039(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter at 61a48515 destination=queue/abc/SendEmails isTopic=false tx=true durable=false reconnect=10 provider=java:ABCJMSProvider user=jmsuser pass=<not shown> maxMessages=1 minSession=1 maxSession=1 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQMaxResent=5)
> javax.jms.IllegalStateException: This method is not applicable inside the application server. See the J2EE spec, e.g. J2EE1.4 Section 6.6
> at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.setExceptionListener(JmsSessionFactoryImpl.java:224)
> at org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler.setupDLQConnection(AbstractDLQHandler.java:142)
> at org.jboss.resource.adapter.jms.inflow.dlq.AbstractDLQHandler.setup(AbstractDLQHandler.java:83)
> at org.jboss.resource.adapter.jms.inflow.dlq.JBossMQDLQHandler.setup(JBossMQDLQHandler.java:48)
> at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDLQ(JmsActivation.java:369)
> at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:315)
> at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:259)
> at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsActivation.java:639)
> 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:756)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/554139#554139]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2042]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100723/8a66e52d/attachment.html
More information about the jboss-user
mailing list