users@glassfish.java.net

Validator Gives Errors, Can't Find Them

From: <glassfish_at_javadesktop.org>
Date: Thu, 12 Jul 2007 06:05:01 PDT

The big ones I don't understand are the login/error pages and the missing user roles.


          ---------------------------
          STATIC VERIFICATION RESULTS
          ---------------------------

        
         ----------------------------------
         NUMBER OF FAILURES/WARNINGS/ERRORS
         ----------------------------------
         # of Failures : 5
         # of Warnings : 0
         # of Errors : 0

          -----------------------------
          RESULTS FOR EJB-RELATED TESTS
          -----------------------------
        
         --------------
         FAILED TESTS :
         --------------
        
         Test Name : tests.persistence.DefaultProviderVerification
         Test Assertion : Test validity of EJB 3.0 persistence unit. This test tests validity using a portable persistence provider. Please refer to EJB 3.0 Persistence API Specification for further information.
         Test Description : For [ CI#CIS_UserEJB.jar#cis ]
Exception [TOPLINK-0] (Oracle TopLink Essentials - 2.0 (Build b51-rc (06/15/2007))): oracle.toplink.essentials.exceptions.IntegrityException

Descriptor Exceptions:

---------------------------------------------------------



Exception [TOPLINK-60] (Oracle TopLink Essentials - 2.0 (Build b51-rc (06/15/2007))): oracle.toplink.essentials.exceptions.DescriptorException

Exception Description: The method [_toplink_setusers_vh] or [_toplink_getusers_vh] is not defined in the object [com.stryker.cmf.users.Groups].

Internal Exception: java.lang.NoSuchMethodException: com.stryker.cmf.users.Groups._toplink_getusers_vh()

Mapping: oracle.toplink.essentials.mappings.OneToOneMapping[users]

Descriptor: RelationalDescriptor(com.stryker.cmf.users.Groups --> [DatabaseTable(public.groups)])



Runtime Exceptions:

---------------------------------------------------------



java.lang.NullPointerException




          -----------------------------
          RESULTS FOR WEB-RELATED TESTS
          -----------------------------
        
         --------------
         FAILED TESTS :
         --------------
        
         Test Name : tests.web.FormLoginPage
         Test Assertion : Web form-login-page value defines the location in the Web application where the page to be used for login can be found. Please refer to Java Servlet 2.5 Specification Section #SRV.13.4 for further information.
         Test Description : For [ CI#CIWeb.war ]
Error: The form-login-page [ system/login.faces ] value does not define the location in the Web application [ ] where the page to be used for login can be found.

         Test Name : tests.web.FormErrorPage
         Test Assertion : Web form-error-page value defines the location in the Web application where the error page that is displayed when login is not successful can be found. Please refer to Java Servlet 2.5 Specification Section #SRV.13.3 for further information.
         Test Description : For [ CI#CIWeb.war ]
Error: The form-error-page [ system/denied.faces ] value does not define the location in Web application [ ] where the error page that is displayed when login is not successful can be found.

         Test Name : tests.web.EjbLinkElement
         Test Assertion : The value of the ejb-link element is the ejb-name of an enterprise bean in the same J2EE application archive. Please refer to Java Servlet 2.5 Specification Section #SRV.13.4, JavaEE 5 Platform Specification Section #5.5.2 for further information.
         Test Description : For [ CI#CIWeb.war ]
Error: No enterprise bean matching [ CIS_UserEJB ] found within [ CI ] EAR file.

         Test Name : tests.web.runtime.ASSecurityRoleMapping
         Test Assertion : security-role-mapping entries are specified correctly.
         Test Description : For [ CI#CIWeb.war ]
FAILED [AS-WEB security-role-mapping] : role-name [ users ] is not valid. It is either empty or not defined in web.xml.
FAILED [AS-WEB security-role-mapping] : role-name [ users ] is not valid. It is either empty or not defined in web.xml.

        
          ----------------------------------
          END OF STATIC VERIFICATION RESULTS
          ----------------------------------
    



**************** Here is web.xml *************
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
        <context-param>
                <param-name>javax.faces.CONFIG_FILES</param-name>
                <param-value>/WEB-INF/faces-config.xml</param-value>
        </context-param>
        <context-param>
                <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                <param-value>.xhtml</param-value>
        </context-param>
        <servlet>
                <servlet-name>Faces Servlet</servlet-name>
                <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                <load-on-startup>0</load-on-startup>
        </servlet>
        <servlet-mapping>
                <servlet-name>Faces Servlet</servlet-name>
                <url-pattern>*.faces</url-pattern>
        </servlet-mapping>
        <welcome-file-list>
                <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
        <listener>
                <listener-class>
                        com.sun.faces.application.WebappLifecycleListener
                </listener-class>
        </listener>

        <security-constraint>
                <web-resource-collection>
                        <web-resource-name>Secure Pages</web-resource-name>
                        <url-pattern>/pages/*</url-pattern>
                        <url-pattern>/index.jsp</url-pattern>
                        <url-pattern>/system/*</url-pattern>
                        <http-method>GET</http-method>
                        <http-method>POST</http-method>
                </web-resource-collection>
                <auth-constraint>
                        <role-name>users</role-name>
                        <role-name>admin</role-name>
                </auth-constraint>
        </security-constraint>
        <security-constraint>
                <web-resource-collection>
                        <web-resource-name>Admin Pages</web-resource-name>
                        <url-pattern>/admin/*</url-pattern>
                        <http-method>GET</http-method>
                        <http-method>POST</http-method>
                </web-resource-collection>
                <auth-constraint>
                        <role-name>admin</role-name>
                </auth-constraint>
        </security-constraint>

        <login-config>
                <auth-method>FORM</auth-method>
                <realm-name>cis</realm-name>
                <form-login-config>
                        <form-login-page>/system/login.jsp</form-login-page>
                        <form-error-page>/system/denied.jsp</form-error-page>
                </form-login-config>
        </login-config>

        <security-role>
                <description>System Administrators</description>
                <role-name>admin</role-name>
        </security-role>
        <security-role>
                <description>Doctors/Surgeons</description>
                <role-name>users</role-name>
        </security-role>
        <security-role>
                <description>Hospital Account Manager</description>
                <role-name>acctmgr</role-name>
        </security-role>
        <security-role>
                <description>Sales Force/Sales Manager</description>
                <role-name>sales</role-name>
        </security-role>
        <security-role>
                <description>In-house Staff</description>
                <role-name>inhouse</role-name>
        </security-role>

        <session-config>
                <session-timeout>10</session-timeout>
        </session-config>

        <error-page>
                <error-code>500</error-code>
                <location>/errors/error.jsp</location>
        </error-page>
        <error-page>
                <exception-type>EntityExistsException</exception-type>
                <location>/errors/entityexists.jsp</location>
        </error-page>
        <error-page>
                <exception-type>EntityNotFoundException</exception-type>
                <location>/errors/entityno.jsp</location>
        </error-page>
        <error-page>
                <error-code>404</error-code>
                <location>/errors/notfound.jsp</location>
        </error-page>
</web-app>


***********Here is sun-web.xml***********
<sun-web-app>
        <security-role-mapping>
                <role-name>users</role-name>
                <group-name>users</group-name>
        </security-role-mapping>
        <security-role-mapping>
                <role-name>admin</role-name>
                <group-name>admin</group-name>
        </security-role-mapping>
        <security-role-mapping>
                <role-name>acctmgr</role-name>
                <group-name>acctmgr</group-name>
        </security-role-mapping>
        <security-role-mapping>
                <group-name>sales</group-name>
                <role-name>sales</role-name>
        </security-role-mapping>
        <security-role-mapping>
                <group-name>inhouse</group-name>
                <role-name>inhouse</role-name>
        </security-role-mapping>
</sun-web-app>
[Message sent by forum member 'amattas' (amattas)]

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