User: d_jencks Date: 02/01/29 13:08:04 Modified: src/main/org/jboss/resource ConnectionFactoryLoader.java Log: improved error messages from deploying Revision Changes Path 1.19 +24 -15 jbosscx/src/main/org/jboss/resource/ConnectionFactoryLoader.java Index: ConnectionFactoryLoader.java =================================================================== RCS file: /cvsroot/jboss/jbosscx/src/main/org/jboss/resource/ConnectionFactoryLoader.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- ConnectionFactoryLoader.java 2002/01/02 17:06:53 1.18 +++ ConnectionFactoryLoader.java 2002/01/29 21:08:03 1.19 @@ -50,6 +50,7 @@ import org.jboss.system.ServiceMBeanSupport; import org.jboss.management.j2ee.JDBCDataSource; +import org.jboss.deployment.DeploymentException; /** * Service that configures an instance of a deployed resource adapter and binds @@ -65,7 +66,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">David Jencks</a> * @author <a href="mailto:[EMAIL PROTECTED]">Andreas Schaefer</a> * @see RARDeployer - * @version $Revision: 1.18 $ <p> + * @version $Revision: 1.19 $ <p> * * <b>Revisions:</b> <p> * @@ -487,8 +488,12 @@ * Does the actual work of configuring a connection factory. * This could now throw exceptions since it is no longer called from a notification. */ - private void loadConnectionFactory() + private void loadConnectionFactory() throws DeploymentException { + if (jndiName == null || "".equals(jndiName)) + { + throw new DeploymentException("Null or blank jndi name, cannot bind"); + } // This context is used in a few places. There is no point // continuing if JNDI isn't working. @@ -500,7 +505,7 @@ catch (NamingException ne) { log.error("Unable to obtain initial context", ne); - return; + throw new DeploymentException("Can't get initialContext!" + ne); } RARMetaData metaData = null; try @@ -510,9 +515,12 @@ catch (Exception e) { log.error("Unable to obtain RARMetaData", e); - return; + throw new DeploymentException("Could not get metadata for rar! " + e); } // end of try-catch - + if (metaData == null) + { + throw new DeploymentException("MetaData for resource adapter was null!"); + } // This is the class loader through which we should be able to // load the resource adapter's classes @@ -533,7 +541,7 @@ { log.error("Unable to load managed connection factory class '" + mcfClassName + "'", cnfe); - return; + throw new DeploymentException("Failed to load ManagedConnectionFactory class!" + cnfe); } try { @@ -543,7 +551,7 @@ { log.error("Unable to instantiate manageed connection factory class '" + mcfClass + "'", e); - return; + throw new DeploymentException("Could not create ManagedConnectionFactory instance! " + e); } // Set the properties on it @@ -676,7 +684,7 @@ { log.error("Unable to instantiate principal mapping class '" + princMapClass + "'", e); - return; + throw new DeploymentException("Could not create PrincipalMapping instance" + e); } principalMapping.setName(jndiName); @@ -693,7 +701,7 @@ } catch (Exception e) { log.error("Unable to find connection manager factory at from loader " + cmfLoaderName); - return; + throw new DeploymentException("Could not get ConnectionManagerFactory!! - invalid config!!" + e); } // end of try-catch @@ -704,9 +712,9 @@ cmConfig.rsf = new JBossResourceSubjectFactory(principalMapping); cmConfig.isReauthenticationSupported = metaData.getReauthenticationSupport(); - JBossConnectionListenerImpl listener = - new JBossConnectionListenerImpl(mcf, jndiName); - cmConfig.listener = listener; + //JBossConnectionListenerImpl listener = + // new JBossConnectionListenerImpl(mcf, jndiName); + //cmConfig.listener = listener; Properties cmProperties = new Properties(); try @@ -728,10 +736,10 @@ catch (ResourceException re) { log.error("Error initialising connection manager", re); - return; + throw new DeploymentException("Could not set up ConnectionManager! " + re); } - listener.setConnectionManager(cm); + //listener.setConnectionManager(cm); // Create us a connection factory @@ -744,7 +752,7 @@ catch (ResourceException re) { log.error("Unable to create connection factory", re); - return; + throw new DeploymentException("Could not create ConnectionFactory! " + re); } // Bind it into JNDI @@ -769,6 +777,7 @@ { log.error("Unable to bind connection factory to JNDI name '" + bindName + "'", ne); + throw new DeploymentException("Could not bind ConnectionFactory into JNDI! " + ne); } }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development