{"id":664,"date":"2019-02-05T01:10:30","date_gmt":"2019-02-04T16:10:30","guid":{"rendered":"https:\/\/ito-u-oti.com\/?p=664"},"modified":"2019-02-05T01:10:30","modified_gmt":"2019-02-04T16:10:30","slug":"post-664","status":"publish","type":"post","link":"https:\/\/ito-u-oti.com\/?p=664","title":{"rendered":"Spring batch Eclipse\u4e0a\u3067\u306f\u52d5\u4f5c\u3059\u308b\u304cjar\u304b\u3089\u306e\u8d77\u52d5\u3067\u30a8\u30e9\u30fc\uff08UnsatisfiedDependencyException\uff09"},"content":{"rendered":"<h2 id=\"outline__1\">\u4e8b\u8c61<\/h2>\n<p>Spring batch Eclipse\u4e0a\u3067\u306f\u52d5\u4f5c\u3059\u308b\u304cjar\u304b\u3089\u306e\u8d77\u52d5\u3067\u30a8\u30e9\u30fc\uff08UnsatisfiedDependencyException\uff09<br \/>\nEclipse\u3067\u5b9f\u884c\u3068\u304b\u30c7\u30d0\u30c3\u30b0\u3068\u304b\u3067\u306f\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u3066\u3044\u305f\u304c\u3001maven build\u3057\u3066\u751f\u6210\u3057\u305fjar\u3092\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u7570\u5e38\u7d42\u4e86\u3068\u306a\u3063\u305f\u3002<\/p>\n<h2 id=\"outline__2\">\u30a8\u30e9\u30fc\u5185\u5bb9<\/h2>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nC:\\opt\\java&gt;java -cp &quot;app\\*;lib\\*&quot; org.springframework.batch.core.launch.support.CommandLineJobRunner META-INF\/jobs\/Hoge\/Hoge.xml Hoge puge=pupuge\r\n&#x5B;2018\/10\/30 16:43:17] &#x5B;main] &#x5B;o.s.c.s.ClassPathXmlApplicationContext] &#x5B;INFO ] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@757c7103: startup date &#x5B;Tue Oct 30 16:43:17 JST 2018]; root of context hierarchy\r\n&#x5B;2018\/10\/30 16:43:17] &#x5B;main] &#x5B;o.s.b.f.x.XmlBeanDefinitionReader] &#x5B;INFO ] Loading XML bean definitions from class path resource &#x5B;META-INF\/jobs\/Hoge\/Hoge.xml]\r\n&#x5B;2018\/10\/30 16:43:17] &#x5B;main] &#x5B;o.s.b.f.x.XmlBeanDefinitionReader] &#x5B;INFO ] Loading XML bean definitions from class path resource &#x5B;META-INF\/spring\/job-base-context.xml]\r\n&#x5B;2018\/10\/30 16:43:17] &#x5B;main] &#x5B;o.s.b.f.x.XmlBeanDefinitionReader] &#x5B;INFO ] Loading XML bean definitions from class path resource &#x5B;META-INF\/spring\/launch-context.xml]\r\n&#x5B;2018\/10\/30 16:43:18] &#x5B;main] &#x5B;o.s.b.f.c.PropertyPlaceholderConfigurer] &#x5B;INFO ] Loading properties file from class path resource &#x5B;batch-application.properties]\r\n&#x5B;2018\/10\/30 16:43:18] &#x5B;main] &#x5B;o.s.b.f.c.PropertyPlaceholderConfigurer] &#x5B;INFO ] Loading properties file from class path resource &#x5B;ValidationMessages.properties]\r\n&#x5B;2018\/10\/30 16:43:18] &#x5B;main] &#x5B;o.s.b.f.s.DefaultListableBeanFactory] &#x5B;INFO ] Overriding bean definition for bean 'HogeTasklet' with a different definition: replacing &#x5B;Generic bean: class &#x5B;itouoti.Hoge.HogeTasklet]; scope=step; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=false; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in URL &#x5B;jar:file:\/C:\/tmp\/java\/app\/sample-1.0.0-SNAPSHOT.jar!\/itouoti\/Hoge\/HogeTasklet.class]] with &#x5B;Root bean: class &#x5B;org.springframework.aop.scope.ScopedProxyFactoryBean]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true\r\n; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in BeanDefinition defined in URL &#x5B;jar:file:\/C:\/tmp\/java\/app\/sample-1.0.0-SNAPSHOT.jar!\/itouoti\/Hoge\/HogeTasklet.class]]\r\n&#x5B;2018\/10\/30 16:43:18] &#x5B;main] &#x5B;o.s.b.f.a.AutowiredAnnotationBeanPostProcessor] &#x5B;INFO ] JSR-330 'javax.inject.Inject' annotation found and supported for autowiring\r\n&#x5B;2018\/10\/30 16:43:18] &#x5B;main] &#x5B;o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker] &#x5B;INFO ] Bean 'jobRegistry' of type &#x5B;class org.springframework.batch.core.configuration.support.MapJobRegistry] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)\r\n&#x5B;2018\/10\/30 16:43:18] &#x5B;main] &#x5B;o.s.b.c.r.s.JobRepositoryFactoryBean] &#x5B;INFO ] No database type set, using meta data indicating: DB2\r\n&#x5B;2018\/10\/30 16:43:19] &#x5B;main] &#x5B;o.s.b.c.l.s.SimpleJobLauncher] &#x5B;INFO ] No TaskExecutor has been set, defaulting to synchronous executor.\r\n&#x5B;2018\/10\/30 16:43:19] &#x5B;main] &#x5B;o.h.v.i.util.Version  ] &#x5B;INFO ] HV000001: Hibernate Validator 5.2.4.Final\r\n&#x5B;2018\/10\/30 16:43:19] &#x5B;main] &#x5B;o.s.c.s.ClassPathXmlApplicationContext] &#x5B;WARN ] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'HogeServiceImpl': Unsatisfied dependency expressed through field 'sharedService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'itouoti.sharedService.SharedService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}\r\n&#x5B;2018\/10\/30 16:43:19] &#x5B;main] &#x5B;o.s.b.c.l.s.CommandLineJobRunner] &#x5B;ERROR] Job Terminated in error: Error creating bean with name 'HogeServiceImpl': Unsatisfied dependency expressed through field 'sharedService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'itouoti.sharedService.SharedService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}\r\norg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'HogeServiceImpl': Unsatisfied dependency expressed through field 'sharedService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'itouoti.sharedService.SharedService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}\r\n        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)\r\n        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)\r\n        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)\r\n        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1225)\r\n        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:552)\r\n        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)\r\n        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)\r\n        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)\r\n        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)\r\n        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)\r\n        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:759)\r\n        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)\r\n        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)\r\n        at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:139)\r\n        at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;init&gt;(ClassPathXmlApplicationContext.java:83)\r\n        at org.springframework.batch.core.launch.support.CommandLineJobRunner.start(CommandLineJobRunner.java:290)\r\n        at org.springframework.batch.core.launch.support.CommandLineJobRunner.main(CommandLineJobRunner.java:592)\r\nCaused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'itouoti.sharedService.SharedService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}\r\n        at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1474)\r\n        at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1102)\r\n        at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064)\r\n        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)\r\n        ... 16 common frames omitted\r\n<\/pre>\n<h2 id=\"outline__3\">\u539f\u56e0<\/h2>\n<p>\u3059\u3054\u304f\u3057\u3087\u3046\u3082\u306a\u3044\u3051\u3069\u304b\u306a\u308a\u6642\u9593\u304c\u304b\u304b\u3063\u3066\u3057\u307e\u3063\u305f\u3002<br \/>\n\u7d50\u679c\u3068\u3057\u3066\u3001component-scan\u3067\u8aad\u307f\u8fbc\u3093\u3067\u3044\u305fpackage\u304c\u5c0f\u6587\u5b57\u3068\u306a\u3063\u3066\u3044\u305f\u3002<br \/>\neclipse\u3067\u306f\u5c0f\u6587\u5b57\u5927\u6587\u5b57\u3092\u5224\u5b9a\u3057\u306a\u3044\uff1f<\/p>\n<p>\u539f\u56e0\u3068\u306a\u3063\u305fxml\u306ecomponent-scan\u30bf\u30b0<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;context:component-scan\r\n        base-package=&quot;itouoti.batch.Hoge,\r\n                        itouoti.Hoge,\r\n                        itouoti.sharedservice,\r\n                        itouoti.repository.Hoge,\r\n                        itouoti.repository.sharedRepository,\r\n                        itouoti.repository.commonDTO&quot; \/&gt;\r\n<\/pre>\n<p>\u300citouoti.sharedService\u300d\u304c\u6b63\u3057\u3044<\/p>\n<h2 id=\"outline__4\">\u89e3\u6c7a\u7b56<\/h2>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u5c0f\u6587\u5b57\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u3092\u5927\u6587\u5b57\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;context:component-scan\r\n        base-package=&quot;itouoti.batch.Hoge,\r\n                        itouoti.Hoge,\r\n                        itouoti.sharedService,\r\n                        itouoti.repository.Hoge,\r\n                        itouoti.repository.sharedRepository,\r\n                        itouoti.repository.commonDTO&quot; \/&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8b\u8c61 Spring batch Eclipse\u4e0a\u3067\u306f\u52d5\u4f5c\u3059\u308b\u304cjar\u304b\u3089\u306e\u8d77\u52d5\u3067\u30a8\u30e9\u30fc\uff08Unsati [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":93,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[149,155],"class_list":["post-664","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-error-bugs","tag-spring-batch","tag-unsatisfieddependencyexception"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=664"}],"version-history":[{"count":1,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/664\/revisions"}],"predecessor-version":[{"id":665,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/posts\/664\/revisions\/665"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=\/wp\/v2\/media\/93"}],"wp:attachment":[{"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ito-u-oti.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}