• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB javax.naming.NoInitialContextException error

 
Greenhorn
Posts: 11
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone! I created an EJB (@Remote bean session bean) in Eclipse - its realy easy.


I deployed this on Windfly 9 and the EJB.jar is in Deployment section.

And after this i created Client Project with one class to use this ejb:


with jboss-ejb-client.properties


When i run this class i get this error...



Please help me i want to learn this!

There is my projects structure:

struct.png
[Thumbnail for struct.png]
structure
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error indicates it cant find enough information to construct context lookup, so check constructed message in context.lookup string, it seems wrong. As per given code it will construct as : ("ejbjboss-as-ejb-remote-app//Test!TestRemote")

Adam Kortylewicz wrote:
//calculator = (Test) ctx.lookup("ejb:/wildfly-ejb-remote-server-side/"+beanName+"!"+viewClassName);
calculator = (Test) ctx.lookup("ejb" + appName + "/" + moduleName + "/" + distinctName + "/" + beanName + "!" + viewClassName);

 
Adam Kortylewicz
Greenhorn
Posts: 11
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the answer but this one




do the same error

I dont get it! All tutorials do the same think and only I have this error

Any other idea? Please
 
Adam Kortylewicz
Greenhorn
Posts: 11
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But with this one:




i get this error



Any idea?
 
Adam Kortylewicz
Greenhorn
Posts: 11
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Get another error when i just invoke





Please help me with this one
 
Arun Chidambaram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are trying to retrieve Remote Interface and cast it to concrete class(Test). Change it to TestRemote



 
Adam Kortylewicz
Greenhorn
Posts: 11
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Next error only:


I don't get it
 
Arun Chidambaram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As error indicates, it is missing jboss logger class. Are you using logger in your class? If so you need to add those dependencies in your lib folder.

 
Adam Kortylewicz
Greenhorn
Posts: 11
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added jboss logging jar and xnio-nio and xnio-api jars to project and now i have another error:



I dont get this
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic