YAML ファイルを使用して構成プロパティを外部化しようとしています。プロパティの読み取りに成功し、Spring Boot アプリケーションを使用して個別に実行しました。
しかし、同じクラスを Spring バッチ ジョブ プロジェクトに統合し、ジョブをデプロイしようとすると、以下の例外が発生します。例外とはどういう意味ですか? 不適切なクラスのキャストを無効にするにはどうすればよいですか??
これらは私のMavenの依存関係です:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.1.RELEASE</version>
</parent>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
<version>${springbatch.version}</version>
<scope>provided</scope>
</dependency>
[2014-08-20 15:14:13.511] boot - 5604 ERROR [DeploymentsPathChildrenCache-0] --- ContainerRegistrar: Exception deploying module
java.lang.IllegalStateException: java.lang.ClassCastException: org.springframework.boot.logging.logback.LogbackLoggingSystem cannot be cast to org.springframework.boot.logging.LoggingSystem
at org.springframework.boot.logging.LoggingSystem.get(LoggingSystem.java:85)
at org.springframework.boot.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:160)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:122)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:98)
at org.springframework.boot.context.event.EventPublishingRunListener.publishEvent(EventPublishingRunListener.java:92)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:58)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:275)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:130)
at org.springframework.xd.module.core.SimpleModule.initialize(SimpleModule.java:191)
at org.springframework.xd.dirt.module.ModuleDeployer.deploy(ModuleDeployer.java:127)
at org.springframework.xd.dirt.module.ModuleDeployer.deployAndStore(ModuleDeployer.java:117)
at org.springframework.xd.dirt.module.ModuleDeployer.deployAndStore(ModuleDeployer.java:107)
at org.springframework.xd.dirt.server.ContainerRegistrar.deployModule(ContainerRegistrar.java:237)
at org.springframework.xd.dirt.server.ContainerRegistrar.deployJob(ContainerRegistrar.java:512)
at org.springframework.xd.dirt.server.ContainerRegistrar.onChildAdded(ContainerRegistrar.java:442)
at org.springframework.xd.dirt.server.ContainerRegistrar.access$800(ContainerRegistrar.java:96)
at org.springframework.xd.dirt.server.ContainerRegistrar$DeploymentListener.childEvent(ContainerRegistrar.java:807)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:509)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:503)
at org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
at org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500)
at org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$10.run(PathChildrenCache.java:762)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: org.springframework.boot.logging.logback.LogbackLoggingSystem cannot be cast to org.springframework.boot.logging.LoggingSystem
at org.springframework.boot.logging.LoggingSystem.get(LoggingSystem.java:81)
... 31 more
[2014-08-20 15:14:13.601] boot - 5604 INFO [DeploymentsPathChildrenCache-0] --- ContainerRegistrar: Path cache event: /deployments/modules/a6acf7b1-32de-408a-ab96-4ece1df91115/NewJob3.job.database-sy
nchronizer-0, type: CHILD_REMOVED
[2014-08-20 15:14:13.602] boot - 5604 INFO [DeploymentsPathChildrenCache-0] --- ContainerRegistrar: Undeploying module [ModuleDescriptor@6436d9c4 moduleName = 'database-synchronizer', moduleLabel = [
null], group = 'NewJob3', sourceChannelName = [null], sinkChannelName = [null], sinkChannelName = [null], index = 0, type = job, parameters = map[[empty]], children = list[[empty]]]
[2014-08-20 15:14:13.605] boot - 5604 ERROR [JobDeploymentsPathChildrenCache-0] --- PathChildrenCache:
java.lang.IllegalStateException: Container a6acf7b1-32de-408a-ab96-4ece1df91115 experienced the following error deploying module database-synchronizer-0 of type job: java.lang.IllegalStateException: j
ava.lang.ClassCastException: org.springframework.boot.logging.logback.LogbackLoggingSystem cannot be cast to org.springframework.boot.logging.LoggingSystem
at org.springframework.xd.dirt.server.ModuleDeploymentWriter.validateResults(ModuleDeploymentWriter.java:543)
at org.springframework.xd.dirt.server.JobDeploymentListener.deployJob(JobDeploymentListener.java:146)
at org.springframework.xd.dirt.server.JobDeploymentListener.onChildAdded(JobDeploymentListener.java:113)
at org.springframework.xd.dirt.server.JobDeploymentListener.childEvent(JobDeploymentListener.java:97)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:509)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$5.apply(PathChildrenCache.java:503)
at org.apache.curator.framework.listen.ListenerContainer$1.run(ListenerContainer.java:92)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
at org.apache.curator.framework.listen.ListenerContainer.forEach(ListenerContainer.java:83)
at org.apache.curator.framework.recipes.cache.PathChildrenCache.callListeners(PathChildrenCache.java:500)
at org.apache.curator.framework.recipes.cache.EventOperation.invoke(EventOperation.java:35)
at org.apache.curator.framework.recipes.cache.PathChildrenCache$10.run(PathChildrenCache.java:762)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)