• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in connecting client application with EJB deployed in JBOSS

 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am getting following exception when I try to run client application which is using EJB deployed in JBOSS 5.x


My sever is up and listening at http://127.0.0.1:8080.
Below is the code of client application


Here are my jndi.properties


Please help me out

Thanks
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The naming port is by default 1099. The port you are using 8080 is the HTTP port. So your jndi.properties should be changed to :


 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran

I have changed the port as you said but problem remains same.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the following command output from the system where you are running the client:



And what command did you use to start the server?

By the way, i just noticed that the exception stacktrace shows this:

at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)


which doesn't look right to me. Are you sure your jndi.properties is being picked up in the classpath? You can try deleting that file and if you still see this exact same error then your jndi.properties is not being picked up.
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try this to get the initial context



Please note in this sample the context factory is different
org.jboss.naming.NamingContextFactory
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


after using above code snippet I get following exception



Please also examine below build.xml file which i am using running the client


I am trying to run my first ever EJB program and i really appreciate all your efforts

Thanks


 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran Pai wrote:
By the way, i just noticed that the exception stacktrace shows this:

at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)


which doesn't look right to me. Are you sure your jndi.properties is being picked up in the classpath? You can try deleting that file and if you still see this exact same error then your jndi.properties is not being picked up.


You are right jaikiran, deleting properties file doesnot change error. Where should i palce properties file to make it picked by classpath.
 
Vikram Saxena
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jndi.properties should be present in the $JBOSS_HOME/<<server>>/conf directory. See if it helps.
 
Anurag Blore
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Root exception is java.lang.ClassNotFoundException: org.jboss.naming.NamingContextFactory]


to resolve above include this jar from jboss in your class path
jbossall-client.jar it should be in your jboss/client folder.
I would recommend to add all the jars from jboss/client folder.


what is the jboss version?
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mates thanks for all your help and support. Finally I have run "Hello World"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic