ssm遇到的问题

1、无法创建spring bean配置文件(spring Bean Definition)

        说明maven项目不是spring  需要在pom文件中导入spring的jar包

            Maven Repository中搜索spring bean

            <!-- https://mvnrepository.com/artifact/org.springframework/spring-beans -->
            <dependency>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-beans</artifactId>
                    <version>4.3.7.RELEASE</version>

                </dependency>



2、在xml中如果标签报错(例如;context:component-scan)一般是表头引入错误

3、mybatis逆向代码生成报错如下:

    Exception in thread "main" java.sql.SQLException: Column 'IS_GENERATEDCOLUMN' not found.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1146)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5609)
at org.mybatis.generator.internal.db.DatabaseIntrospector.getColumns(DatabaseIntrospector.java:619)
at org.mybatis.generator.internal.db.DatabaseIntrospector.introspectTables(DatabaseIntrospector.java:221)
at org.mybatis.generator.config.Context.introspectTables(Context.java:653)
at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:257)
at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:139)

at com.ssm.test.MBGTest.main(MBGTest.java:25)



        原因是jar包的问题,从maven中央仓库重新导入。



阅读更多

没有更多推荐了,返回首页