4 Replies Latest reply on Aug 22, 2004 9:49 AM by dymon

    Problem with login-config.xml

    Michael Forster Newbie

      We are using the default login-config.xml in our own install, but we are getting the following error on running JBoss.

      19:24:54,441 WARN [XMLLoginConfigImpl] Failed to load config: file:/C:/ingotz/J
      org.jboss.security.auth.login.ParseException: Encountered "<?xml" at line 1, col
      umn 1.
      Was expecting one of:


      What is causing this and how can we stop it?

        • 1. Re: Problem with login-config.xml
          Scott Stark Master

          The login-config.xml has been corrputed and failed to parse as an xml file so its being treated as the sun ascii file format and failing. Look in the server.log for the original xml problem.

          • 2. Re: Problem with login-config.xml
            Ryan Johnston Newbie

            I followed your instructions and found that a null pointer is being thrown. The file is at the location, is readable, and parses as valid XML in Internet Explorer. Any suggestions?

            2004-08-12 17:39:31,617 DEBUG [org.jboss.security.auth.login.XMLLoginConfigImpl] Try loading config as XML, url=file:/C:/jboss-3.2.5/server/default/conf/login-config.xml
            2004-08-12 17:39:31,617 DEBUG [org.jboss.security.auth.login.XMLLoginConfigImpl] Failed to load config as XML
             at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:658)
             at org.apache.crimson.parser.Parser2.parse(Parser2.java:333)
             at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
             at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
             at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:76)
             at org.jboss.security.auth.login.XMLLoginConfigImpl.loadURL(XMLLoginConfigImpl.java:338)
             at org.jboss.security.auth.login.XMLLoginConfigImpl.loadXMLConfig(XMLLoginConfigImpl.java:280)
             at org.jboss.security.auth.login.XMLLoginConfigImpl.loadConfig(XMLLoginConfigImpl.java:251)
             at org.jboss.security.auth.login.XMLLoginConfigImpl.loadConfig(XMLLoginConfigImpl.java:233)
             at org.jboss.security.auth.login.XMLLoginConfig.startService(XMLLoginConfig.java:152)

            • 3. Re: Problem with login-config.xml
              ssaracut Newbie

              did you ever get that error resolved? I have the exact same problem... I am using just the standard login-config.xml . Didn't make any changes and when I look in the log i'm getting hte same null pointer exception.

              • 4. Re: Problem with login-config.xml
                dymon Newbie

                Hi all,

                I faced this problem too, and I have been doing some "investigations" :)

                This "null pointer" exception occured only on the client side of my j2ee app. The login-config.xml was present on the server too as part of jaas authentication - {jboss}/server/default/config/, but there - no exception.
                I noticed that if I put jboss.jar in the client classpath, the error misteriously dissapears... Browsing the files in jboss.jar I found some dtds, and one particullarily interesting - /org/jboss/metadata/security_config.dtd. Combined with the following snippet from XMLLoginConfigImpl.java:

                 /** Local entity resolver to handle the security-policy DTD public id.
                 private static class LocalResolver implements EntityResolver
                 private static final String LOGIN_CIONFIG_PUBLIC_ID = "-//JBoss//DTD JBOSS Security Config 3.0//EN";
                 private static final String LOGIN_CIONFIG_DTD_NAME = "/org/jboss/metadata/security_config.dtd";

                I'm not an XML expert myself, but I think this "resolver" expects security_config.dtd to be at a specific location in the classpath, namely: /org/jboss/metadata/

                So the solution, (or workaround ?) would be to put the dtd where it is expected to be.
                In my app, I created an additional folder on the client side - /org/jboss/metadata/, put the dtd in there, and added the folder to the client's classpath. Works fine.
                Another approach would be to include this folder into an existing jar, on the client's classpath.

                That's it,