struts-config.xml
=================================
<action attribute="adminForm"
input="/jsp/ques/errors.jsp"
path="/jsp/admin/admin"
type="org.springframework.web.struts.DelegatingActionProxy"
scope="request"
parameter="method"
>
<forward name="admin" path="/jsp/admin/adminlogin.jsp"></forward>
</action>=========================
applicationContext-*.xml
===========
<bean name="/jsp/admin/admin" class="org.lzq.jxlt.struts.action.AdminAction">
<property name="adminservice" ref="adminservice"></property>
</bean>
<bean id="admindao" class="org.lzq.jxlt.dao.impl.AdminDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean><bean id="adminservice" class="org.lzq.jxlt.service.impl.AdminServiceImpl">
<property name="admindao" ref="admindao"></property>
</bean>
=============控制台异常:16:25:59,936 ERROR ContextLoader:205 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/jsp/admin/admin' defined in file [D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyTest\WEB-INF\classes\applicationContext-actions.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: No matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:212)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:127)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:775)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:608)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:970)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:729)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:416)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2010-1-4 16:25:59 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/jsp/admin/admin' defined in file [D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyTest\WEB-INF\classes\applicationContext-actions.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: No matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:212)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:127)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:775)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:608)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(
在线等!
=================================
<action attribute="adminForm"
input="/jsp/ques/errors.jsp"
path="/jsp/admin/admin"
type="org.springframework.web.struts.DelegatingActionProxy"
scope="request"
parameter="method"
>
<forward name="admin" path="/jsp/admin/adminlogin.jsp"></forward>
</action>=========================
applicationContext-*.xml
===========
<bean name="/jsp/admin/admin" class="org.lzq.jxlt.struts.action.AdminAction">
<property name="adminservice" ref="adminservice"></property>
</bean>
<bean id="admindao" class="org.lzq.jxlt.dao.impl.AdminDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean><bean id="adminservice" class="org.lzq.jxlt.service.impl.AdminServiceImpl">
<property name="admindao" ref="admindao"></property>
</bean>
=============控制台异常:16:25:59,936 ERROR ContextLoader:205 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/jsp/admin/admin' defined in file [D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyTest\WEB-INF\classes\applicationContext-actions.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by:
java.lang.IllegalArgumentException: No matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:212)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:127)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:775)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:608)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:970)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:729)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:416)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:290)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348)
at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2010-1-4 16:25:59 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/jsp/admin/admin' defined in file [D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\MyTest\WEB-INF\classes\applicationContext-actions.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [org.lzq.jxlt.service.AdminService] for property 'adminservice'; nested exception is java.lang.IllegalArgumentException: No matching editors or conversion strategy found
Caused by: java.lang.IllegalArgumentException: No matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:212)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:127)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:775)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:608)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(
在线等!
解决方案 »
- 中文的正则表达式
- 这两句代码是神马意思?
- Ext中加载数据,请高手赐教,在线等,谢谢!
- 一个JAVA高斯消去法问题,有点小错误不会改,麻烦各位了,好的给高分,急~~~~~~~~
- 急急急急急急急急急急急急!!!!请问各位学长,谁有加密与解密的源代码。急用谢谢!!!
- 求助sql查询问题
- 各位进来帮个忙,实在搞不出来了,简单的问题.struts
- 关于org.apache.axis.client.AdminClient的问题
- 如何在JBuiulder中实现一个菜单的功能
- 怎样设置TOMCAT的server.xml中的某些端口(急……急!!!!!)
- Spring 2.5 驱动注解---无法找到实例
- JAVA怎么样实现即时消息提醒?
首先看你的注入有没有问题。DataSource---->SessionFactory---->Dao---->Biz---->Action
还有你最后在spring注入Action的那个路径 不要用id 用name=“/path”
自己写的挺垃圾的不好意思往上贴,实在没办法了
AdminAction:
public class AdminAction extends DispatchAction {
private AdminService adminservice; //跳转到Admin的网页上去
public ActionForward toAdminLogin(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
//AdminForm adminform=(AdminForm)form;
return mapping.findForward("admin");
}
public ActionForward adminLogin(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
AdminForm adminform=(AdminForm)form;
MD5Code md5=new MD5Code();
String adminname=adminform.getAdminname();
String adminpwd=adminform.getAdminpwd();
boolean ad=this.adminservice.loginAdmin(adminname, md5.getMD5ofStr(adminpwd));
if(ad==true)
{
return mapping.findForward("adminloginsuccess");
}
else
{
return mapping.findForward("loginfalse");
}
}
//管理员添加
public ActionForward addAdmin(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
AdminForm adminform=(AdminForm)form;
MD5Code md5=new MD5Code();
Admin admin=new Admin();
String adminname=adminform.getAdminname();
String adminpwd=adminform.getAdminpwd();
admin.setAdminname(adminname);
admin.setAdminpwd(md5.getMD5ofStr(adminpwd));
this.adminservice.addAdmin(admin);
return mapping.findForward("addadmin");
} public AdminService getAdminservice() {
return adminservice;
} public void setAdminservice(AdminService adminservice) {
this.adminservice = adminservice;
}
}
AdminService是接口还是类?
先检查xml文件里是否有写错的地方,
要不然就是短了六个jar包,
实在不行,也不懂了。我最后是把软件重装了一次行可以的
<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml" />
</plug-in>
这个配置了吗
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext-*.xml</param-value>
</context-param>