tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r375650 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory: EjbFactory.java ResourceEnvFactory.java ResourceFactory.java TransactionFactory.java
Date Tue, 07 Feb 2006 17:55:13 GMT
Author: remm
Date: Tue Feb  7 09:55:11 2006
New Revision: 375650

URL: http://svn.apache.org/viewcvs?rev=375650&view=rev
Log:
- More detailed error report using exception nesting.

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/EjbFactory.java
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceEnvFactory.java
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceFactory.java
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/TransactionFactory.java

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/EjbFactory.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/EjbFactory.java?rev=375650&r1=375649&r2=375650&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/EjbFactory.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/EjbFactory.java
Tue Feb  7 09:55:11 2006
@@ -114,11 +114,19 @@
                     try {
                         factoryClass = tcl.loadClass(factoryClassName);
                     } catch(ClassNotFoundException e) {
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 } else {
                     try {
                         factoryClass = Class.forName(factoryClassName);
                     } catch(ClassNotFoundException e) {
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 }
                 if (factoryClass != null) {
@@ -135,6 +143,12 @@
                     factory = (ObjectFactory)
                         Class.forName(javaxEjbFactoryClassName).newInstance();
                 } catch(Throwable t) {
+                    if (t instanceof NamingException)
+                        throw (NamingException) t;
+                    NamingException ex = new NamingException
+                        ("Could not create resource factory instance");
+                    ex.initCause(t);
+                    throw ex;
                 }
             }
 

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceEnvFactory.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceEnvFactory.java?rev=375650&r1=375649&r2=375650&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceEnvFactory.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceEnvFactory.java
Tue Feb  7 09:55:11 2006
@@ -77,17 +77,31 @@
                     try {
                         factoryClass = tcl.loadClass(factoryClassName);
                     } catch(ClassNotFoundException e) {
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 } else {
                     try {
                         factoryClass = Class.forName(factoryClassName);
                     } catch(ClassNotFoundException e) {
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 }
                 if (factoryClass != null) {
                     try {
                         factory = (ObjectFactory) factoryClass.newInstance();
                     } catch(Throwable t) {
+                        if (t instanceof NamingException)
+                            throw (NamingException) t;
+                        NamingException ex = new NamingException
+                            ("Could not create resource factory instance");
+                        ex.initCause(t);
+                        throw ex;
                     }
                 }
             }

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceFactory.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceFactory.java?rev=375650&r1=375649&r2=375650&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceFactory.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/ResourceFactory.java
Tue Feb  7 09:55:11 2006
@@ -77,28 +77,31 @@
                     try {
                         factoryClass = tcl.loadClass(factoryClassName);
                     } catch(ClassNotFoundException e) {
-                        throw new NamingException(
-                            "Could not create resource factory, ClassNotFoundException:"
+
-                            e.getMessage());
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 } else {
                     try {
                         factoryClass = Class.forName(factoryClassName);
                     } catch(ClassNotFoundException e) {
-                        throw new NamingException(
-                            "Could not create resource factory, ClassNotFoundException:"
+
-                            e.getMessage());
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 }
                 if (factoryClass != null) {
                     try {
                         factory = (ObjectFactory) factoryClass.newInstance();
-                    } catch(Throwable t) {
-                        if( t instanceof NamingException)
-                            throw (NamingException)t;
-                        throw new NamingException(
-                            "Could not create resource factory instance, " +
-                            t.getMessage());
+                    } catch (Throwable t) {
+                        if (t instanceof NamingException)
+                            throw (NamingException) t;
+                        NamingException ex = new NamingException
+                            ("Could not create resource factory instance");
+                        ex.initCause(t);
+                        throw ex;
                     }
                 }
             } else {
@@ -110,8 +113,11 @@
                         factory = (ObjectFactory) 
                             Class.forName(javaxSqlDataSourceFactoryClassName)
                             .newInstance();
-                    } catch(Throwable t) {
-
+                    } catch (Throwable t) {
+                        NamingException ex = new NamingException
+                            ("Could not create resource factory instance");
+                        ex.initCause(t);
+                        throw ex;
                     }
                 } else if (ref.getClassName().equals("javax.mail.Session")) {
                     String javaxMailSessionFactoryClassName =
@@ -122,6 +128,10 @@
                             Class.forName(javaxMailSessionFactoryClassName)
                             .newInstance();
                     } catch(Throwable t) {
+                        NamingException ex = new NamingException
+                            ("Could not create resource factory instance");
+                        ex.initCause(t);
+                        throw ex;
                     }
                 }
             }

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/TransactionFactory.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/TransactionFactory.java?rev=375650&r1=375649&r2=375650&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/TransactionFactory.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/naming/factory/TransactionFactory.java
Tue Feb  7 09:55:11 2006
@@ -77,17 +77,31 @@
                     try {
                         factoryClass = tcl.loadClass(factoryClassName);
                     } catch(ClassNotFoundException e) {
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 } else {
                     try {
                         factoryClass = Class.forName(factoryClassName);
                     } catch(ClassNotFoundException e) {
+                        NamingException ex = new NamingException
+                            ("Could not load resource factory class");
+                        ex.initCause(e);
+                        throw ex;
                     }
                 }
                 if (factoryClass != null) {
                     try {
                         factory = (ObjectFactory) factoryClass.newInstance();
                     } catch(Throwable t) {
+                        if (t instanceof NamingException)
+                            throw (NamingException) t;
+                        NamingException ex = new NamingException
+                            ("Could not create resource factory instance");
+                        ex.initCause(t);
+                        throw ex;
                     }
                 }
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message