问题描述
我们开发了基于Seam 2的Java EE 5应用程序,它在Weblogic 11g上运行。
We developed a Seam 2 based Java EE 5 application and it runs on Weblogic 11g.
现在我尝试将相同的WAR文件部署到新的Weblogic 12c( 12.1.1.0在我的本地Windows 7机器上)按照与之前的WLS相同的步骤,包括部署所需的JSF 1.2库。
Now I tried to deploy the same WAR file to the new Weblogic 12c (12.1.1.0 on my local Windows 7 machine) by following the same steps as on the previous WLS, including the deployment of the required JSF 1.2 library.
部署和启动应用程序的工作正常,但是当我在浏览器中打开URL时,我收到500错误,日志文件显示以下异常:
The deployment and start of the application works fine, but when I open the URL in the browser, I get an 500 error and the logfile shows the following exception:
java.lang.UnsupportedOperationException
at javax.faces.application.Application.getResourceHandler(Application.java:287)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:588)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:242)
...
类Application中的相关操作属于JSF的2.0版本,我不明白为什么容器试图调用它,因为我说使用JSF 1.2。
The operation in question in class Application belongs to the 2.0 version of JSF, which I don't understand why the container tries to call it since I stated to use JSF 1.2.
任何想法导致问题的原因以及如何简单地将现有Java EE 5应用程序迁移到WLS 12 ?
Any ideas what causes the problem and how to simply migrate an existing Java EE 5 application to WLS 12?
编辑1/2/12 :由于没有答案,也许有点赏金会有帮助吗? ;-)不认真,是否有任何细节可以帮我解决这个问题?
Edit 1/2/12: Since there are no answers, maybe a little bounty would help? ;-) No seriously, are there any details I may be able to provide to help me out on that one?
编辑1/5/12 :与cj91请求相关 - 该项目不是基于Maven的,因此没有POM。但是这里是部署描述符weblogic.xml:
Edit 1/5/12: Related to cj91 request - the project is not Maven based, so there's no POM. But here's the deployment descriptor weblogic.xml:
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
<library-ref>
<library-name>jsf</library-name>
<specification-version>1.2</specification-version>
<implementation-version>1.2</implementation-version>
<exact-match>false</exact-match>
</library-ref>
</weblogic-web-app>
以下是ant build所采用的罐子列表:
And here's the list of jars taken by the ant build:
commons-digester.jar
jboss-seam-debug.jar
jboss-seam-excel.jar
jboss-seam-ioc.jar
jboss-seam-mail.jar
jboss-seam-pdf.jar
jboss-seam-rss.jar
jboss-seam-ui.jar
jsf-facelets.jar
jxl.jar
richfaces-impl.jar
richfaces-ui.jar
standard.jar
jstl.jar
jsf-api.jar
commons-collections-3.2.1.jar
commons-lang.jar
jboss-seam.jar
persistence-api.jar
jta.jar
jsf-impl.jar
darkX.jar
glassX.jar
laguana.jar
antlr-runtime.jar
commons-beanutils.jar
core.jar
drools-templates.jar
drools-decisiontables.jar
drools-compiler.jar
drools-api.jar
drools-core.jar
janino.jar
jboss-el.jar
jboss-seam-remoting.jar
jbpm-jpdl.jar
mvel2.jar
richfaces-api.jar
spiffy-with_source-all-0.05.jar
SuperCSV-1.52.jar
commons-logging.jar
dom4j.jar
javassist.jar
cglib.jar
antlr.jar
slf4j-api.jar
slf4j-log4j12.jar
hibernate-core.jar
hibernate-search.jar
hibernate-commons-annotations.jar
hibernate-annotations.jar
hibernate-entitymanager.jar
hibernate-validator.jar
jboss-common-core.jar
concurrent.jar
lucene-core.jar
gwt-servlet.jar
我确定其中有更多的罐子比不需要,但这就是设置它目前运行在WebLogic 10.3.5上。
I'm sure there are more jars in it than needed, but that's the setting in which it currently runs on a WebLogic 10.3.5.
我怀疑jsf和jstl jar是问题的根源,但是从战争中删除它们并没有改变任何事情。
I suspected the jsf and jstl jars to be the source of the problem, but deleting them from the war didn't change anything.
问题仍然是 - 为什么WLS 12试图从JSF 2.0执行某些事情?
The question is still - why does WLS 12 tries to execute something from JSF 2.0?
编辑1/6/12 :我设法解决原来的问题 - 仍然是应用程序运行不正常(对我来说这仍然很奇怪,si我没想到在更新到WLS的新版本时,必须在以前运行的应用程序中更改很多东西,但我在这里声明这个案例已经解决了。
Edit 1/6/12: I managed to solve the original problem - still the application is not running properly (and still this is strange for me, since I didn't expect that one has to change many things in a previously running application when updating to a new release of WLS), but I declare this case here as solved.
对于那些感兴趣的人,我做了 - 感谢答案的帮助和谷歌搜索这些东西:
For those interested, I did - thanks to the help of the answers and some googling these things:
将weblogic.xml更改为:
Change weblogic.xml to:
<?xml version='1.0' encoding='UTF-8'?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>
</container-descriptor>
<library-ref>
<library-name>jsf</library-name>
<specification-version>1.2</specification-version>
<implementation-version>1.2.9.0</implementation-version>
<exact-match>true</exact-match>
</library-ref>
</weblogic-web-app>
从WEB-INF / lib删除以下罐子:
Deleted the following jars from WEB-INF/lib:
jsf-impl.jar
jsf-api.jar
persistence-api.jar
jta.jar
jstl.jar
在faces-config.xml中更改视图处理程序(由于IllegalStateException,请参阅):
Within faces-config.xml change view handler to (due to IllegalStateException, see here):
<view-handler>org.ajax4jsf.application.AjaxViewHandler</view-handler>
在persistence.xml中将查询工厂类更改为(由于ClassNotFoundException:org.hibernate.hql.ast .HqlToken,请参阅)
Within persistence.xml change query factory class to (due to ClassNotFoundException: org.hibernate.hql.ast.HqlToken, see here)
<property name="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
推荐答案
你应该问问自己为什么升级到新版本容器没有升级你的应用程序如果答案是因为代码库太大并且您的旧容器工作正常,请不要管它。
You should ask yourself why you are upgrading to a newer container without upgrading your application. If the answer is "because the code base is too large" and your old container is working just fine, leave it alone.
但是,有两个可能的错误:
1)你的web-inf / lib中是否嵌入了任何jsf api jar?
2)你确定你设置1.2支持正确吗?如果你正在加载jsf2.0类,你可能需要使用一个特殊的类加载器,它首先读取1.2个罐子。
But, there are two likely errors:1) Do you have any jsf api jars embedded in your web-inf/lib?2) Are you sure you've setup 1.2 support correct? If you're loading jsf2.0 classes, you may need to use a special classloader that reads 1.2 jars first.
编辑:
至少,这些罐子应由您的容器提供,不应包含在您的WEB-INF / lib中:
At minimum, these jars should be provided by your container and should NOT be included in your WEB-INF/lib:
- jsf-impl.jar
- jsf-api.jar
- persistence-api.jar
我很确定这些也会导致问题:
I'm fairly certain these will also cause problems:
- jta.jar
- jstl。 jar
- jsf-facelets.jar
这篇关于将JSF-Application迁移到Weblogic 12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!