Spring batch 抛出NoClassDefFoundError的示例项目:com/fasterxml/jackson/databind/ObjectMapper
我已经按照计划实施了这个项目 但我得到了: 创建名为“batchConfigurer”的bean时出错:调用init方法失败;嵌套的异常是java.lang.NoClassDefFoundError:com/fasterxml/jackson/databind/ObjectMapper 我是新来的Spring batch 抛出NoClassDefFoundError的示例项目:com/fasterxml/jackson/databind/ObjectMapper,spring-batch,Spring Batch,我已经按照计划实施了这个项目 但我得到了: 创建名为“batchConfigurer”的bean时出错:调用init方法失败;嵌套的异常是java.lang.NoClassDefFoundError:com/fasterxml/jackson/databind/ObjectMapper 我是新来的 任何人都可以提供帮助吗?以下各项工作正常: $>git clone https://github.com/spring-guides/gs-batch-processing.git $>c
任何人都可以提供帮助吗?以下各项工作正常:
$>git clone https://github.com/spring-guides/gs-batch-processing.git
$>cd gs-batch-processing/complete
$>./mvnw clean install
$>./mvnw spring-boot:run
输出如下:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.4.RELEASE)
2019-05-30 12:23:12.642 INFO 90644 --- [ main] hello.Application : Starting Application on localhost with PID 90644 (/private/tmp/gs-batch-processing/complete/target/classes started by mbenhassine in /private/tmp/gs-batch-processing/complete)
2019-05-30 12:23:12.646 INFO 90644 --- [ main] hello.Application : No active profile set, falling back to default profiles: default
2019-05-30 12:23:13.333 INFO 90644 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2019-05-30 12:23:13.338 WARN 90644 --- [ main] com.zaxxer.hikari.util.DriverDataSource : Registered driver with driverClassName=org.hsqldb.jdbcDriver was not found, trying direct instantiation.
2019-05-30 12:23:13.683 INFO 90644 --- [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Driver does not support get/set network timeout for connections. (feature not supported)
2019-05-30 12:23:13.687 INFO 90644 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2019-05-30 12:23:14.091 INFO 90644 --- [ main] o.s.b.c.r.s.JobRepositoryFactoryBean : No database type set, using meta data indicating: HSQL
2019-05-30 12:23:14.277 INFO 90644 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : No TaskExecutor has been set, defaulting to synchronous executor.
2019-05-30 12:23:14.437 INFO 90644 --- [ main] hello.Application : Started Application in 2.114 seconds (JVM running for 5.2)
2019-05-30 12:23:14.438 INFO 90644 --- [ main] o.s.b.a.b.JobLauncherCommandLineRunner : Running default command line with: []
2019-05-30 12:23:14.503 INFO 90644 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : Job: [FlowJob: [name=importUserJob]] launched with the following parameters: [{run.id=1}]
2019-05-30 12:23:14.530 INFO 90644 --- [ main] o.s.batch.core.job.SimpleStepHandler : Executing step: [step1]
2019-05-30 12:23:14.590 INFO 90644 --- [ main] hello.PersonItemProcessor : Converting (firstName: Jill, lastName: Doe) into (firstName: JILL, lastName: DOE)
2019-05-30 12:23:14.590 INFO 90644 --- [ main] hello.PersonItemProcessor : Converting (firstName: Joe, lastName: Doe) into (firstName: JOE, lastName: DOE)
2019-05-30 12:23:14.590 INFO 90644 --- [ main] hello.PersonItemProcessor : Converting (firstName: Justin, lastName: Doe) into (firstName: JUSTIN, lastName: DOE)
2019-05-30 12:23:14.590 INFO 90644 --- [ main] hello.PersonItemProcessor : Converting (firstName: Jane, lastName: Doe) into (firstName: JANE, lastName: DOE)
2019-05-30 12:23:14.590 INFO 90644 --- [ main] hello.PersonItemProcessor : Converting (firstName: John, lastName: Doe) into (firstName: JOHN, lastName: DOE)
2019-05-30 12:23:14.604 INFO 90644 --- [ main] hello.JobCompletionNotificationListener : !!! JOB FINISHED! Time to verify the results
2019-05-30 12:23:14.607 INFO 90644 --- [ main] hello.JobCompletionNotificationListener : Found <firstName: JILL, lastName: DOE> in the database.
2019-05-30 12:23:14.607 INFO 90644 --- [ main] hello.JobCompletionNotificationListener : Found <firstName: JOE, lastName: DOE> in the database.
2019-05-30 12:23:14.607 INFO 90644 --- [ main] hello.JobCompletionNotificationListener : Found <firstName: JUSTIN, lastName: DOE> in the database.
2019-05-30 12:23:14.607 INFO 90644 --- [ main] hello.JobCompletionNotificationListener : Found <firstName: JANE, lastName: DOE> in the database.
2019-05-30 12:23:14.607 INFO 90644 --- [ main] hello.JobCompletionNotificationListener : Found <firstName: JOHN, lastName: DOE> in the database.
2019-05-30 12:23:14.610 INFO 90644 --- [ main] o.s.b.c.l.support.SimpleJobLauncher : Job: [FlowJob: [name=importUserJob]] completed with the following parameters: [{run.id=1}] and the following status: [COMPLETED]
。\uuuuuuuuuuuu_
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
::弹簧靴::(v2.1.4.版本)
2019-05-30 12:23:12.642 INFO 90644---[main]你好。应用程序:使用PID 90644在本地主机上启动应用程序(/private/tmp/gs batch processing/complete/target/classes start by mbenhassine in/private/tmp/gs batch processing/complete)
2019-05-30 12:23:12.646信息90644---[main]你好。应用程序:未设置活动配置文件,返回默认配置文件:默认
2019-05-30 12:23:13.333信息90644---[main]com.zaxxer.hikari.HikariDataSource:hikaripol-1-开始。。。
2019-05-30 12:23:13.338警告90644---[main]com.zaxxer.hikari.util.DriverDataSource:找不到driverClassName=org.hsqldb.jdbcDriver的注册驱动程序,正在尝试直接实例化。
2019-05-30 12:23:13.683信息90644---[main]com.zaxxer.hikari.pool.PoolBase:HikariPool-1-驱动程序不支持获取/设置连接的网络超时。(不支持此功能)
2019-05-30 12:23:13.687信息90644---[main]com.zaxxer.hikari.HikariDataSource:hikaripol-1-启动完成。
2019-05-30 12:23:14.091信息90644---[main]o.s.b.c.r.s.JobRepositoryFactoryBean:未设置数据库类型,使用元数据指示HSQL
2019-05-30 12:23:14.277信息90644---[main]o.s.b.c.l.support.SimpleZoblancher:未设置TaskExecutor,默认为synchronous executor。
2019-05-30 12:23:14.437信息90644---[main]你好。应用程序:在2.114秒内启动应用程序(JVM运行5.2)
2019-05-30 12:23:14.438信息90644---[main]o.s.b.a.b.JobLauncherCommandLineRunner:运行默认命令行时使用:[]
2019-05-30 12:23:14.503信息90644---[main]o.s.b.c.l.support.simplejoblancher:Job:[FlowJob:[name=importUserJob]]使用以下参数启动:[{run.id=1}]
2019-05-30 12:23:14.530信息90644---[main]o.s.batch.core.job.simplestphandler:执行步骤:[step1]
2019-05-30 12:23:14.590信息90644---[main]你好。Personimprocessor:将(名字:吉尔,姓氏:Doe)转换为(名字:吉尔,姓氏:Doe)
2019-05-30 12:23:14.590信息90644---[main]你好。Personimprocessor:将(名:乔,姓:多伊)转换为(名:乔,姓:多伊)
2019-05-30 12:23:14.590信息90644---[main]你好。Personimprocessor:将(名字:Justin,姓氏:Doe)转换为(名字:Justin,姓氏:Doe)
2019-05-30 12:23:14.590信息90644---[main]你好。PersonItemProcessor:将(名字:Jane,名字:Doe)转换为(名字:Jane,名字:Doe)
2019-05-30 12:23:14.590信息90644---[main]你好。PersonItemProcessor:将(名字:John,姓氏:Doe)转换为(名字:John,姓氏:Doe)
2019-05-30 12:23:14.604信息90644---[main]你好。JobCompletionNotificationListener:!!!工作完成了!是时候验证结果了
2019-05-30 12:23:14.607信息90644---[main]hello.JobCompletionNotificationListener:在数据库中找到。
2019-05-30 12:23:14.607信息90644---[main]hello.JobCompletionNotificationListener:在数据库中找到。
2019-05-30 12:23:14.607信息90644---[main]hello.JobCompletionNotificationListener:在数据库中找到。
2019-05-30 12:23:14.607信息90644---[main]hello.JobCompletionNotificationListener:在数据库中找到。
2019-05-30 12:23:14.607信息90644---[main]hello.JobCompletionNotificationListener:在数据库中找到。
2019-05-30 12:23:14.610信息90644---[main]o.s.b.c.l.support.simplejoblancher:Job:[FlowJob:[name=importUserJob]]已完成,参数为:[{run.id=1}],状态为:[completed]
如您所见,没有NoClassDefFoundError2个JAR已损坏,jackson数据绑定和log4 虽然mvn clean安装错误是日志中的
(无效LOC头错误签名)
,但构建正在成功进行,因此我错过了日志
我不得不从.m2中删除文件夹,然后运行
mvn clean install
这解决了问题克隆后我仍然得到相同的文件夹。原因可能是什么?相同的依赖关系一切都是一样的