Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-9249

@Singleton bean can't be bound to a custom JNDI name

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 6.0.0.Final
    • None
    • None
    • None

    Description

      I have a Singleton bean like this:

      @Singleton
      public class DummySingleton implements Dummy {

      public String getHello()

      { return "Hello Dummy!"; }

      }

      and an interface like this:

      public interface Dummy {
      public String getHello();
      }

      I've tried this in ejb-jar.xml (everything is packaged into an EAR file):
      <?xml version="1.0" encoding="UTF-8"?>

      <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.1"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">
      <enterprise-beans>
      <session>
      <ejb-name>DummySingleton</ejb-name>
      <ejb-class>com.tracetracker.global.aps.DummySingleton</ejb-class>
      <session-type>Singleton</session-type>
      <init-on-startup>false</init-on-startup>
      <ejb-local-ref>
      <ejb-ref-name>ejb3/hub/DummySingleton</ejb-ref-name>
      <local>com.tracetracker.global.aps.Dummy</local>
      </ejb-local-ref>
      </session>
      </enterprise-beans>
      </ejb-jar>

      I've also tried to add it to jboss.xml like this:
      <session>
      <ejb-name>DummySingleton</ejb-name>
      <local-jndi>ejb3/hub/DummySingleton</local-jndi>
      </session>

      but no matter what I try it will not end up in JNDI bound to ejb3/hub/DummySingleton.
      I can have normal session beans, and they will bind to ejb3/hub/xxxxx, but not when it's a singleton.

      Attachments

        Activity

          People

            Unassigned Unassigned
            viggo.navarsete_jira Viggo Navarsete (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: