-
1. Re: not bound Exception
toddhunter Jun 23, 2002 9:20 PM (in response to cdmdev)I think the problem is in your jboss.xml
--
<ejb-name>helloEJBDisplay</ejb-name>
<jndi-name></jndi-name>
--
If you are doing
Object ref = jndiContext.lookup("helloEJBDisplay");
have tag,value : <jndi-name>helloEJBDisplay</jndi-name>
The rest looks okay -
2. Re: not bound Exception
cdmdev Jun 24, 2002 10:29 PM (in response to cdmdev)Thanks for the suggestion, but I have tried that as well. I also coppied a hello world ejb example straight from a book to verify that I did not mess up something in my code. I get the same not bound exception. I am at a loss as to what could be the problem. It seems that the jar file is being deployed, but it does not register the bean for some reason. We are not required to have a web.xml file right, I thought we didn't even need to have a jboss.xml file.
Does anyone know why a bean might not be registered? But the jar deployment is successful? Thanks in advance.
Brent -
3. Re: not bound Exception
joelvogt Jun 24, 2002 10:58 PM (in response to cdmdev)mok, Can try a few more things,
look at http://<your-server>:8082
and make sure that your jndi name is there, should be something like
jndiName=helloEJBDisplay
You might also try with your initial context adding the property
env.put("java.naming.rmi.security.manager", "yes");
Btw, is the jndi lookup from within JBOSS (same jvm) or an external client? -
4. Re: not bound Exception
cdmdev Jun 25, 2002 12:22 PM (in response to cdmdev)I am running the client from another VM, not JBoss. I am pointing it to the JBossNS though, see code:
*******************************************************
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "localhost");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );
env.put("java.naming.rmi.security.manager", "yes");
Context jndiContext = new InitialContext(env);
//System.out.println("before initContext");
//InitialContext jndiContext = new InitialContext();
System.out.println("before lookup");
Object ref = jndiContext.lookup("Hello");
System.out.println("after lookup");
********************************************************
Also, I looked at 8082 on localhost, and I can not see my bean. I see the ones that JBoss deploys upon startup, but not mine.
Could it be a problem with how I start it up? I do not see any exceptions on startup, I issue run (I have it both on Linux and Windows) and I have the same symptoms. It deploys but does not register my bean.
I created a simple HelloWorld bean straight from the book. does anyone have a simple code that deploys in their JBoss 3.0 that they can send me, inlcuding the xml files (bvbenson@hotmail.com)? Maybe it is a configuration issue with JBoss?
Any more ideas? Thanks for all the replys I appreciate all your help.
Brent -
5. Re: not bound Exception
cdmdev Jun 25, 2002 9:10 PM (in response to cdmdev)Hey guys, thanks. I found my problem...It was that I had Ejb-jar.xml and not ejb-jar.xml. For some reason windows automatically capitalizes my file names. Thanks for all your help.
-
6. Re: not bound Exception
joelvogt Jun 25, 2002 10:21 PM (in response to cdmdev)he he, good old windows. glad your up and running