我有一个使用 Grails 2.2.4 编写的 Web 应用程序。到目前为止,我们一直在 AIX 上使用 IBM 1.6 JDK 编译和运行它,因为我们的 AIX 版本不支持 1.7 或更高版本。
我们最近更新了 AIX 版本,因此我们现在可以支持 1.7 和 1.8。我们需要在 Grails 2.2.4 应用程序中至少使用 1.7,以便我们可以使用 TLS 1.2。
当我们尝试使用 IBM 1.7 JDK 时,我们会在一些单元测试中遇到错误,例如:
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
它发生在 1272 次测试中的 37 次中,并且仅在 IBM 1.7 SDK 下测试时发生。使用 Oracle 或 OpenJDK 运行时,测试运行没有失败。
有谁知道如何解决这个问题?
在部署和启动(使用 Tomcat )时,它的显示方式略有不同。
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