我有一个使用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