Announcement Announcement Module
Collapse
No announcement yet.
no matching editors or conversion strategy found Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • no matching editors or conversion strategy found

    I am using Spring 3.1.1 and Spring batch 2.1.8. I was able to setup and run my first spring batch job. But when I tried to create one my own reader by implementing ItemReader or extending the implementations like MultiResourceItemReader I get the below exception.

    My implementation is exactly same as the MultiResourceItemReader (including the package) except the class name: CusMultiResourceItemReader, still gives this exception

    Code:
    public class CustomMultiResourceItemReader<T> extends
    		MultiResourceItemReader<T> {
    
    	
    	public static final String CURRENT_RESOURCE_KEY = "CURRENT_RESOURCE_KEY";
    	
    	private DataProcessCompletedHandler dataProcessCompletedHandler;
    
    	
    	public DataProcessCompletedHandler getDataProcessCompletedHandler() {
    		return dataProcessCompletedHandler;
    	}
    Code:
    	<bean id="sampleIOFaltFileReader"
    			class="org.springframework.batch.item.file.CusMultiResourceItemReader"
    
    		scope="step">
    		<property name="delegate">
    			<bean class="org.springframework.batch.item.file.FlatFileItemReader">
    				<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" value="personId,firstName,lastName" />
    							</bean>
    						</property>
    						<property name="fieldSetMapper">
    							<bean
    								class="org.springframework.batch.item.file.mapping.BeanWrapperFieldSetMapper">
    								<property name="targetType" value="gov.va.med.esi.batch.vo.PersonVO" />
    							</bean>
    						</property>
    					</bean>
    				</property>
    			</bean>
    		</property>
    		<property name="resource" value="file:C:\test*.data" />
    	</bean>
    
    
    
    
    
    	<!-- Sample writer -->
    	<bean id="sampleIOtFileitemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter"
    		scope="step">
    		<property name="resource" value="file:C:\test.out" />
    		<property name="lineAggregator">
    			<bean class="org.springframework.batch.item.file.transform.DelimitedLineAggregator">
    				<property name="delimiter" value="," />
    				<property name="fieldExtractor">
    					<bean class="org.springframework.batch.item.file.transform.BeanWrapperFieldExtractor">
    						<property name="names" value="personId,firstName,lastName" />
    					</bean>
    				</property>
    			</bean>
    		</property>
    	</bean>
    
    	<job id="sampleIOJob"  parent="abstractJob"  xmlns="http://www.springframework.org/schema/batch">
    		<step id="step" parent="abstractStep">
    			<tasklet> 
    				<chunk reader="sampleIOFaltFileReader" writer="sampleIOtFileitemWriter" skip-limit="999999999">
    					<skippable-exception-classes>
    						<include
    							class="org.springframework.batch.item.file.FlatFileParseException" />
    					</skippable-exception-classes>
    				</chunk>
    			</tasklet>
    		</step>
    	</job>

    Any help is greatly appreciated.




    o
    Code:
    rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'step': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy109 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 'org.springframework.batch.item.ItemReader' for property 'itemReader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy109 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 [org.springframework.batch.item.ItemReader] for property 'itemReader': no matching editors or conversion strategy found
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    	at com.oracle.weblogic.wsee.wrapper.org.springframework.web.context.ContextLoaderListener.contextInitialized(Unknown Source)
    	at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    	at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
    	at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
    	at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
    	at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
    	at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
    	at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    	at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    	at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    	at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    	at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
    	at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    	
    	at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
    	at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
    	at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    	at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    	at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    	at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    	at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    	at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    	at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    	at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    	at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type '$Proxy109 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 'org.springframework.batch.item.ItemReader' for property 'itemReader'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [$Proxy109 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 [org.springframework.batch.item.ItemReader] for property 'itemReader': no matching editors or conversion strategy found
    	at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:485)
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516)
    	at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    	... 48 more
    Caused by: java.lang.IllegalStateException: Cannot convert value of type [$Proxy109 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 [org.springframework.batch.item.ItemReader] for property 'itemReader': no matching editors or conversion strategy found
    	at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:241)
    	at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470)
    	... 54 more
Working...
X