File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Unable to run web-client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Unable to run web-client" Watch "Unable to run web-client" New topic
Author

Unable to run web-client

Anton Shaykin
Ranch Hand

Joined: Dec 13, 2009
Posts: 57

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

Joined: Jul 20, 2005
Posts: 10101
    
164

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.

[My Blog] [JavaRanch Journal]
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10101
    
164

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 Shaykin
Ranch Hand

Joined: Dec 13, 2009
Posts: 57

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

Joined: Jul 20, 2005
Posts: 10101
    
164

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 Shaykin
Ranch Hand

Joined: Dec 13, 2009
Posts: 57

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to run web-client