diff options
author | vamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-21 14:41:51 +0000 |
---|---|---|
committer | vamsic007 <vamsic007@13f79535-47bb-0310-9956-ffa450edef68> | 2009-03-21 14:41:51 +0000 |
commit | a59e0a56017d05b0e977d4e6c914cc9ecd052a2a (patch) | |
tree | 26de006ff56fe6370f0c37a4e83d488a450d65bf /branches/sca-java-1.x/modules/contribution-jee-impl | |
parent | 4a0a0204a77a0bf1a25c90a292680deff196cfea (diff) |
Do not throw exception if the jar is not an EJB jar.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@756952 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java b/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java index 0820cc7edc..f342bc89f1 100644 --- a/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java +++ b/branches/sca-java-1.x/modules/contribution-jee-impl/src/main/java/org/apache/tuscany/sca/contribution/jee/impl/JavaEEIntrospectorImpl.java @@ -28,6 +28,7 @@ import java.util.Map; import org.apache.openejb.config.AppModule; import org.apache.openejb.config.EjbModule; +import org.apache.openejb.config.UnknownModuleTypeException; import org.apache.openejb.config.WebModule; import org.apache.openejb.jee.EjbJar; import org.apache.openejb.jee.EjbRef; @@ -206,9 +207,20 @@ public class JavaEEIntrospectorImpl implements JavaEEIntrospector { } JavaEEModuleHelper jmh = new JavaEEModuleHelper(); - EjbModule em = jmh.getMetadataCompleteModules(tempFile.getAbsolutePath()).getEjbModules().get(0); - if(!tempFile.delete()) { - tempFile.deleteOnExit(); + EjbModule em; + try { + em = jmh.getMetadataCompleteModules(tempFile.getAbsolutePath()).getEjbModules().get(0); + } catch(ContributionReadException e) { + if(e.getCause() instanceof UnknownModuleTypeException) { + // Not an EJB jar + return null; + } else { + throw e; + } + } finally { + if(!tempFile.delete()) { + tempFile.deleteOnExit(); + } } return createEjbModuleInfo(em); } |