SpringContextUtil.getBean("testStudentFacade")有什么问题? 异常可能被抛出了,你catch一下看看。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在标签类中异常跑步出来,不知道怎么搞得。最后问题锁定SpringContextUtil这个类,用它的什么方法都会抛异常。但是SpringContextUtil这个类有什么问题呢?我在ContextLoaderListener已经把它这样了:public void contextInitialized(ServletContextEvent event) { super.contextInitialized(event); ServletContext context = event.getServletContext(); ApplicationContext ctx = WebApplicationContextUtils .getRequiredWebApplicationContext(context); SpringContextUtil.setApplicationContext(ctx); String contextName = context.getServletContextName(); log.info("eapf::: contextName==>"+contextName); String realpath = context.getRealPath("/"); log.info("eapf:::realpath==>"+realpath); String serverInfo = context.getServerInfo(); log.info("eapf:::serverInfo==>"+serverInfo); SpringContextUtil.setContextName(contextName); SpringContextUtil.setRealPath(realpath); SpringContextUtil.setServerInfo(serverInfo); }debug时上面的也没问题呀,为什么SpringContextUtil就是用不成?真搞不懂!!! 我也遇到这样的问题,看一下你的SpringContextUtil是怎么写的??? 关于url转换 二级缓存load()方法有效,别的方法无效,很杯具! 'sessionFactory'问题 请教关于axis1.2的问题 bat给main方法传参日文乱码问题 请教个关于ANT邮件的问题 文件上传下载(EXCEL) <logic:iterate>究竟可以检索什么范围内的集合? struts问题:如何实现修改功能? 急问高手关于在web.xml中的ejb-link说明? struts2问题-There is no Action mapped for namespace 关于自定义maven目录结构的问题?(不使用推荐目录)
异常。但是SpringContextUtil这个类有什么问题呢?我在ContextLoaderListener已经把它这样了:
public void contextInitialized(ServletContextEvent event) {
super.contextInitialized(event);
ServletContext context = event.getServletContext();
ApplicationContext ctx = WebApplicationContextUtils
.getRequiredWebApplicationContext(context);
SpringContextUtil.setApplicationContext(ctx); String contextName = context.getServletContextName();
log.info("eapf::: contextName==>"+contextName);
String realpath = context.getRealPath("/");
log.info("eapf:::realpath==>"+realpath);
String serverInfo = context.getServerInfo();
log.info("eapf:::serverInfo==>"+serverInfo);
SpringContextUtil.setContextName(contextName);
SpringContextUtil.setRealPath(realpath);
SpringContextUtil.setServerInfo(serverInfo); }
debug时上面的也没问题呀,为什么SpringContextUtil就是用不成?真搞不懂!!!