4 Replies Latest reply on Oct 9, 2011 9:47 AM by Robert Morse

    Seam Drools NPE

    Robert Morse Apprentice

      Well, I've decided to attempt migrating one of our Seam2 apps to Seam3.  Rather than trying to convert, I wanted to start with a known working Seam3 project, and gradually migrate our application to it.   So, I started with the jboss-javaee6-webapp architype, deployed it on JBoss AS7.0.2.Final using the jboss-as plugin, and got it to work.  Our existing applications rely heavily on Drools, so I wanted to see if that could be added.   I included the the following into the POM based on the Seam Drools page.






      <dependency>
           <groupId>org.jboss.seam.drools</groupId>
           <artifactId>seam-drools-api</artifactId>
           <version>3.0.0-SNAPSHOT</version>
      </dependency>
      <dependency>
              <groupId>org.jboss.seam.drools</groupId>
           <artifactId>seam-drools-impl</artifactId>
           <version>3.0.0-SNAPSHOT</version>
           <scope>runtime</scope>
      </dependency>
      


      Upon deployment, JBoss immediately complained about not finding Slf4j, so I added:




      <dependency>
           <groupId>org.slf4j</groupId>
           <artifactId>slf4j-api</artifactId>
           <version>1.6.2</version>
      </dependency>
      


      This got rid of the missing class exception, but I'm now encountering the following upon deployment:




      java.lang.NullPointerException
           at java.io.StringReader.<init>(StringReader.java:33)
           at org.jboss.seam.drools.bootstrap.DroolsExtension.initCEPAlerting(DroolsExtension.java:252)
           at org.jboss.seam.drools.bootstrap.DroolsExtension.afterBeanDiscovery(DroolsExtension.java:99)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
           at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
           at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
           at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
           at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
           at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
           at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
           at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
           at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
           at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:88)
           at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:52)
           at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:43)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:380)
           at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81)
           at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)
           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)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
           at java.lang.Thread.run(Thread.java:680)
      
      


      Any suggestions?  Are there any working examples of Seam Drools?




        • 1. Re: Seam Drools NPE
          Jason Porter Master

          If I'm not mistaken, they just had a beta or CR release of Drools which works correctly on AS7, however, you're best bet is to ask on their forms for AS7 support.

          • 2. Re: Seam Drools NPE
            Robert Morse Apprentice

            Hello Jason,
            According to Shane Bryzak,when I asked about Drools availability, he said:



            We need to update that page - Seam will not be providing a Drools module, rather the Drools team will be providing native CDI integration instead.


            And when I asked the Drools guys, Mark Proctor replied:






            We are waiting for seam 3.1 to be released (later this month). The seam
            people will then work on a namespace extensions to their DRL parser, so
            that we can align the spring and cdi xml. After we have aligned the XML
            document based configurations we will address annotations.

            We want to try and keep spring and seam aligned, so it's one step at a
            time. As soon as they sort out the XML, we'll do the rest our side asap.

            This is disappointing since Seam2 appears to have no life signs, and without a rules engine, there's not much we can do to move forward.  if there's a Seam marketing person....Fire them!


            • 3. Re: Seam Drools NPE
              Shane Bryzak Master

              There's nothing stopping you from using Drools in your application without CDI integration.  Seam Security uses it to implement rule-based permissions with no problems.

              • 4. Re: Seam Drools NPE
                Robert Morse Apprentice

                I will take a look at it.
                Thanks.