facebook

javax.naming.NoInitialContextException

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #339667 Reply

    raka_oscr
    Member

    Hi,
    I am new to EJB 3, it is just fantastic working on myeclipse. I tried develop a simple EJB application by following the below link.

    http://www.myeclipseide.com/documentation/quickstarts/ejb3/

    I was almost done.

    When I run the client bean, It shows the error as shown below:

    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in 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 com.myeclipseide.ejb3.MyBeanClient.main(MyBeanClient.java:10)

    I don’t what was the problem. How can i overcome this?

    Thanks
    -raka

    #339697 Reply

    support-swapna
    Moderator

    Raka,

    This is the error you get from JBoss when you omit the jndi.properties file (right under src). This file should contain the following entries. Adjust the values as per your server settings:

    java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
    java.naming.provider.url=localhost:1099
    java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

    Make sure the jndi.properties file in your classpath.

    Hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: javax.naming.NoInitialContextException

You must be logged in to post in the forum log in