org.apache.ibatis.exceptions.PersistenceException怎么解决?

调试一个开源项目出现报错,项目所有sql都会报空指针异常


严重: Servlet.service() for servlet [springMvc] in context with path [/mallapp] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.NullPointerException
### The error may exist in file [H:\WorksSpace\.metadata\.plugins\org.eclipse.wst.server.core\tmp2\wtpwebapps\mallapp\WEB-INF\classes\mybatis\category\CategoryMapper.xml]
### The error may involve CategoryMapper.listAll-Inline
### The error occurred while setting parameters
### SQL: select       category_name,    category_img,    sort,    category_id,   super_id      from        shop_category      where      super_id =?   order by sort
### Cause: java.lang.NullPointerException] with root cause
java.lang.NullPointerException
    at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:43)
    at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:81)
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:80)
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62)
    at com.sun.proxy.$Proxy84.parameterize(Unknown Source)
    at org.apache.ibatis.executor.ReuseExecutor.prepareStatement(ReuseExecutor.java:79)
    at org.apache.ibatis.executor.ReuseExecutor.doQuery(ReuseExecutor.java:56)
    at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
    at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96)
    at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
    at com.sun.proxy.$Proxy74.selectList(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:198)
    at com.yq.dao.DaoSupport.findForList(DaoSupport.java:118)
    at com.yq.service.category.impl.CategoryService.listAll(CategoryService.java:62)
    at com.yq.service.category.impl.CategoryService$$FastClassBySpringCGLIB$$51d95cd7.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:711)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:644)
    at com.yq.service.category.impl.CategoryService$$EnhancerBySpringCGLIB$$c2253a36.listAll(<generated>)
    at com.yq.controller.category.CategoryController.list(CategoryController.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:749)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:690)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:945)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

CategoryMapper.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="CategoryMapper">

    <!--表名 -->
    <sql id="tableName">
        shop_category
    </sql>

    <!-- 字段 -->
    <sql id="Field">
        category_name,  
        category_img,   
        sort,   
        category_id,
        super_id
    </sql>

    <!-- 字段值 -->
    <sql id="FieldValue">
        #{category_name},
        #{category_img},    
        #{sort},    
        #{category_id},
        #{super_id}
    </sql>

    <!-- 新增-->
    <insert id="save" parameterType="pd">
        insert into 
    <include refid="tableName"></include>
        (
    <include refid="Field"></include>
        ) values (
    <include refid="FieldValue"></include>
        )
    </insert>

    <!-- 删除-->
    <delete id="delete" parameterType="pd">
        delete from
        <include refid="tableName"></include>
        where 
            category_id = #{category_id}
    </delete>

    <!-- 修改 -->
    <update id="edit" parameterType="pd">
        update
        <include refid="tableName"></include>
        set 
            category_name = #{category_name},
            category_img = #{category_img},
            sort = #{sort}
        where 
        category_id = #{category_id}
    </update>

    <!-- 通过ID获取数据 -->
    <select id="findById" parameterType="pd" resultType="pd">
        select 
        <include refid="Field"></include>
        from 
        <include refid="tableName"></include>
        where 
        category_id = #{category_id}
    </select>

    <!-- 列表 -->
    <select id="datalistPage" parameterType="page" resultType="pd">
        select
        <include refid="Field"></include>
        from 
        <include refid="tableName"></include>
        where 1=1 
        and
        super_id =#{pd.super_id}
        order by sort
    </select>

    <!-- 列表(全部) -->
    <select id="listAll" parameterType="pd" resultType="pd">
        select
        <include refid="Field"></include>
        from 
        <include refid="tableName"></include>
        where

        super_id =#{super_id}
        order by sort
    </select>

    <!-- 批量删除 -->
    <delete id="deleteAll" parameterType="String">
        delete from
        <include refid="tableName"></include>
        where 
            category_id in
        <foreach item="item" index="index" collection="array" open="(" separator="," close=")">
                 #{item}
        </foreach>
    </delete>

