简体   繁体   中英

Spring batch JobOperator com.thoughtworks.xstream.converters.ConversionException: Cannot construct type

I need get running job executions. For this goal I try to use JobOperator. But I have caught an exception:

2018-02-01 12:00:58.669 ERROR 1480 --- [io-50201-exec-4] c.s.i.l.s.o.f.ExceptionHandlerFilter     : Error occurred during processing: Request processing failed; nested exception is com.thoughtworks.xstream.converters.ConversionException: Cannot construct type
---- Debugging information ----
message             : Cannot construct type
cause-exception     : java.lang.InstantiationException
cause-message       : java.util.Map$Entry
construction-type   : java.util.Map$Entry
class               : java.util.Map$Entry
required-type       : java.util.Map$Entry
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /map/map/entry
line number         : -1
class[1]            : java.util.HashMap
converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter
version             : 1.4.9

I was tried the solution by using jettison 1.1 instead of 1.3.2 link But this didn't have any effect. How can I resolve the problem?

Modified. Below is the stacktrase. Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot construct type

   Caused by: com.thoughtworks.xstream.converters.ConversionException: Cannot  construct type
        ---- Debugging information ----
        message             : Cannot construct type
        cause-exception     : java.lang.InstantiationException
        cause-message       : java.util.Map$Entry
        construction-type   : java.util.Map$Entry
        class               : java.util.Map$Entry
        required-type       : java.util.Map$Entry
        converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
        path                : /map/map/entry
        line number         : -1
        class[1]            : java.util.HashMap
        converter-type[1]   : com.thoughtworks.xstream.converters.collections.MapConverter
        version             : 1.4.9
        -------------------------------
            at com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider.newInstance(SunLimitedUnsafeReflectionProvider.java:86) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:584) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:280) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:73) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.converters.collections.MapConverter.putCurrentEntryIntoMap(MapConverter.java:106) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:98) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:92) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:87) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:70) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1230) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1214) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1085) ~[xstream-1.4.9.jar:1.4.9]
            at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1076) ~[xstream-1.4.9.jar:1.4.9]
            at org.springframework.batch.core.repository.dao.XStreamExecutionContextStringSerializer.deserialize(XStreamExecutionContextStringSerializer.java:112) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.batch.core.repository.dao.XStreamExecutionContextStringSerializer.deserialize(XStreamExecutionContextStringSerializer.java:45) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao$ExecutionContextRowMapper.mapRow(JdbcExecutionContextDao.java:322) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao$ExecutionContextRowMapper.mapRow(JdbcExecutionContextDao.java:309) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:697) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:633) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:684) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:716) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:726) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:781) ~[spring-jdbc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.getExecutionContext(JdbcExecutionContextDao.java:127) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.batch.core.explore.support.SimpleJobExplorer.getStepExecutionDependencies(SimpleJobExplorer.java:208) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.batch.core.explore.support.SimpleJobExplorer.findRunningJobExecutions(SimpleJobExplorer.java:104) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) ~[spring-aop-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$PassthruAdvice.invoke(SimpleBatchConfiguration.java:127) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) ~[spring-aop-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at com.sun.proxy.$Proxy112.findRunningJobExecutions(Unknown Source) ~[na:na]
            at org.springframework.batch.core.launch.support.SimpleJobOperator.getRunningExecutions(SimpleJobOperator.java:221) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.batch.core.launch.support.SimpleJobOperator$$FastClassBySpringCGLIB$$44ee6049.invoke(<generated>) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:669) ~[spring-aop-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.batch.core.launch.support.SimpleJobOperator$$EnhancerBySpringCGLIB$$9d48448c.getRunningExecutions(<generated>) ~[spring-batch-core-3.0.7.RELEASE.jar:3.0.7.RELEASE]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
            at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
            at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) ~[spring-webmvc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.8.RELEASE.jar:4.3.8.RELEASE]
            ... 91 common frames omitted
        Caused by: java.lang.InstantiationException: java.util.Map$Entry
            at sun.misc.Unsafe.allocateInstance(Native Method) ~[na:1.8.0_161]
            at com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider.newInstance(SunLimitedUnsafeReflectionProvider.java:82) ~[xstream-1.4.9.jar:1.4.9]
            ... 158 common frames omitted

I solved my problem. The problem was in gradle. I've used command:

gradlew build --refresh-dependencies

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM