Your code is looking up an object in JNDI, and part of the object name you are giving to JNDI contains the directory name 'comp', but no such directory exists. Most likely, you are using a name such as "java:/env/comp/XXX".
One way to see what JDNI names are bound is to use jmx-console, click on the jboss:service=JNDIView mbean, and then invoke the list operation.
thnx for your reply
actually i am even not able to run my local host so cant open the
jmx-console.I tried to change the ports but that also didnt work.
What do you mean by "not able to run my local host"? Are you saying that JBoss will not run on your computer? Or are you saying that you cannot bring up a browser on the computer that is running JBoss and your therefore cannot use "http://localhost:8080/jmx-console" to access the jmx-console? If the later, there is no requirement to be on the same computer to access jmx-console. Simply replace 'localhost' with the hostname of the computer running JBoss.
Jboss server is on my machine itself but since the server is not able to deploy my code so i cannot bring up the browser and use "http://localhost:8080/jmx-console" to access the jmx-console.The Jboss server is still starting and it was goin on fine some time back but suddenly this JNDI exception started to occur and i am not able to deploy anything on server.