</mapper>

mybatis-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD SQL Map Config 3.0//EN"  
    "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

    <settings> 
        <setting name="cacheEnabled" value="true" /><!-- 全局映射器启用缓存 -->   
        <setting name="useGeneratedKeys" value="true" /> 
        <setting name="defaultExecutorType" value="REUSE" /> 
        <!-- 打印查询语句 -->  
        <setting name="logImpl" value="LOG4J" />  

    </settings>

    <typeAliases>
        <typeAlias type="org.change.entity.system.User" alias="User"/>
        <typeAlias type="org.change.entity.system.Role" alias="Role"/>
        <typeAlias type="org.change.entity.system.Menu" alias="Menu"/>
        <typeAlias type="org.change.entity.system.Dictionaries" alias="Dictionaries"/>
        <typeAlias type="org.change.entity.system.Department" alias="Department"/>
        <typeAlias type="org.change.util.PageData" alias="pd"/>
        <!-- 分页 -->
        <typeAlias type="org.change.entity.Page" alias="Page"/>
    </typeAliases>

    <plugins>
        <plugin interceptor="org.change.plugin.PagePlugin">
            <property name="dialect" value="mysql"/>
            <property name="pageSqlId" value=".*listPage.*"/>
        </plugin>
    </plugins>

</configuration>

DAO.java

public interface DAO {

    /**
     * 保存对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object save(String str, Object obj) throws Exception;

    /**
     * 修改对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object update(String str, Object obj) throws Exception;

    /**
     * 删除对象 
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object delete(String str, Object obj) throws Exception;

    /**
     * 查找对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object findForObject(String str, Object obj) throws Exception;

    /**
     * 查找对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object findForList(String str, Object obj) throws Exception;

    /**
     * 查找对象封装成Map
     * @param s
     * @param obj
     * @return
     * @throws Exception
     */
    public Object findForMap(String sql, Object obj, String key , String value) throws Exception;

}

DaoSupport.java

@Repository("daoSupport")
public class DaoSupport implements DAO {

    @Resource(name = "sqlSessionTemplate")
    private SqlSessionTemplate sqlSessionTemplate;

    /**
     * 保存对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object save(String str, Object obj) throws Exception {
        return sqlSessionTemplate.insert(str, obj);
    }

    /**
     * 批量更新
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object batchSave(String str, List objs )throws Exception{
        return sqlSessionTemplate.insert(str, objs);
    }

    /**
     * 修改对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object update(String str, Object obj) throws Exception {
        return sqlSessionTemplate.update(str, obj);
    }

    /**
     * 批量更新
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public void batchUpdate(String str, List objs )throws Exception{
        SqlSessionFactory sqlSessionFactory = sqlSessionTemplate.getSqlSessionFactory();
        //批量执行器
        SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH,false);
        try{
            if(objs!=null){
                for(int i=0,size=objs.size();i<size;i++){
                    sqlSession.update(str, objs.get(i));
                }
                sqlSession.flushStatements();
                sqlSession.commit();
                sqlSession.clearCache();
            }
        }finally{
            sqlSession.close();
        }
    }

    /**
     * 批量更新
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object batchDelete(String str, List objs )throws Exception{
        return sqlSessionTemplate.delete(str, objs);
    }

    /**
     * 删除对象 
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object delete(String str, Object obj) throws Exception {
        return sqlSessionTemplate.delete(str, obj);
    }

    /**
     * 查找对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object findForObject(String str, Object obj) throws Exception {
        return sqlSessionTemplate.selectOne(str, obj);
    }

    /**
     * 查找对象
     * @param str
     * @param obj
     * @return
     * @throws Exception
     */
    public Object findForList(String str, Object obj) throws Exception {
        return sqlSessionTemplate.selectList(str, obj);
    }

    public Object findForMap(String str, Object obj, String key, String value) throws Exception {
        return sqlSessionTemplate.selectMap(str, obj, key);
    }

}

spring.xml

