2011-12-06 38 views
0

我在GlassFish(ver.3)應用程序服務器中開發了一個JSF(2.1)應用程序(JavaEE5),其中包含primefaces(版本2.x)和Eclipse Link(ver 2 JPA 2.0)。現在我需要在WebLogic Server(10.x或11)中安裝應用程序。當我嘗試在Weblogics Web界面上安裝應用程序時,它顯示一條大錯誤消息 如何將我的應用程序從一臺應用程序服務器遷移到另一臺應用程序服務器?包括在項目將JSF 2.1應用程序從Glassfish 3遷移到Weblogic 10.x或11

錯誤消息開始像這樣

Message icon - Error Exception in AppMerge flows' progression 
Message icon - Error Exception in AppMerge flows' progression 
Message icon - Error Error loading the persistence descriptor WEB-INF/classes/META-INF/persistence.xml from the module Lee5.war. 
See the following stack trace for nested errors: 
    weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND D:\bea\user_projects\domains\base_domain\[email protected] 
    finder: [email protected] 
    annotation: \WEB-INF\classes\META-INF\persistence.xml:2:3:2:3: 
    problem: cvc-attribute.4: The value '2.0' does not equal the fixed value '1.0' of attribute 'version':<[email protected] 
    finder: [email protected] annotation: /WEB-INF/classes/META-INF/persistence.xml:2:3> 
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245) 
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231) 
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155) 
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:411) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759) 
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768) 
    at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptor(AbstractPersistenceUnitRegistry.java:177) 
    at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:101) 
+0

我沒有一個很好的答案,但它看起來像這個問題是圍繞WebLogic類加載器。 WebLogic與其他應用程序服務器一樣,都有自己的類加載器和它們的類加載器給予優惠待遇的內置庫包。從Tomcat遷移到JBoss時,我遇到了類似的問題,因爲JBoss 5類加載器正在加載其捆綁版本的JSF 1.2,而不是我在WEB-INF/lib中加載的JSF 2.0。 –

+0

嘗試在Tomcat 7上運行應用程序,因爲它沒有預先捆綁的庫,並且它的類加載器將首先在「WEB-INF/lib」中查找JAR文件。這將幫助您縮小問題範圍。如果它適用於Tomcat,那麼我們必須弄清楚WebLogic中正在加載哪個版本的JSF和JPA。 –

回答

0

你可以看看這個Eclipse的錯誤的LIB IDE的Netbeans 7.0 JSF 2.1 primefaces庫,非常接近您的問題,還請注意的WebLogic 10.3擁有的Java EE 5和Servlet 2.5和JSF 2.1 requires Servlets 3.0 \

你也可以看到這個題目,它指向的schemaLocation的類型不同:http://dev.eclipse.org/mhonarc/lists/eclipselink-users/msg05639.html

您應該仔細查看移植指南!

編輯:該郵件也可能會有所幫助:http://blog.eisele.net/2011/01/weblogic-10340-oepe-maven-primefaces.html

2
annotation: \WEB-INF\classes\META-INF\persistence.xml:2:3:2:3: 
problem: cvc-attribute.4: The value '2.0' does not equal the fixed value '1.0' of attribute 'version':<[email protected] 

這個特殊的問題造成的,因爲web應用程序中提供這是JPA 2.0編寫在WebLogic 10.3.x中只支持JPA 1.0 persistence.xml。您需要閱讀以下開發人員指南,瞭解如何讓JPA 2.0在Weblogic 10.3.x上運行:Running JPA 2.0 API on WebLogic 10.3

一旦你解決這個問題,你打不過作爲已經Spauny暗示一個新的問題:JSF 2.1,需要3.0的Servlet,這可以可以通過升級的Weblogic 10.3到Weblogic 11.解決您需要降級到JSF 2.0。 JSF 2.0在Weblogic 10.3.3和更新的版本中被支持。對於舊版本,我不確定如何升級它。另見Steps to deploy latest JSF version in weblogic 10.3