i have a similar problem when i want to connect to a EJB:
Caused by: java.lang.ClassCastException: $Proxy89
... 27 more
The code is:
Context context = new InitialContext();
Object ref = context.lookup("InfoSessionFacade");
InfoSessionFacadeHome home = (InfoSessionFacadeHome) PortableRemoteObject.narrow(ref,
I use Jboss 4.0.2 Final and i use the jboss and tomcat 5.5.9 libraries to compile my files.
Thanks for any help.
Hi, after reading a lot of articels now i new, that this is not a bug and i didn't make a mistake. the problem is, that there is a change of settings between jboss 4.0.2 RC1 and 4.0.2 Final, but i don't know what. it has something to do with classloading and virtual machines. everybody says this but nobody says what to do to resolve this problem :-( .
know i use jboss 4.0.3 RC1 and everything works fine.
Grüße aus Deutschland,
I had the same problem as you (ClassCastException when trying to retrieve the Home class) with Jboss AS 4.0.2.
I could fix the problem by (reading the readme doc :-) ) and changing two properties:
and in ../deploy/ear-deployer.xml:
For me, it no works fine...finally!!!
I hope this can help you too.
Sorry... in my last post, the xml tags I had copied/pasted from the files were ignored.
So, the changes I have made are:
set to true the value of the property CallByValue in both files I mentionned.
Hello and thanks. I indeed missed some class files in the client. In my project layout the classes that the client uses are packaged into the client jar and have to be given in a different place than the jars for linking.
Thank you antimoine67 for the reference. Now it functions!
After a lot of pain and readings, changing the CallByValue settings worked for me (I don't get the ClassCastException anymore!)
I am building a very simple Statless Session Bean (the most simple HelloWorld type of thing)...
Can anybody explain *why* this is needed? This doesn't look like a standard thing to do (especially considering the simplicity of my SSB).
I'd really appreciate some insight about this!
Nicolas (JBoss 4.0.2, JRE 1.5, wXP)
Why are you all assuming thay all ClassCastExceptions are equal?
Some of you are talking about remote access to EJBs and some of you are talking about accessing EJBs from web applications.
Can anybody explain *why* this is needed? This doesn't look like a standard thing to do
You have not bothered to describe the architecture of your deployment, there are lots of reasons why people see ClassCastExceptions and they are dependant on what you are deploying.
I would guess that you are deploying a war that contains the home and remote interfaces of your bean, if so this is the source of the problem. Remove the interfaces from the war and you should be able to access the bean without the problems.