完全禁用Wildfly 8.2中的Weld JSF集成

时间:2015-06-12 14:56:52

标签: cdi jsf-2.2 wildfly weld seam2

我正在将Seam 2.3 Web应用程序迁移到EE7。目前,该应用程序在Wildfly 8.2上运行(包含所有依赖项的Bill of Materials版本)并且运行正常,但性能问题除外:页面需要几分钟才能加载,或者从不执行。

看来Weld / CDI相关。 WeldApplication被添加到faces应用程序链的某处,这会导致解决BeanManager的常量失败尝试,偶尔会出现一些线程锁定问题。

我尝试将焊接模块从wildfly中剥离出来,或者在启用焊接模块的情况下运行,但设置为require-bean-descriptor。我的项目不包含beans.xml。

是否可以阻止将WeldApplication添加到faces应用程序链?。至少直到我在迁移的一个阶段摆脱Seam。

解决方法:我目前的工作有点像黑客,但似乎可以解决问题。我已将自己的ApplicationFactory添加到faces-config.xml,这基本上绕过了WeldApplication。

@Override
public Application getApplication() {
    return new MyApplication( delegate.getWrapped().getApplication() );
}

编辑#1: 堆栈跟踪与性能问题热点,以提供一些上下文。


javax.naming.NameNotFoundException: BeanManager -- service jboss.naming.context.java.module.make.make.BeanManager

Exception 'javax.naming.NameNotFoundException' occurred in thread 'DefaultQuartzScheduler_Worker-1' at org.jboss.as.naming.InitialContext$DefaultInitialContext.findContext(InitialContext.java:187)
      at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:104)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)
      at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)
      at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
      at javax.naming.InitialContext.lookup(InitialContext.java:417)
      at javax.naming.InitialContext.lookup(InitialContext.java:417)
      at org.jboss.as.jsf.injection.weld.WeldApplication.beanManager(WeldApplication.java:105)
      - locked  (a org.jboss.as.jsf.injection.weld.WeldApplication)
      at org.jboss.as.jsf.injection.weld.WeldApplication.init(WeldApplication.java:63)
      at org.jboss.as.jsf.injection.weld.WeldApplication.delegate(WeldApplication.java:75)
      at org.jboss.as.jsf.injection.weld.ForwardingApplication.getResourceHandler(ForwardingApplication.java:262)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:640)
      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at nl.artefact.profiling.ProfilingFilter.doFilter(ProfilingFilter.java:30)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at nl.artefact.profiling.TimingFilter.doFilter(TimingFilter.java:35)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
      at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
      at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
      at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
      at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)
      at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
      at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)
      at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)
      at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
      at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
      at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)
      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)
      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)
      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)
      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)

1 个答案:

答案 0 :(得分:2)

我不确定这是否适用于Wildfly,但我在<deployment>的{​​{1}}块中使用以下代码段来禁用JBoss AS 7.2.0中的Weld

jboss-deployment-structure.xml