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 EJB Standalone Client Remote Lookup Problem 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 "EJB Standalone Client Remote Lookup Problem" Watch "EJB Standalone Client Remote Lookup Problem" New topic
Author

EJB Standalone Client Remote Lookup Problem

Ned Rowly
Greenhorn

Joined: Feb 14, 2011
Posts: 1
After spending countless hours searching for a solution I've given up and decided I'll need some help.

I deployed my EJB .jar file in the /farm folder (for clustering) and the clustering works fine for the multiple nodes.

However I run into some problems when testing a node using a standalone test client.

The EJB is located in a remote server (server A) and the client jar file is located in another machine. I execute the client jar file via the command line using java -jar client.jar. However it throws me the following exception.

Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference cannot be cast to <Remote Bean Client>

I've added jbossall-client.jar to my classpath (I've added this in the MANIFEST.MF file of the client.jar file). I haven't been using a legacy version of JBoss, consistently using JBoss 6.

My guess is I haven't packaged my client jar correctly. Currently I have the following in there:
> package1: client + beanRemoteInterface
> META-INF/MANIFEST.MF

The contents of the Client is as follows:

My EJB jar looks like this: (one package)
> Bean
> EntityBean
> BeanLocal
> BeanRemote

Am I suppose to include the remote bean interface with the client jar? I did some research and some people claim it's a class loader issue loading two instances of the same BeanRemote interface. Anyone got any suggestions? I'm really looking to just get a very simple standalone client to test clustering functions.

Thanks in advance!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB Standalone Client Remote Lookup Problem