2 Replies Latest reply on Feb 1, 2011 5:14 AM by asterisk

    MDB -> SLSB -> SLSB auth fails with EJB2 and HornetQ on JBoss 5.1

    asterisk Newbie



      I have a secured EJB2 application on Jboss 5.1 and HornetQ 2.0 as default JMS provider. My problem is that I receive a SecurityException if I try to create a SLSB in a method of a SLSB that was called from an MDB. So the call stack is Client -> MDB -> SLSB -> SLSB. The last step is the one that fails. The application is secured, so I use the run-as property to pass a valid role for the MDB. This seems to work, because I can initilize a secured SLSB from the MDB. But once the SLSB tries to access another SLSB, I get this SecurityException. Does anybody know how to solve this problem?


      Another problem is, that the message in the example is sent once, but received many times on MDB side. Can anybody tell me why?


      I have attached some sample code. It is a modified example from the HornetQ examples. So if you want to run it, you have to setup everything so that you can execute the HornetQ examples. Then unzip the file to <hornetq>/examples/javaee/ and change into the directory "mdb-ejb". Here you can call "./build.sh deploy" and "./buld.sh" as usual.


      Thanks in advance!



      Kind regards