关于Wildfly 8 Final的JSF 1.2 - weld-core-jsf仍在引用JSF 2.2 API [英] JSF 1.2 on Wildfly 8 Final - weld-core-jsf is still referencing JSF 2.2 API

查看:104
本文介绍了关于Wildfly 8 Final的JSF 1.2 - weld-core-jsf仍在引用JSF 2.2 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在将一个JSF-1.2应用程序迁移到Wildfly 8 Final并且陷入困境:(

I'm currently migrating a JSF-1.2 app to Wildfly 8 Final and am stuck :(

首先,我阅读了许多相关问题的帖子(例如 https://community.jboss.org/message/845006 将JSF 1.2 Seam应用程序迁移到WildFly Beta 1 ,但是建议的解决方案(不包括焊接子系统)对我不起作用。

First of all, I've read many post with related issues (e.g. https://community.jboss.org/message/845006 or Migrate JSF 1.2 Seam app to WildFly Beta 1) but the proposed solution (excluding the weld subsystem) doesn't work for me.

我做了什么:


  • 我遵循了多jsf功能教程这里并安装了JSF 1.2作为wildfly的模块(确切地说,3个模块)。

  • 接下来就是我为javax.faces.api和com添加了排除项.sun.jsf-impl(主插槽)以及1.2插槽的相应依赖项我的jboss-deployment-structure.xml用于我的战争。

  • 由于该应用程序使用的是Tomahawk和Tomahawk Sandbox,我也在用我的耳朵部署,我也排除了主插槽和包括这些部署的两个模块的1.2个插槽。

  • I followed the multi-jsf feature tutorial here and installed JSF 1.2 as a module for wildfly (to be exact, 3 modules).
  • The next was that I added exclusions for javax.faces.api and com.sun.jsf-impl (main slots) as well as the corresponding dependencies to the 1.2 slots to my jboss-deployment-structure.xml for my war.
  • Since the app is using Tomahawk and Tomahawk Sandbox which I am also deploying with my ear, I also excluded the main slots and included the 1.2 slots of both modules for these deployments.

我的问题:


  • 当我尝试调用部署的初始页面(login.xhthml)时,我收到以下错误,该错误是由模块'org引起的插槽1.2中的.jboss.as.jsf-injection'


ERROR [request] UT005023: Exception handling request to /backoffice/login.faces: java.lang.NoSuchMethodError: javax.faces.context.FacesContext.getAttributes()Ljava/util/Map;
     [exec]     at org.jboss.weld.jsf.ConversationAwareViewHandler.getActionURL(ConversationAwareViewHandler.java:103)
     [exec]     at javax.faces.application.ViewHandlerWrapper.getActionURL(ViewHandlerWrapper.java:147)
     [exec]     at com.sun.facelets.FaceletViewHandler.getActionURL(FaceletViewHandler.java:807)
     [exec]     at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlRenderer.getActionUrl(HtmlRenderer.java:77)
     [exec]     at org.apache.myfaces.custom.form.HtmlFormRenderer.getActionUrl(HtmlFormRenderer.java:45)
     [exec]     at org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlFormRendererBase.encodeBegin(HtmlFormRendererBase.java:102)
     [exec]     at org.apache.myfaces.custom.form.HtmlFormRenderer.encodeBegin(HtmlFormRenderer.java:134)
     [exec]     at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:816)
     [exec]     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:928)
     [exec]     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
     [exec]     at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594)
     [exec]     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
     [exec]     at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
     [exec]     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
     [exec]     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
     [exec]     at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
     [exec]     at com.jamonapi.JAMonFilter.doFilter(JAMonFilter.java:57)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:190)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at org.apache.myfaces.custom.conversation.ConversationServletFilter.doFilter(ConversationServletFilter.java:78)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at org.apache.myfaces.custom.requestParameterProvider.RequestParameterServletFilter.doFilter(RequestParameterServletFilter.java:66)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at de.voebzvd.indra.backoffice.webapp.AvoidCachingFilter.doFilter(AvoidCachingFilter.java:53)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at org.securityfilter.filter.SecurityFilter.doFilter(SecurityFilter.java:188)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at de.voebzvd.logging.BaseFilter.doFilter(BaseFilter.java:44)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at de.voebzvd.logging.NDCFilter.doFilter(NDCFilter.java:50)
     [exec]     at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:56)
     [exec]     at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
     [exec]     at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
     [exec]     at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
     [exec]     at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
     [exec]     at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
     [exec]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
     [exec]     at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
     [exec]     at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
     [exec]     at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
     [exec]     at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
     [exec]     at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
     [exec]     at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
     [exec]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
     [exec]     at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
     [exec]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
     [exec]     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
     [exec]     at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
     [exec]     at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
     [exec]     at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
     [exec]     at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
     [exec]     at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
     [exec]     at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
     [exec]     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
     [exec]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
     [exec]     at java.lang.Thread.run(Thread.java:744)

