users@glassfish.java.net

Re: How to: use Form based auth via JDBCRealm:oracle in Glassfish 3.0

From: <glassfish_at_javadesktop.org>
Date: Thu, 14 Jan 2010 04:26:29 PST

After changing my web.xml to include the realm jdbc_wonderland I not get these errors - I think i get them when i redeploy the web app:


[#|2010-01-14T07:18:58.684-0500|SEVERE|glassfishv3.0|org.apache.tomcat.util.digester.Digester|_ThreadID=30;_ThreadName=Thread-1;|Begin event threw exception

java.lang.ClassNotFoundException: org.apache.catalina.realm.JDBCRealm

        at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:744)

        at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61)

        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1656)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

        at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:242)

        at org.apache.tomcat.util.digester.Rule.begin(Rule.java:189)

        at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1414)

        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)

        at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)

        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)

        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)

        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)

        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)

        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)

        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)

        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)

        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)

        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)

        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1699)

        at org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:819)

        at org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfi


Also the relvant sections of my web.xml are:
 <security-constraint> <display-name>Logged in jsp</display-name>
  
    <web-resource-collection>
      <web-resource-name>Logged in jsp</web-resource-name><description/>
            <!-- Define the context-relative URL(s) to be protected -->
      <url-pattern>/loggedin.jsp</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint><description/>
            <!-- Anyone with one of the listed roles may access this area -->
            <role-name>member</role-name>
            <role-name>admin</role-name>
    </auth-constraint> <user-data-constraint>
       <description/>
       <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

  <security-constraint>
   <display-name>Login via GET</display-name>
    <web-resource-collection>
      <web-resource-name>Login via GET</web-resource-name><description/>
            <!-- Define the context-relative URL(s) to be protected -->
      <url-pattern>/login.do</url-pattern>
            <http-method>GET</http-method>
    </web-resource-collection>
    <auth-constraint><description/>
            <!-- Anyone with one of the listed roles may access this area -->
            <role-name>member</role-name>
            <role-name>admin</role-name>
    </auth-constraint> <user-data-constraint>
       <description/>
       <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
  </security-constraint>

  <security-constraint>
  <display-name>Login via GET</display-name>
    <web-resource-collection>
      <web-resource-name>Any Post .do</web-resource-name>
      <description/>
            <!-- Define the context-relative URL(s) to be protected -->
      <url-pattern>*.do</url-pattern>
      <http-method>POST</http-method>
    </web-resource-collection>
    <auth-constraint>
      <!-- Anyone with one of the listed roles may access this area -->
      <description/>
            <role-name>member</role-name>
            <role-name>admin</role-name>
    </auth-constraint>
    <user-data-constraint>
       <description/>
       <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>

  </security-constraint>

  <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>jdbc_wonderland</realm-name>
    <form-login-config>
      <form-login-page>/loginPage.jsp</form-login-page>
      <form-error-page>/loginError.jsp</form-error-page>
    </form-login-config>
  </login-config>

  <!-- Security roles referenced by this web application -->
  <security-role>
    <description />
    <role-name>member</role-name>
  </security-role>
   
  <security-role>
    <description />
    <role-name>admin</role-name>
  </security-role>
   
>> perhaps the way different servers hash the password ?
I was wondering about the hash too but it was at least partially working before.
[Message sent by forum member 'cal41' (calgach_at_yahoo.ca)]

http://forums.java.net/jive/thread.jspa?messageID=380911