geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r959724 - in /geronimo/server/trunk/plugins/connector-1_6: geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/
Date Thu, 01 Jul 2010 16:58:14 GMT
Author: djencks
Date: Thu Jul  1 16:58:14 2010
New Revision: 959724

URL: http://svn.apache.org/viewvc?rev=959724&view=rev
Log:
GERONIMO-5422 warn on certain ra.xml errors

Modified:
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java?rev=959724&r1=959723&r2=959724&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-1_6/src/main/java/org/apache/geronimo/connector/wrapper/outbound/ManagedConnectionFactoryWrapper.java
Thu Jul  1 16:58:14 2010
@@ -103,7 +103,6 @@ public class ManagedConnectionFactoryWra
         this.connectionImplClass = connectionImplClass;
         this.jndiName = jndiName;
 
-        allImplementedInterfaces.add(cl.loadClass(connectionFactoryInterface));
         for (String interfaceName: implementedInterfaces) {
             allImplementedInterfaces.add(cl.loadClass(interfaceName));
         }

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=959724&r1=959723&r2=959724&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
Thu Jul  1 16:58:14 2010
@@ -378,7 +378,7 @@ public class ConnectorModuleBuilder impl
 
         boolean standAlone = earEnvironment == null;
 
-        String name = null;
+        String name;
         if (connector != null && connector.getModuleName() != null) {
             name = connector.getModuleName();
         } else if (standAlone) {
@@ -1258,16 +1258,12 @@ public class ConnectorModuleBuilder impl
 
         Object driver = managedConnectionFactoryInstanceGBeanData.getAttribute("Driver");
         if (driver != null && driver instanceof String) {
-            try {
-                bundle.loadClass((String) driver);
-            } catch (ClassNotFoundException e1) {
-                log.warn("Problem loading driver class '" + driver + "', possibly due to
a missing dependency on the driver jar!!", e1);
-            }
+            checkClass(bundle, (String)driver);
         }
 
         Set<String> implementedInterfaces = new HashSet<String>();
-        implementedInterfaces.add((String) managedConnectionFactoryInstanceGBeanData.getAttribute("connectionFactoryInterface"));
-        implementedInterfaces.add((String) managedConnectionFactoryInstanceGBeanData.getAttribute("connectionFactoryImplClass"));
+        implementedInterfaces.add(checkClass(bundle, (String) managedConnectionFactoryInstanceGBeanData.getAttribute("connectionFactoryInterface")));
+        implementedInterfaces.add(checkClass(bundle, (String) managedConnectionFactoryInstanceGBeanData.getAttribute("connectionFactoryImplClass")));
         try {
             if (resourceAdapterAbstractName != null) {
                 managedConnectionFactoryInstanceGBeanData.setReferencePattern("ResourceAdapterWrapper",
resourceAdapterAbstractName);
@@ -1276,9 +1272,11 @@ public class ConnectorModuleBuilder impl
             String[] additionalInterfaces = connectiondefinitionInstance.getImplementedInterfaceArray();
             if (additionalInterfaces != null) {
                 for (int i = 0; i < additionalInterfaces.length; i++) {
-                    implementedInterfaces.add(additionalInterfaces[i].trim());
+                    implementedInterfaces.add(checkClass(bundle, additionalInterfaces[i].trim()));
                 }
             }
+            //in case some class was not loadable
+            implementedInterfaces.remove(null);
             managedConnectionFactoryInstanceGBeanData.setAttribute("implementedInterfaces",
implementedInterfaces.toArray(new String[implementedInterfaces.size()]));
 
         } catch (Exception e) {
@@ -1307,6 +1305,22 @@ public class ConnectorModuleBuilder impl
         }
     }
 
+    /**
+     * check class is loadable: return null and log warning if not.
+     * @param bundle to use to load the class
+     * @param clazz name of class to try to load
+     * @return clazz if loadable, null otherwise.
+     */
+    private String checkClass(Bundle bundle, String clazz) {
+        try {
+            bundle.loadClass(clazz);
+            return clazz;
+        } catch (ClassNotFoundException e1) {
+            log.warn("Problem loading class: " + clazz, e1);
+        }
+        return null;
+    }
+
     public GBeanData locateActivationSpecInfo(AbstractNameQuery resourceAdapterInstanceQuery,
String messageListenerInterface, Configuration configuration) throws DeploymentException {
         //First, locate the module gbean from the JCAResourceAdapter instance
         AbstractName instanceName;



Mime
View raw message