Index: ejb3/src/main/java/org/jboss/ejb3/deployers/JBossASKernel.java
===================================================================
--- ejb3/src/main/java/org/jboss/ejb3/deployers/JBossASKernel.java	(revision 109980)
+++ ejb3/src/main/java/org/jboss/ejb3/deployers/JBossASKernel.java	(working copy)
@@ -61,6 +61,8 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import static org.jboss.as.naming.javaee.NamingJavaEEUtil.stripSuffix;
+
 /**
  * The JBossAS implementation of the ejb3 KernelAbstraction integration api
  * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
@@ -228,13 +230,6 @@
       }
    }
 
-   private static String stripSuffix(String s)
-   {
-      if(s == null || s.length() < 4)
-         return s;
-      return s.substring(0, s.length() - 4);
-   }
-
    public void uninstall(String name)
    {
       
Index: server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEUtil.java
===================================================================
--- server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEUtil.java	(revision 0)
+++ server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEUtil.java	(revision 0)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright (c) 2010, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.as.naming.javaee;
+
+/**
+ * @author <a href="mailto:cdewolf@redhat.com">Carlo de Wolf</a>
+ */
+public class NamingJavaEEUtil
+{
+   public static String stripSuffix(String s)
+   {
+      int i;
+      if(s == null || (i = s.lastIndexOf('.')) == -1)
+         return s;
+      return s.substring(0, i);
+   }
+}
Index: server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEApplicationInformer.java
===================================================================
--- server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEApplicationInformer.java	(revision 109980)
+++ server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEApplicationInformer.java	(working copy)
@@ -7,6 +7,8 @@
 import org.jboss.reloaded.naming.deployers.javaee.JavaEEApplicationInformer;
 import org.jboss.system.metadata.ServiceDeployment;
 
+import static org.jboss.as.naming.javaee.NamingJavaEEUtil.stripSuffix;
+
 /**
  * @author <a href="cdewolf@redhat.com">Carlo de Wolf</a>
  */
@@ -27,7 +29,9 @@
       }
       
       String name = deploymentUnit.getSimpleName();
-      return name.substring(0, name.length() - 4);
+      
+      // prevent StringIndexOutOfBoundsException and only cut when there is a typical extension
+      return stripSuffix(name);
    }
 
    public boolean isEnterpriseApplicationArchive(DeploymentUnit deploymentUnit)
Index: server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEModuleInformer.java
===================================================================
--- server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEModuleInformer.java	(revision 109980)
+++ server/src/main/java/org/jboss/as/naming/javaee/NamingJavaEEModuleInformer.java	(working copy)
@@ -27,6 +27,8 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.reloaded.naming.deployers.javaee.JavaEEModuleInformer;
 
+import static org.jboss.as.naming.javaee.NamingJavaEEUtil.stripSuffix;
+
 /**
  * @author <a href="cdewolf@redhat.com">Carlo de Wolf</a>
  */
@@ -74,7 +76,7 @@
       String path = deploymentUnit.getRelativePath();
       if(path == null || path.length() == 0)
          path = deploymentUnit.getSimpleName();
-      return path.substring(0, path.length() - 4);
+      return stripSuffix(path);
    }
 
    public ModuleType getModuleType(DeploymentUnit deploymentUnit)
