Fix for problem reported by: Christopher G. Stach II

We're using Resin and trying to use 4.0-RC2.  It just so happens that
Resin makes this call in ConnectionPool.init(ManagedConnectionFactory):

ManagedConnection mConn = mcf.createManagedConnection(subject, null);

So, eventually that null info gets dereferenced and BOOM!

com.caucho.server.webapp.Application.start java.lang.NullPointerException
       at org.apache.activemq.ra.ActiveMQResourceAdapter.createConnectionFactory(ActiveMQResourceAdapter.java:156)
       at org.apache.activemq.ra.ActiveMQResourceAdapter.makeConnection(ActiveMQResourceAdapter.java:100)
       at org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:103)
       at com.caucho.jca.ConnectionPool.init(ConnectionPool.java:462)

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@392556 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2006-04-08 16:48:15 +00:00
parent 9cd60d8c5d
commit 67064db832
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,9 @@ public class ActiveMQManagedConnectionFactory implements ManagedConnectionFactor
*/
public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo info) throws ResourceException {
try {
if( info == null ) {
info = this.info;
}
ActiveMQConnectionRequestInfo amqInfo = (ActiveMQConnectionRequestInfo) info;
return new ActiveMQManagedConnection(subject, adapter.makeConnection(amqInfo), amqInfo);
}