• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Error in connecting client application with EJB deployed in JBOSS

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jaikiran

I have changed the port as you said but problem remains same.
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mates thanks for all your help and support. Finally I have run "Hello World"
 
You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic