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

@Resource(lookup="java:module/ModuleName") doesnt work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 6.0.0.Final
    • EJB
    • None
    • Hide

      This does work:

      InitialContext context = new InitialContext();
      String appName = (String) context.lookup("java:app/AppName");
      String moduleName = (String) context.lookup("java:module/ModuleName");
      
      Show
      This does work: InitialContext context = new InitialContext(); String appName = ( String ) context.lookup( "java:app/AppName" ); String moduleName = ( String ) context.lookup( "java:module/ModuleName" );

      I cant inject the current application- or modulename with the resource-annotation in an EJB
      This doesnt work:

      @Resource(lookup="java:module/ModuleName")
      private String moduleName;
            
      @Resource(lookup="java:app/AppName")
      private String appName;
      

              jaikiran Jaikiran Pai (Inactive)
              windigo_jira Felix Ullrich (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: