1 Reply Latest reply on Apr 9, 2013 2:22 PM by wdfink

    JNDI issues during migration from EAP5 to EAP6

    jaigates1

      I am facing problem in defining beans and injecting it back.

       

      Below code works fine in eap5

      @Resource(mappedName="queue/request_queue")

       

      But in eap6 queue names should be like "java:/queue/request_queue", so i changed the queue name and injected like

       

      @Resource(mappedName="java:/queue/request_queue"), this worked in EAP6 but its failing in EAP5, saying jndi name not in correct format.

       

      Now, i need a permanent fix to solve this. Can we generate this jndi name dynamically during deployment time and inject in @Resource like

       

      @Resource(mappedName=<<SOMECONSTANT>>), as far as i have seen constants should be declared during compile time itself, but then how to address this problem ???

       

      NOTE: if i fix this by doing workaround like removing @Resource and intialising object using @PostConstruct this piece works fine. BUT i am not able define it in MDB

       

      @MessageDriven(name = "SOMEMDBNAME", activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = <<<QUEUENAME>>>),

      })

       

      here <<<QUEUENAME>>> should be given as constant during compile time, so here also i endup in editing this according to AppServer.

       

       

      So is there any permanent solution which will make my code work in both EAP5 & EAP6"