11 Replies Latest reply on Dec 7, 2009 11:30 AM by Lars Rödiger

    NullPointerException while deploying  drools serviceunit into servicemx

    Amit Amit Newbie

      I have created service unit with maven archetype (mvn archetype:create -DarchetypeGroupId=org.apache.servicemix.tooling -DarchetypeArtifactId=servicemix-drools-service-unit -DgroupId=drools.first.example -DartifactId=drools-first-example)

       

      modified the drl file

      .......................

       

      package org.apache.servicemix.drools

       

      import org.apache.servicemix.drools.model.Exchange;

       

      global org.apache.servicemix.drools.model.JbiHelper jbi;

       

      rule "Unspecified id"

           when

                me : Exchange( status == Exchange.ACTIVE, $in : in != null )

           then     

       

                System.out.println("printing................");

      end

       

      and added it to service assembly.

       

      while deploying the SA into service mix(mvn jbi:projectDeploy) getting the following error.

       

       

      Caused by: javax.jbi.management.DeploymentException: <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-

      message">

              <component-name>servicemix-drools</component-name>

              <component-task-result-details>

                      <task-result-details>

                              <task-id>start</task-id>

                              <task-result>FAILED</task-result>

                              <message-type>ERROR</message-type>

                              <task-status-msg><msg-loc-info><loc-token/><loc-message>Unable to start service unit</loc-message></m

      sg-loc-info></task-status-msg>

                              <exception-info>

                                      <nesting-level>1</nesting-level>

                                      <msg-loc-info>

                                              <loc-token />

                                              <loc-message>java.lang.NullPointerException</loc-message>

                                              <stack-trace><![CDATA[javax.jbi.JBIException: java.lang.NullPointerException

              at org.apache.servicemix.drools.DroolsEndpoint.start(DroolsEndpoint.java:207)

              at org.apache.servicemix.common.DefaultServiceUnit.start(DefaultServiceUnit.java:78)

              at org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:155)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.start(ServiceUnitImpl.java:123)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.changeState(ServiceAssemblyImpl.java:298)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.transition(ServiceAssemblyImpl.java:274)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.init(ServiceAssemblyImpl.java:136)

              at org.apache.servicemix.jbi.deployer.impl.Deployer.registerServiceAssembly(Deployer.java:454)

              at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:97)

              at org.apache.servicemix.jbi.deployer.impl.DeploymentService.deploy(DeploymentService.java:95)

              at org.apache.servicemix.jbi.deployer.impl.AdminCommandsImpl.deployServiceAssembly(AdminCommandsImpl.java:179)

              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:585)

              at com.sun.jmx.mbeanserver.StandardMetaDataImpl.invoke(StandardMetaDataImpl.java:414)

              at javax.management.StandardMBean.invoke(StandardMBean.java:323)

              at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)

              at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)

              at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)

              at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)

              at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1410)

              at javax.management.remote.rmi.RMIConnectionImpl.access$100(RMIConnectionImpl.java:81)

              at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1247)

              at java.security.AccessController.doPrivileged(Native Method)

              at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1350)

              at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:784)

              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:585)

              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)

              at sun.rmi.transport.Transport$1.run(Transport.java:153)

              at java.security.AccessController.doPrivileged(Native Method)

              at sun.rmi.transport.Transport.serviceCall(Transport.java:149)

              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)

              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)

              at java.lang.Thread.run(Thread.java:595)

      Caused by: java.lang.NullPointerException

              at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:47)

              at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)

              at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)

              at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)

              at org.drools.compiler.RuleBaseLoader.loadFromReader(RuleBaseLoader.java:38)

              at org.apache.servicemix.drools.DroolsEndpoint.start(DroolsEndpoint.java:205)

              ... 37 more

      ]]]]><![CDATA[></stack-trace>

                                      </msg-loc-info>

                              </exception-info>

                      </task-result-details>

              </component-task-result-details>

      </component-task-result>

              at org.apache.servicemix.common.BaseServiceUnitManager.failure(BaseServiceUnitManager.java:292)

              at org.apache.servicemix.common.BaseServiceUnitManager.start(BaseServiceUnitManager.java:162)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceUnitImpl.start(ServiceUnitImpl.java:123)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.changeState(ServiceAssemblyImpl.java:298)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.transition(ServiceAssemblyImpl.java:274)

              at org.apache.servicemix.jbi.deployer.artifacts.ServiceAssemblyImpl.init(ServiceAssemblyImpl.java:136)

              at org.apache.servicemix.jbi.deployer.impl.Deployer.registerServiceAssembly(Deployer.java:454)

              at org.apache.servicemix.jbi.deployer.impl.ServiceAssemblyInstaller.install(ServiceAssemblyInstaller.java:97)

              ... 29 more

      ]]></stack-trace>

      </exception-info>

      </task-result-details>

      </frmwk-task-result-details>

      </frmwk-task-result>

      </jbi-task-result>

      </jbi-task>

       

      Edited by: amit.b.pal@gmail.com on Jun 12, 2009 1:04 PM

       

      Edited by: amit.b.pal@gmail.com on Jun 12, 2009 1:05 PM