重写+ JBoss模块

时间:2015-01-29 20:49:23

标签: rewrite wildfly-8

Rewrite不适用于Wildfly 8.2上的多个 WAR。我使用JBoss Modules(jboss-deployment-structure.xml)导入Rewrite类(我的WEB-INF / lib为空)。

我必须通过配置web.xml来引导它,如下所述: http://www.ocpsoft.org/rewrite/docs/configuration/install

即使我使用的是Servlet 3.1,也没有使用EAR,因为META-INF / services中的注释@RewriteConfiguration和提供者注册文件被忽略。

这是我的jboss-deployment-structure.xml:

<jboss-deployment-structure>
  <deployment>
    <dependencies>
      <module name="org.ocpsoft.rewrite" meta-inf="export"/>
    </dependencies>
  </deployment>  
</jboss-deployment-structure>

请注意,如果jar位于WEB-INF / lib中,则Rewrite适用于多个WAR。但我想知道Rewrite或JBoss Modules内部的逻辑导致了这个问题。 AFAIK,每个WAR都有单独的类加载器:https://docs.jboss.org/author/display/WFLY8/Class+Loading+in+WildFly

这是一个例外:

15:25:08,154 ERROR [io.undertow.request](默认任务-2)UT005023:对/ sakila / ActorManagement的异常处理请求:java.lang.RuntimeException:实例化类 com时出错.test.RewriteConfigurationProvider         在org.ocpsoft.common.services.ServiceLoader.loadEnriched(ServiceLoader.java:342)[rewrite-servlet-2.0.9.Final.jar:2.0.9.Final]         在org.ocpsoft.common.services.ServiceLoader.loadClass(ServiceLoader.java:243)[rewrite-servlet-2.0.9.Final.jar:2.0.9.Final]         在org.ocpsoft.common.services.ServiceLoader.reload(ServiceLoader.java:158)[rewrite-servlet-2.0.9.Final.jar:2.0.9.Final]         在org.ocpsoft.common.services.ServiceLoader.iterator(ServiceLoader.java:394)[rewrite-servlet-2.0.9.Final.jar:2.0.9.Final]         在org.ocpsoft.common.util.Iterators.asList(Iterators.java:40)[rewrite-servlet-2.0.9.Final.jar:2.0.9.Final]         at org.ocpsoft.rewrite.servlet.RewriteFilter.init(RewriteFilter.java:131)[rewrite-servlet-2.0.9.Final.jar:2.0.9.Final]         at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         在org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:85)         at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:97)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:79)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.core.ManagedFilter.getFilter(ManagedFilter.java:65)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.FilterHandler $ FilterChainImpl.doFilter(FilterHandler.java:132)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.server.handlers.DisableCacheHandler.handleRequest(DisableCacheHandler.java:33)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         在org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.ServletInitialHandler.access $ 000(ServletInitialHandler.java:76)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.servlet.handlers.ServletInitialHandler $ 1.handleRequest(ServletInitialHandler.java:166)[undertow-servlet-1.1.0.Final.jar:1.1.0.Final]         在io.undertow.server.Connectors.executeRootHandler(Connectors.java:197)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         at io.undertow.server.HttpServerExchange $ 1.run(HttpServerExchange.java:759)[undertow-core-1.1.0.Final.jar:1.1.0.Final]         在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[rt.jar:1.8.0_20]         at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)[rt.jar:1.8.0_20]         在java.lang.Thread.run(Thread.java:745)[rt.jar:1.8.0_20] 引起:org.jboss.weld.exceptions.IllegalArgumentException:WELD-001408:类型为ApplicationSettings且带有限定符@Default的依赖项不满意   在注入点[BackedAnnotatedField] @Inject com.test.RewriteConfigurationProvider.applicationSettings   at com.test.RewriteConfigurationProvider.applicationSettings(RewriteConfigurationProvider.java:0)         at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:82)[weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]         在org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:70)[weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]         在org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1118)[weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]         at org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201)[weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]         在org.ocpsoft.rewrite.cdi.CdiServiceEnricher.enrich(CdiServiceEnricher.java:74)[rewrite-integration-cdi-2.0.9.Final.jar:2.0.9.Final]         在org.ocpsoft.common.services.ServiceLoader.loadEnriched(ServiceLoader.java:324)[rewrite-servlet-2.0.9.Final.jar:2.0.9.Final]         ......还有41个

0 个答案:

没有答案