Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6189661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:27:11+00:00 2026-05-24T02:27:11+00:00

I have deployed an ejb in a war file(not an ear file). I have

  • 0

I have deployed an ejb in a war file(not an ear file).
I have successfully consumed an ejb deployed in an ear file previously but now I am getting javax.naming.NameNotFoundException because my EJB is hosted in the war file. If my web app is called SpeechServices and the bean is under com.xyz.ejb package and its name is Service then what will be the JNDI lookup string i should be using?
I am using the following right now.

ServiceRemote remote = (ServiceRemote) ct.lookup("SpeechServices/Service/remote-com.xyz.ejb.ServiceRemote");

Please help me rectify the error in above statement.

My full code is following, which works to connect to ejbs if they are in an ear,

        Properties env = new Properties();
        env.put(Context.INITIAL_CONTEXT_FACTORY,
                "org.jnp.interfaces.NamingContextFactory");
        env.put(Context.URL_PKG_PREFIXES,
                "org.jboss.naming:org.jnp.interfaces");
        env.put(Context.PROVIDER_URL, "jnp://localhost:1099");
        env.put(Context.SECURITY_PRINCIPAL, "admin");
        env.put(Context.SECURITY_CREDENTIALS, "admin");
        env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
                "org.jboss.security.jndi.JndiLoginInitialContextFactory");
        InitialContext ct = new InitialContext(env);
        ServiceRemote remote = (ServiceRemote) ct.lookup("SpeechServices/Service/remote-com.xyz.ejb.ServiceRemote");
        System.out.println(remote.parseNotes(null, null, null));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:27:11+00:00Added an answer on May 24, 2026 at 2:27 am

    Check the JNDI to make sure that you are using the right key. To do this:

    1. Access JBoss:service=JNDIView in JMX-Console
    2. invoke list() method
    3. Verify whether your EJB is bound properly and confirm that the key you are using is correct
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have deployed a .war file inside Jetty Server. The server has been started,
I have an ear file that consists of a war file together with a
I have a war and an ejb deployed on my Glassfish V3. I need
I have deployed a new build on Production server, but I dont see the
I'm looking for an entry point in an EJB deployed on JBoss. Servlets have
I have a top-down EJB Webservice (deployed on Websphere 6.01) that hangs the first
I have a problem calling EJB object in struts action. I deployed my application
I'm using JBoss 4.2.3, EJB2, XDoclet and have deployed one EAR with the EJBs
I have an EJB JAR + JSF WAR that runs fine on local GlassFish
I have deployed an enterprise app in an EAR and a standalone web app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.