这是stacktrace:
上下文初始化失败 org.springframework.beans.factory.BeanCreationException:创建在ServletContext资源[/WEB-INF/applicationContext.xml]中定义名称为'sqlSessionFactory'的bean时出错:bean的初始化失败;嵌套异常是java.lang.reflect.MalformedParameterizedTypeException
我使用了带有mybatis-spring 1.1.1的库,并添加了spring-web-3.1.1.RELEASE.jar。我的IDE是JDeveloper 11.1.2.1.0。这是WEB-INF / lib
的内容 aopalliance-1.0.jar
commons-logging-1.1.1.jar
jettison-1.1.jar
mybatis-3.1.1.jar
mybatis-spring-1.1.1.jar
mybatis-spring-1.1.1-javadoc.jar
mybatis-spring-1.1.1-sources.jar
spring-aop-3.1.1.RELEASE.jar
spring-asm-3.1.1.RELEASE.jar
spring-batch-core-2.1.8.RELEASE.jar
spring-batch-infrastructure-2.1.8.RELEASE.jar
spring-beans-3.1.1.RELEASE.jar
spring-context-3.1.1.RELEASE.jar
spring-core-3.1.1.RELEASE.jar
spring-expression-3.1.1.RELEASE.jar
spring-jdbc-3.1.1.RELEASE.jar
spring-tx-3.1.1.RELEASE.jar
spring-web-3.1.1.RELEASE.jar
xpp3_min-1.1.4c.jar
xstream-1.3.jar
这是applicationContext.xml的内容
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${driverClassName}"/>
<property name="url" value="${url}"/>
<property name="username" value="${username}"/>
<property name="password" value="${password}"/>
</bean>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="ph.com.aub.util"/>
</bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="ph.com.aub.mappers" />
</bean>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location">
<value>classpath:jdbc.properties</value>
</property>
</bean>