【问题标题】:IBM worklight 6.1 - Post Worklight server installation , appcenter throwing errorsIBM worklight 6.1 - 安装 Worklight 服务器后,appcenter 抛出错误
【发布时间】:2014-01-24 14:59:15
【问题描述】:

我已经在带有 derby 数据库的 WAS 85 完整版上安装了 Worklight server 6.1。安装后尝试访问应用中心时遇到错误。

 RequestProces E org.apache.wink.server.internal.RequestProcessor handleRequest An unhandled exception occurred which will be propagated to the container.
                             java.lang.RuntimeException: Unable to open data base.
at com.ibm.puremeap.util.DataUtil.getData(DataUtil.java:475)
at com.ibm.puremeap.services.BaseService.<init>(BaseService.java:55)
at com.ibm.puremeap.services.MobileServices.<init>(MobileServices.java:58)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:68)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:529) 



Caused by: javax.persistence.PersistenceException: Provider error. Provider: org.apache.openjpa.persistence.PersistenceProviderImpl
at javax.persistence.Persistence.createFactory(Persistence.java:175)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:111)
at com.ibm.puremeap.resources.data.impl.PureMeapData.<init>(PureMeapData.java:180)
at com.ibm.puremeap.resources.data.impl.PureMeapData.fromDataSource(PureMeapData.java:102)
at com.ibm.puremeap.resources.data.DataStoreFactory.getJPADBStore(DataStoreFactory.java:46)
at com.ibm.puremeap.resources.data.DataStoreFactory.getDataStore(DataStoreFactory.java:34)
at com.ibm.puremeap.util.DataUtil.getData(DataUtil.java:453)
... 78 more


Caused by: <openjpa-1.2.2-r422266:898935 nonfatal general error> org.apache.openjpa.util.GeneralException: org.xml.sax.SAXException: wsjar:file:/C:/IBML/WebSphere/PortalServer/wcm/prereq.wcm/wcm/shared/app/ilwwcm-domain-impl.jar!/META-INF/persistence.xml [Location: Line: 3, C: 121]: 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'.
at org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:379)
at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:318)
at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:295)
at org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:268)

最新的 worklight server+ websphere application server 85 是否有其他人面临同样的问题。

我可以访问 appcenter,但一切都变灰了。

【问题讨论】:

  • 尝试使用 DB2 安装 Worklight 服务器,但同样的错误。

标签: websphere ibm-mobilefirst worklight-server


【解决方案1】:

以下是调查摘要和一些可能有帮助的解决方法(已经尝试过)。

(A) Websphere Portal Classloader 策略设置:


Server Classloader Policy (WebspherePortal/server1) = Multiple
Server Classloader Mode = PARENT_LAST

Application (Worklight) Classloader Mode = PARENT_LAST
War Classloader (Worklight) Policy = Module
War Classloader (Worklignt) Mode = PARENT_LAST

WebsherePortal/WCM shared library is applied/associated at Server level.
Worklight Shared library is applied/associated to Worklight Console Application.

Since the shared library of Portal/WCM is mapped at the server level its visible to all the applications installed on the server. So in this case it is available to Worklight Console as well. Also, we have a worklight shared library mapped to worklight console ear and and hence the clash (For JPA related problem I feel that J2EE container automatically finds "META-INF/persistence.xml" which is the portal one).

(B) 可能的解决方法:


(1) 将 web-inf/lib 的 worklight j2ee jar 部分打包到 worklight 控制台 ear 中,以便加载 War 类加载器并覆盖门户共享库之一。

(2) 在 WebSphere_Portal 之外的单独服务器/配置文件上安装 Worklight 控制台。

(3) 由于问题与类路径中与 JPA 相关的 .xml 文件不正确有关。我们可以通过以下解决方法来解决这个问题。

Steps:

(a) Rename worklight-jee-library.jar\META-INF\persistence.xml to  worklight-jee-library.jar\META-INF\worklight-persistence.xml.

(b) Modify/Add property called "persistenceXmlLocation" in worklight-jee-library.jar\conf\spring-server-core.xml and worklight-jee-library.jar\conf\spring-server-reports.xml files to have "META-INF/worklight-persistence.xml" (or classpath:./META-INF/worklight-persistence.xml).

Note: This is modified so that persistence xml file is picked from within worklight-jee-library.jar.

(c) - optional step - In persistence.xml similar paths (in <mapping-file> tag) should be mentioned for orm.xml files (I believe there are more than one orm files there).

(d) orm.xml file can be removed from ilwwcm-eventlog-jpa.jar.

其他参考: http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14580282

确保您更正了问题标题。它应该是 Portal Server 而不是 Post 服务器。另外,我相信您正在尝试访问 Worklight 控制台。

【讨论】:

    猜你喜欢
    • 2014-05-20
    • 2014-03-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多