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

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

问题描述

我正在尝试迁移Seam 2.3应用程序,以使用Infinispan在JBoss AS7中进行缓存.我查看了Seam 2.3发行版中的Blog示例,并将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天全站免登陆