Presence of beans.xml triggers exception
hilco Mar 12, 2010 9:25 PMHi all,
I'm trying to follow the "Getting started with JSF" chapter of "Beginning JSF 2 APIs and JBoss Seam" (see http://www.apress.com/book/downloadfile/4406). I've installed JBoss 5.1 and Weld 1.0.1-Final. A basic page with <h:outputText value="..."> works nicely. I'm using Sun's JDK 1.5 on GNU/Linux.
The chapter then continues with a more dynamic approach. It introduces a bean ("foo") and the XHTML page now references <h:outputText value="#{foo.subject}">. However, as soon as I add an (empty) beans.xml I get an exception in JBoss when publishing the new WAR:
*** DEPLOYMENTS IN ERROR: Name -> Error
vfszip:/home/hilco/bin/jboss/jboss-5.1.0.GA/server/default/deploy/Hello.war/ -> org.jboss.deployers.spi.DeploymentException: Missing ValidatorFactory attachment in deployment: AbstractVFSDeploymentContext@765019{vfszip:/home/hilco/bin/jboss/jboss-5.1.0.GA/server/default/deploy/Hello.war/}
DEPLOYMENTS IN ERROR:
Deployment "vfszip:/home/hilco/bin/jboss/jboss-5.1.0.GA/server/default/deploy/Hello.war/" is in error due to the following reason(s): org.jboss.deployers.spi.DeploymentException: Missing ValidatorFactory attachment in deployment: AbstractVFSDeploymentContext@765019{vfszip:/home/hilco/bin/jboss/jboss-5.1.0.GA/server/default/deploy/Hello.war/}
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:146)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:170)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
at java.lang.Thread.run(Thread.java:595)
Removing beans.xml takes care of the exception (of course, #{foo.subject} no longer yields any text [strangely enough, there's no exception complaining about 'foo' not being known either, but that's a separate issue]).
How do I fix this "Missing ValidatorFactory attachment in deployment" problem?
Cheers,
Hilco