在Glassfish上部署CDI时出错 [英] Error when deploying using CDI on Glassfish

查看:231
本文介绍了在Glassfish上部署CDI时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Glassfish上玩CDI,但没有太多。
当我在/ WebContent / META-INF中放入empyt beans.xml时,出现以下错误:


不能部署CDI_Example
模块的部署错误:CDI_Example:加载应用程序时发生异常:org.glassfish.deployment.common.DeploymentException:WELD-001201加载beans.xml URL错误:null


< blockquote>

Weld文档说该文件可能为空,但它看起来像Glassfish v3期望文件中的任何内容。



任何人有一个想法?



Thx

解决方案

意味着beans.xml应该是完全空的。
这意味着您不必指定任何内容,但至少应包含以下内容:

  <?xml version =1.0encoding =UTF-8?> 
< beans xmlns =http://java.sun.com/xml/ns/javaeexmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexsi:schemaLocation =http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd\">
< / beans>


I was playing around with CDI on Glassfish but did not get too far. As soon as I put an empyt beans.xml in /WebContent/META-INF I get the following error:

cannot Deploy CDI_Example Deployment Error for module: CDI_Example: Exception while loading the app : org.glassfish.deployment.common.DeploymentException: WELD-001201 Error loading beans.xml URL: null

The Weld documentation says the file may be empty but it looks like Glassfish v3 expects anything within the file.

Anybody got an idea?

Thx

解决方案

"Empty" does not mean that beans.xml should be completely empty. It means that you don't have to specify anything, but it should at least contain the following content:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>

这篇关于在Glassfish上部署CDI时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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