org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.flatFileItemReader' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Cannot create inner bean 'org.springframework.core.io.UrlResource#1242b11' of type [org.springframework.core.io.UrlResource] while setting bean property 'resource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]}

Spring JIRA | David J. M. Karlsen | 7 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    This late binding worked in 2.0.4 but not in the latest 2.1 milestone: {code} <bean id="flatFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step"> <property name="strict" value="false" /> <property name="resource"> <bean class="org.springframework.core.io.UrlResource" scope="step"> <constructor-arg value="#{jobParameters[inputFileUrl]}" /> </bean> </property> <property name="lineMapper"> <bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper"> <property name="lineTokenizer"> <bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer"> <property name="delimiter" value=";" /> <property name="names"> <list> <value>zipCode</value> <value>city</value> <value>name</value> <value>addressType</value> <value>countyNumber</value> <value>countyName</value> </list> </property> </bean> </property> <property name="fieldSetMapper"> <bean class="com.davidkarlsen.zipcodeservice.dataload.ZipCodeFieldSetMapper" /> </property> </bean> </property> </bean> {code} {noformat} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.flatFileItemReader' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Cannot create inner bean 'org.springframework.core.io.UrlResource#1242b11' of type [org.springframework.core.io.UrlResource] while setting bean property 'resource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]} at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.batch.core.scope.StepScope.get(StepScope.java:146) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33) [spring-aop-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182) [spring-aop-3.0.0.RELEASE.jar:3.0.0.RELEASE] at $Proxy18.close(Unknown Source) [na:na] at org.springframework.batch.item.support.CompositeItemStream.close(CompositeItemStream.java:86) [spring-batch-infrastructure-2.1.0.M4.jar:na] at org.springframework.batch.core.step.item.ChunkMonitor.close(ChunkMonitor.java:104) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.item.support.CompositeItemStream.close(CompositeItemStream.java:86) [spring-batch-infrastructure-2.1.0.M4.jar:na] at org.springframework.batch.core.step.tasklet.TaskletStep.close(TaskletStep.java:284) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:256) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:115) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:99) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:276) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:118) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48) [spring-core-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:112) [spring-batch-core-2.1.0.M4.jar:na] at com.davidkarlsen.zipcodeservice.dataload.BatchTest.testReadFile(BatchTest.java:60) [test-classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_17] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_17] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_17] at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_17] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) [junit-4.7.jar:na] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [junit-4.7.jar:na] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) [junit-4.7.jar:na] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) [junit-4.7.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) [junit-4.7.jar:na] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) [junit-4.7.jar:na] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) [junit-4.7.jar:na] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) [junit-4.7.jar:na] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) [junit-4.7.jar:na] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) [junit-4.7.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.junit.runners.ParentRunner.run(ParentRunner.java:236) [junit-4.7.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) [surefire-junit4-2.4.3.jar:2.4.3] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) [surefire-api-2.4.3.jar:2.4.3] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) [surefire-api-2.4.3.jar:2.4.3] at org.apache.maven.surefire.Surefire.run(Surefire.java:177) [surefire-api-2.4.3.jar:2.4.3] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_17] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_17] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_17] at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_17] at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) [surefire-booter-2.4.3.jar:2.4.3] at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) [surefire-booter-2.4.3.jar:2.4.3] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]} at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:283) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] ... 60 common frames omitted {noformat}

    Spring JIRA | 7 years ago | David J. M. Karlsen
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.flatFileItemReader' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Cannot create inner bean 'org.springframework.core.io.UrlResource#1242b11' of type [org.springframework.core.io.UrlResource] while setting bean property 'resource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]}
  2. 0

    This late binding worked in 2.0.4 but not in the latest 2.1 milestone: {code} <bean id="flatFileItemReader" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step"> <property name="strict" value="false" /> <property name="resource"> <bean class="org.springframework.core.io.UrlResource" scope="step"> <constructor-arg value="#{jobParameters[inputFileUrl]}" /> </bean> </property> <property name="lineMapper"> <bean class="org.springframework.batch.item.file.mapping.DefaultLineMapper"> <property name="lineTokenizer"> <bean class="org.springframework.batch.item.file.transform.DelimitedLineTokenizer"> <property name="delimiter" value=";" /> <property name="names"> <list> <value>zipCode</value> <value>city</value> <value>name</value> <value>addressType</value> <value>countyNumber</value> <value>countyName</value> </list> </property> </bean> </property> <property name="fieldSetMapper"> <bean class="com.davidkarlsen.zipcodeservice.dataload.ZipCodeFieldSetMapper" /> </property> </bean> </property> </bean> {code} {noformat} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.flatFileItemReader' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Cannot create inner bean 'org.springframework.core.io.UrlResource#1242b11' of type [org.springframework.core.io.UrlResource] while setting bean property 'resource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]} at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.batch.core.scope.StepScope.get(StepScope.java:146) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33) [spring-aop-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182) [spring-aop-3.0.0.RELEASE.jar:3.0.0.RELEASE] at $Proxy18.close(Unknown Source) [na:na] at org.springframework.batch.item.support.CompositeItemStream.close(CompositeItemStream.java:86) [spring-batch-infrastructure-2.1.0.M4.jar:na] at org.springframework.batch.core.step.item.ChunkMonitor.close(ChunkMonitor.java:104) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.item.support.CompositeItemStream.close(CompositeItemStream.java:86) [spring-batch-infrastructure-2.1.0.M4.jar:na] at org.springframework.batch.core.step.tasklet.TaskletStep.close(TaskletStep.java:284) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:256) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:115) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:99) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:276) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:118) [spring-batch-core-2.1.0.M4.jar:na] at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48) [spring-core-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:112) [spring-batch-core-2.1.0.M4.jar:na] at com.davidkarlsen.zipcodeservice.dataload.BatchTest.testReadFile(BatchTest.java:60) [test-classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_17] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_17] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_17] at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_17] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) [junit-4.7.jar:na] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) [junit-4.7.jar:na] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) [junit-4.7.jar:na] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) [junit-4.7.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) [junit-4.7.jar:na] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) [junit-4.7.jar:na] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) [junit-4.7.jar:na] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) [junit-4.7.jar:na] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) [junit-4.7.jar:na] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) [junit-4.7.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.junit.runners.ParentRunner.run(ParentRunner.java:236) [junit-4.7.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180) [spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) [surefire-junit4-2.4.3.jar:2.4.3] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140) [surefire-api-2.4.3.jar:2.4.3] at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127) [surefire-api-2.4.3.jar:2.4.3] at org.apache.maven.surefire.Surefire.run(Surefire.java:177) [surefire-api-2.4.3.jar:2.4.3] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_17] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_17] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_17] at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_17] at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) [surefire-booter-2.4.3.jar:2.4.3] at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) [surefire-booter-2.4.3.jar:2.4.3] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]} at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:283) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270) [spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE] ... 60 common frames omitted {noformat}

    Spring JIRA | 7 years ago | David J. M. Karlsen
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.flatFileItemReader' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Cannot create inner bean 'org.springframework.core.io.UrlResource#1242b11' of type [org.springframework.core.io.UrlResource] while setting bean property 'resource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]}
  3. 0

    How to access jobParameters in SpringBatch as a bean?

    Stack Overflow | 4 years ago | Kodaganti
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.fileDownloadReader' defined in class path resource [launch-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy13 implementing java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'com.test.components.TestBean' for property 'reconBean'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy13 implementing java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.test.components.TestBean] for property 'reconBean': no matching editors or conversion strategy found
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Cannot convert value of type [com.sun.proxy.$Proxy32 ScopedObject

    Stack Overflow | 3 years ago | vishal
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.importExchangesItemWriter' defined in file [/home/vishal/install/sts-bundle/vfabric-tc-server-developer-2.9.6.RELEASE/base-instance/wtpwebapps/spring/WEB-INF/classes/META-INF/spring/batch/jobs/foundation/steps/import-exchanges.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'com.sun.proxy.$Proxy32 implementing org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'com.st.symfony.Symfony' for property 'symfony'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.sun.proxy.$Proxy32 implementing org.springframework.aop.scope.ScopedObject,java.io.Serializable,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.st.symfony.Symfony] for property 'symfony': no matching editors or conversion strategy found
  6. 0

    Spring Batch: not able to access jobexecutionConext in flatfileitemwriter

    Stack Overflow | 3 years ago | manankhh
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scopedTarget.subroHeaderFooterWriter' defined in class path resource [subrogation.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy46 implementing org.springframework.batch.item.file.ResourceAwareItemWriterItemStream,org.springframework.beans.factory.InitializingBean,java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised' to required type 'org.springframework.batch.item.file.FlatFileItemWriter' for property 'delegate'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy46 implementing org.springframework.batch.item.file.ResourceAwareItemWriterItemStream,org.springframework.beans.factory.InitializingBean,java.io.Serializable,org.springframework.aop.scope.ScopedObject,org.springframework.aop.framework.AopInfrastructureBean,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [org.springframework.batch.item.file.FlatFileItemWriter] for property 'delegate': no matching editors or conversion strategy found
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.factory.BeanCreationException

    Error creating bean with name 'org.springframework.core.io.UrlResource#1242b11' defined in class path resource [com/davidkarlsen/zipcodeservice/dataload/batch-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.core.io.UrlResource]: Constructor threw exception; nested exception is java.net.MalformedURLException: no protocol: %{jobParameters[inputFileUrl]}

    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor()
  2. Spring Beans
    AbstractBeanFactory$2.getObject
    1. org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:283)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:984)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    3. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:886)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    4. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:479)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    5. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    6. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    7. org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    8. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1305)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    9. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1067)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    10. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:511)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    11. org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    12. org.springframework.beans.factory.support.AbstractBeanFactory$2.getObject(AbstractBeanFactory.java:328)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    12 frames
  3. Spring Batch Core
    StepScope.get
    1. org.springframework.batch.core.scope.StepScope.get(StepScope.java:146)[spring-batch-core-2.1.0.M4.jar:na]
    1 frame
  4. Spring Beans
    AbstractBeanFactory.getBean
    1. org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2. org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)[spring-beans-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2 frames
  5. Spring AOP
    JdkDynamicAopProxy.invoke
    1. org.springframework.aop.target.SimpleBeanTargetSource.getTarget(SimpleBeanTargetSource.java:33)[spring-aop-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:182)[spring-aop-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2 frames
  6. Unknown
    $Proxy18.close
    1. $Proxy18.close(Unknown Source)[na:na]
    1 frame
  7. Spring Batch Infrastructure
    CompositeItemStream.close
    1. org.springframework.batch.item.support.CompositeItemStream.close(CompositeItemStream.java:86)[spring-batch-infrastructure-2.1.0.M4.jar:na]
    1 frame
  8. Spring Batch Core
    ChunkMonitor.close
    1. org.springframework.batch.core.step.item.ChunkMonitor.close(ChunkMonitor.java:104)[spring-batch-core-2.1.0.M4.jar:na]
    1 frame
  9. Spring Batch Infrastructure
    CompositeItemStream.close
    1. org.springframework.batch.item.support.CompositeItemStream.close(CompositeItemStream.java:86)[spring-batch-infrastructure-2.1.0.M4.jar:na]
    1 frame
  10. Spring Batch Core
    SimpleJobLauncher$1.run
    1. org.springframework.batch.core.step.tasklet.TaskletStep.close(TaskletStep.java:284)[spring-batch-core-2.1.0.M4.jar:na]
    2. org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:256)[spring-batch-core-2.1.0.M4.jar:na]
    3. org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:115)[spring-batch-core-2.1.0.M4.jar:na]
    4. org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:61)[spring-batch-core-2.1.0.M4.jar:na]
    5. org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:60)[spring-batch-core-2.1.0.M4.jar:na]
    6. org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:144)[spring-batch-core-2.1.0.M4.jar:na]
    7. org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:124)[spring-batch-core-2.1.0.M4.jar:na]
    8. org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:99)[spring-batch-core-2.1.0.M4.jar:na]
    9. org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:276)[spring-batch-core-2.1.0.M4.jar:na]
    10. org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:118)[spring-batch-core-2.1.0.M4.jar:na]
    10 frames
  11. Spring Core
    SyncTaskExecutor.execute
    1. org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)[spring-core-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    1 frame
  12. Spring Batch Core
    SimpleJobLauncher.run
    1. org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:112)[spring-batch-core-2.1.0.M4.jar:na]
    1 frame
  13. com.davidkarlsen.zipcodeservice
    BatchTest.testReadFile
    1. com.davidkarlsen.zipcodeservice.dataload.BatchTest.testReadFile(BatchTest.java:60)[test-classes/:na]
    1 frame
  14. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.6.0_17]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[na:1.6.0_17]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[na:1.6.0_17]
    4. java.lang.reflect.Method.invoke(Method.java:597)[na:1.6.0_17]
    4 frames
  15. JUnit
    InvokeMethod.evaluate
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)[junit-4.7.jar:na]
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)[junit-4.7.jar:na]
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)[junit-4.7.jar:na]
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)[junit-4.7.jar:na]
    4 frames
  16. Spring TestContext
    SpringJUnit4ClassRunner.runChild
    1. org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)[spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2. org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)[spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    3. org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)[spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    4. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)[spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    4 frames
  17. JUnit
    ParentRunner$2.evaluate
    1. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)[junit-4.7.jar:na]
    2. org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)[junit-4.7.jar:na]
    3. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)[junit-4.7.jar:na]
    4. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)[junit-4.7.jar:na]
    5. org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)[junit-4.7.jar:na]
    6. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)[junit-4.7.jar:na]
    6 frames
  18. Spring TestContext
    RunAfterTestClassCallbacks.evaluate
    1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)[spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)[spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    2 frames
  19. JUnit
    ParentRunner.run
    1. org.junit.runners.ParentRunner.run(ParentRunner.java:236)[junit-4.7.jar:na]
    1 frame
  20. Spring TestContext
    SpringJUnit4ClassRunner.run
    1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)[spring-test-3.0.0.RELEASE.jar:3.0.0.RELEASE]
    1 frame
  21. JUnit4 Provider
    JUnit4TestSet.execute
    1. org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)[surefire-junit4-2.4.3.jar:2.4.3]
    1 frame
  22. SureFire
    Surefire.run
    1. org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)[surefire-api-2.4.3.jar:2.4.3]
    2. org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)[surefire-api-2.4.3.jar:2.4.3]
    3. org.apache.maven.surefire.Surefire.run(Surefire.java:177)[surefire-api-2.4.3.jar:2.4.3]
    3 frames
  23. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.6.0_17]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[na:1.6.0_17]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[na:1.6.0_17]
    4. java.lang.reflect.Method.invoke(Method.java:597)[na:1.6.0_17]
    4 frames
  24. SureFire
    SurefireBooter.main
    1. org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)[surefire-booter-2.4.3.jar:2.4.3]
    2. org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)[surefire-booter-2.4.3.jar:2.4.3]
    2 frames