2 Replies Latest reply on Mar 14, 2010 1:49 AM by hilco

    Presence of beans.xml triggers exception

    hilco

      Hi 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

        • 1. Re: Presence of beans.xml triggers exception
          jaikiran

          Is that the complete exception stacktrace you see? If there is something more then please post it too. By the way, i am not sure AS 5.1.0 had enough support for Weld. Maybe you should try it against AS 6.0.0.M2

          • 2. Re: Presence of beans.xml triggers exception
            hilco

            Yeah, apparently the difference between WebBeans 1.0.0 alpha2 (which the book uses) and Weld 1.0.1 is quite significant. I now have to use JBoss 6.0 (and JDK1.6). A bit disappointing but at least, after changing the annotations (they're in completely different packages all of a sudden), it's working now.

             

            I guess, JSF 2.0 is really very, very cutting edge. :-)