[jboss-user] [EJB 3.0] - classcastexception on redeploy

Bart1985 do-not-reply at jboss.com
Fri Dec 8 05:13:35 EST 2006


Hello,

I am relatively new to EJB3.0 and I am currently developing session and entity beans for a new application.

I'm using Jboss-4.0.5 and when I deploy the first time and I use a standalone application to test my sessionbeans, everything works fine. But when I redeploy my .jar application and use that standalone application again to invoke a sessionbean that passes a remote interface of another sessionbean, I get a classcastexception on PortableRemoteObject.narrow in the standalone application!

This is the remote interface that I invoke to get another sessionbeans remote interface:

@Remote
public interface PermissionRemote

{
  public SchoolsRemote getSchoolsBean();//UserlogRemote ulr);
}

And then the interface that causes the classcastexception:

@Remote
public interface SchoolsRemote
{
  public boolean subscribeSchool(String adminFullName, 
                                 String adminUserName,
                                 String adminEmail,
                                 String adminPhoneNumber,
                                 String adminPassword,
                                 String schoolName);  
  //public School  findSchool(int pKey);
  public String  sayHi();
}

The JBoss error:

11:08:09,078 ERROR [STDERR] java.lang.ClassCastException
11:08:09,078 ERROR [STDERR]     at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)

11:08:09,078 ERROR [STDERR]     at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
11:08:09,078 ERROR [STDERR]     at schoolTime.ejb.permission.PermissionBean.getSchoolsBean(Unknown Source)
11:08:09,078 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:08:09,078 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
11:08:09,078 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
11:08:09,078 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:585)
11:08:09,078 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
11:08:09,078 ERROR [STDERR]     at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
11:08:09,078 ERROR [STDERR]     at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.
java:63)
11:08:09,078 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,078 ERROR [STDERR]     at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEn
tityManagerInterceptor.java:54)
11:08:09,078 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,078 ERROR [STDERR]     at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
11:08:09,078 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,078 ERROR [STDERR]     at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
11:08:09,078 ERROR [STDERR]     at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
11:08:09,078 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,078 ERROR [STDERR]     at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
11:08:09,078 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,078 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.
java:62)
11:08:09,078 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,109 ERROR [STDERR]     at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java
:77)
11:08:09,109 ERROR [STDERR]     at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor
.java:131)
11:08:09,109 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,109 ERROR [STDERR]     at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
11:08:09,109 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,109 ERROR [STDERR]     at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:10
6)
11:08:09,109 ERROR [STDERR]     at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
11:08:09,109 ERROR [STDERR]     at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
11:08:09,109 ERROR [STDERR]     at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
11:08:09,109 ERROR [STDERR]     at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandle
r.java:82)
11:08:09,109 ERROR [STDERR]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
11:08:09,109 ERROR [STDERR]     at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
11:08:09,109 ERROR [STDERR]     at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
11:08:09,109 ERROR [STDERR]     at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
11:08:09,109 ERROR [STDERR]     at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
11:08:09,109 ERROR [STDERR] Caused by: java.lang.ClassCastException: $Proxy93
11:08:09,109 ERROR [STDERR]     at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)

11:08:09,109 ERROR [STDERR]     ... 36 more

If anybody can help, I will be most grateful.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992205#3992205

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992205



More information about the jboss-user mailing list