Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to run web-client

 
Anton Shaikin
Ranch Hand
Posts: 65
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry if this is off-topic. I'm a Java EE novice and I'm having problem running pretty simple web application. The code and instructions I took from here:
EJB: http://javahowto.blogspot.com/2007/06/simple-ejb-3-application-hand-made.html
Servlet: http://javahowto.blogspot.com/2007/07/simple-ejb-3-servlet-application.html
I tried to deploy this application using JBoss5.1.0GA and JDK1.6.0_11 to no avail.
You can see the server log in the comment made by Anton on this page http://javahowto.blogspot.com/2007/07/simple-ejb-3-servlet-application.html
Any help would be highly appreciated.
So far all the sample EJBs I tried to deploy from various books and tutorials didn't give the desirable results, so I'm getting really frustrated
I would also be very grateful if someone could advise me any simple and easy-to-run sample EJB3.0 applications.
Thanks in advance!
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anton Shaykin wrote:
I would also be very grateful if someone could advise me any simple and easy-to-run sample EJB3.0 applications.
Thanks in advance!


Since you say, you are using JBoss AS, here are the official JBoss EJB3 tutorials.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anton Shaykin wrote:
You can see the server log in the comment made by Anton on this page http://javahowto.blogspot.com/2007/07/simple-ejb-3-servlet-application.html


The example in their blog seems to be for Glassfish and you are using JBoss AS. The error relates to the JNDI name being used and i won't be surprised because JNDI names for beans are application server specific. Which means that if you deploy an application on Glassfish and the same application on JBoss, then the beans will have different JNDI names. Effectively, you are using a wrong JNDI name for the bean.
 
Anton Shaikin
Ranch Hand
Posts: 65
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply!
I admit, that so far I didn't get clear understanding of how JNDI lookup works. So, could you give me a hint, what part of code should be modified? Should I add something, related to initialContext to the Servlet, or maybe I should change web.xml?
Also, I read JBoss official doumentation, and there are some bugs even there, because I wasn't able to run their sample EJBs.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anton Shaykin wrote:
Also, I read JBoss official doumentation, and there are some bugs even there, because I wasn't able to run their sample EJBs.

What errors are you seeing?

So, could you give me a hint, what part of code should be modified?


The mappedName in the @EJB injection of the servlet uses an JNDI name which needs to change. When you deploy your application on JBoss AS, it will print out the jndi names to which the EJB is being bound. You will have to change the injection to use that JNDI name. Alternately, you can use the JNDIView to check the JNDI name of the bean
 
Anton Shaikin
Ranch Hand
Posts: 65
IntelliJ IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What errors are you seeing?

I don't really remember. As soon as I get home I'll post them (probably in a new thread). But when I googled them, I found out that I'm not the only one.
Thanks for your reply, sir.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic