• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB javax.naming.NoInitialContextException error

 
Adam Kortylewicz
Greenhorn
Posts: 11
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • 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
 
Arun Chidambaram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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 Java Oracle
  • Mark post as helpful
  • send pies
  • 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 Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But with this one:




i get this error



Any idea?
 
Adam Kortylewicz
Greenhorn
Posts: 11
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • 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
  • 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 Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Next error only:


I don't get it
 
Arun Chidambaram
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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 Java Oracle
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!