gpt4 book ai didi

jboss - 使用 Wildfly 10 配置 Ehcache

转载 作者:行者123 更新时间:2023-12-04 14:26:01 25 4
gpt4 key购买 nike

尝试在wildfly10中使用ehcache.xml实现ehcache

添加了 ehcache.jar 文件作为模块并添加了依赖项,如下所述:

   <resources>
<resource-root path="ehcache-1.2.2.jar"/>
</resources>

<dependencies>
<module name="org.apache.commons.logging"/>
<module name="org.apache.log4j"/>
<module name="javax.xml.parsers"/>
</dependencies>


</module>

当我尝试运行服务器 war 文件时出现以下错误。

Error configuring from d:\ehcache.xml. Initial cause was Error configuring from input stream. Initial cause was __redirected.__SAXParserFactory cannot be cast to javax.xml.parsers.SAXParserFactory

任何线索都会有所帮助。

堆栈跟踪:

  • net.sf.ehcache.CacheException: 配置错误
    d:\ehcache\ehcache.xml。最初的原因是配置错误
    输入流。最初的原因是 __redirected.__SAXParserFactory
    无法转换为 javax.xml.parsers.SAXParserFactory
    net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:80)net.sf.ehcache.CacheManager.parseConfiguration(CacheManager.java:752)net.sf.ehcache.CacheManager.init(CacheManager.java:386)
    net.sf.ehcache.CacheManager.(CacheManager.java:295)
    MySqlTest.ehcache(MySqlTest.java:93)
    MySqlTest.processRequest(MySqlTest.java:77)
    MySqlTest.doGet(MySqlTest.java:224)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)java.lang.Thread.run(Thread.java:745)

最佳答案

你好像用的是Ehcache 1,这个版本真的真的真的很老了。您至少应该升级到 Ehcache 2。最新的是 Ehcache 3。Ehcache 1 很可能与您当前的 Java 版本和 wildfly 依赖项不兼容。

关于jboss - 使用 Wildfly 10 配置 Ehcache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43886501/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com