s1123547375 2020-10-19 09:34 采纳率: 0%
浏览 54

spring3+hibernate3+activiti5.1.6集成,自动部署bar后,使用restful方式访问流程出现问题

这几天搭建了spring3+hibernate3+activiti5.1.6的一个项目(用了咖啡猫部分开源项目内容),使用activiti部署流程(自动部署bar方式)之后,用restful方式访问获取流程列表的接口(repository/deployments),比正常返回参数少了url和tenantid。

-------------------------**我是分割线**--------------------------

我访问时候的返回参数:

图片说明

API手册上写的返回参数:

图片说明

配置代码如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:util="http://www.springframework.org/schema/util"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<context:property-placeholder ignore-unresolvable="true" local-override="true"
                                  location="config/application.properties"/>

    <util:properties id="APP_PROPERTIES" location="config/application.properties" local-override="true"/>

    <!-- 数据源配置, 使用DBCP数据库连接池 -->
    <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <!-- Connection Info -->
        <property name="driverClassName" value="${jdbc.driver}"/>
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.username}"/>
        <property name="password" value="${jdbc.password}"/>

        <!-- Connection Pooling Info -->
        <property name="maxActive" value="20"/>
        <property name="maxIdle" value="10"/>
        <property name="defaultAutoCommit" value="false"/>
        <!-- 连接Idle一个小时后超时 -->
        <property name="timeBetweenEvictionRunsMillis" value="3600000"/>
        <property name="minEvictableIdleTimeMillis" value="3600000"/>
    </bean>

    <!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 -->
    <context:component-scan base-package="me.kafeitu.demo.activiti">
        <!-- <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> -->
    </context:component-scan>


    <!-- 使用annotation定义事务 -->
    <tx:annotation-driven transaction-manager="transManager" proxy-target-class="true"/>

    <!-- 引擎内部提供的UUID生成器,依赖fastxml的java-uuid-generator模块 -->
    <bean id="uuidGenerator" class="org.activiti.engine.impl.persistence.StrongUuidGenerator" />



    <!-- 创建SessionFactory -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="packagesToScan">
            <list><value>me.kafeitu.demo.activiti.entity</value></list>
        </property>
        <!--  配置映射文件 -->
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                <prop key="hbm2ddl.auto">update</prop>  
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.format_sql">true</prop> 
            </props>
        </property>
    </bean>

    <!-- 1.配置事务管理器 -->
    <bean id="transManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"></property>
    </bean>

    <!--  配置基础的Dao,在其他的DAO中只需要继承即可 -->
    <!-- <bean id="baseDao" abstract="true" class="me.kafeitu.demo.activiti.base.BaseDao">
        <property name="sessionFactory" ref="sessionFactory"></property>
    </bean> -->

    <!-- spring负责创建流程引擎的配置文件 -->
    <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
        <!-- 数据源 -->
        <property name="dataSource" ref="dataSource" />
        <!-- 配置事务管理器,统一事务 -->
        <property name="transactionManager" ref="transManager" />
        <!-- 设置建表策略,如果没有表,自动创建表 -->
        <property name="databaseSchemaUpdate" value="true" />
        <!-- 自动部署 -->
        <property name="deploymentResources">
            <list>
                <value>config/leave-dynamic-from.bar</value>
                <value>config/dispatch.bar</value>
            </list>
        </property>
        <!-- 自定义表单字段类型 -->
        <property name="customFormTypes">
            <list>
                <bean class="me.kafeitu.demo.activiti.activiti.form.UsersFormType"/>
            </list>
        </property>
        <!-- 全局事件 -->
        <property name="typedEventListeners">
            <map>
                <entry key="VARIABLE_CREATED" >
                    <list>
                        <ref bean="variableCreateListener"/>
                    </list>
                </entry>
            </map>
        </property>
    </bean>

    <!-- 创建流程引擎对象 -->
    <bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
        <property name="processEngineConfiguration" ref="processEngineConfiguration" />
    </bean>

    <bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService"/>
    <bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService"/>
    <bean id="formService" factory-bean="processEngine" factory-method="getFormService"/>
    <bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService"/>
    <bean id="taskService" factory-bean="processEngine" factory-method="getTaskService"/>
    <bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService"/>
    <bean id="managementService" factory-bean="processEngine" factory-method="getManagementService"/>
    <!-- Activiti end -->

    <!-- <jaxws:endpoint id="leaveWebService" implementor="me.kafeitu.demo.activiti.webservice.LeaveWebServiceImpl" address="/leave"/> -->
</beans>
  • 写回答

1条回答 默认 最新

  • 夜郎king 2022博客之星IT其它领域TOP 12 2023-07-09 08:36
    关注

    查一下是不是版本导致的?

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置