6 Replies Latest reply: Mar 27, 2012 5:36 AM by Christian Kaltepoth RSS

Seam Cron

Trevor Sweeney Newbie

I am trying to setup a project using seam cron. I am using the current snapshot which looks like should be compatible with solder 3.1.0-beta3.  However on deployment i get the following error.




16:51:49,604 ERROR [org.jboss.weld.Bootstrap] (MSC service thread 1-2) : java.lang.IllegalStateException: Singleton not set for ModuleClassLoader for Module "deployment.awrec.war:main" from Service Module Loader
     at org.jboss.as.weld.services.ModuleGroupSingletonProvider$TCCLSingleton.get(ModuleGroupSingletonProvider.java:73) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]
     at org.jboss.weld.context.AbstractSharedContext.getBeanStore(AbstractSharedContext.java:54) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:94) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:693) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:264) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.bootstrap.events.BeforeShutdownImpl.fire(BeforeShutdownImpl.java:62) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.bootstrap.events.BeforeShutdownImpl.fire(BeforeShutdownImpl.java:50) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.weld.bootstrap.WeldBootstrap.shutdown(WeldBootstrap.java:499) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]
     at org.jboss.as.weld.WeldContainer.stop(WeldContainer.java:102) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]
     at org.jboss.as.weld.services.WeldService.start(WeldService.java:92) [jboss-as-weld-7.0.2.Final.jar:7.0.2.Final]
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_20]
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_20]
     at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]

16:51:49,619 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."awrec.war".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."awrec.war".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Properties] with qualifiers [@Default] at injection point [[field] @Inject private org.jboss.seam.cron.spi.scheduling.CronSchedulingInstaller.schedProperties]
     at org.jboss.as.weld.services.WeldService.start(WeldService.java:96)
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_20]
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_20]
     at java.lang.Thread.run(Thread.java:619) [:1.6.0_20]
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Properties] with qualifiers [@Default] at injection point [[field] @Inject private org.jboss.seam.cron.spi.scheduling.CronSchedulingInstaller.schedProperties]
     at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:270)
     at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)
     at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:129)
     at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:351)
     at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:336)
     at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:404)
     at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)
     at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
     ... 5 more




Looking at the code the CronSchedulingInstaller is trying to inject a resource called properties of type java.lang.Properties.  Inside solder 3.1.0-Beta3 there is also a class called Properties. 


Here is my current dependancy list in my POM




<dependency>
  <groupId>org.jboss.solder</groupId>
  <artifactId>solder-api</artifactId>
  <version>3.1.0.Beta3</version>
</dependency>

 <dependency>
  <groupId>org.jboss.solder</groupId>
  <artifactId>solder-impl</artifactId>
  <version>3.1.0.Beta3</version>
</dependency>

<dependency>
  <groupId>org.jboss.seam.rest</groupId>
  <artifactId>seam-rest-api</artifactId>
  <version>3.1.0.Final</version>
</dependency>

 <dependency>
  <groupId>org.jboss.seam.rest</groupId>
  <artifactId>seam-rest</artifactId>
  <version>3.1.0.Final</version>
</dependency>

<dependency>
  <groupId>javax.enterprise</groupId>
  <artifactId>cdi-api</artifactId>
  <version>1.0-SP4</version>
</dependency>


<dependency>
  <groupId>org.jboss.solder</groupId>
  <artifactId>solder-logging</artifactId>
  <version>3.1.0.Beta3</version>
</dependency>

<dependency>
  <groupId>org.jboss.solder</groupId>
  <artifactId>solder-tooling</artifactId>
  <version>3.1.0.Beta3</version>
</dependency>

<dependency>
  <groupId>org.apache.velocity</groupId> 
  <artifactId>velocity</artifactId> 
  <version>1.7</version> 
  </dependency>
<dependency>
  <groupId>org.jboss.resteasy</groupId> 
  <artifactId>jaxrs-api</artifactId> 
  <version>2.3-beta-1</version> 
  </dependency>
