-
Bug
-
Resolution: Done
-
Critical
-
JBossAS-3.2.6 Final, JBossAS-4.0.1 Final
-
None
org.jboss.resource.connectionmanager.CachedConnectionManager calls toString() on EJBs (e.g. line 250, where "rawKey" is an EJB.
The "toString()" method of an EJB may, however, be overwritten, as is appropriate for the type of EJB. Such a toString() method may use getPrimaryKey() as it will usually be called from the business methods, i.e. from a context where this call is legal.
CachedConnectionManager calls toString() during create, i.e. in a context where the call to getPrimaryKey is illegal, which results in an IllegalStateException. In order to avoid this kind of problem, the application server should never call toString() on EJBs.