[jboss-user] [Security & JAAS/JBoss] - Re: NullPointerException @ DatabaseServerLoginModule.java:14

jahebe do-not-reply at jboss.com
Tue Jan 22 14:12:18 EST 2008

So, I've debugged deep into the JNDI SPI - and I've tracked the "null" happening in orb.jboss.util.naming.NonSerializableFactory.

  |    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable env)
  |         throws Exception
  |     {	// Get the nns value from the Reference obj and use it as the map key
  |         Reference ref = (Reference) obj;
  |         RefAddr addr = ref.get("nns");  
  |         String key = (String) addr.getContent(); // = java:/FluxMonClockerDS
  |         Object target = wrapperMap.get(key); // Return null
  |         return target;
  |     }

Seeing this I added a method breakpoint in the bind() method and restarted JBoss.
The only breakpoint I got was for "java:/Mail".

So to check this, I changed the dsJndiName for the DatabaseServerLoginModule to "java:/Mail".
Restarted and initiated a new login - and presto; ClassCastException instead of NPE.
(noting that javax.mail.Session cannot be cast to javax.sql.Datasource).

So I presume this would be indicative of some fault in the JNDI configuration - although I don't quite see why...?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4122340#4122340

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4122340

More information about the jboss-user mailing list