0 Replies Latest reply on Jun 17, 2016 5:23 PM by haary_neo

    Local JNDI is not recognized - java:app is truncated when looking for JNDI

    haary_neo

      Hi I am deploying my application in wildfly 10 which has stateful beans.

      When it is deployed I can see my ejb's are deployed as below in the console.log,

       

      2016-06-17 16:19:38,237 INFO  [org.jboss.as.ejb3.deployment] (MSC service thread 1-6) WFLYEJB0473: JNDI bindings for session bean named 'UserAuthenticator' in deployment unit 'subdeployment "promo.service.ejb.jar" of deployment "promo.admin.ear"' are as follows:

        java:global/promo.admin/promo.service.ejb/UserAuthenticator!com.sonymusic.promo.service.authentication.local.UserAuthenticatorLocal

        java:app/promo.service.ejb/UserAuthenticator!com.sonymusic.promo.service.authentication.local.UserAuthenticatorLocal

        java:module/UserAuthenticator!com.sonymusic.promo.service.authentication.local.UserAuthenticatorLocal

        java:global/promo.admin/promo.service.ejb/UserAuthenticator

        java:app/promo.service.ejb/UserAuthenticator

        java:module/UserAuthenticator

       

      When I look for the jndi from my code it is throwing the following error,

       

      Caused by: javax.naming.NameNotFoundException: promo.admin/promo.service.ejb/UserAuthenticator!com.sonymusic.promo.service.authentication.local.UserAuthenticatorLocal [Root exception is java.lang.IllegalStateException: WFLYEE0046: Failed to instantiate component view]

        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:153).

       

      the jndi I am paasing to look from my code is ,

      java:global/promo.admin/promo.service.ejb/UserAuthenticator!com.sonymusic.promo.service.authentication.local.UserAuthenticatorLocal

       

      ContextlocalJNDIContext = new InitialContext();

      String jndiName = String.format("java:global/promo.admin/promo.service.ejb/%s!%s", clazz.getSimpleName().replace("Local", ""),clazz.getCanonicalName());

          log.info("JNDI name after is  " + jndiName);

          Object o = localJNDIContext.lookup(jndiName);

       

       

       

      If we look at the server log, " java:global/" is totally omitted when looking for the jar.

      Is there any reason that " java:global/" is truncated ? do I have to set any configuration change in standaloe-full.xml ?

       

      In my persistence.xml I have the following entry,

       

      <property name="jboss.as.jpa.providerModule" value="application" /> // we are loading the hibernate version higher(5.1.0.final) than provided by wildfly 10 by default

      <property name="wildfly.jpa.hibernate.search.module" value="none" />//hibernate search version is 5.5.3

       

      Is the above entry stopping some dependency to  load ?

       

      Please advise.

       

      Thanks

      Hari