Spring-问题集锦1

is unrecognized or represents more than one time zone. You must configure either the server or JDBC

当采用SSM出现如此提示,或使用JDBC的时候出现如此提示

===解决方法:===
JDBC Connector 版本6.x版本和6.x以下版本链接URL不兼容,需要添加两个链接参数useLegacyDatetimeCode,serverTimezone
url=jdbc:mysql://localhost:3306/dazzle_meet?useLegacyDatetimeCode=false&serverTimezone=UTC

No converter found for return value of type: class java.lang.Boolean

出现类似如此的错误都是没有解析器所造成的

==解决方法== pom.xml添加依赖:

<dependency>
    <groupId>com.fasterxml.jackson.coregroupId>
    <artifactId>jackson-coreartifactId>
    <version>2.4.3version>
dependency>
<dependency>
    <groupId>com.fasterxml.jackson.coregroupId>
    <artifactId>jackson-databindartifactId>
    <version>2.4.3version>
dependency>

在spring配置中添加:

<mvc:annotation-driven>
     <mvc:message-converters>
            <bean class="org.springframework.http.converter.StringHttpMessageConverter"/>
            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
   mvc:message-converters>
mvc:annotation-driven>

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException:

字段编码不匹配,插入的数据编码和数据库的字段编码类型不一致导致

中文乱码

web.xml加入过滤器

<filter>
    <filter-name>characterEncodingFilterfilter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilterfilter-class>
    param>
        <param-name>encodingparam-name>
        <param-value>UTF-8param-value>
    param>
    param>
        <param-name>forceEncodingparam-name>
        <param-value>trueparam-value>
    param>
filter>
<filter-mapping>
    <filter-name>characterEncodingFilterfilter-name>
    /*
  

设置mvc不拦截静态资源


<mvc:annotation-driven />
<mvc:resources location="/html/" mapping="/html/**" />
<mvc:resources location="/js/" mapping="/js/**" />
<mvc:resources location="/css/" mapping="/css/**" />
<mvc:resources location="/images/" mapping="/images/**" />

HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement ‘mk.mtv.dao.UserDao.getUserList’. It’s likely that neither a Result Type nor a Result Map was specified.

当使用Spring+Mybatis结合使用的时候,出现这个异常

<select id="getUserList">
    select
        *
    from
        `user`
select>

==解决办法:== 根据异常提示可知,是由返回类型不确定导致,加上返回类型即可,如上,改为:====

Dynamic Web Module 3.0 requires Java 1.6 or newer.

==解决方法:==在pom.xml中添加插件

<plugin>
    <groupId>org.apache.maven.pluginsgroupId>
    <artifactId>maven-compiler-pluginartifactId>
    <configuration>
        <source>1.7source>
        <target>1.7target>
    configuration>
plugin>

然后再进行maven update project即可

error at ::0 formal unbound in pointcut 以及 error at ::0 can’t find referenced pointcut myMethod

(1)error at ::0 formal unbound in pointcut

==解决方法==:去掉函数通知函数中的参数,比如:将

    @Before("execution(public void com.bjsxt.dao.impl.UserDAOImpl.*(..))")
    public void beforeMethod(Method method){
       System.out.println("method before");
    }

==改为==

    @Before("execution(public void com.bjsxt.dao.impl.UserDAOImpl.*(..))")
    public void beforeMethod(){
       System.out.println("method before");
    }

The content of element type “web-app” must match “(icon?,display- name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet- mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env- ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)”. No grammar constraints (DTD or XML schema) detected for the document.

==解决方法==
- 1.严格按照提示上的顺序排列
- 2.删除

你可能感兴趣的:(bug集合)