Topic
5 replies Latest Post - ‏2011-07-11T19:10:58Z by MaheshC
MaheshC
MaheshC
5 Posts
ACCEPTED ANSWER

Pinned topic WAS 7.0.0.0 (Spring 3.1 + Hibernate 3 + JPA 2.0)

‏2011-07-11T16:27:43Z |
I am trying to deploy my application on WAS 7.0 which is having Spring3.1,JPA2.0 and Hibernate-3, I am getting below error which was related to peristence_2.xsd missmatch, same issue I have resolved in Tomcat by adding the latest jar for spring,Hibernate and JPA, but I could not guess why this error is coming on WAS deployment.
Does the WAS configuration needs to be changed to get the latest XSD
Note: I have successfully created Shared Lib which is correctly pointing to my server and hence it is taking the customized persistence provider(in my case it is hibernate)

Can someone have any clues in this. Please let me know if you need more information on the same.

7/11/11 21:51:33:655 IST 00000017 SystemErr R com.ibm.ws.exception.RuntimeWarning: com.ibm.ws.metadata.MetaDataException: CWWJP0040E: The persistence.xml in application TESTAPP, module FATCAWS.war, has a syntax error at line number: 2, column number: 248.
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:185)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.jpa.management.JPAComponentImpl.startingDeployedModule(JPAComponentImpl.java:878)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.jpa.management.JPAComponentImpl.stateChanged(JPAComponentImpl.java:722)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl.stateChanged(ApplicationMgrImpl.java:1114)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectEvent(DeployedApplicationImpl.java:1296)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.DeployedModuleImpl.setState(DeployedModuleImpl.java:213)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:608)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:938)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:740)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1312)
7/11/11 21:51:33:655 IST 00000017 SystemErr R at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4279)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4367)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1317)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2089)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:437)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:122)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:380)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:644)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:613)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1215)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at java.lang.reflect.Method.invoke(Method.java:599)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:36)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at java.lang.reflect.Method.invoke(Method.java:599)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:243)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1085)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:966)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1313)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1206)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:239)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:564)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1384)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:104)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:852)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:785)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:325)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1070)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:273)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:319)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.isclite.container.controller.InformationController.processForwardConfig(InformationController.java:207)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1443)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1384)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistence(WSCUrlFilter.java:927)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:494)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:315)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:852)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:785)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:443)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:859)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
7/11/11 21:51:33:671 IST 00000017 SystemErr R Caused by: com.ibm.ws.metadata.MetaDataException: CWWJP0040E: The persistence.xml in application TESTAPP, module TESTAPP.war, has a syntax error at line number: 2, column number: 248.
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.jpa.management.JPAPxmlInfo.extractPersistenceUnits(JPAPxmlInfo.java:432)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.jpa.management.JPAScopeInfo.processPersistenceUnit(JPAScopeInfo.java:140)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.ibm.ws.jpa.management.JPAApplInfo.processModulePUs(JPAApplInfo.java:169)
7/11/11 21:51:33:671 IST 00000017 SystemErr R ... 96 more
7/11/11 21:51:33:671 IST 00000017 SystemErr R Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'persistence' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.xs.XMLSchemaValidator.processOneAttribute(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.jaxp.validation.ValidatorHandlerImpl.startElement(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.startElement(ValidatingUnmarshaller.java:85)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:113)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
7/11/11 21:51:33:671 IST 00000017 SystemErr R at
Updated on 2011-07-11T19:10:58Z at 2011-07-11T19:10:58Z by MaheshC
  • leealber
    leealber
    19 Posts
    ACCEPTED ANSWER

    Re: WAS 7.0.0.0 (Spring 3.1 + Hibernate 3 + JPA 2.0)

    ‏2011-07-11T17:00:23Z  in response to MaheshC
    MaheshC,

    • WAS 7 supports JPA 1.0 specification; to use JPA 2.0 in WAS, you will need to install JPA FeP over WAS 7.
    • JPA FeP will augment WAS 7 profile with enhanced support (2.0 xsd and parser) to parser persistence.xml properly in container-managed persistence configuration.
    • WAS 8 supports JPA 1 and 2 specifications right out from the box.

    From the exception message, it looks like WAS container is still using the JPA 1.0 parser to parse a 2.0 persistence.xml. In JSE configuration, the provider (Hibernate) is responsible to do the parsing but you will need to upgrade WAS to handle 2.0 specification in JEE configuration.

    Albert Lee.
    • MaheshC
      MaheshC
      5 Posts
      ACCEPTED ANSWER

      Re: WAS 7.0.0.0 (Spring 3.1 + Hibernate 3 + JPA 2.0)

      ‏2011-07-11T17:16:56Z  in response to leealber
      Hello leealber,

      Very thanks to your quick reply.
      I have some following questions
      1. This application is perfectly running on Tomcat , I was having same problem with tomcat too but when I took the latest jars from the Spring and Hibernate site(where they resolved some bugs in it) and same code was working very much fine.
      2. Where can I get the JPA FeP, is it a installable provided by IBM or open source one
      3. Is there any way we can achive this using some configuration as I got one link which shows that with JPA 2.0 we can deploy the application as I was going thru attached pdf from IBM

      One more question which is what are the things needed to change in my application if I want to use the WAS Persistence provider.

      Thanks for your help

      Regards,
      Mahesh Chintawar
      • MaheshC
        MaheshC
        5 Posts
        ACCEPTED ANSWER

        Re: WAS 7.0.0.0 (Spring 3.1 + Hibernate 3 + JPA 2.0)

        ‏2011-07-11T17:20:24Z  in response to MaheshC
        Also on some of the forums it is mentioned that we need to check if wsjpaversion.sh is setup properly or not,if anyone has faced such issues then please let me know the configuration required to do so.

        http://www.ibm.com/developerworks/forums/thread.jspa?threadID=354137&tstart=0#14558434

        Thanks
        MaheshC
      • leealber
        leealber
        19 Posts
        ACCEPTED ANSWER

        Re: WAS 7.0.0.0 (Spring 3.1 + Hibernate 3 + JPA 2.0)

        ‏2011-07-11T17:36:53Z  in response to MaheshC
        MaheshC,

        1. I assume you are using Hibernate/Spring in a non-container-managed-persistence configuration. Typically, web app using servlet/JSF are in this mode (e.g. use of @PersistenceUnit, Persistence.creatEntityManagerFactory() but not @PersistenceContext). This by-passes the container managed processing/semantics and it is up to the provider to perform JPA operations. Therefore you are using JPA successfully.
        2. JPA FeP are available from http://www-01.ibm.com/software/webservers/appserv/was/featurepacks/osgi/index.html#
        3. Once you have JPA FeP install, you can following Lisa's instruction to install Hibernate provider as the alternate provider.
        4. WAS persistence provider is the default provider in WAS 7 (JPA 1.0), JPA FeP and WAS 8 (JPA 2.0). No configuration is required in these installed releases. Or you can explicitly use the <provider> element in your persistence-unit definition in pesistence.xml.

        Albert Lee.
        • MaheshC
          MaheshC
          5 Posts
          ACCEPTED ANSWER

          Re: WAS 7.0.0.0 (Spring 3.1 + Hibernate 3 + JPA 2.0)

          ‏2011-07-11T19:10:58Z  in response to leealber
          Hello leealber,

          Thanks for your reply, this will definitely show me the way to deploy the changes in my application.