Andrew
Andrew

Reputation: 1

org.springframework.beans.FatalBeanException type mismatch between read and write methods

I have a web application written using Grails 2.2.4. To this point we have been compiling and running it using the IBM 1.6 JDK on AIX because our AIX version did not support 1.7 or higher.

We recently updated our AIX version so we can now support 1.7 and 1.8. We need to do make use of 1.7 at minimum with our Grails 2.2.4 application so that we can use TLS 1.2.

When we try to use the IBM 1.7 JDK we get errors in some of our unit tests like:

java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
        at grails.test.mixin.services.ServiceUnitTestMixin.mockService(ServiceUnitTestMixin.groovy:46)
        at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
        at org.spockframework.runtime.extension.builtin.JUnitFixtureMethodsExtension$FixtureType$FixtureMethodInterceptor.intercept(JUnitFixtureMethodsExtension.java:145)
        at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:84)
        at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
        at org.spockframework.runtime.extension.MethodInvocation.invokeTargetMethod(MethodInvocation.java:91)
        at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:85)
        at com.atlassian.clover.recorder.spock.CloverSpockIterationInterceptor.intercept(CloverSpockIterationInterceptor.java:36)
        at org.spockframework.runtime.extension.MethodInvocation.proceed(MethodInvocation.java:84)
        at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
        at org.spockframework.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:138)
Caused by: java.lang.reflect.InvocationTargetException
        ... 11 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
        ... 11 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
        ... 11 more

It happens in 37 of 1272 tests and only when tested under the IBM 1.7 SDK. When run using Oracle or OpenJDK the tests run with no failures.

Does anyone know how to get around this?

On deployment and startup (using Tomcat ) it shows up a little differently.

2017-05-04 11:24:52.782 | ERROR | org.springframework.web.context.ContextLoader | localhost-startStop-1 | Context initialization failed |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
        at java.util.concurrent.FutureTask.run(FutureTask.java:274)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
        at java.lang.Thread.run(Thread.java:809)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
        ... 5 more
Caused by: java.lang.reflect.InvocationTargetException
        ... 5 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
        ... 5 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
        ... 5 more
2017-05-04 11:24:52.790 | ERROR | org.codehaus.groovy.grails.web.context.GrailsContextLoader | localhost-startStop-1 | Error initializing the application: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
        at java.util.concurrent.FutureTask.run(FutureTask.java:274)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
        at java.lang.Thread.run(Thread.java:809)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
        ... 5 more
Caused by: java.lang.reflect.InvocationTargetException
        ... 5 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
        ... 5 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
        ... 5 more
2017-05-04 11:24:52.795 | ERROR | org.codehaus.groovy.grails.web.context.GrailsContextLoader | localhost-startStop-1 | Error initializing Grails: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass |
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:483)
        at java.util.concurrent.FutureTask.run(FutureTask.java:274)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:627)
        at java.lang.Thread.run(Thread.java:809)
Caused by: java.lang.RuntimeException: Unable to locate constructor with Class parameter for class org.codehaus.groovy.grails.commons.DefaultGrailsServiceClass
        ... 5 more
Caused by: java.lang.reflect.InvocationTargetException
        ... 5 more
Caused by: org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [com.cfglife.agent.AgentContextService]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
        ... 5 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
        ... 5 more

Upvotes: 0

Views: 1573

Answers (0)

Related Questions