What are you setting as your codebase?
When I start the RMIServer I set
In jar are stubs.
The problem is, that I have already done all this many times, when the RMI Client was running under the Java Program, but as soon as the client was brought in JBoss framework it doesn't work.
OK. Error is found.
The problem was in ClassLoader.
My system creates the RMI Client from URL ClassLoader by creating of the client erlier I did commented the initialization of the ContextClassLoader.
In other hand the RMI Class Loader uses as basis Thread.getContextClassLoader(). When the context class loader was not inited, of cource, the context class loader didn't have needed interface. That's was the problem why it was saying that interface is not found, when this interface was not available at codebase. And that's why he was saying "classcastexception" when remote interface was available at codebase. Because the loaded class was in other class loader as the class to be casted to.
so. any way thanx to all.