JDBC Realm Class Not Found


I have not been coding for a while but finally have some ideas I want to work on, so started up Eclipse and tried to test a simple API I had with postman. No luck. Could not authenticate and the console output in eclipse indicated there was a problem with the Realm.

2015-01-20T20:02:19.956-0400|INFO: Running GlassFish Version: GlassFish Server Open Source Edition 4.1 (build 13)
2015-01-20T20:02:19.966-0400|INFO: Server log file is using Formatter class: com.sun.enterprise.server.logging.ODLLogFormatter
2015-01-20T20:02:20.406-0400|INFO: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2015-01-20T20:02:20.406-0400|INFO: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
2015-01-20T20:02:20.406-0400|INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
2015-01-20T20:02:20.416-0400|INFO: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
2015-01-20T20:02:20.426-0400|WARNING: Disabled realm [smallbizJdbcRealm] due to errors.
2015-01-20T20:02:20.426-0400|WARNING: Caught exception.
com.sun.enterprise.security.auth.realm.BadRealmException: java.lang.ClassNotFoundException: com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found by org.glassfish.main.security [248]

I logged into GlassFish (I can’t remember updating it from version 4.0 to 4.1 but apparently 4.1 was running) and checked out my realm and I saw it indicating an error as well “java.lang.ClassNotFoundException: com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found by org.glassfish.main.security [248]”

com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found

com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm not found

I checked Google and came across a discussion here which seems to indicate the class name was com.sun.enterprise.security.auth.realm.jdbc.JDBCRealm prior to GlassFish 4 but was changed to com.sun.enterprise.security.ee.auth.realm.jdbc.JDBCRealm for GlassFish 4. This created the issue I experience so the ee.was subsequently removed from the class name. I could not find a way to change the class name in the admin console, so I did over the realm, and sure enough, the class names that were selectable did not have ee. Everything now works fine.

 

Leave a Reply