首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 服务器 > 其他服务器 >

jbpm4.4与ssh2调整老报错

2013-01-07 
jbpm4.4与ssh2整合老报错最近在学习jbpm4.4与ssh2整合的时候老是整合不成功,搞都很烦,在此请求各位大虾帮

jbpm4.4与ssh2整合老报错
最近在学习jbpm4.4与ssh2整合的时候老是整合不成功,搞都很烦,在此请求各位大虾帮助!!

我的ssh2框架分别是:struts2.2.3,spring 2.5,hibernate 3.3

项目整合的beans.xml(applicationContext.xml)文件如下:


<context:property-placeholder location="classpath:jdbc.properties"/>
 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${driverClassName}"/>
    <property name="url" value="${url}"/>
    <property name="username" value="${username}"/>
    <property name="password" value="${password}"/>
     <!-- 连接池启动时的初始值 -->
 <property name="initialSize" value="${initialSize}"/>
 <!-- 连接池的最大值 -->
 <property name="maxActive" value="${maxActive}"/>
 <!-- 最大空闲值.当经过一个高峰时间后,连接池可以慢慢将已经用不到的连接慢慢释放一部分,一直减少到maxIdle为止 -->
 <property name="maxIdle" value="${maxIdle}"/>
 <!--  最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请 -->
 <property name="minIdle" value="${minIdle}"/>
 </bean>


<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>



<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingLocations">
<list>
<value>classpath:jbpm.execution.hbm.xml</value>
<value>classpath:jbpm.history.hbm.xml</value>
<value>classpath:jbpm.identity.hbm.xml</value>
<value>classpath:jbpm.repository.hbm.xml</value>
<value>classpath:jbpm.task.hbm.xml</value>
    </list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
<prop key="hibernate.default_batch_fetch_size">10</prop>
<prop key="hibernate.max_fetch_depth">0</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>

<!--jbpm4.4工作流  -->
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper" lazy-init="default" autowire="default" dependency-check="default">
  <property name="jbpmCfg" value="spring-jbpm4.cfg.xml" />
</bean>
<bean id="processEngine" factory-bean="springHelper"  factory-method="createProcessEngine" />
 <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
    <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
    <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
    <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="txManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">


<property name="sessionFactory" ref="sessionFactory" />
</bean>

<tx:annotation-driven transaction-manager="txManager" />


<!--配置事务的传播特性-->
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="del*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>

<aop:config>
<aop:advisor pointcut="execution(* com.lsxy.*.*(..))" advice-ref="txAdvice"/>
</aop:config>

</beans>

spring-jbpm4.cfg.xml文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration>
 <process-engine-context>
     <string name="spring.cfg" value="spring-jbpm4.xml" />
   </process-engine-context>
 <import resource="jbpm.default.cfg.xml" />
 <import resource="jbpm.tx.spring.cfg.xml" />
 <import resource="jbpm.jpdl.cfg.xml" />
 <import resource="jbpm.bpmn.cfg.xml" />
 <import resource="jbpm.identity.cfg.xml" />
 <import resource="jbpm.businesscalendar.cfg.xml" />
 <import resource="jbpm.console.cfg.xml" />
 <!--  
 <import resource="jbpm.jobexecutor.cfg.xml" />
 -->
</jbpm-configuration>

web.xml文件如下:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>

</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
  
<!--   让工程找到spring的配置文件 -->
    <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:beans.xml
</param-value>
</context-param>


<!--   配置工程有spring的能力 -->
  <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

jar报截图如下
jbpm4.4与ssh2调整老报错
jbpm4.4与ssh2调整老报错

tomcat-6.0.32 下面的lib文件夹中的el-api.jar已经用juel-api.jar,juel-engine.jar,juel-impl.jar替换。
部署到tomcat-6.0.32中报如下错误:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: No bean class specified on bean definition
at org.springframework.beans.factory.support.AbstractBeanDefinition.getBeanClass(AbstractBeanDefinition.java:349)
at org.springframework.beans.factory.support.AbstractBeanDefinition.getResolvedAutowireMode(AbstractBeanDefinition.java:520)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:340)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:903)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:817)


at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1315)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2012-3-26 20:04:45 org.apache.catalina.core.StandardContext start
严重: Error listenerStart


将bean.xml文件中的
    <bean id="processEngine" factory-bean="springHelper"  factory-method="createProcessEngine" />
    <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
    <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
    <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
    <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
注释掉,项目就不会报错了。

请问各位大虾是怎么回事,是不是我什么地方的配置出问题了???

[解决办法]
  <bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />
  <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
  <bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
  <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
  <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />

没有在bean定义中指定bean的类
[解决办法]
应该有个class呀,
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"  clss = "xx.xx.xx"/>

[解决办法]
我就定了两个,其他的没定
    <bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper"/>
    <bean id="processEngine" factory-bean="springHelper"  factory-method="createProcessEngine" />

其他都可以通过processEngine得到,你把其他的删了,先试试吧
[解决办法]
<bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper" lazy-init="default" autowire="default" dependency-check="default">

dependency-check="default"把这个删了就行了

热点排行