导入了servlet包没有用,加了构造函数还是没用啊?

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chargeoffDetailAction' defined in file [D:\apache-tomcat-6.0.26\webapps\CreditService\WEB-INF\classes\applicationContext-action.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.db.credit.loan.inloan.chargeoff.action.ChargeoffDetailAction]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: 
The import javax.servlet.ServletContext cannot be resolved
The import javax.servlet.http.HttpServletRequest cannot be resolved
The import javax.servlet.http.HttpServletResponse cannot be resolved
The import javax.servlet.http.HttpSession cannot be resolved
HttpServletResponse cannot be resolved to a type
The method getRequest() is undefined for the type BaseAction<T>
The method getRequest() is undefined for the type BaseAction<T>
The method getRequest() is undefined for the type BaseAction<T>
HttpServletRequest cannot be resolved to a type
HttpServletResponse cannot be resolved to a type
HttpSession cannot be resolved to a type
ServletContext cannot be resolved to a type
The method getServletContext() is undefined for the type BaseAction<T>
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:997)
at com.db.credit.loan.inloan.chargeoff.action.ChargeoffDetailAction.<init>(ChargeoffDetailAction.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
... 30 more

四季花海
浏览 98回答 1
1回答

慕容708150

你的spring application.xml配置错误,或者加载的东西不存在,导致初始化加载失败
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java