Java org.springframework.web.servlet.FrameworkServlet initServletBean上下文初始化失败
Java org.springframework.web.servlet.FrameworkServlet initServletBean上下文初始化失败,java,xml,spring,servlets,Java,Xml,Spring,Servlets,无法将类型为“efms.db.dao.impl.AutoTestDaoImpl”的属性值转换为属性“AutoTestDao”所需的类型“efms.db.dao.AutoTestDao”。这看起来AutoTestDaoImpl实际上并没有实现AutoTestDao。。。但是我不认为升级到Spring 3会对它有什么改变,如果它以前工作过的话。AutoTestDaoImpl正确地实现了AutoTestDao,这就是为什么我没有找到根本原因。你能展示AutoTestDaoImpl和AutoTestDa
无法将类型为“efms.db.dao.impl.AutoTestDaoImpl”的属性值转换为属性“AutoTestDao”所需的类型“efms.db.dao.AutoTestDao”
。这看起来AutoTestDaoImpl实际上并没有实现AutoTestDao。。。但是我不认为升级到Spring 3会对它有什么改变,如果它以前工作过的话。AutoTestDaoImpl正确地实现了AutoTestDao,这就是为什么我没有找到根本原因。你能展示AutoTestDaoImpl和AutoTestDao吗?是否有任何AOP或事务代理?我已经在上面展示了AutoTestDaoImpl和AutoTestDao。。。不,我们没有使用AOP/事务代理
AutomationReport.java
public class AutomationReport {
private AutoTestDao autoTestDao;
private EventDao eventDao;
public void setAutoTestDao(AutoTestDao autoTestDao) {
this.autoTestDao = autoTestDao;
}
public AutoTestDao getAutoTestDao() {
return autoTestDao;
}
public void setEventDao(EventDao eventDao) {
this.eventDao = eventDao;
}
public EventDao getEventDao() {
return eventDao;
}
}
AutoTestDao.java
public interface AutoTestDao extends EfmsDatabaseDao {
/*******************************************************
Need to implement these methods from EfmsDatabaseDao
public Object getPrimaryKey(Object bean);
public Object insert(Object bean);
public Object insert(Object bean, boolean generatePK);
public Object update(Object bean);
public Object update(Object bean, boolean modifiedOnly);
public int delete(Object bean);
public Object findByPrimaryKey(Object key);
*******************************************************/
//Methods
}
AutoTestDaoImpl.java
public class AutoTestDaoImpl extends AutoTestDaoBaseImpl implements AutoTestDao {
private JdbcTemplate jdbcTemplate;
public AutoTestDaoImpl(DataSource ds) {
super(ds);
this.jdbcTemplate = new JdbcTemplate(ds);
}
public AutoTestDaoImpl(JdbcTemplate template) {
super(template);
}
//Methods Implemantation
}
<import resource="classpath:tp_dao.xml"/>
<import resource="classpath:tp_etl_db.xml"/>
<!-- This for local testing -->
<!--bean id="DataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName"><value>oracle.jdbc.OracleDriver</value></property>
<property name="url"><value>jdbc:oracle:thin:@floradbdv1.ims.att.com:1521:efmsdv</value></property>
<property name="username"><value>efms</value></property>
<property name="password"><value>efms8135</value></property>
</bean> -->
<bean id="transcationTemplate"
class="org.springframework.transaction.support.TransactionTemplate">
<constructor-arg>
<bean class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<constructor-arg><ref bean="DataSource"/></constructor-arg>
</bean>
</constructor-arg>
</bean>
<bean id="autoTestDao" class="efms.db.dao.impl.AutoTestDaoImpl">
<constructor-arg><ref bean="DataSource"/></constructor-arg>
</bean>
<bean id="eventDao" class="efms.db.dao.impl.EventDaoImpl">
<constructor-arg><ref bean="DataSource"/></constructor-arg>
</bean>
<bean id="automationReport" class="efms.bizobj.AutomationReport">
<property name="autoTestDao"> <ref bean="autoTestDao"/></property>
<property name="eventDao"> <ref bean="eventDao"/></property>
</bean>
<bean id="psatMetricsHome"
class="efms.controller.AutomationReportController">
<property name="automationReport"> <ref bean="automationReport"/></property>
</bean>
<bean id="wotAutomationReport"
class="efms.controller.AutomationReportController">
<property name="automationReport"> <ref bean="automationReport"/></property>
</bean>
<bean id="ctaAutomationReport"
class="efms.controller.AutomationReportController">
<property name="automationReport"> <ref bean="automationReport"/></property>
</bean>
<bean id="eadAutomationReport"
class="efms.controller.AutomationReportController">
<property name="automationReport"> <ref bean="automationReport"/></property>
</bean>
<bean id="ddAutomationReport"
class="efms.controller.AutomationReportController">
<property name="automationReport"> <ref bean="automationReport"/></property>
</bean>
<bean id="eventAutomationReport"
class="efms.controller.AutomationReportController">
<property name="automationReport"> <ref bean="automationReport"/></property>
</bean>
<bean id="urlMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/PSATMetricsHome.html">
<ref bean="psatMetricsHome" />
</entry>
<entry key="/WOTAutomationReport.html">
<ref bean="wotAutomationReport" />
</entry>
<entry key="/CTAAutomationReport.html">
<ref bean="ctaAutomationReport" />
</entry>
<entry key="/EADAutomationReport.html">
<ref bean="eadAutomationReport" />
</entry>
<entry key="/DDAutomationReport.html">
<ref bean="ddAutomationReport" />
</entry>
<entry key="/AutomationReport.html">
<ref bean="eventAutomationReport" />
</entry>
</map>
</property>
</bean>
TrigTransactionDao,EfmsNewtonControlDao,DetermineServiceSr,UpdSvcActivationDetailsSp,EfmsDerivativePkg,GetSvcRequestByRuleSp,ServiceActivationAdminDao,ServiceActivationDetailDao,Service2speedCpeDao,ServiceActivationRuleDao,ServiceActivationRuleLogDao,DefEfmsTransMsProcDao,SvcActByUsrDao,ServiceActivationCandidateProcessingDao,SvcActivationTrackingDao,LoadSvcActivationTrackingDao,DqaAutoLogDao,DqaAutoProcDao,DqaChecklistDataDao,DqaChecklistNodalDao,DqaDvaConfigDao,TsnowMsgTrackerDao,CompleteEvent,CompleteWorklistItem,DeriveDqaServiceType,FqPurgeSp,SystemCompleteWorklistItem,PsatConfigActivityLogDao,PsatProjectExcludeDao,PsatProductDao,PsatOcoDao,PsatMcnExcludeDao,EfmsOmxEventInfoDao,GetNewWorklistPkg,EventHistoryDao,IssueUpdateDao,WfEventNotificationDao,EfmsOmxProcDao,EventJeop,propertyConfigurer,txManager,efmsDBTransaction,dbTransaction,DataSource,transcationTemplate,autoTestDao,eventDao,automationReport,psatMetricsHome,wotAutomationReport,ctaAutomationReport,eadAutomationReport,ddAutomationReport,eventAutomationReport,urlMapping,viewResolver]; root of factory hierarchy
[10/30/14 13:06:48:569 EDT] 00000034 DispatcherSer E org.springframework.web.servlet.FrameworkServlet initServletBean Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'automationReport' defined in ServletContext resource [/WEB-INF/psatMetrics-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'efms.db.dao.impl.AutoTestDaoImpl' to required type 'efms.db.dao.AutoTestDao' for property 'autoTestDao'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [efms.db.dao.impl.AutoTestDaoImpl] to required type [efms.db.dao.AutoTestDao] for property 'autoTestDao': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:574)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:241)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:358)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:169)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:739)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3935)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:557)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:607)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:984)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1069)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1604)