码迷,mamicode.com
首页 > 移动开发 > 详细

tomcat加载war包报错:/wls/systems/bbc-kit/apps/bbc-kit.war!/com/bbc-kit/entities/DocFile.class not found且路径中多一个!号

时间:2017-06-08 01:33:02      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:ble   重启   打包   pac   shm   not found   sql   invalid   hashmap   

尝试用springmvc,mybatis,mysql做个工具平台。

在本地mac笔记本上运行正常,但把包放置到服务器上,启动tomcat就报错。类找不到了。

文件目录:

实现需求:上传文档并记录在数据库中。自建了DocFile类。创建对应的mapper文件写sql语句。

mapper.xml中namespace是指向DocFileDao。

<mapper namespace="com.bbc_kit.operation.dao.DocFileDao">
<!-- namespace 需要和dao层的"包名+接口名"一致 -->
    <resultMap type="com.bbc_kit.operation.entities.DocFile" id="DocFileResult">
        <id property="docFileId" column="docFileId" jdbcType="VARCHAR"/>
        <result property="docFileType" column="docFileType" jdbcType="VARCHAR"/>
        <result property="docFileName" column="docFileName" jdbcType="VARCHAR"/>
        <result property="docFilePath" column="docFilePath" jdbcType="VARCHAR"/>
        <result property="created_by" column="created_by" jdbcType="VARCHAR"/>
        <result property="date_created" column="date_created" jdbcType="DATE"/>
        <result property="updated_by" column="updated_by" jdbcType="VARCHAR"/>
        <result property="date_updated" column="date_updated" jdbcType="DATE"/>
        <result property="valiable" column="valiable" jdbcType="VARCHAR"/>
    </resultMap>

    <select id="queryOptDocFile" parameterType="HashMap" resultMap="DocFileResult">
        select * from t_docfile where docFileType=#{docFileType}  and valiable=‘Y‘
    </select>

    <update id="updateInvalidDocFile" parameterType="String" >
        update t_docfile set valiable=‘N‘ where docFileId=#{docFileId}
    </update>

    <select id="getDocFile" parameterType="String" resultType="DocFile">
        select * from t_docfile where  docFileId=#{docFileId}
    </select>

 

但启动后就莫名其妙报找不到这个DocFile类。且提示的路径中war包后面多了一个感叹号。

后来发现是自己在mapper文件的类引用上大意了,没有把完整的包路径加上

<select id="getDocFile" parameterType="String" resultType="DocFile">
        select * from t_docfile where  docFileId=#{docFileId}
    </select>

改为

<select id="getDocFile" parameterType="String" resultType="com.bbc_kit.operation.entities.DocFile">
        select * from t_docfile where  docFileId=#{docFileId}
    </select>

再打包上传重启就正常了。本地环境不报错是环境内部的一些配置混乱了,没有显现出来。

tomcat加载war包报错:/wls/systems/bbc-kit/apps/bbc-kit.war!/com/bbc-kit/entities/DocFile.class not found且路径中多一个!号

标签:ble   重启   打包   pac   shm   not found   sql   invalid   hashmap   

原文地址:http://www.cnblogs.com/llspark/p/6407816.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!