错误是由jar weld-core-jsf中包含的ConversationAwareViewHandler引起的模块org.jboss.as.jsf-injection中的-2.1.2.Final.jar,我也安装了JSF 1.2模块。这个类仍然引用JSF 2.2 API并相应地失败。

The error is caused by the ConversationAwareViewHandler which is contained in the jar weld-core-jsf-2.1.2.Final.jar in module org.jboss.as.jsf-injection which I also installed with the JSF 1.2 modules. This Class still references JSF 2.2 API and fails accordingly.

从战斧中排除焊接子系统,我的战争也没有用。我试过这个:

Excluding the weld subsystem from tomahawk and my war did also not work. I tried this:

<sub-deployment name="myfaces-tomahawk-core.jar">
  <exclude-subsystems>
    <subsystem name="weld" />
  </exclude-subsystems>
  <exclusions>
    <module name="javax.faces.api" slot="main" />
    <module name="com.sun.jsf-impl" slot="main" />
  </exclusions>
  <dependencies>
    <module name="com.sun.jsf-impl" slot="1.2" />
    <module name="javax.faces.api" slot="1.2" />
    <module name="org.apache.commons.beanutils" />
    <module name="org.apache.commons.lang" />
    <module name="org.apache.commons.logging" />
  </dependencies>
</sub-deployment>
<sub-deployment name="myfaces-tomahawk-sandbox.jar">
  <exclude-subsystems>
    <subsystem name="weld" />
  </exclude-subsystems>
  <exclusions>
    <module name="javax.faces.api" slot="main" />
    <module name="com.sun.jsf-impl" slot="main" />
  </exclusions>
  <dependencies>
    <module name="com.sun.jsf-impl" slot="1.2" />
    <module name="javax.faces.api" slot="1.2" />
    <module name="org.apache.commons.beanutils" />
    <module name="org.apache.commons.collections" />
    <module name="org.apache.commons.lang" />
    <module name="org.apache.commons.logging" />
  </dependencies>
</sub-deployment>
<sub-deployment name="backoffice.war">
  <exclude-subsystems>
    <subsystem name="weld" />
  </exclude-subsystems>
  <exclusions>
    <module name="javax.faces.api" slot="main" />
    <module name="com.sun.jsf-impl" slot="main" />
  </exclusions>
  <dependencies>
    <module name="com.sun.jsf-impl" slot="1.2" />
    <module name="javax.faces.api" slot="1.2" />
    <module name="net.sourceforge.jamonapi" />
    <module name="org.apache.commons.beanutils" />
    <module name="org.apache.commons.codec" />
    <module name="org.apache.commons.lang" />
    <module name="org.apache.commons.logging" />
  </dependencies>
</sub-deployment>

我还能做什么?

推荐答案

简而言之,这个问题是由焊接和JSF 1.2的不兼容引起的,在将来的版本中不会修复(参见这里)。

To make it short, this problem is caused by an incompatibility of weld and JSF 1.2 that won't be fixed in future releases (see here).

在我看来,有三种方法可供选择:

In my opinion there are three ways one can go:


  1. 升级您的应用程序代码以使用JSF 2.x.

  2. 在必要时排除焊接子系统(可能需要重新配置wildfly的default-cdi设置。)

  3. 适当地修补类 ConversationAwareViewHandler 以便在旧版本的情况下采取不同的行动JSF API。

  1. Upgrade your application code to work with JSF 2.x.
  2. Exclude the weld subsystem where necessary (will likely require reconfiguring the default-cdi settings of wildfly).
  3. Patch the class ConversationAwareViewHandler appropriately to act differently in case of the old JSF API.

对我来说,只有选项可以修补JSF注入模块,因为无法进行应用程序升级和选项2需要对申请进行更大规模的重组。

For me, there was only the option to patch the JSF-injection module since an application upgrade was not possible and option 2 would require a larger restructuring of the application.

这篇关于关于Wildfly 8 Final的JSF 1.2 - weld-core-jsf仍在引用JSF 2.2 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