2 Replies Latest reply on Jan 30, 2008 7:39 AM by 10takashi

    How to use "SecurityManager attribute" on EJB 3.0 MDB

    10takashi

      Hello there,

      My name is Takashi. Currently I'm searching the solution for the title.
      In conclusion, I want to know the way how to define Anotation for this attribute.
      (@ActivationConfigProperty(propertyName)

      First I'm describing my environment.

      --------------
      The host that has queue(remotehost)

      Name: Remotehost
      Server: Linux(SUSE 9.3)
      JDK Version: 1.5.0_14
      JBoss Version: 4.2.2-AS

      The host that has MDB tries to listen to remotehost's MQ(localhost)

      Name: localhost
      Server: Linux(SUSE 9.3)
      JDK Version: 1.5.0_14
      JBoss Version: 4.2.2-AS
      --------------


      In Remotehost, I defined queue/remotetest with Security Manager like this
      in remotehost-ds.xml file and deployed in Remotehost's /default/deploy/jms folder.

      --------------

      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
      <depends optional-attribute-name="ExpiryDestination">
      jboss.mq.destination:service=Queue,name=expiredTest
      <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager
      <depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager







      <depends optional-attribute name="SecurityManager">
      jboss.mq:service=SecurityManager
      --------------

      The above show the "Security Manager attribute".

      In localhost, I created a EJB 3.0 MDB tries to listen to Remotehost's MQ through RemoteJMSProvider like this,

      --------------
      @MessageDriven(activationConfig =
      {
      @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
      @ActivationConfigProperty(propertyName="destination", propertyValue="queue/remotetest"),
      @ActivationConfigProperty(propertyName="providerAdapterJNDI", propertyValue="java:/RemoteJMSProvider")
      })
      --------------

      When I execute this code, I got this error,

      --------------
      org.jboss.deployment.DeploymentException: Error for ActivationSpec class
      --------------

      In EJB2.0, in jboss.xml file, I defined mdb-user and mdb-passwd like this

      --------------
      <message-driven>
      <ejb-name>Remotetest</ejb-name>
      <destination-jndi-name>queue/remotetest</destination-jndi-name>
      <mdb-user>test</mdb-user>
      <mdb-passwd>test</mdb-passwd>
      <resource-ref>
      </resource-ref>
      </message-driven>
      --------------

      However, I couldn't find any doccument how can I define in EJB 3.0 MDB corresponding to the red characters part above....

      If anyone gives me good suggestion, I'm really appriciated.


      Best regards
      Takashi

        • 1. Re: How to use
          genman

          Remember to include the messageListenerInterface annotation property, e.g.:

          @MessageDriven(activationConfig = {
          @ActivationConfigProperty( ...
          },
          messageListenerInterface=MessageListener.class
          )


          What's the full exception stack trace on deployment?u

          • 2. Re: How to use
            10takashi

            Genman,

            Thank you for your reply.

            I included the one you specified to my code.
            messageListenerInterface=MessageListener.class

            However, result is same...


            Here is full exception stack trace
            =====================
            13:35:06,722 INFO [JmsActivation] Attempting to reconnect org.jboss.resource.ad
            apter.jms.inflow.JmsActivationSpec@1205042(ra=org.jboss.resource.adapter.jms.Jms
            ResourceAdapter@10463c3 destination=queue/test isTopic=false tx=true durable=fa
            lse reconnect=10 provider=java:/FipcaRemoteJMSProvider user=null maxMessages=1 m
            inSession=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resou
            rce.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null
            DLQMaxResent=5)
            13:35:06,893 ERROR [JmsActivation] Unable to reconnect org.jboss.resource.adapte
            r.jms.inflow.JmsActivationSpec@1205042(ra=org.jboss.resource.adapter.jms.JmsReso
            urceAdapter@10463c3 destination=queue/test isTopic=false tx=true durable=false
            reconnect=10 provider=java:/FipcaRemoteJMSProvider user=null maxMessages=1 minSe
            ssion=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.
            adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQM
            axResent=5)
            javax.jms.JMSSecurityException: Connection not authorized to subscribe to destin
            ation: audit
            at org.jboss.mq.security.ServerSecurityInterceptor.subscribe(ServerSecur
            ityInterceptor.java:156)
            at org.jboss.mq.server.TracingInterceptor.subscribe(TracingInterceptor.j
            ava:643)
            at org.jboss.mq.server.JMSServerInvoker.subscribe(JMSServerInvoker.java:
            177)
            at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocke
            tManagerHandler.java:188)
            at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.j
            ava:419)
            at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
            utor.java:761)
            at java.lang.Thread.run(Thread.java:595)