4 Replies Latest reply on Jul 25, 2009 7:30 AM by ainze

    java.lang.NullPointerException in CreateDeploymentQueryCmd.j

      Hello, i'm trying launch jBPM on tomcat 6.0 + spring + hibernate + blazeDS.

      I debugged programm and found that instanse of org.jbpm.pvm.internal.session.DbSession is missed. can any one tell why its happened?

      java.lang.NullPointerException
      at org.jbpm.pvm.internal.cmd.CreateDeploymentQueryCmd.execute(CreateDeploymentQueryCmd.java:38)
      at org.jbpm.pvm.internal.cmd.CreateDeploymentQueryCmd.execute(CreateDeploymentQueryCmd.java:33)
      at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
      at org.jbpm.pvm.internal.spring.CommandTransactionCallback.doInTransaction(CommandTransactionCallback.java:50)
      at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
      at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:79)
      at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
      at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
      at org.jbpm.pvm.internal.repository.RepositoryServiceImpl.createDeploymentQuery(RepositoryServiceImpl.java:88)
      at com.lorisit.jbpm.Test.getStartActivityNames(Test.java:45)
      at com.lorisit.jbpm.Test$$FastClassByCGLIB$$632a54d4.invoke()
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
      at com.lorisit.jbpm.Test$$EnhancerByCGLIB$$d55d736e.getStartActivityNames()
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
      at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
      at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
      at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
      at flex.messaging.endpoints.AbstractEndpoint$$FastClassByCGLIB$$1a3ef066.invoke()
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      at org.springframework.flex.core.MessageInterceptionAdvice.invoke(MessageInterceptionAdvice.java:59)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:126)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      at org.springframework.aop.framework.Cglib2AopProxy$FixedChainStaticTargetInterceptor.intercept(Cglib2AopProxy.java:582)
      at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$a5f80c55.serviceMessage()
      at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
      at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
      at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
      at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
      at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
      at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
      at flex.messaging.endpoints.AMFEndpoint$$EnhancerByCGLIB$$a5f80c55.service()
      at org.springframework.flex.servlet.MessageBrokerHandlerAdapter.handle(MessageBrokerHandlerAdapter.java:101)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
      at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)

        • 1. Re: java.lang.NullPointerException in CreateDeploymentQueryC
          shekharv

          Could you post your jbpm configuration?

          • 2. Re: java.lang.NullPointerException in CreateDeploymentQueryC

            jbpmCtx.xml

            <?xml version="1.0" encoding="UTF-8"?>
            <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:flex="http://www.springframework.org/schema/flex" xmlns:security="http://www.springframework.org/schema/security"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="
             http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
             http://www.springframework.org/schema/flex
             http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
             http://www.springframework.org/schema/security
             http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
             <bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
             <constructor-arg value="config/jbpm.cfg.xml" />
             </bean>
            
             <bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
             <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
             <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
             <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
            </beans>


            appCtx.xml

            <?xml version="1.0" encoding="UTF-8"?>
            <beans xmlns="http://www.springframework.org/schema/beans"
             xmlns:flex="http://www.springframework.org/schema/flex"
             xmlns:security="http://www.springframework.org/schema/security"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xmlns:tx="http://www.springframework.org/schema/tx"
             xsi:schemaLocation="
             http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
             http://www.springframework.org/schema/beans
             http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
             http://www.springframework.org/schema/flex
             http://www.springframework.org/schema/flex/spring-flex-1.0.xsd
             http://www.springframework.org/schema/security
             http://www.springframework.org/schema/security/spring-security-2.0.4.xsd">
             <bean id="propertyConfigurer"
             class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
             <property name="location" value="/WEB-INF/config/server.properties" />
             </bean>
             <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
             destroy-method="close">
             <property name="driverClass" value="${db.driver}" />
             <property name="jdbcUrl" value="${db.uri}" />
             <property name="properties">
             <props>
             <prop key="c3p0.acquire_increment">1</prop>
             <prop key="c3p0.idle_test_period">10</prop>
             <prop key="c3p0.timeout">120</prop>
             <prop key="c3p0.max_size">10</prop>
             <prop key="c3p0.min_size">1</prop>
             <prop key="c3p0.max_statements">10</prop>
             <prop key="c3p0.preferredTestQuery">select 1</prop>
             <prop key="user">${db.user}</prop>
             <prop key="password">${db.password}</prop>
             </props>
             </property>
             </bean>
            
             <bean id="sessionFactory"
             class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
             <property name="dataSource" ref="dataSource" />
             <property name="configLocation">
             <value>/WEB-INF/config/hibernate.cfg.xml</value>
             </property>
             <property name="configurationClass">
             <value>org.hibernate.cfg.AnnotationConfiguration</value>
             </property>
             <property name="hibernateProperties">
             <props>
             <prop key="hibernate.dialect">${db.hibernate.dialect}</prop>
             <prop key="hibernate.cache.use_query_cache">false</prop>
             <prop key="hibernate.cache.show_sql">false</prop>
             <prop key="hibernate.max_fetch_depth">4</prop>
             <prop key="hibernate.cache.use_second_level_cache">true</prop>
             <prop key="hibernate.hbm2ddl.auto">update</prop>
             <prop key="hibernate.format_sql">true</prop>
             <!-- stats -->
             <prop key="hibernate.generate_statistics">true</prop>
             <prop key="hibernate.cache.use_structured_entries">true</prop>
             </props>
             </property>
             </bean>
            
             <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
             <property name="sessionFactory" ref="sessionFactory" />
             <property name="dataSource" ref="dataSource" />
             </bean>
             <tx:annotation-driven transaction-manager="transactionManager"/>
            </beans>



            jbpm.cfg.xml

            <?xml version="1.0" encoding="UTF-8"?>
            <jbpm-configuration xmlns="http://jbpm.org/xsd/cfg">
             <process-engine-context>
            
             <repository-service />
             <repository-cache />
             <execution-service />
             <history-service />
             <management-service />
             <task-service />
             <identity-service />
             <command-service>
             <retry-interceptor />
             <environment-interceptor />
             <spring-transaction-interceptor current="true"/>
            
             <!--<spring-transaction-interceptor />-->
            
             </command-service>
            
             <hibernate-configuration>
             <cfg resource="jbpm.hibernate.cfg.xml" />
             </hibernate-configuration>
            
             <deployer-manager>
             <jpdl-deployer />
             </deployer-manager>
            
             <script-manager default-expression-language="juel"
             default-script-language="juel"
             read-contexts="execution, environment, process-engine"
             write-context="">
             <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
             </script-manager>
            
             <authentication />
            
             <job-executor auto-start="false" />
            
             <id-generator />
             <types resource="jbpm.variable.types.xml" />
            
             <business-calendar>
             <monday hours="9:00-12:00 and 12:30-17:00"/>
             <tuesday hours="9:00-12:00 and 12:30-17:00"/>
             <wednesday hours="9:00-12:00 and 12:30-17:00"/>
             <thursday hours="9:00-12:00 and 12:30-17:00"/>
             <friday hours="9:00-12:00 and 12:30-17:00"/>
             <holiday period="01/07/2008 - 31/08/2008"/>
             </business-calendar>
            
             </process-engine-context>
             <transaction-context>
             <repository-session />
             <message-session />
             <timer-session />
             <history-session />
             <transaction />
            
             <hibernate-session />
            
             <hibernate-session current="true" />
             <identity-session />
             </transaction-context>
            </jbpm-configuration>


            hibernate.cfg.xml
            <!DOCTYPE hibernate-configuration PUBLIC
             "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
             "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
            
            <hibernate-configuration>
             <session-factory>
             <mapping resource="jbpm.execution.hbm.xml"/>
             <mapping resource="jbpm.repository.hbm.xml"/>
             <!-- <mapping resource="jbpm.jpdl.hbm.xml"/> -->
             <mapping resource="jbpm.task.hbm.xml"/>
             <mapping resource="jbpm.history.hbm.xml"/>
             </session-factory>
            </hibernate-configuration>


            • 3. Re: java.lang.NullPointerException in CreateDeploymentQueryC

              i use jBPM 4.0

              • 4. Re: java.lang.NullPointerException in CreateDeploymentQueryC
                ainze

                Zajs,

                You are missing the <db-session /> in your transaction-context.

                Futhermore, you have a duplicate entry of <hibernate-session />

                KR,
                Andries