1 2 Previous Next 16 Replies Latest reply on Feb 6, 2008 8:13 AM by ghz_gordo

    Corba

    ollka

      Hi,

      I'm trying to find answer on using ejb3 with corba.

      With ejb2.1 it works fine, i set up iiop invoker in jboss.xml and my bean register at corba naming service.

      But i cannot find any possibility to do it with ejb3.

      Please, give me some links or advices to work woth ejb3 and corba.

      Thanks.

        • 1. Re: Corba
          wolfc

          To make a bean available over iiop use:

          @RemoteBinding(factory=org.jboss.ejb3.iiop.IORFactory.class)


          • 2. Re: Corba
            ollka

            Thanks for your answer.

            And where I can find org.jboss.ejb3.iiop.IORFactory.class?
            I have tried almost all of jboss libs but there is no such class...

            • 3. Re: Corba
              wolfc

              deploy/ejb3.deployer/jboss-ejb3.jar

              • 4. Re: Corba
                ollka

                And what name component should i use to resolve my bean?

                with ejb2 in deploying log i could see iiop and jndi name
                [Home IOR for MyBean bound to ejb/MyBean in JNP naming service
                Home IOR for MyBean bound to iiop/ejb/MyBean in CORBA naming service]
                , but now i can see nothing.

                I know jndi names, to that it binds automaticly, but what iiop name?

                • 5. Re: Corba
                  ollka

                  And should my Remote interface implements java.rmi.Remote?

                  When i try to use REmoteBinding in Bean Metadata, i have following:
                  org.omg.PortableServer.POAPackage.AdapterAlreadyExists: IDL:omg.org/PortableServer/POA/AdapterAlreadyExists:1.0
                  at org.jacorb.poa.POA.create_POA(POA.java:748)
                  at org.jboss.invocation.iiop.IIOPInvoker$ServantRegistryWithTransientPOAPerServant.bind(IIOPInvoker.java:494)
                  at org.jboss.ejb3.iiop.IORFactory.start(IORFactory.java:358)
                  at org.jboss.ejb3.ProxyDeployer.start(ProxyDeployer.java:83)
                  at org.jboss.ejb3.SessionContainer.start(SessionContainer.java:124)
                  at org.jboss.ejb3.stateful.StatefulContainer.start(StatefulContainer.java:91)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:102)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                  at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:417)
                  at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                  at $Proxy82.start(Unknown Source)
                  at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:96)
                  at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:281)
                  at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:328)
                  at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                  at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:417)
                  at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                  at $Proxy28.start(Unknown Source)
                  at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:449)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                  at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                  at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                  at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
                  at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                  at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                  at $Proxy29.start(Unknown Source)
                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                  at sun.reflect.GeneratedMethodAccessor23.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:266)
                  at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
                  at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                  at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
                  at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
                  at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
                  at sun.rmi.transport.Transport$1.run(Transport.java:159)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
                  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
                  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
                  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
                  at java.lang.Thread.run(Thread.java:619)


                  When i use it before my remote interface, i have not such exception, so i think it doesn't work in that way...

                  • 6. Re: Corba
                    wolfc

                    The JNDI names and Corba Naming names are equal.

                    So: HomedStatelessBean/home or MyStatelessBean/remote

                    • 7. Re: Corba
                      ollka

                      What about exception?

                      When i try to use same name, i have org.omg.CosNaming.NamingContextPackage.NotFound exception.

                      I tryed to use RemoteBinding before remote interface and before bean.
                      In first case i have no exceptions while deploying, but nothing happens when i try to resolve by bean (i have NotFound exception)

                      In the second case i have exception, listed in my previos post, so i think, something doesn't work and it doesn't boud to corba naming service, or smth else happens, but result is the same - i have NotFount exception on my client.

                      • 8. Re: Corba
                        wolfc

                        The bean must comply to EJB 2.1 API, so the Remote interface is mandatory. In JBoss the home interface is optional.

                        To lookup the bean I use the following properties:

                        Properties props = new Properties();
                         props.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
                         props.put("java.naming.provider.url", "corbaloc::localhost:3528/NameService");
                         props.put("java.naming.factory.object", "org.jboss.tm.iiop.client.IIOPClientUserTransactionObjectFactory");
                         props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming.client:org.jnp.interfaces");


                        • 9. Re: Corba
                          ollka

                          Maybe i don't understand something...

                          Look
                          example of myBean
                          I have
                          @Remote
                          public interface MyBeanRemote extends java.rmi.Remote {...}

                          @Stateless
                          @Remote({MyBeanRemote.class})
                          @RemoteBinding(factory=org.jboss.ejb3.iiop.IORFactory.class)
                          public class MyBean implements MyBeanRemote {...}

                          When i deploy this - i have exception listed before (org.omg.PortableServer.POAPackage.AdapterAlreadyExists: IDL:omg.org/PortableServer/POA/AdapterAlreadyExists:1.0) (but bean is deployed)
                          And when i try to resolve bean from client, using your properties, i have NotFound exception.

                          If i try to move @REmoteBinding to MyBeanRemote interface, i have no exceptions but still have NotFound exception.

                          • 10. Re: Corba
                            ollka

                            As i understand, my exception is a result of "double" binding to the same name. I don't know, why it happens, but it occurs only when i redeploy my ejbs.

                            If i restart whole server, i have another exception:
                            java.lang.ClassCastException
                            at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
                            at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
                            at org.jboss.ejb3.iiop.IORFactory.createProxy(IORFactory.java:154)
                            ... 136 more
                            Caused by: java.lang.ClassCastException: Object is not of remote type javax.ejb.EJBObject
                            at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:221)
                            ... 138 more

                            If i use EJBObject - i have ejb2, isn't so?

                            • 11. Re: Corba
                              ollka

                              And even if i implements EJBObject and all callback methods, i still have the same exception

                              • 12. Re: Corba
                                ollka

                                No ideas?

                                • 13. Re: Corba
                                  ollka

                                  Problem solved by patching file IORFactory (in jboss-ejb3.jar)
                                  Method createProxy make return CORBA.Object, don't narrow to EJBObject

                                  • 14. Re: Corba
                                    ghz_gordo

                                    Hello ollka !!

                                    I have the same problem..

                                    and, if is possible, i want to know how u patching the file IORFactory...

                                    or somebody know how solve this problem ?

                                    thx a lot !!!

                                    1 2 Previous Next