4 Replies Latest reply on Sep 2, 2002 11:25 PM by David Weitzman

    Security Exception

    David Weitzman Newbie

      I'm writing a set of JBoss services and want to have Queue for sending messages around. When calling QueueConnectionFactory.createQueueConnection() I get this exception:

      javax.jms.IllegalStateException: SecurityManager only works with a SubjectSecurityManager
      at org.jboss.mq.security.SecurityManager.authenticate(SecurityManager.java:185)
      at org.jboss.mq.security.ServerSecurityInterceptor.authenticate(ServerSecurityInterceptor.java:40)
      at org.jboss.mq.server.TracingInterceptor.authenticate(TracingInterceptor.java:575)
      at org.jboss.mq.server.JMSServerInvoker.authenticate(JMSServerInvoker.java:288)
      at org.jboss.mq.il.jvm.JVMServerIL.authenticate(JVMServerIL.java:302)
      at org.jboss.mq.Connection.authenticate(Connection.java:759)
      at org.jboss.mq.Connection.(Connection.java:233)
      at org.jboss.mq.SpyConnection.(SpyConnection.java:48)
      at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:135)
      at smtp.commands.DataCommand.connectToQueue(DataCommand.java:43)
      [Rest of trace omitted]

      Does anyone know what causes this?

      Thanks.

        • 1. Re: Security Exception
          David Weitzman Newbie

          Forgot to mention that I'm using JBoss 3.0.2.

          • 2. Re: Security Exception
            David Weitzman Newbie

            I managed to mutate the problem.

            I'll start off by saying I'm using the minimal version of JBoss 3.0.2 and all of the JMS configuration is stuff I copied.

            Anyway, by setting in the configuration that org.jboss.mq.security.SecurityManager depends on JaasSecurityManager and registering org.jboss.security.plugins.JaasSecurityManagerService as an mbean, I get a new, different error message:


            org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.lang.SecurityException: Unable to locate a login configuration)
            at org.jboss.mq.Connection.authenticate(Connection.java:766)
            at org.jboss.mq.Connection.(Connection.java:233)
            at org.jboss.mq.SpyConnection.(SpyConnection.java:48)
            at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:135)
            at smtp.commands.DataCommand.connectToQueue(DataCommand.java:43)
            [more stuff omitted]

            Are there more things I should be copying from the 'default' configuration of the server to make this work?

            • 3. Re: Security Exception
              David Weitzman Newbie

              I just tested my stuff on the 'default' setup and it works fine. The problem here must be configuring JMS to work in the 'minimal' server.

              I asked earlier if JBossMQ could exist separately from the rest of JBoss (in the thread at http://jboss.org/forums/thread.jsp?forum=48&thread=20484) and the answer was 'you can just use JBoss reduced to the minimal server and add only JBossMQ'. It looks like I'll need something more concrete.

              What does it take to add JBossMQ to a minimal JBoss 3.0.2?

              I've copied jbossmq-destinations-service.xml, jbossmq-service.xml, jms-ra.rar and jms-service.xml for good measure, jca-service.xml because it may be necessary for that .rar.

              To the conf dir I've copied jbossmq-state.xml, auth.conf, login-config.xml.

              I stuck this section in jboss-service.xml:

              <!-- ==================================================================== -->
              <!-- Security -->
              <!-- ==================================================================== -->


              jboss.security:service=XMLLoginConfig


              login-config.xml


              <!-- JAAS security manager and realm mapping -->


              org.jboss.security.plugins.JaasSecurityManager




              I've copied into the lib dir: jaas, jboss-j2ee, jboss-jca, jbossmq, jbosssx, and my own .jar.

              What am I missing?

              • 4. Re: Security Exception
                David Weitzman Newbie

                Now I've changed it to a whole new error. Will the fun never end? Only this one seems more peculiar

                Problem starting service jboss.security:service=XMLLoginConfig
                java.lang.NullPointerException
                at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:524)
                at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
                at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
                at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
                at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:86)
                at org.jboss.security.auth.login.XMLLoginConfig.loadURL(XMLLoginConfig.java:291)
                at org.jboss.security.auth.login.XMLLoginConfig.loadConfig(XMLLoginConfig.java:259)
                at org.jboss.security.auth.login.XMLLoginConfig.start(XMLLoginConfig.java:233)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                ...

                It can't be a problem with the formatting of login-config.xml unless I've suddenly stumbled on a major bug in crimson that nobody else has noticed. Why would the XML parser be throwing exceptions?