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

  • SEARCH
  • Home
  • 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 682581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:36:43+00:00 2026-05-14T01:36:43+00:00

I have the following error Exception in thread main javax.naming.NameNotFoundException: CounterBean not bound trying

  • 0

I have the following error

 Exception in thread "main" javax.naming.NameNotFoundException: CounterBean not bound

trying to access an EJB JAR CounterBean.jar deployed on JBoss5 from a client application outside the Application Server.

From the Jboss log, it looks like it does not have a global JNDI name? Is this ok?
What have I done wrong?

JBoss log:

13:50:39,669 INFO  [JBossASKernel] Created KernelDeployment for: Counter.jar
13:50:39,672 INFO  [JBossASKernel] installing bean:   jboss.j2ee:jar=Counter.jar,name=CounterBean,service=EJB3
13:50:39,672 INFO  [JBossASKernel]   with dependencies:
13:50:39,672 INFO  [JBossASKernel]   and demands:
13:50:39,673 INFO  [JBossASKernel]      partition:partitionName=DefaultPartition;  Required: Described
13:50:39,673 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService; Required: Described
13:50:39,673 INFO  [JBossASKernel]   and supplies:
13:50:39,673 INFO  [JBossASKernel]      jndi:CounterBean
13:50:39,673 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=Counter.jar,name=CounterBean,service=EJB3) to KernelDeployment of: Counter.jar
13:50:39,712 INFO  [SessionSpecContainer] Starting  jboss.j2ee:jar=Counter.jar,name=CounterBean,service=EJB3
13:50:39,727 INFO  [EJBContainer] STARTED EJB: com.don.CounterBean ejbName: CounterBean
13:50:39,732 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

The client code is:

public static void main(String[] args) throws NamingException, InterruptedException {
    InitialContext ctx = new InitialContext();
    Counter s = (Counter)ctx.lookup("CounterBean/remote");
    for(int i = 0; i < 100; i++ ) {
        s.printCount(i);
        Thread.sleep(1000);
    }
}

Error message:

java -Djava.naming.provider.url=jnp://123.123.123.123:1099 -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory com.don.Client

Exception in thread "main" javax.naming.NameNotFoundException: CounterBean not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
    at sun.rmi.transport.Transport$1.run(Transport.java:159)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
    at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
        at com.don.Client.main(Client.java:10)
  • 1 1 Answer
  • 1 View
  • 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-14T01:36:44+00:00Added an answer on May 14, 2026 at 1:36 am

    This is what I get when I deploy a simple Stateless Session Bean (SLSB) with a remote interface on JBoss 5.x:

    01:52:07,313 INFO  [JBossASKernel] Created KernelDeployment for: sandbox-services-1.0-SNAPSHOT.jar
    01:52:07,313 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3
    01:52:07,314 INFO  [JBossASKernel]   with dependencies:
    01:52:07,314 INFO  [JBossASKernel]   and demands:
    01:52:07,314 INFO  [JBossASKernel]  jboss.ejb:service=EJBTimerService
    01:52:07,314 INFO  [JBossASKernel]   and supplies:
    01:52:07,314 INFO  [JBossASKernel]  Class:com.stackoverflow.q2440956.samples.services.hello.Echo
    01:52:07,314 INFO  [JBossASKernel]  jndi:EchoBean/remote-com.stackoverflow.q2440956.samples.services.hello.Echo
    01:52:07,314 INFO  [JBossASKernel]  jndi:EchoBean/remote
    01:52:07,314 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3) to KernelDeployment of: sandbox-services-1.0-SNAPSHOT.jar
    01:52:07,315 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@a130d1{name=jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
    01:52:07,381 INFO  [SessionSpecContainer] Starting jboss.j2ee:jar=sandbox-services-1.0-SNAPSHOT.jar,name=EchoBean,service=EJB3
    01:52:07,382 INFO  [EJBContainer] STARTED EJB: com.stackoverflow.q2440956.samples.services.hello.EchoBean ejbName: EchoBean
    01:52:07,412 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
    
        EchoBean/remote - EJB3.x Default Remote Business Interface
        EchoBean/remote-com.stackoverflow.q2440956.samples.services.hello.Echo - EJB3.x Remote Business Interface
    

    When I look at the trace you provided, I can’t see anything related to the remote interface (that you’ll need for a remote call) and consequently, no JNDI name for it. So the question is: does your SLSB define and implement a remote interface properly?

    In my case, my bean is defined like this:

    @Stateless
    public class EchoBean implements Echo {
        ...
    }
    

    And the remote interface looks like:

    @Remote
    public interface Echo {
        String echo(final String in);
    }
    

    Do you have something similar?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Java program fails with the following error on Windows. Exception in thread main
The class LongInteger is causing the following error when run: Exception in thread main
While using Leiningen, I got the following abrupt error: Exception in thread main java.lang.NoSuchMethodError:
I get the following error in my java code: Exception in thread main java.lang.StringIndexOutOfBoundsException:
I have following code using hibernate to throw a custom exception on error and
I use wcsncasecmp inside c/c++ app. Compile have following error: error: 'wcsncasecmp' was not
I'm trying to install memcached-1.2.8-repcached-2.2.1 I have the following error after running make :
I have the following error with my ASP.NET web site. I have just moved
I have the following error: LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
I have the following error message: SQLSTATE[HY000] [2003] Can't connect to MySQL server on

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.