1 Reply Latest reply on Oct 27, 2013 5:13 AM by shsarma

    problem with jndi lookup  with ejb3

    shsarma

      <pre>

      Hi friends

      i am facing issues with  lookup  of  ejb3 stateless session bean  ,i attached the source for the same .

      my statelesssession bean is deployed successfully in jboss 7.1 and i am using jdk1.7 version

      once it deployed i am able to see the successful binding message in jboss side

       

      could you please look into it and help me to resolve the issue.

       

      Exception in thread "main" javax.naming.NoInitialContextException: Need to speci

      fy class name in environment or system property, or as an applet parameter, or i

      n an application resource file:  java.naming.factory.initial

              at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

              at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

              at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)

              at javax.naming.InitialContext.lookup(Unknown Source)

              at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.lookupRemo

      teStatelessCalculator(RemoteEJBClient.java:113)

              at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStat

      elessBean(RemoteEJBClient.java:39)

              at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.main(Remot

      eEJBClient.java:27)

       

       

      and then i try to run the client and every thing  i kept  into the class path including  jndi properties file .

       

      E:\examples\jbossExamples\ejbExample>java -classpath ;classes org.jboss.as.quick

      starts.ejb.remote.client.RemoteEJBClient

      jboss-ejb-client.properties loaded from Classpath::connections = default

      context initated

      ejb:/jboss-as-ejb-remote-app//CalculatorBean!org.jboss.as.quickstarts.ejb.remote

      .stateless.RemoteCalculator

      hi context

      Exception in thread "main" javax.naming.NoInitialContextException: Need to speci

      fy class name in environment or system property, or as an applet parameter, or i

      n an application resource file:  java.naming.factory.initial

              at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

              at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

              at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)

              at javax.naming.InitialContext.lookup(Unknown Source)

              at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.lookupRemo

      teStatelessCalculator(RemoteEJBClient.java:113)

              at org.jboss.as.quickstarts.ejb.remote.client.RemoteEJBClient.invokeStat

      </pre>