summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/modules/contribution-jee-impl
diff options
context:
space:
mode:
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.java18
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);
}