8 Replies Latest reply on Jan 29, 2007 4:58 AM by svadu

    Seam 1.1 on Resin

      HI All,

      I've managed to run Seam 1.1 on Resin 3.0.21 with little workarounds (Gavin I posted about it on theserverside.com). It works pretty well for hibernate examples. However, if I want it to run in the ejb-3 micro-container I am getting the following exception:

       java.lang.RuntimeException: exception invoking: startup
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:112)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1791)
       at org.jboss.seam.Component.callCreateMethod(Component.java:1739)
       at org.jboss.seam.Component.newInstance(Component.java:1728)
       at org.jboss.seam.contexts.Lifecycle.startup(Lifecycle.java:152)
       at org.jboss.seam.contexts.Lifecycle.endInitialization(Lifecycle.java:126)
       at org.jboss.seam.init.Initialization.init(Initialization.java:430)
       at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33)
       at com.caucho.server.webapp.Application.start(Application.java:1647)
       at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:621)
       at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
       at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:509)
       at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:153)
       at com.caucho.server.webapp.ApplicationContainer.start(ApplicationContainer.java:670)
       at com.caucho.server.host.Host.start(Host.java:420)
       at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:621)
       at com.caucho.server.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:72)
       at com.caucho.server.deploy.DeployController.startOnInit(DeployController.java:509)
       at com.caucho.server.deploy.DeployContainer.start(DeployContainer.java:153)
       at com.caucho.server.host.HostContainer.start(HostContainer.java:504)
       at com.caucho.server.resin.ServletServer.start(ServletServer.java:971)
       at com.caucho.server.deploy.DeployController.startImpl(DeployController.java:621)
       at com.caucho.server.deploy.AbstractDeployControllerStrategy.start(AbstractDeployControllerStrategy.java:56)
       at com.caucho.server.deploy.DeployController.start(DeployController.java:517)
       at com.caucho.server.resin.ResinServer.start(ResinServer.java:546)
       at com.caucho.server.resin.Resin.init(Resin.java)
       at com.caucho.server.resin.Resin.main(Resin.java:625)
       Caused by: java.lang.reflect.InvocationTargetException
       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:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
       ... 26 more
       Caused by: java.lang.NoSuchMethodError: javax.ejb.Local.value()[Ljava/lang/Class;
       at org.jboss.ejb3.ProxyFactoryHelper.getLocalInterfaces(ProxyFactoryHelper.java:124)
       at org.jboss.ejb3.ProxyDeployer.initializeLocalBindingMetadata(ProxyDeployer.java:117)
       at org.jboss.ejb3.SessionContainer.instantiated(SessionContainer.java:71)
       at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:573)
       at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:555)
       at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:536)
       at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:508)
       at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:463)
       at org.jboss.ejb3.embedded.EJB3StandaloneDeployer.create(EJB3StandaloneDeployer.java:437)
       at org.jboss.seam.core.Ejb.startup(Ejb.java:55)
       ... 32 more
      


      It seems that ejb-30.jar that is located at resin/lib is not compatible with the one jboss libs want to use. If I delete the jar from resin/lib then class loading works pretty well and ejb-3 works. However this is a problem because I can't do the same at my hosting provider (the ejb-30.jar would be missing for everyone else).
      I was wandering whether there is anything possible to do from Seam side?

      Thanks in advance,

      Siarhei

        • 1. Re: Seam 1.1 on Resin
          gavin.king

          I probably could catch and swallow that exception (you could easily patch Seam to do this yourself, in fact), but is that really the best solution?

          So the problem is that Resin has an older or incorrect implementation of the EJB3 API. It's best to get the Resin guys to fix that, I suppose.

          Anyway, if you really want me to patch Seam, I'll do it, let me know.

          • 2. Re: Seam 1.1 on Resin

            It would be great if you could patch it for me!

            But I will raise the issue on resin site anyway, the problem is that ejb-3 isn't getting much of priority there (that ejb-30.jar isn't changing for several versions.

            Thanks in advance!

            • 3. Re: Seam 1.1 on Resin

              I just tried to 'fake' the interface so that the reflection wouldn't complain but there are more interfaces that have the same problem. I am not sure now if it's worthy patching unpatchable (or almost equal to fixing ejb-3 on resin).

              • 4. Re: Seam 1.1 on Resin

                I have a little update:

                the ejb-30.jar is only javax.ejb.* and javax.persistence.* interfaces for ejb and persistence. Once I copied those from jboss seam the booking application which uses ejb-3 micro-container worked. It seems to be that for Resin it is enough to update the interfaces (I wish it was that simple though :S ). I still can;t figure out a way to override that jar file in case if I am not allow to 'mess' with resin/lib...

                • 5. Re: Seam 1.1 on Resin

                  Do you have to use EJB3 session bean components? If EJB3 is broken in Resin, chances are you are not using any EJB3-specific services anyway. :)

                  Would POJO components + JPA sufficient for you? I think Seam POJO apps such as the "jpa" and "hibernate2" examples should run in resin.

                  • 6. Re: Seam 1.1 on Resin

                    Yes hibernate example works fine, I just wanted to use entity manager from ejb-3 which is somewhat simpler to use than hibernate... I guess the world isn't as perfect as we all want :)

                    • 7. Re: Seam 1.1 on Resin

                      I just tried the jpa example and it works wonders, I guess the problem isn't as critical anymore :) I raised an issue at Resin anyway. Hopefully things will get better!

                      • 8. Re: Seam 1.1 on Resin

                        Just an update: According to the bugtracker the Resin team has fixed the issue and updated the interfaces. The fix should be included in Resin 3.1.0. In the meanwhile it is possible to use a Resin API to override classloader priorities to load up-to-date interfaces from the micro-container or simply replace interfaces in resin/lib (if permissions allow).