The type cast is required, because the remote object from context is EJBHome, and I need the Home object for a specific JavaBean, and I can only access them through this node.
I'm debugging with beanHome = PortableRemoteObject.narrow( java.lang.Object.new(), Java::custom.ServicesHome.java_class ) 2009/7/30 Thomas E Enebo <[email protected]> > Try changing: > > Java.ruby_to_java(Java::custom.ServicesHome.class) > > to: > > Java::custom.ServicesHome.java_class In this case the narrow() method gets apparently null class: NativeException: java.lang.ClassCastException: null com/sun/corba/se/impl/javax/rmi/PortableRemoteObject.java:229:in `narrow' javax/rmi/PortableRemoteObject.java:137:in `narrow' > > > ...though it strikes me that we should really work if we do: > > Java::custom.ServicesHome In this case: TypeError: for method narrow expected [java.lang.Object, java.lang.Class]; got: [java.lang.Object,org.jruby.RubyModule]; error: argument type mismatch > > > Hmmm, may need to look into that, Thanks. Besides this, I need to transform the InitialContext object to java.lang.Object. -- -- mikael
