Bugs item #697254, was opened at 2003-03-04 05:56 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=697254&group_id=22866
Category: JBossServer Group: v3.2 >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Marcus Eriksson (marcuseriksson) >Assigned to: Scott M Stark (starksm) Summary: ClassCastException when using EAR based scoping Initial Comment: I'm not sure if this behaviour is by design or a bug... Two EARs with a bean in the first EAR calling a bean in the second EAR. Is this not possible if I use EAR based scoping? I get a ClassCastException when I narrow the home of the called bean: Object o = ctx.lookup(jndiName); TestBeanHome home = (TestBeanHome) PortableRemoteObject.narrow(o, TestBeanHome.class); (JBoss 3.2.0RC2, J2SE1.4.1) ---------------------------------------------------------------------- >Comment By: Scott M Stark (starksm) Date: 2003-03-04 23:54 Message: Logged In: YES user_id=175228 Yes, this violates the point of scoping which is to isolate the deployment classes. The TestBeanHome seen in ear1 will not match the corresponding class bound into JNDI. You can disable the call by reference mode which is causing the class cast exception by creating a custom container configuration that uses the ByValueInvokerInterceptor in the client proxy. An example from the testsuite is shown below. There still may be a problem with the JNDI lookup also using a by reference semantic as well that needs to be turned off. The only way to do this is to create an InitialContext with the java.naming.provider.url=localhost:1099 property defined. This causes the lookup to go through RMI and will isolate the version of TestBeanHome bound into JNDI from the one available in the second ear. <?xml version="1.0" encoding="UTF-8"?> <jboss> <invoker-proxy-bindings> <invoker-proxy-binding> <name>by-value-stateless-rmi-invoker</name> <invoker-mbean>jboss:service=invoker,type=jrmp</invoker-mbean> <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory> <proxy-factory-config> <client-interceptors> <home> <interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor> <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor> <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor> <interceptor>org.jboss.invocation.ByValueInvokerInterceptor</interceptor> </home> <bean> <interceptor>org.jboss.proxy.ejb.StatelessSessionInterceptor</interceptor> <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor> <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor> <interceptor>org.jboss.invocation.ByValueInvokerInterceptor</interceptor> </bean> </client-interceptors> </proxy-factory-config> </invoker-proxy-binding> </invoker-proxy-bindings> <enterprise-beans> <session> <ejb-name>ENCBean1</ejb-name> <local-jndi-name>jbosstest/ejbs/local/ENCBean1</local-jndi-name> </session> <session> <ejb-name>SecuredEJB</ejb-name> <jndi-name>jbosstest/ejbs/SecuredEJB</jndi-name> <configuration-name>Secure Stateless SessionBean</configuration-name> </session> <session> <ejb-name>UnsecuredEJB</ejb-name> <jndi-name>jbosstest/ejbs/UnsecuredEJB</jndi-name> <ejb-ref> <ejb-ref-name>ejb/Session</ejb-ref-name> <jndi-name>jbosstest/ejbs/SecuredEJB</jndi-name> </ejb-ref> </session> <session> <ejb-name>NotOptimizedEJB</ejb-name> <jndi-name>jbosstest/ejbs/NotOptimizedEJB</jndi-name> <invoker-bindings> <invoker> <invoker-proxy-binding-name>by-value-stateless-rmi-invoker</invoker-proxy-binding-name> </invoker> </invoker-bindings> </session> </enterprise-beans> <container-configurations> <container-configuration extends="Standard Stateless SessionBean"> <container-name>Secure Stateless SessionBean</container-name> <security-domain>java:/jaas/other</security-domain> </container-configuration> </container-configurations> </jboss> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=376685&aid=697254&group_id=22866 ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development