Re: javax.naming.NameNotFoundException: HelloHome not bound - Java

This is a discussion on Re: javax.naming.NameNotFoundException: HelloHome not bound - Java ; carrozzini wrote: > I'm quite new in the world of Enterprise Java Bean and I'm trying to > do the example of the Mastering EJB2 book and i got this error : > javax.naming.NameNotFoundException: HelloHome not bound > Properties props ...

+ Reply to Thread
Results 1 to 6 of 6

Re: javax.naming.NameNotFoundException: HelloHome not bound

  1. Default Re: javax.naming.NameNotFoundException: HelloHome not bound

    carrozzini wrote:
    > I'm quite new in the world of Enterprise Java Bean and I'm trying to
    > do the example of the Mastering EJB2 book and i got this error :
    > javax.naming.NameNotFoundException: HelloHome not bound


    > Properties props = System.getProperties();
    > Context ctx = new InitialContext(props);


    Could you try the default constructor here (new InitialContext())?

    -marek


  2. Default Re: javax.naming.NameNotFoundException: HelloHome not bound

    Marek Lange <marek.lange@web.de> wrote in message news:<bgnkvj$s7r$00$1@news.t-online.com>...
    > carrozzini wrote:
    > > I'm quite new in the world of Enterprise Java Bean and I'm trying to
    > > do the example of the Mastering EJB2 book and i got this error :
    > > javax.naming.NameNotFoundException: HelloHome not bound

    >
    > > Properties props = System.getProperties();
    > > Context ctx = new InitialContext(props);

    >
    > Could you try the default constructor here (new InitialContext())?
    >
    > -marek


    Hi,

    Just a question, how can I see if my Bean is correctly named in the
    JNDI server. Maybe is not a mystake in my code but simply that the
    JNDI name doesn't exist at all ?

    Do you know how can I check this ?

    Thanx.

  3. Default Re: javax.naming.NameNotFoundException: HelloHome not bound


    "carrozzini" <carrozzini@perso.ch> skrev i meddelandet
    news:26d065a7.0308050640.2b880353@posting.google.com...
    > Marek Lange <marek.lange@web.de> wrote in message

    news:<bgnkvj$s7r$00$1@news.t-online.com>...
    > > carrozzini wrote:
    > > > I'm quite new in the world of Enterprise Java Bean and I'm trying to
    > > > do the example of the Mastering EJB2 book and i got this error :
    > > > javax.naming.NameNotFoundException: HelloHome not bound

    > >
    > > > Properties props = System.getProperties();
    > > > Context ctx = new InitialContext(props);

    > >
    > > Could you try the default constructor here (new InitialContext())?
    > >
    > > -marek

    >
    > Hi,
    >
    > Just a question, how can I see if my Bean is correctly named in the
    > JNDI server. Maybe is not a mystake in my code but simply that the
    > JNDI name doesn't exist at all ?
    >
    > Do you know how can I check this ?
    >
    > Thanx.


    Try to list and print out the JNDI-bindings.

    NamingEnumeration ne = ctx.listBindings("");
    while(ne.hasMore()).... etc...
    You might have to step further down the JNDI-namespace, i.e
    NamingEnumeration ne = ctx.listBindings("ejb");

    //Josef



  4. Default Re: javax.naming.NameNotFoundException: HelloHome not bound

    Marek Lange <marek.lange@web.de> wrote in message news:<bgp1dj$9v8$06$1@news.t-online.com>...
    > carrozzini wrote:
    > > Marek Lange <marek.lange@web.de> wrote in message news:<bgnkvj$s7r$00$1@news.t-online.com>...
    > >
    > >>carrozzini wrote:
    > >>
    > >>>I'm quite new in the world of Enterprise Java Bean and I'm trying to
    > >>>do the example of the Mastering EJB2 book and i got this error :
    > >>>javax.naming.NameNotFoundException: HelloHome not bound
    > >>
    > >>
    > >>
    > >>> Properties props = System.getProperties();
    > >>> Context ctx = new InitialContext(props);
    > >>
    > >>Could you try the default constructor here (new InitialContext())?
    > >>
    > >>-marek

    > >
    > >
    > > Hi,
    > >
    > > Just a question, how can I see if my Bean is correctly named in the
    > > JNDI server. Maybe is not a mystake in my code but simply that the
    > > JNDI name doesn't exist at all ?
    > >
    > > Do you know how can I check this ?

    >
    > Look at the JBoss JMX-Console (htpp://host:8080/jmx-console). There you
    > can see all deployed beans and their JNDI names (domain: jboss.j2ee).
    >
    > -marek



    Hi everybody,

    so I corrected 1-2 bugs. I don't know why but the the error was in my
    xml file. So know the ejb is deployed correctly now and I tried the
    url that you mentionned and i got this :

    jboss.j2ee
    jndiName=HelloHome,plugin=pool,service=EJB
    jndiName=HelloHome,service=EJB
    jndiName=ejb/converter/Converter,plugin=pool,service=EJB
    jndiName=ejb/converter/Converter,service=EJB
    jndiName=ejb/mgmt/MEJB,plugin=pool,service=EJB
    jndiName=ejb/mgmt/MEJB,service=EJB
    module=HelloWorld.jar,service=EjbModule
    module=converter.jar,service=EjbModule
    module=ejb-management.jar,service=EjbModule
    service=EARDeployer

    Does it means that's ok ?

    But know I got another error code when I launch my test client :

    javax.naming.CommunicationException: Receive timed out. Root
    exception is java.net.SocketTimeoutException: Receive timed out

    at java.net.PlainDatagramSocketImpl.receive(Native Method)
    at java.net.DatagramSocket.receive(DatagramSocket.java:671)
    at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1038)
    at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1158)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:478)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at tests.Test.main(Test.java:23)
    Exception in thread "main"


    My test client code :

    import exemples.Hello;
    import exemples.HelloHome;

    /**
    *
    */
    public class Test extends java.lang.Object {

    public static void main(String[] args) throws Exception{

    Properties p = new Properties();
    p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
    p.put("java.naming.factory.url.pkgs","org.jboss.namingrg.jnp.interfaces");
    p.put("java.naming.provider.url.package","localhost:1099");
    InitialContext ic = new InitialContext(p);
    Object obj = ic.lookup("HelloHome");

    HelloHome home = (HelloHome) PortableRemoteObject.narrow(obj,
    HelloHome.class);
    Hello hello = home.create();
    System.out.println(hello.hello());
    hello.remove();

    }

    }


    Could you help me ?


    thanx !!!

  5. Default Re: javax.naming.NameNotFoundException: HelloHome not bound

    carrozzini wrote:
    > jboss.j2ee
    > jndiName=HelloHome,plugin=pool,service=EJB
    > jndiName=HelloHome,service=EJB
    > jndiName=ejb/converter/Converter,plugin=pool,service=EJB
    > jndiName=ejb/converter/Converter,service=EJB
    > jndiName=ejb/mgmt/MEJB,plugin=pool,service=EJB
    > jndiName=ejb/mgmt/MEJB,service=EJB
    > module=HelloWorld.jar,service=EjbModule
    > module=converter.jar,service=EjbModule
    > module=ejb-management.jar,service=EjbModule
    > service=EARDeployer
    >
    > Does it means that's ok ?


    Yes.

    > But know I got another error code when I launch my test client :
    >
    > javax.naming.CommunicationException: Receive timed out. Root
    > exception is java.net.SocketTimeoutException: Receive timed out


    > Properties p = new Properties();
    > p.put("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
    > p.put("java.naming.factory.url.pkgs","org.jboss.namingrg.jnp.interfaces");
    > p.put("java.naming.provider.url.package","localhost:1099");

    ^^^^^^^^
    The key is wrong here - it should be "java.naming.provider.url". You'd
    better take the constants:

    p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
    "org.jnp.interfaces.NamingContextFactory");
    p.setProperty(Context.PROVIDER_URL, "localhost:1099");
    p.setProperty(Context.URL_PKG_PREFIXES,
    "org.jboss.namingrg.jnp.interfaces");

    That should work.

    -marek


  6. Default Re: javax.naming.NameNotFoundException: HelloHome not bound

    Marek Lange <marek.lange@web.de> wrote in message news:<3F33775C.8040309@web.de>...
    > carrozzini schrieb:
    > > So i changed my class as you said. Now it looks like this :
    > >
    > > public class Test extends java.lang.Object {

    > ^^^^^^^^^^^^^^not necessary
    >
    > > public static void main(String[] args) throws Exception{
    > >
    > > Properties p = new Properties();
    > > p.setProperty(Context.INITIAL_CONTEXT_FACTORY,
    > > "org.jnp.interfaces.NamingContextFactory");
    > > p.setProperty(Context.PROVIDER_URL, "localhost:1099");
    > > p.setProperty(Context.URL_PKG_PREFIXES,
    > > "org.jboss.namingrg.jnp.interfaces");
    > > InitialContext ic = new InitialContext(p);

    >
    > > I launched the application and I have another error
    > > java.lang.NoClassDefFoundError:
    > > Lorg/jboss/tm/TransactionPropagationContextFactory;
    > > at java.lang.Class.getDeclaredFields0(Native Method)
    > > at java.lang.Class.privateGetDeclaredFields(Class.java:1494)
    > > at java.lang.Class.getField0(Class.java:1727)
    > > at java.lang.Class.getDeclaredField(Class.java:1189)
    > > at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1430)

    >
    > You need jboss-transaction-client.jar in your client CLASSPATH (in
    > $JBOSS_HOME/client/jboss-transaction-client.jar).
    >
    > -marek



    Hello,

    it works :

    -thank you
    -vielen dank
    -grazie mille
    -merci infiniment

+ Reply to Thread

Similar Threads

  1. javax.naming.NameNotFoundException
    By Application Development in forum Java
    Replies: 0
    Last Post: 05-01-2005, 02:51 PM
  2. What does javax.naming.Reference means ?
    By Application Development in forum Java
    Replies: 0
    Last Post: 01-14-2005, 04:18 AM
  3. Replies: 2
    Last Post: 08-19-2004, 03:54 AM
  4. JBoss EJB Error- javax.naming.NameNotFoundException
    By Application Development in forum Java
    Replies: 0
    Last Post: 07-12-2004, 12:01 AM
  5. ??NameNotFoundException: interest not bound
    By Application Development in forum Java
    Replies: 0
    Last Post: 09-08-2003, 10:03 AM