2 Replies Latest reply on Feb 5, 2009 2:52 PM by pregnirit

    Deployment on Websphere 6.1 - problems and observations

    pregnirit

      Hi,


      I'm deploying my Seam POJO application to Websphere 6.1.0.21 with EJB3 enabled. I make all the settings described in the Websphere deployment guide (thanks, Jay!), still the following error appears:



      [2/3/09 9:59:55:787 CST] 00000021 WebApp        E   Exception caught while initializing context 
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: TestEntityManagerFactory
           at org.jboss.seam.Component.newInstance(Component.java:2096)
           at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
           at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
           at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:112)
           at org.jboss.seam.init.Initialization.init(Initialization.java:727)
           at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
           at com.ibm.ws.wswebcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:916)
           at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:354)
           at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:337)
           at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:92)
           at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
           at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:671)
           at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:624)
           at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:395)
           at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:611)
           at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1306)
           at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1165)
           at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:587)
           at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:832)
           at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:952)
           at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1502)
           at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4128)
           at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4226)
           at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:245)
           at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1507)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:618)
           at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:62)
           at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:618)
           at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:265)
           at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1089)
           at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:971)
           at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:231)
           at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:238)
           at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:833)
           at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:802)
           at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1082)
           at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
           at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:975)
           at com.ibm.ws.management.application.sync.StartDeploymentTask.startDeployment(StartDeploymentTask.java:196)
           at com.ibm.ws.management.application.sync.StartDeploymentTask.fullAppUpdate(StartDeploymentTask.java:92)
           at com.ibm.ws.management.application.sync.StartDeploymentTask.performTask(StartDeploymentTask.java:81)
           at com.ibm.ws.management.application.sync.AppBinaryProcessor$AppBinThread.run(AppBinaryProcessor.java:896)
           at com.ibm.ws.management.application.sync.AppBinaryProcessor.postProcess(AppBinaryProcessor.java:633)
           at com.ibm.ws.management.application.sync.AppBinaryProcessor._onChangeCompletion(AppBinaryProcessor.java:441)
           at com.ibm.ws.management.application.sync.AppBinaryProcessor$2.run(AppBinaryProcessor.java:413)
           at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
           at com.ibm.ws.management.application.sync.AppBinaryProcessor.onChangeCompletion(AppBinaryProcessor.java:400)
           at com.ibm.ws.management.repository.FileRepository.postNotify(FileRepository.java:1776)
           at com.ibm.ws.management.repository.FileRepository.update(FileRepository.java:1320)
           at com.ibm.ws.management.repository.client.LocalConfigRepositoryClient.update(LocalConfigRepositoryClient.java:189)
           at com.ibm.ws.sm.workspace.impl.WorkSpaceMasterRepositoryAdapter.update(WorkSpaceMasterRepositoryAdapter.java:637)
           at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.update(RepositoryContextImpl.java:1882)
           at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.synch(RepositoryContextImpl.java:1829)
           at com.ibm.ws.sm.workspace.impl.WorkSpaceImpl.synch(WorkSpaceImpl.java:479)
           at com.ibm.ws.console.core.action.SyncWorkSpaceAction.execute(SyncWorkSpaceAction.java:239)
           at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
           at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
           at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
           at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:510)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
           at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1097)
           at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1038)
           at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
           at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistence(WSCUrlFilter.java:792)
           at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:363)
           at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:229)
           at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
           at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
           at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
           at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:834)
           at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:682)
           at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:566)
           at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:486)
           at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3444)
           at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
           at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
           at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1466)
           at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
           at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
           at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
           at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
           at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)
           at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
           at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
           at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
           at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
           at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
           at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
           at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
           at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: Test] Unable to configure EntityManagerFactory
           at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
           at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
           at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
           at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:85)
           at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
           at java.lang.reflect.Method.invoke(Method.java:618)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:138)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2209)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2124)
           at org.jboss.seam.Component.newInstance(Component.java:2084)
           ... 95 more
      Caused by: org.hibernate.AnnotationException: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.apply(org.hibernate.mapping.PersistentClass)
           at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:374)
           at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
           at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
           at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
           at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
           at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
           at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
           ... 108 more
      Caused by: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.apply(org.hibernate.mapping.PersistentClass)
           at java.lang.Class.throwNoSuchMethodException(Class.java:274)
           at java.lang.Class.getParameterTypesSignature(Class.java:2045)
           at java.lang.Class.getMethod(Class.java:794)
           at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:365)
           ... 114 more



      The same error appears with the jpa example application as well, and reinstall or stopping/starting the application doesn't help. I have all the Hibernate jars packed (even listed them in the manifest class path and yet, the startup doesn't work correctly), the 'PARENTLAST' classloader setting verified.


      However, restarting the container resolves the problem, and then the application always runs correctly (so I guess, it's not a config issue).
      Just to make things look a bit more complicated, if both my app and the jpa example are deployed, even after a WAS restart only one of them will initialize correctly, the other one throws the error above, as if there was some sort of a race condition (classloading issue??)...


      So, I can confirm that Seam does run on WAS 6.1.0.21 (EJB3 enabled) - after a restart, but still this is not really a production ready resolution that the container needs to be restarted after every deploy (and 2 Seam apps cannot be deployed to the same container).


      Any ideas/help on the root cause?

        • 1. Re: Deployment on Websphere 6.1 - problems and observations
          jkronegg

          org.hibernate.validator.ClassValidator is in the hibernate-validator.jar, while its caller (org.hibernate.cfg.AnnotationConfiguration) is in hibernate-annotations.jar.


          You may have have incompatible versions between these two jars. I would download compatible versions from Hibernate web site.


          If this does not solve the problem, I would try to find the jars which contains these classes (jarscan does it very well, despite of its loozy text interface).

          • 2. Re: Deployment on Websphere 6.1 - problems and observations
            pregnirit

            Yes, I also suspected something like that, so I also tried it with Hibernate 3.3.1 and the other jars that are compatible with that version according to Hibernate's compatibility matrix. Still the same error.


            And after a WAS restart it works correctly! So I don't really think it's a Hibernate compatibility issue, otherwise it wouldn't work either after the container is restarted.


            I rather suspect something with how Websphere loads the Hibernate jars...I will check out jarscan, thanks