Issue #43 new

Context load error on run test with JDK7

Anonymous created an issue

I have a project that use 'mockito' and 'springockito' to implement stub and verify behavior on test. They runs (and test) like a charm with JDK6.

But with JDK7 it crashes on test, exactly on load the 'mocked' interface bean.

The configuration for mockito on context:

    <!-- Beans per a emprar als flows -->
    <mockito:mock id="serveiPersones" class="cat.base.hxx.serveis.IServeiPersones"/>

The interface cat.base.hxx.serveis.IServeiPersones is on attached file. Also I attached the spring context file.

The test crashes on load the context. The cause is a java.lang.reflect.MalformedParameterizedTypeException on creating the 'serveiPersones' bean:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serveiPersones': Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:42)
    at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:173)
    at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:197)
    ... 38 more
Caused by: java.lang.reflect.MalformedParameterizedTypeException
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(ParameterizedTypeImpl.java:60)
    at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(ParameterizedTypeImpl.java:53)

The attached file '20130808-test_error.log' contains the whole trace.

Comments (1)

  1. Przemek W

    It fails with version 1.0.4 which is the latest compatible with spring 2.5 (yea, I know, quite old). Works fine with never springockito versions (and spring accordingly)

    Are there any chances/plans to fix this issue?

  2. Log in to comment