• Post Reply Bookmark Topic Watch Topic
  • New Topic

ejb stateless example  RSS feed

 
sai rama krishna
Ranch Hand
Posts: 524
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working on below example

http://stackoverflow.com/questions/27519075/how-to-create-ejb-3-2-stateless-bean-project-and-running-it-on-wildfly-8

my code is same as in above link.

when i run Test main class getting below error


ejb:/EJBTest//SLBean!com.example.ejbtest.SLBeanRemote
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:  java.naming.factory.initial
      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at com.example.ejbtest.Test.main(Test.java:30)


please advise.

I am attaching structure.


I tried one other example on same Wildfly 10 server as below






my jndi bindings from server are


/*
* java:global/GreetEJBProjectStaless/GreetBean!com.gp.GreetBean
* java:app/GreetEJBProjectStaless/GreetBean!com.gp.GreetBean
* java:module/GreetBean!com.gp.GreetBean
* java:global/GreetEJBProjectStaless/GreetBean!com.gp.GreetBeanRemote
* java:app/GreetEJBProjectStaless/GreetBean!com.gp.GreetBeanRemote
* java:module/GreetBean!com.gp.GreetBeanRemote
* java:jboss/exported/GreetEJBProjectStaless/GreetBean!com.gp.
* GreetBeanRemote
*/


i am ataching my project structure for this second example as well.

please advise on how to resolve these issues?
strEjb.png
[Thumbnail for strEjb.png]
ex 1
strEjb2.png
[Thumbnail for strEjb2.png]
ex2
 
sai rama krishna
Ranch Hand
Posts: 524
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please advise
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!