4 Replies Latest reply on Nov 6, 2012 2:12 AM by Nicklas Karlsson

    Is @Singleton completely broken on 7.1.1.Final?

    Wayne Schroeder Newbie

      I'm having a hard time even asking this because it seems so hard to believe because I see lots of people using this already, but for the life of me, I can't get a bean to deploy without an error after adding @Singleton to it.  I've got plenty of @Stateless beans deployed from a project that was on 4.2.3.  Heck, I've even got my MDB's deployed and connected to their queues.  The moment I try and add @Singleton to a bean, deployment pops with a message such as:


      JBAS011046: A component named 'BrokenBean' is already defined in this module


      Here's what broken bean looks like:


      package <removed>;


      import javax.ejb.Singleton;

      import javax.ejb.Stateless;




      public class BrokenBean





      That's it.  Won't deploy after adding this code or adding @Singleton to any bean.  This is placed in my ejb.jar that is inside my ear, loaded by an application.xml that specifies j2ee 6. There are no duplicate instances of this bean's class file in the ear or contained in any of its jars in the ear.




      <?xml version="1.0" encoding="UTF-8"?>






         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd">













      manifest for the ear and ejb.jar are identical as we set no additional items


      Manifest-Version: 1.0

      Ant-Version: Apache Ant 1.8.3

      Created-By: 1.6.0_37-b06-434-11M3909 (Apple Inc.)



      There are no other xml files in play besides the application.xml.  No jboss-app.xml or ejb-jar.xml is used or has ever been needed.


      What am I missing?