aspose file tools*
The moose likes JBoss/WildFly and the fly likes invoking EJB via Http call using Jboss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "invoking EJB via Http call using Jboss" Watch "invoking EJB via Http call using Jboss" New topic
Author

invoking EJB via Http call using Jboss

vinoth subramaniam
Ranch Hand

Joined: Jul 05, 2008
Posts: 47
Hi all,
I am new to the world of remotes and homes. I am stuck in this problem for a while... Please help me out.

I am using EJB 2.1 , Jboss 4.0.2, JDK 1.6 and JRE 5.0. I can able to invoke the session bean from a java application. But when i tried to invoke from the servlet (in my case JSF servlet,... also i tried with the Http Servlet ...i got the same result), it is giving the communication exception error. just like the call from main method, i am using Eclipse RCP as a front end and can be able to invoke the session beans.

1. What is the configuration need to be done in Jboss AS for EJB. Please explain it.
2. What is the exact difference between when a user making a call from a main method and call from a servlet.
3. Do i have to use the concept of Mbean? if it is so, could you please brief it. Or giveme some links to explore it.



Here is the class which is invoking the (Proxy) EJB,



This is the Error Message i am getting when i tried to invoke the EJB session bean ..... I understood that the root exception is because of the jboss-client.jar and jbossall-client.jar. But i am using the same jar files which comes along with the jboss 4.0.2.Zip. I am getting the same error. Is there any other thing causing this error? So what is the solution for this problem.



Thanks for your valuable time.

- Vinoth[/size][/size]
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

Looks like you error is that the client side version of the class is not the same version of your class on the server.

You need to make sure the jars on both sides that contains your EJBs have the same compiled versions. Otherwise you will get the exception that you are receiving.

So, in reality the question ends up not being EJB or about JBoss. Funny.

Good Luck, and try to recompile your code, and use the same .class files on both client and server sides.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
vinoth subramaniam
Ranch Hand

Joined: Jul 05, 2008
Posts: 47
Hi, thanks for the reply. My EAR have the both web client and EJB. So do i need to put the compiled jar file in the web client's library once again? Can you put some more words on that ...
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10220
    
166

Looks like the classpath has incorrect version of JBoss jar files. Do you package any JBoss jar files in your application? If yes, remove them from your packaging.

[My Blog] [JavaRanch Journal]
vinoth subramaniam
Ranch Hand

Joined: Jul 05, 2008
Posts: 47
I solved the problem, thank you ..! As you said there is a jar file (jboss-common.jar) in the WEB-INF/lib. I removed it and that problem is solved.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: invoking EJB via Http call using Jboss