Instantiation of bean failed; nested exception is org.springframework.beans.Bean

zhangxuli 2014-05-14 09:29:47
String index out of range: -1
Could not instantiate bean class [com.runfine.wd.action.LoginAction]: Constructor threw exception; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Error creating bean with name 'loginAction' defined in file [/usr/apache-tomcat-7.0.53/webapps/wd/WEB-INF/classes/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.runfine.wd.action.LoginAction]: Constructor threw exception; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Unable to instantiate Action, loginAction, defined for 'LoginAction' in namespace '/'Error creating bean with name 'loginAction' defined in file [/usr/apache-tomcat-7.0.53/webapps/wd/WEB-INF/classes/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.runfine.wd.action.LoginAction]: Constructor threw exception; nested exception is java.lang.StringIndexOutOfBoundsException: String index out of range: -1

本人将windows下部署好的项目发布到linux下登陆时报的错(在win下正常运行),求高手指点
...全文
14645 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangxuli 2014-05-16
  • 打赏
  • 举报
回复
谢谢你们的回答,问题找到了,是linux与windows下的路径不一样,action extends ActionSupportStruts2 ,ActionSupportStruts2 extends ActionSupportStrut,而ActionSupportStruts2中变量的文件路径没改。
tony4geek 2014-05-16
  • 打赏
  • 举报
回复
你看看这个文件找找看看。 [/usr/apache-tomcat-7.0.53/webapps/wd/WEB-INF/classes/applicationContext.xml]: 另外 linux 路径和window 不一样
zhangxuli 2014-05-16
  • 打赏
  • 举报
回复
项目中的所有bean都不能被实例化
zhangxuli 2014-05-16
  • 打赏
  • 举报
回复
可是配置都好着呢呀,在windows下都能运行正常,
tony4geek 2014-05-16
  • 打赏
  • 举报
回复
应该配置 问题 找不到 Unable to instantiate Action, loginAction, defined for 'LoginAction' in namespace '/'Error creating bean with name 'loginAction' defined in file [/usr/apache-tomcat-7.0.53/webapps/wd/WEB-INF/classes/applicationContext.xml]:
zhangxuli 2014-05-16
  • 打赏
  • 举报
回复
项目在windows下运行正常,在linux下我也试过其他的模块存在同样的问题,不能实例化bean,
点滴寸土 2014-05-15
  • 打赏
  • 举报
回复
配置文件里loginAction这一块配置有问题吧

81,120

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