users@glassfish.java.net

Form Based Auth in jdbc Realm using backing bean with MySQL

From: <forums_at_java.net>
Date: Fri, 13 Jan 2012 11:37:57 -0600 (CST)

Unable to get this to work.  Attached is exception report as will as screen
shots showing setup.  Please help.

 

 

Exception Report

[#|2012-01-13T12:05:41.687-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=17;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:41.687-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=17;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:41.687-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=17;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:41.703-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=17;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:41.703-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=17;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:41.703-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=17;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:41.734-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=19;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:41.734-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=19;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:41.734-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=19;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:41.734-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=19;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:41.734-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=19;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:41.734-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=19;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:44.125-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=16;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:44.125-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=16;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:44.125-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=16;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:44.125-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=16;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:44.125-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=16;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:44.125-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=16;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:44.156-0500|INFO|glassfish3.1.1|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin|_ThreadID=33;_ThreadName=Thread-2;|Server
shutdown initiated|#]

[#|2012-01-13T12:05:44.171-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=18;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:44.171-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=18;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:44.171-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=18;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:44.171-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=18;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:44.171-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=18;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:44.171-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=18;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:44.218-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=20;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:44.218-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=20;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:44.218-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=20;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1\config\admin-keyfile|#]

[#|2012-01-13T12:05:44.218-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=20;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: file=C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:44.218-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=20;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=init;|FileRealm
: jaas-context=ignore|#]

[#|2012-01-13T12:05:44.218-0500|FINE|glassfish3.1.1|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=20;_ThreadName=Thread-2;ClassName=com.sun.enterprise.security.auth.realm.file.FileRealm;MethodName=loadKeyFile;|Reading
file realm: C:\glassfish3\glassfish\domains\domain1/config/admin-keyfile|#]

[#|2012-01-13T12:05:47.765-0500|INFO|glassfish3.1.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=33;_ThreadName=Thread-2;|JMXStartupService:
Stopped JMXConnectorServer: null|#]

[#|2012-01-13T12:05:47.765-0500|INFO|glassfish3.1.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=33;_ThreadName=Thread-2;|JMXStartupService
and JMXConnectors have been shut down.|#]

[#|2012-01-13T12:05:47.765-0500|INFO|glassfish3.1.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=33;_ThreadName=Thread-60;|Shutdown
procedure finished|#]

 

 

Realm Config

Configuration Name: server-config

Realm Name: DB1Realm Class Name:
com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm Class Name:
com.sun.enterprise.security.auth.realm.pam.PamRealm
com.sun.enterprise.security.auth.realm.solaris.SolarisRealm
com.sun.enterprise.security.auth.realm.certificate.CertificateRealm
com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm
com.sun.enterprise.security.auth.realm.file.FileRealm
com.sun.enterprise.security.auth.realm.ldap.LDAPRealm
Choose a realm class name from the drop-down list or specify a custom class
  
  Properties specific to this Class

JAAS Context: Identifier for the login module to use for this realm   JNDI:
JNDI name for this realm   User Table: Name of the database table that
contains the list of authorized users for this realm   User Name Column:
Name of the column in the user table that contains the list of user names  
Password Column: Name of the column in the user table that contains the user
passwords   Group Table: Name of the database table that contains the list
of groups for this realm   Group Name Column: Name of the column in the
group table that contains the list of group names   Assign Groups:
Comma-separated list of group names   Database User: USERNAME Specify the
database user name in the realm instead of the JDBC connection pool  
Database Password: XXXXXXXXXXXXXX  Specify the database password in the
realm instead of the JDBC connection pool   Digest Algorithm: Digest
algorithm (default is SHA-256); note that the default was MD5 in GlassFish
versions prior to 3.1   Encoding: Encoding (allowed values are Hex and
Base64)   Charset: Character set for the digest algorithm  
 

 

 

 

JDBC Resource

 

======== EDIT JDBC RESOURCE
==================================================

Edit an existing JDBC data source.
 

JNDI Name: jdbc/DB1DataSource Pool Name: DB1Pool DerbyPool SamplePool
__TimerPool Use the JDBC Connection Pools [1] page to create new pools  
Description: Status: Enabled Enabled
Coonection Pool

======== EDIT JDBC CONNECTION POOL
===========================================

Modify an existing JDBC connection pool. A JDBC connection pool is a group of
reusable connections for a particular database.

 Indicates required field
General Settings Pool Name: DB1Pool Resource Type: javax.sql.DataSource
javax.sql.XADataSource javax.sql.ConnectionPoolDataSource java.sql.Driver
Must be specified if the datasource class implements more than 1 of the
interface.    Datasource Classname: Vendor-specific classname that
implements the DataSource and/or XADataSource APIs   Driver Classname:
Vendor-specific classname that implements the java.sql.Driver interface.  
Ping: Enabled When enabled, the pool is pinged during creation or
reconfiguration to identify and warn of any erroneous values for its
attributes   Description:
Pool Settings Initial and Minimum Pool Size: Connections Minimum and initial
number of connections maintained in the pool   Maximum Pool Size:
Connections Maximum number of connections that can be created to satisfy
client requests   Pool Resize Quantity: Connections Number of connections
to be removed when pool idle timeout expires   Idle Timeout: Seconds
Maximum time that connection can remain idle in the pool   Max Wait Time:
Milliseconds Amount of time caller waits before connection timeout is
sent  
Transaction Non Transactional Connections: Enabled Returns non-transactional
connections   Transaction Isolation: read-uncommitted read-committed
repeatable-read serializable If unspecified, use default level for JDBC
Driver   Isolation Level: Guaranteed All connections use same isolation
level; requires Transaction Isolation  
========  
==================================================================

 
======== EDIT JDBC CONNECTION POOL PROPERTIES
================================

Modify properties of an existing JDBC connection pool.
 

Pool Name: DB1Pool
 

Additional Properties (6)
[2]    Name [3]
 Value [4]
 Description: [5]
USERNAME XXXXXXXXXXXXXXX

[1] http://localhost:4848/jdbc/jdbcConnectionPools.jsf
[2] http://localhost:4848/common/index.jsf#
[3] http://localhost:4848/common/index.jsf#
[4] http://localhost:4848/common/index.jsf#
[5] http://localhost:4848/common/index.jsf#

--
[Message sent by forum member 'raysod']
View Post: http://forums.java.net/node/882698