在 Seam 2.3 中配置 Infinispan CacheProvider [英] Configuring Infinispan CacheProvider in Seam 2.3

查看:15
本文介绍了在 Seam 2.3 中配置 Infinispan CacheProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试迁移我的 Seam 2.3 应用程序以使用 Infinispan 在 JBoss AS7 中进行缓存.我查看了 Seam 2.3 发行版中的博客示例,并将 jGroupsConfig.xml 和 infinispan.xml 文件复制到我的 Web 应用程序的源路径中,并修改了我的 components.xml 以指定适当的缓存提供程序.但是,当我运行这样的东西时......

I am trying to migrate my Seam 2.3 application to use Infinispan for caching within JBoss AS7. I've looked at the Blog example within the Seam 2.3 distribution, and have copied the jGroupsConfig.xml and infinispan.xml files into my web application's source path and modified my components.xml to specify the appropriate cache provider. However, when I run something like this...

public class MyClass {

...

@In
CacheProvider cacheProvider;

...

public void myMethod() {
this.cacheProvider.get("abcd");
}

...

}

...我收到一条错误消息,提示无法启动 Infinispan 缓存.除了看起来解析器报告了 IOException 之外,没有其他错误.我只看到:

...I get an error saying the Infinispan cache cannot be started. There are no further errors, beyond what appears to be a parser reporting an IOException. All I see is:

com.ctc.wstx.exc.WstxIOException:  Stream closed

我已经启动了日志记录,但仍然没有看到任何有用的信息.我还需要做些什么才能让 Infinispan 缓存在我的应用程序中工作?我需要在 JBoss AS7 控制台中手动创建任何东西吗?我的缓存配置文件在我的 web 项目的源目录中.这是正确的位置吗?

I've cranked up the logging but still don't see anything useful. Is there anything further I need to do to get Infinispan caching working within my app? Do I need to manually create anything within the JBoss AS7 console? My cache config files are in my web project's source directory. Is that the correct location?

推荐答案

对于遇到此问题的其他人,我终于准备好了所有必要的部分.这是我必须做的...

For anyone else having this issue, I've finally gotten all of the necessary pieces in place. Here's what I had to do...

  1. 不要在您的 JBoss 部署结构文件中声明 Infinispan 模块.相反,使用属于 Seam 2.3 发行版的 JAR

  1. Do NOT declare the Infinispan module in your JBoss deployment structure file. Instead, use the JARs that are part of the Seam 2.3 distribution

WstxIOException 本身是因为它无法找到我的 infinispan.xml 配置文件.将它放在 Java 源目录中,使其成为类路径的直接部分,而不是在 META-INF 或 WEB-INF 目录中(除非您在 components.xml 文件中这样声明)

The WstxIOException itself is due to the fact that it was unable to locate my infinispan.xml configuration file. Place this in the Java source directory so it becomes a direct part of your classpath, not in your META-INF or WEB-INF directories (unless you declare it as such in your components.xml file)

确保您的 EAR 中有来自 Seam 2.3 发行版的所有 XML 解析 JAR(stax 等)

Make sure you have all of the XML parsing JARs (stax, etc.) from the Seam 2.3 distribution in your EAR

这篇关于在 Seam 2.3 中配置 Infinispan CacheProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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