问题描述
试图让“Primefaces Showcase 自动完成”运行时我遇到了“CountryService.java”无法加载的问题。我从 (https://www.primefaces.org/showcase/ui/input/autoComplete.xhtml?jfwid=52f7c) 复制了它。看起来它是由“@Inject private CountryService countryService;”引起的无法正常运行。
在 autoCompleteView.java 中,我向 completeText 方法添加了一个打印行:
public List completeText(字符串查询){ System.out.println(thisClassName + ": completeText (1) - " + query + " / " + countryService);}
运行时显示:“AutoCompleteView: completeText (1) - ned / null”,表示“countryService”尚未初始化。会不会是 CDI 问题?我使用的是“tomee-8.0.6-webprofile”,根据文档应该支持 CDI!还是必须将 CDI2.0 单独安装到我的 Java 库列表中?
我尝试了以下的 @BalusC 解决方案:How to inject FacesContext with JSF 2.3 and TomEE?
也许我的安装中缺少某些东西? :
日食 18-12;
Apache Tomcat (TomEE)/9.0.41 (8.0.6);
JSF2.3;
myfaces2.3;
Primefaces 8.0;
有人可以帮我吗?非常感谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)