<dependency>
  <groupId>org.apache.velocity</groupId> 
  <artifactId>velocity-tools</artifactId> 
  <version>2.0</version> 
  <exclusions>
  <exclusion>
  <groupId>dom4j</groupId> 
  <artifactId>dom4j</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>oro</groupId> 
  <artifactId>oro</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>sslext</groupId> 
  <artifactId>sslext</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>org.apache.struts</groupId> 
  <artifactId>struts-core</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>org.apache.struts</groupId> 
  <artifactId>struts-taglib</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>org.apache.struts</groupId> 
  <artifactId>struts-tiles</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>commons-beanutils</groupId> 
  <artifactId>commons-beanutils</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>commons-digester</groupId> 
  <artifactId>commons-digester</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>commons-chain</groupId> 
  <artifactId>commons-chain</artifactId> 
  </exclusion>
  <exclusion>
  <groupId>commons-validator</groupId> 
  <artifactId>commons-validator</artifactId> 
  </exclusion>
  </exclusions>
  </dependency>
 <dependency>
  <groupId>org.jboss.seam.cron</groupId>
  <artifactId>seam-cron-api</artifactId>
  <version>3.0.0-SNAPSHOT</version>
  <exclusions>
   <exclusion>
     <groupId>org.jboss.seam.solder</groupId>
    <artifactId>seam-solder</artifactId>
  </exclusion>
  </exclusions>
</dependency>

<dependency>
  <groupId>org.jboss.seam.cron</groupId>
  <artifactId>seam-cron-impl</artifactId>
  <version>3.0.0-SNAPSHOT</version>
  <exclusions>
   <exclusion>
     <groupId>org.jboss.seam.solder</groupId>
    <artifactId>seam-solder</artifactId>
  </exclusion>
  </exclusions>
</dependency>

<dependency>
  <groupId>org.jboss.seam.cron</groupId>
  <artifactId>seam-cron-spi</artifactId>
  <version>3.0.0-SNAPSHOT</version>
</dependency>

<dependency>
  <groupId>commons-collections</groupId>
  <artifactId>commons-collections</artifactId>
  <version>3.0</version>
</dependency>



any help would be greatly appreciated







  • 1. Re: Seam Cron
    Trevor Sweeney Newbie

    bueller.....bueller?

  • 2. Re: Seam Cron
    Bernard Labno Master

    Have you got cron.properties file in WEB-INF/classes?

  • 3. Re: Seam Cron
    Trevor Sweeney Newbie

    I didn't, however adding it had no affect on the problem

  • 4. Re: Seam Cron
    Trevor Sweeney Newbie

    Either my question is ridiculously trivial or there is no solution, either way can a seam cron person let me know how to move through this?

  • 5. Re: Seam Cron
    Sjikke Bats Newbie

    Hi,

     

    I have the same problem with seam 3.1.0 final in combination with seam cron 3.0.0.Alpha1 and jboss 7.1

     

    Any solution?

  • 6. Re: Seam Cron
    Christian Kaltepoth Newbie

    Hey all,

     

    I debugged this a bit and found out that Seam Cron 1.0.0.Alpha1 seems to be incompatible with Solder 3.1.0.Final. The Solder package names changed and therefore the qualifier used on CronSchedulingInstaller.schedProperties seems to be ignored.

     

    A quick and dirty workaround for this issue is to add the following producer to your project:

     

    public class SeamCronPropertiesProducer {
    
      @Produces
      public Properties getSeamCronProperties( InjectionPoint injectionPoint ) {
        Class<?> beanClass = injectionPoint.getBean().getBeanClass();
        if( "org.jboss.seam.cron.spi.scheduling.CronSchedulingInstaller".equals( beanClass.getName() ) ) {
          return new Properties();
        }
        return null;
      }
    
    }
    

     

    I hope this will help anyone!

     

    Christian