1 Reply Latest reply on Sep 5, 2002 7:35 AM by Dirk Haase

    Security with MDBs and containers

    Dirk Haase Newbie


      I recently added a Message-Driven Bean to my application whiche created new entities upon receiving a message. The Entity was in a security domain and required the role of InternalRole to be accessed. I always got an Authenticaion Error: principal=null. But I thought that was the way it's supposed to be with MDBs. The Message-Driven Bean had a security-identy run-as InternalRole, so I didn't know what was wrong. At that time, my jboss.xml did not have any containers, everything was in the same security domain. So I removed everything from the security domain and my application worked well. But I wanted the security back. I thought it would be ok if that one entity bean was not secure as it only has local interfaces, so I decided to make up different containers in the jboss.xml configuration and put some beans in a security context and some not. But since this change, the jboss verifier always gives me following exception:
      [echo] Calling JBoss verifier ...
      [java] Problem starting the application:
      [java] Exception: java.lang.NullPointerException
      [java] Message: null
      [java] java.lang.NullPointerException
      [java] at org.jboss.metadata.ConfigurationMetaData.importJbossXml(ConfigurationMetaData.java:266)
      [java] at org.jboss.metadata.ApplicationMetaData.importJbossXml(ApplicationMetaData.java:492)
      [java] at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:184)
      [java] at org.jboss.verifier.Main.main(Main.java:79)
      [java] Java Result: -1

      Is there any way how I can get a more detailed description of the error?

      I know these are two different problems, but maybe somebody can help me with one of them.

      First question is: How can I access beans that require a certain role from a message-driven bean? (I tried run-as. It doesn't work)

      Second question is: Is there a general problem with beans in different containers in jboss.xml that causes above exception? How do i know what is wrong with my jboss.xml? My jboss.xml complies to the DTD, no error there.

      thanks in advance,

        • 1. Re: Security with MDBs and containers
          Dirk Haase Newbie

          I found the problem. I was mislead by listing 8-4 in the Quick Start Guide. I didnt know container-configurations need to depends on one of the configurations in standardjboss.xml.
          There are several errors in this listing.
          1) the tag <contaner-name> is used instead of <configuration-name>
          2) the <enterprise-beans> tag must be before the <container-configuration> tag.
          3) the <container-configuration> tag must have the depends attribute.