<?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:aop="http://www.springframework.org/schema/aop" 
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
                        http://www.springframework.org/schema/beans/spring-beans.xsd
                        http://www.springframework.org/schema/aop 
                        http://www.springframework.org/schema/aop/spring-aop.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
    ">



    <!-- 配置事务管理器 -->
    <bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">   
        <property name="dataSource" ref="dataSource"></property>
    </bean>

    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">  
        <property name="location" value="classpath:jdbc.properties"/>  
    </bean> 

    <!-- 阿里 druid数据库连接池 -->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" 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="filters" value="${filters}" />  
         <!-- 最大并发连接数 -->
         <property name="maxActive" value="${maxActive}" />
         <!-- 初始化连接数量 -->
         <property name="initialSize" value="${initialSize}" />
         <!-- 配置获取连接等待超时的时间 -->
         <property name="maxWait" value="${maxWait}" />
         <!-- 最小空闲连接数 -->
         <property name="minIdle" value="${minIdle}" />  
         <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
         <property name="timeBetweenEvictionRunsMillis" value="${timeBetweenEvictionRunsMillis}" />
         <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
         <property name="minEvictableIdleTimeMillis" value="${minEvictableIdleTimeMillis}" />  
         <property name="validationQuery" value="${validationQuery}" />  
         <property name="testWhileIdle" value="${testWhileIdle}" />  
         <property name="testOnBorrow" value="${testOnBorrow}" />  
         <property name="testOnReturn" value="${testOnReturn}" />  
         <property name="maxOpenPreparedStatements" value="${maxOpenPreparedStatements}" />
         <!-- 打开removeAbandoned功能 -->
         <property name="removeAbandoned" value="${removeAbandoned}" />
         <!-- 1800秒,也就是30分钟 -->
         <property name="removeAbandonedTimeout" value="${removeAbandonedTimeout}" />
         <!-- 关闭abanded连接时输出错误日志 -->   
         <property name="logAbandoned" value="${logAbandoned}" />
    </bean>  

    <!-- 启用注解 -->
    <context:annotation-config />

    <!-- 启动组件扫描,排除@Controller组件,该组件由SpringMVC配置文件扫描 -->
    <context:component-scan base-package="com">
        <context:exclude-filter type="annotation"
            expression="org.springframework.stereotype.Controller" />
    </context:component-scan>

    <!-- 注解方式配置事务-->
    <!-- <tx:annotation-driven transaction-manager="transactionManager" />   -->
    <!-- 拦截器方式配置事务 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="delete*" propagation="REQUIRED" read-only="false" 
                       rollback-for="java.lang.Exception"/>
            <tx:method name="insert*" propagation="REQUIRED" read-only="false" 
                       rollback-for="java.lang.Exception" />
            <tx:method name="update*" propagation="REQUIRED" read-only="false" 
                       rollback-for="java.lang.Exception" />
            <tx:method name="save*" propagation="REQUIRED" read-only="false" 
                       rollback-for="java.lang.Exception" />
            <tx:method name="*" propagation="SUPPORTS"/>            
        </tx:attributes>
    </tx:advice> 

    <aop:aspectj-autoproxy proxy-target-class="true"/>

    <!-- 事物处理 -->
    <aop:config>
        <aop:pointcut id="pc" expression="execution(* com.*.service..*(..))" />
        <aop:advisor pointcut-ref="pc" advice-ref="txAdvice" />
    </aop:config>

    <!-- 配置mybatis -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="configLocation" value="classpath:mybatis-config.xml"></property>
        <!-- mapper扫描 -->
        <property name="mapperLocations" value="classpath:mybatis/*/*.xml"></property>
    </bean>

    <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg ref="sqlSessionFactory" />
    </bean>


</beans>

2个回答

super_id 这个值为 null 吧 ; 在mybatis的配置文件中 添加一下

