基于maven下spring+mybatis的javafx项目相关问题

# 基于maven下spring+mybatis的javafx项目相关问题

问题: Could not resolve resource location pattern

实际上是maven打包时没有将mapper下的xml包含进去

解决

>
      >
        >src/main/java>
        >
          >**/*.xml>
        >
        >true>
      >
    >

问题:Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone.

mysql6.0以上需要设置此参数

解决

jdbc:mysql://localhost:3306/testdb?characterEncoding=UTF-8&;serverTimezone=Asia/Shanghai

问题:NullPointerException: Location is required

描述:

FXMLLoader.load(getClass().getResource("TestController.fxml"));

解决:

  1. 更改为
FXMLLoader.load(getClass().getClassLoader().getResource("sample.fxml"));
  1. 使用了maven,在pom.xml中添加
    <resources>
      <resource>
        <directory>src/main/javadirectory>
        <includes>
          <include>**/*.fxmlinclude>
        includes>
        <filtering>truefiltering>
      resource>

问题:BindingException绑定异常

描述:在mapper中传递多个参数

可用参数类型为

arg1, arg0, param1, param2

解决

parameterType="kairongchen.util.DateBean"

设置了实体类,一目了然(也有其他方法,可以尝试)

你可能感兴趣的:(基于maven下spring+mybatis的javafx项目相关问题)