aspose file tools*
The moose likes JBoss/WildFly and the fly likes Error in connecting client application with EJB deployed in JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Error in connecting client application with EJB deployed in JBOSS" Watch "Error in connecting client application with EJB deployed in JBOSS" New topic
Author

Error in connecting client application with EJB deployed in JBOSS

Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
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


"Know where to find the solution and how to use it - that's the secret of success."
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

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 :




[My Blog] [JavaRanch Journal]
Amirr Rafique
Ranch Hand

Joined: Nov 14, 2005
Posts: 324
Jaikiran

I have changed the port as you said but problem remains same.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10202
    
166

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

Joined: Jan 15, 2003
Posts: 74
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

Joined: Nov 14, 2005
Posts: 324


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

Joined: Nov 14, 2005
Posts: 324
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

Joined: Dec 16, 2008
Posts: 53
The jndi.properties should be present in the $JBOSS_HOME/<<server>>/conf directory. See if it helps.


Vikram
SCJP 5 , SCBCD [Prep Started ] , WLS 8.1 Server Admin
Anurag Blore
Ranch Hand

Joined: Jan 15, 2003
Posts: 74
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

Joined: Nov 14, 2005
Posts: 324
Mates thanks for all your help and support. Finally I have run "Hello World"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error in connecting client application with EJB deployed in JBOSS