<setting name="jdbcTypeForNull" value="NULL"/>
``` ,
在 #{super_id} 中添加一个和表字段匹配的jdbcType 例如 #{super_id,jdbcType=VARCHAR} ; 如果用的是 对象.属性 的形式 , 要注意对象本身不能是 null

查询结果为空,导致的空指针异常

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
org.apache.ibatis.exceptions.PersistenceException:
org.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: java.sql.SQLSyntaxErrorException: ORA-00936: missing expressionrnrn### The error may involve com.nicklee.provider.mybatis.maps.test.SelectBS_XJFPByList-Inlinern### The error occurred while setting parametersrn### Cause: java.sql.SQLSyntaxErrorException: ORA-00936: missing expressionrnrn mSession = ServiceStatic.mSqlMapper.openSession();rn // 业务处理层,实现对应业务处理rn try rn rn //list = BS_XJFPControl.f_selectBS_XJFPByList(mSession, gp);rn HashMap mMap=new HashMap();rn mMap.put("ispage", "true");rn mMap.put("bindex", 0);rn mMap.put("eindex", 5);rn list =mSession.selectList("SelectBS_XJFPByList",mMap);rn rn // log4j日志记录器rn mLogger.info(mLogTitle + "查询BS_XJFP数据成功!");rn rn catch (Exception exp)rn rn // log4j日志记录器rn mLogger.error(mLogTitle + "查询BS_XJFP数据失败!" + exp.getMessage());rn rnrnrn selectrn rn a.现结发票号,rn a.船名,rn a.航次,rn a.箱号,rn a.金额,rn a.收款人,rn a.收款日期,rn a.备注,rn a.帐单编号,rn a.发票号,rn a.结算方式,rn a.发票代码,rn a.状态,rn a.开票日期,rn a.现结付款对象,rn rn from BS_XJFP arn rn 现结发票号 = #现结发票号,javaType=String,jdbcType=CHARrn rn
org.apache.ibatis.exceptions.PersistenceException
[code=java]Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: rn### Error building SqlSession.rn### The error may exist in SQL Mapper Configurationrn### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource pom.propertiesrn at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)rn at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:51)rn at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)rn at com.sp.service.impl.textfirst.main(textfirst.java:23)rnCaused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.io.IOException: Could not find resource pom.propertiesrn at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:105)rn at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:88)rn at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:49)rn ... 2 morernCaused by: java.io.IOException: Could not find resource pom.propertiesrn at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:104)rn at org.apache.ibatis.io.Resources.getResourceAsStream(Resources.java:91)rn at org.apache.ibatis.io.Resources.getResourceAsProperties(Resources.java:117)rn at org.apache.ibatis.builder.xml.XMLConfigBuilder.propertiesElement(XMLConfigBuilder.java:172)rn at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:94)rn ... 4 morern[/code]rnrn我在做用Mybatis操作postgersql数据库 不知道怎么错了
nested exception is org.apache.ibatis.exceptions.PersistenceException:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn### The error may exist in file [D:\singbonICCard\WebContent\WEB-INF\classes\com\singbon\mapping\SysUser.xml]rn### The error may involve com.singbon.dao.SysUserDAO.selectCashierListrn### The error occurred while executing a queryrn### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)rn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)rn at com.sun.proxy.$Proxy14.selectList(Unknown Source)rn at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:195)rn at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:124)rn at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:90)rn at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40)rn at com.sun.proxy.$Proxy41.selectCashierList(Unknown Source)rn at com.singbon.device.TerminalManager.sendToMonitor(TerminalManager.java:202)rn at com.singbon.service.monitor.MonitorService.excuteCommand(MonitorService.java:696)rn at com.singbon.service.monitor.PosTransferService.run(PosTransferService.java:102)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn### The error may exist in file [D:\singbonICCard\WebContent\WEB-INF\classes\com\singbon\mapping\SysUser.xml]rn### The error may involve com.singbon.dao.SysUserDAO.selectCashierListrn### The error occurred while executing a queryrn### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95)rn at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)rn ... 10 morernCaused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)rn at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:80)rn at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:66)rn at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:279)rn at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:69)rn at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56)rn at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)rn at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:141)rn at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)rn at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:101)rn ... 15 morernCaused by: java.sql.SQLException: interruptrn at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:809)rn at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:712)rn at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4530)rn at com.alibaba.druid.filter.stat.StatFilter.dataSource_getConnection(StatFilter.java:659)rn at com.alibaba.druid.filter.FilterChainImpl.dataSource_connect(FilterChainImpl.java:4526)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:694)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:686)rn at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:85)rn at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)rn at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)rn ... 25 morernCaused by: java.lang.InterruptedExceptionrn at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1219)rn at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:340)rn at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:806)rn ... 34 morernorg.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn### The error may exist in file [D:\singbonICCard\WebContent\WEB-INF\classes\com\singbon\mapping\SysUser.xml]rn### The error may involve com.singbon.dao.SysUserDAO.selectCashierListrn### The error occurred while executing a queryrn### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)rn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365)rn at com.sun.proxy.$Proxy14.selectList(Unknown Source)rn at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:195)rn at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:124)rn at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:90)rn at org.apache.ibatis.binding.Mapper[i][/i]Proxy.invoke(MapperProxy.java:40)rn at com.sun.proxy.$Proxy41.selectCashierList(Unknown Source)rn at com.singbon.device.TerminalManager.sendToMonitor(TerminalManager.java:202)rn at com.singbon.service.monitor.MonitorService.excuteCommand(MonitorService.java:696)rn at com.singbon.service.monitor.PosUdpService.run(PosUdpService.java:70)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn### The error may exist in file [D:\singbonICCard\WebContent\WEB-INF\classes\com\singbon\mapping\SysUser.xml]rn### The error may involve com.singbon.dao.SysUserDAO.selectCashierListrn### The error occurred while executing a queryrn### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: interruptrn at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:95)rn at sun.reflect.GeneratedMethodAccessor72.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)rn ... 10 more
第一个Mybatis DEMO就出错了org.apache.ibatis.exceptions.PersistenceException:
org.apache.ibatis.exceptions.PersistenceException: rn### Error building SqlSession.rn### Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.rn at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)rn at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:51)rn at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35)rn at com.jsy.test.Test.(Test.java:25)rnCaused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.rn at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:253)rn at org.apache.ibatis.parsing.XPathParser.(XPathParser.java:117)rn at org.apache.ibatis.builder.xml.XMLConfigBuilder.(XMLConfigBuilder.java:60)rn at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:48)rn ... 2 morernCaused by: org.xml.sax.SAXParseException: The reference to entity "characterEncoding" must end with the ';' delimiter.rn at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)rn at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)rn at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)rn at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1427)rn at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:881)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanAttribute(XMLDocumentFragmentScannerImpl.java:1547)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1320)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)rn at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)rn at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)rn at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)rn at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)rn at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)rn at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:251)rn ... 5 morernException in thread "main" java.lang.NullPointerExceptionrn at com.jsy.test.Test.main(Test.java:37)rn
怎么解决??
数据库怎么和SQL联接..
怎么解决???????????
比如在内存中创建一个800*600的24位位图rn颜色全为白色rn怎么创建?rnrn创建后,在ondraw里面怎么显示出来?rnrn点save 后,然后怎么寸成bmp文件呢?rnrnrn麻烦写一下这三个过程的代码好吗?真的很感谢!因为我要在创建后修改一些像素,所以想这样做。
怎么解决???
LINK : warning LNK4089: all references to "SHELL32.dll" discarded by /OPT:REF
Mouse 2118怎么解决呢,怎么解决
Problem DescriptionrnA greedy mouse cici ate rat poison by mistake. To save herself, she have to drink.rnrnrn![](http://acm.hdu.edu.cn/data/images/C96-1006-1.jpg)rnrnCici can only walk in four ways that marked in the photoes followed and only move in the region that colored blue..She expend energy every step.There are cheese in every position which cici can eat to gain energy once she is there.He will never reach the river if she run out of energy.The initially energy of cici is energy of the cheese at the coordinate (0,0).rnif when the mouse arrive a position has 0 energy , he can't eat the cheese.rnNow can you help the wretched monse to calculate whether can he get to the river.rnIf she can,calculate the minimun energy of the maximal energy of every possible position of the river(Y = N-1).rn rnrnInputrnThere are several test cases.In each case,there are three integers n(0
怎么解决?
java.lang.NoClassDefFoundError: HelloWorldrnrnException in thread "main"
怎么解决
[img=https://img-bbs.csdn.net/upload/201306/06/1370518313_271079.png][/img][img=https://img-bbs.csdn.net/upload/201306/06/1370518321_964386.png][/img][img=https://img-bbs.csdn.net/upload/201306/06/1370518331_123894.png][/img]
怎么解决????
<%rnProvider = "Provider=Microsoft.Jet.OLEDB.4.0;"rnPath = "Data Source=" & Server.MapPath("skwldb/db.mdb")rnSet conn= Server.CreateObject("ADODB.Connection")rnp1=Provider&Pathrnconn.Open P1rnrn%>rn<%rndim visiter 'visiter=访问人数rndim sql 'sqlrndim rsrnsql="select visiter from visiter"rnset rs=conn.execute(sql)rncount=rs("visiter")rnCountLen=len(count)rnfor i=1 to 6-countLenrn response.write ""rnnext rnrnfor i=1 to countlenrn response.write ""rnnext rnsql="update visiter set visiter=visiter+1"rnset rs=conn.execute(sql)rnconn.closernset conn=nothingrn%>rn/////////////rn<%rndb="skwldb/db.mdb"rnSet conn2 = Server.CreateObject("ADODB.Connection")rnconnstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")rnconn2.Open connstrrn%>rn<%sql2="select top 8 * from zhxw order by fbsj desc" rnset rs2=server.createobject("adodb.recordset") rnrs2.open sql2,conn,3 rnif rs2.eof then rnresponse.write "现在尚未有内容!"rnelse rnend ifrn%>rn.....rn<%rnwhile not rs2.eof %>rn.....rn<%=rs2("title")%> [<%=rs2("fbsj")%rn......rn<%rs2.movenext rnwend%>rn <%rs2.close%>rnrnrnrn 以上二个放在一个页面上出错提示rnADODB.Recordset 错误 '800a0e7d' rnrn应用程序要求对象操作,但此对象有一参数调用了一个已关闭的或无效的 Connection 对象。 rnrn怎么解决????
怎么解决??
我下载了www.cellsoft.cc的cell5.0试用版,在win2000和xp下使用正常,在win98下不能使用,请问cell这是何解?
怎么解决?
“VisualStudio.NET 无法创建或打开应用程序。问题很可能是因为本地Web服务器上没有安装所需的组件。请运行VisualStudio.NET安装程序并添加Web开发组件。”
org.apache.ibatis.exceptions.PersistenceException:报错处理,Mybatis入门案例(不使用三级分层开发)
首先声明,个人用的JDK9 ,使用的mybatis-3.27.jar  版本; JDK9 连接Mysql数据库,jdbc.properties的配置,需要经过cj 但是可能使用的mybatis版本和连接数据库依赖包版本较低,报错没有找到Cannot find class: com.mysql.jc.jdbc.Driver 修改driver,可以解决。 (PS;错误太低级了,害的从新敲了...
Windows漏洞怎么解决
刚下了个这<<Windows漏洞怎么解决>>动画,结果需要口令.我的8分啊.心不甘.用0D暴力破解了.随便输入什么口令都可以了.:)
ongl的使用方法及怎么解决
这是我个人在项目中遇到的问题的总结,经过我的加工得到的文档,希望对遇到同样问题的人有所帮助。
LINK错误怎么解决
我写了一个多项式的加法(严蔚敏那本教材上的)程序,出错了,怎么解决啊,请高手指点rn代码如下:rn[code=C/C++][/code]rnrn[color=#FF0000]LinkList.h[/color]rnrn#ifndef _LINKLIST_Hrn#define _LINKLIST_Hrnrn#include rn#include "Polynomial.h"rnrnusing namespace std;rnrn//#define LIST_INIT_SIZE 100rn//#define LISTINCREMENT 10rn#define OVERFLOW 1rnrn//#define ElemType intrn#define Status intrnrntypedef struct LNodernrn ElemType data;rn struct LNode *next;rnLNode,*LinkList;rnrntypedef LinkList polynomial;rnrn#endifrnrnrnrn[color=#FF0000]//LinkList.cpp[/color]rnrn#ifndef LINK_CPPrn#define LINK_CPPrnrn#include "LinkList.h"rnrnStatus CreateList(LinkList &L, int n) //逆位序输入数rnrn /*rn int i=0;rn LinkList p;rn L=(LinkList)malloc(sizeof(LNode)); //建空表rn L->next=NULL;rn rn for(i=n ; i > 0 ; --i)rn rn p=(LinkList)malloc(sizeof(LNode));rn scanf("%d",&p->data);rn p->next=L->next; //最后一个元素的指针域为NULLrn L->next=p;rn */rn int i=0; //顺位序输入数rn LinkList p ,q;rn L=q=(LinkList)malloc(sizeof(LNode)); //建空表rn q->next=NULL;rn for(i=n ; i > 0 ; --i)rn rn p=(LinkList)malloc(sizeof(LNode));rn scanf("%d,%d ",&p->data.coef,&p->data.expn);rn q->next=p;rn q=q->next;rn rn q->next=NULL;rn return 1;rnrnrnStatus GetElem(LinkList L,int i,ElemType &e)rnrn int j=1;rn LinkList p=NULL;rn p=L->next; //初始化,p指向第一个节点rn while(p && j < i)rn rn p=p->next;rn ++j;rn rn if(!p || j > i)return 0;rn e=p->data;rn return 1;rnrnrnStatus ListInsert(LinkList &L,int i,ElemType e)rnrn LinkList p=NULL, s=NULL;rn int j=0;rn p=L;rn while(p && j < i-1)rn rn p=p->next;rn ++j;rn rnrn if(!p || j > i-1) return 0;rnrn s=(LinkList)malloc(sizeof(LNode));rn s->data=e;rn s->next=p->next;rn p->next=s;rn return 1;rnrnrnStatus ListDelete(LinkList &L, int i, ElemType &e)rnrn LinkList p=NULL, q=NULL;rn int j=0;rn p=L;rn while(p->next && j < i-1)rn rn p=p->next;rn ++j;rn rnrn if(!(p->next) || j > i-1) return 0;rnrn q=p->next;rn p->next=q->next;rn e=q->data;rn free(q);rn return 1;rnrnrnStatus DestoryList(LinkList &L)rnrn LinkList p=NULL, q=L;rn while(q)rn rn p=q;rn free(p);rn q=q->next;rn rn return 1;rnrnrn/*rnvoid MergeList(LinkList &La, LinkList &Lb, LinkList &Lc)rnrn LinkList pa=NULL, pb=NULL, pc=NULL;rn pa=La->next;rn pb=Lb->next;rn Lc=pc=La;rn while(pa && pb)rn rn if(pa->data <= pb->data)rn rn pc->next=pa;rn pc=pa;rn pa=pa->next;rn rn elsern rn pc->next=pb;rn pc=pb;rn pb=pb->next;rn rn rn pc->next= pa ? pa : pb; //插入剩余段rn free(Lb);rnrn*/rnrnvoid ListTraverse(LinkList L)rnrn LinkList p=L->next;rn int i=0;rn while(p)rn rn cout<data.coef<<","<data.expn<<" ";rn i++; rn if(i%5 == 0) cout<next;rn rn cout<next;rn p=q->next;rn r=p->next;rn q->next=NULL;rn while(r)rn rn p->next=q;rn q=p;rn p=r;rn r=r->next;rn rn p->next=q;rn L->next=p;rnrnrnint ListLength(const LinkList L)rnrn int i=0;rn LinkList p=L->next;rn while(!p) //注意p最后为NULL,故i从0开始计数才算正确rn rn p=p->next; rn i++;rn rn return i;rnrnrn#endifrnrnrn[color=#FF0000]//Polynmial.h[/color]rnrn#ifndef _POLYNOMIAL_Hrn#define _POLYNOMIAL_Hrnrn#include rn//#include "LinkList.h"rnrnusing namespace std;rnrn#define Status intrn//#define ElemType intrnrntypedef struct rnrn float coef;rn int expn;rnterm, ElemType;rnrn//typedef structrn//rn// ElemType e;rn// struct LinkList p;rn//*polynomial;rnrn//typedef LinkList polynomial;rnrn#endifrnrnrn[color=#FF0000]//Polynomial.cpp[/color]rnrn#include "Polynomial.h"rn//#include "LinkList.h"rn#include "LinkList.cpp"rnrnvoid CreatPolyn(polynomial& p,int m)rnrn printf("Please enter the polynomial,coef:expn:\n");rn CreateList(p,m);rnrnrnvoid DestoryPolyn(polynomial p)rnrn DestoryList(p);rn printf("The polynomial has been destoryed!:\n");rnrnrnvoid PrintPolyn(polynomial p)rnrn printf("The polynomial is,coef:expn:\n");rn ListTraverse(p);rnrnrnint PolynLength(polynomial p)rnrn int l=0; rn l=ListLength(p);rn return l;rnrnrnpolynomial AddPolyn(polynomial &pa,polynomial &pb)rnrn polynomial pc=(polynomial)malloc(sizeof(LinkList));rn float coef=0;rn pc->next=NULL;rnrn while(pa&&pb)rn rn if(pa->data.expn==pb->data.expn)rn rn if(coef=(pa->data.coef+pb->data.coef))rn rn pc->next=(polynomial)malloc(sizeof(LinkList));rn pc=pc->next;rn pc->data.coef=coef;rn pc->data.expn=pa->data.expn;rn rn pa=pa->next;rn pb=pb->next;rn rn else if(pa->data.expndata.expn)rn rn pc->next=pa;rn pa=pa->next;rn rn elsern rn pc->next=pb;rn pb=pb->next;rn rn rnrn if(!pa&&pb)rn rn pc=pb;rn rnrn else if(!pb&&pa)rn rn pc=pa;rn rnrn elsern pc->next=NULL;rn return pc;rnrnrnrnrn[color=#FF0000]//main函数[/color]rnvoid main()rnrn polynomial p1,p2,p3;rn CreatPolyn(p1,5);rn CreatPolyn(p2,5);rn PrintPolyn(p1);rn p3=AddPolyn(p1,p2);rn PrintPolyn(p3);rn
这个怎么解决
Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
这个问题怎么解决?
rnrnrn rn 百度地图实现rn rn rnrnrn rn rn经度: rn纬度: rn rn 搜索: rn rn rnrnrnrnrnrn[color=#FF0000]问题出现在代码红色部分,程序总报出,对象不支持此对象和方法![/color]
远程桌面连接报错怎么解决
远程桌面连接rn---------------------------rn远程桌面由于以下原因之一无法连接到远程计算机:rnrn1) 未启用对服务器的远程访问rn2) 远程计算机已关闭rn3) 在网络上远程计算机不可用rnrn确保打开远程计算机、连接到网络并且启用远程访问。rn---------------------------rn确定 帮助 rn---------------------------rn
怎么解决跨站脚本攻击问题
我用的框架是 struts2 + spring + ibatis rn现在要编写个解决跨站脚本攻击的公共类,类似过滤器的存在。rnrn但不知从何入手, 请大大们 赐教。
怎么解决文字滚动问题?
怎么样可以使窗体的栏题栏中的文字,滚动显示?rn谢谢各位?
相关热词 c# 标准差 计算 c#siki第五季 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池