Migration from glassfish 4.0 to Glassfish 4.1.1 -

2019-01-09 19:07发布

问题:

I have this security configuration in Glassfish domain.xml which works for 4.0 but fail in 4.1.1 can someone help to identify what is wrong. The only difference is the class package "ee"

GF 4.0 (with extra ee)

<auth-realm classname="com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm" name="authentication-realm">
<property name="jaas-context" value="jdbcRealm"></property>
<property name="password-column" value="password"></property>
<property name="datasource-jndi" value="jdbc/SomeDS"></property>
<property name="group-table" value="v_user_role"></property>
<property name="charset" value="UTF-8"></property>
<property name="user-table" value="v_user_role"></property>
<property name="group-name-column" value="rolename"></property>
<property name="digest-algorithm" value="SHA-256"></property>
<property name="user-name-column" value="username"></property>
<property name="digestrealm-password-enc-algorithm" value="SHA-256"></property>
<property name="encoding" value="Base64"></property>
</auth-realm>

GF 4.1.1

<auth-realm classname="com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm" name="authentication-realm">
<property name="jaas-context" value="jdbcRealm"></property>
<property name="password-column" value="password"></property>
<property name="datasource-jndi" value="jdbc/SomeDS"></property>
<property name="group-table" value="v_user_role"></property>
<property name="charset" value="UTF-8"></property>
<property name="user-table" value="v_user_role"></property>
<property name="group-name-column" value="rolename"></property>
<property name="digest-algorithm" value="SHA-256"></property>
<property name="user-name-column" value="username"></property>
<property name="digestrealm-password-enc-algorithm" value="SHA-256"></property>
<property name="encoding" value="Base64"></property>
</auth-realm>

回答1:

The problem happened because I copy-pasted the JBDC resource from glassfish 4.0 to glassfish 4.1.1 domain.xml. The problem was resolved after reverting the JDBC resource manually and re-create using admin console or command line.