2 Replies Latest reply on Feb 4, 2005 3:09 AM by simafe_2000

    Connection + classpath problems

    simafe_2000

      Hello.

      Trying to deploy a simple test application packaged in jwm.ear (I'm learning how to configure the form-based authentication) I encountered 2 problems :

      Problem 1:

      Using a DB realm as application policy.
      After entering username/password I always get the error page as output, but no log messages, so I have no ideea what's wrong with my configuration (see below).

      Problem 2:

      Using a file realm as application policy.
      The authentication works fine but I get an error saying that my servlet class is not found, even
      if I double checked that the class is in one of the jars under WEB-INF/lib/ in jwm.war.

      Please see below for further info.
      Thank you in advance,
      Felix

      Configuration:

      Java 1.5, jboss-4.0.1, Win XP

      Excerpts from :

      login-config.xml
      ...

      <! -- DB realm -- >
      <application-policy name="JWM">

      <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
      <module-option name="dsJndiName">java:/JWM</module-option>
      <module-option name="principalsQuery">
      select password from users where username=?
      </module-option>
      <module-option name="rolesQuery">
      select rolename,'Roles' from user_roles where username=?
      </module-option>
      </login-module>

      </application-policy>

      <! -- file realm -- >
      <application-policy name = "JWMFile">

      <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
      <module-option name="usersProperties"> users.properties</module-option>
      <module-option name="rolesProperties"> roles.properties</module-option>
      </login-module>

      </application-policy>
      ...

      mysql-ds.xml

      <local-tx-datasource>
      <jndi-name>JWM</jndi-name>
      <connection-url>jdbc:mysql://127.0.0.1:3306/jwm</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>webclient</user-name>
      < password>pippo< /password>
      </local-tx-datasource>


      Files :
      jwm.ear
      | - javawm.war
      |
      | - META-INF/
      |
      |- Manifest.mf
      |- jboss-app.xml
      |- application.xml

      jwm.war
      | - META-INF/
      | |
      | |- Manifest.mf
      |
      |
      | - WEB-INF/
      | | - jboss-web.xml
      | | - web.xml
      | |
      | | - lib/
      | | - *.jar
      |
      |
      | - user.properties
      | - roles.properties
      | - login.jsp
      | - error.jsp

        • 1. Re: Connection + classpath problems
          danl_thompson

          What error page do you see? 404? 403? 400? something else?

          • 2. Re: Connection + classpath problems
            simafe_2000

            Hi.

            I finally found the answers to my problems.

            Problem 1:
            The error was in the way I declared the JNDI names for data source.
            It should have been :

            login-config.xml
            ...
            <jndi-name>java:/jdbc/JWM</jndi-name>
            ....

            mysql-ds.xml

            ...
            <jndi-name>jdbc/JWM</jndi-name>

            The output was always the error page I declared in web.xml for a failed authentication, not an HTTP error page. And no log messages too.

            Problem 2:
            Well, this was a really studip error. I put the *.java files instead of their compiled mates.


            Thank you,
            Felix