Originally posted by Paul Sturrock:
Have you discovered the JMX-Console in JBoss yet? Run Jboss and got to localhost:8080/jmx-console. This will give you a view of the JNDI name space. You can check whether there is anything bound with the context "HelloWorldBean/remote". If there isn't, presuming your EJB actually deployed, then it shouldn't take long to find out where it was really bound.
Originally posted by Jaikiran Pai:
When you use the default constructor of InitialContext(), it searches for a file (named jndi.properties) which contains the lookup information. And if the tjndi.properties file is not found in the classpath, then you will see the exception, that you are currently seeing. Have a look at NoInitialContextException for more details.
Now, when you specify the lookup properties using the Hashtable in your code, the jndi.properties file is not searched for in the classpath. And that's why the code works.
Originally posted by Richard Luo:
I modified the jndi.properties in $JBOSS_HOME$\server\default\config and then restarted the server but at last it still not worked.
Awaiting for your more help.
Thanks so much!
Originally posted by Mark Spritzler:
No. That file should not be changed it is used to do local lookups within JBoss server. You must revert that file back to the way it was.
You need a seperate jndi.properties file, and it should be with the client archive file in the root of its classpath.
Mark
Originally posted by Mark Spritzler:
Well I can't really tell you which directory but if you have this kind of layout
c:\myproject\src\com\mycompany
and you set your classpath to c:\myproject\src then that is the directory that the jndi.properties file.
Richard you need to put your last name back into your display name to keep with the JavaRanch Naming Policy of using your real first and real last names.
Thanks
Originally posted by Richard Luo:
Again, thank you all for helping me to solve this problem.
You guys are all warm-hearted and this forum is really excellent one!
Don't get me started about those stupid light bulbs. |