<core:init debug="true" jndi-pattern="@jndiPattern@"/>, Seam creates the component.
<core:init debug="false" jndi-pattern="@jndiPattern@"/>, Seam does not create the component.
经过在网上查找发现了这句“This occurs because Seam uses hot deployment into the /WEB-INF/dev directory and hot deployment seems to be disabled when using the debug=false mode.”
在seam的官方文档中发现
You need to be aware of the following limitations:
-
components deployed via
components.xml
may not be hot-deployed -
the hot-deployable components will not be visible to any classes deployed outside of
WEB-INF/dev
-
Seam debug mode must be enabled and
jboss-seam-debug.jar
must be inWEB-INF/lib
-
You may see errors if the system is placed under any load and debug is enabled.
于是修改build.xml将dev更改为classes解决。
<property name="wa.dir" value="${war.web.dir}\dev\" /> 更改为 <property name="war.dir" value="${war.web.dir}\classes\" />