前不久用Struts2+Spring3+Hibernate3做了一个简单的B2C的小项目,那是为了方便使用的Tomcat6作为服务器,但最近工作不是很忙,就尝试着把前面做的B2C部署到WebLogic10上,本以为不会有什么问题,但实际中却遇到了几个问题,总结如下: ①?????WebLogic10与Hibernate3的冲突问题 在网上找了很久,方案在日志{weblogic10和hibernate3?冲突解决方案(转)?}中已经说明了,这里就不再说明。 ②?????web.xml中配置的spring自动管理session用的是监听器形式的,在启动时会报错 解决方案:将原来监听器形式― <listener> <listener-class> org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor </listener-class> </listener> 更改成过滤器形式,如下― <filter> ???????<filter-name>autoSession</filter-name> <filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter </filter-class> </filter> <filter-mapping> ????????<filter-name>autoSession</filter-name> ????????<url-pattern>/*</url-pattern> </filter-mapping> ③?????web.xml配置的struts2的核心过滤器中的struts.xml文件不能加载,以及在log4j.properties文件配置的日志文件路径问题: 说明:我有这样一个习惯,尽可能的将项目的配置文件放置在WEB-INF/config/文件夹下,相信大家也知道,如果将struts.xml文件配置到非CLASSPATH下,则需要在web.xml配置strut2核心过滤器时,初始化struts.xml文件路径。如我将struts.xml文放置在WEB-INF/config/struts/路径下。如果是在Tomcat6服务器下,我是在web.xml中这样配置的,如下: <filter> ??????????????<filter-name>struts2</filter-name> ??????????????<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> ??????????????<init-param> ?????????????????????<param-name>config</param-name> ?????????????????????<param-value> struts-default.xml,struts-plugin.xml,../config/struts/struts.xml </param-value> ??????????????</init-param> ???????</filter> ???????<filter-mapping> ??????????????<filter-name>struts2</filter-name> ??????????????<url-pattern>/*</url-pattern> ???????</filter-mapping> 但是在WebLogic10服务器下,这种形式不能加载struts.xml文件,原因是它找不到../config/struts/struts.xml文件,于是通过在WebLogic10服务器下查找B2C的目录结构,发现B2C项目在$WEBLOGIC_HOME/user_projects/domains/milodomain/autodeploy/下(说明:$WEBLOGIC_HOME表示安装的WebLogic10所在目录,milodomain表示本人自己建立的domain)然后再log4j.properties配置日志文件为log4j.appender.file.File=../webapps/${工程名称}/logs/debug.log,发现在启动WebLogic10服务器,在$WEBLOGIC_HOME/user_projects/domains目录下生成一个webapps文件夹,里面有日志文件,并且日志打出,于是推断“../”表示$WEBLOGIC_HOME/user_projects/domains,最后也就得到不能加载struts.xml文件的解决方案如下:{修改web.xml中struts2核心过滤器配置文件的路径} <filter> ??????????????<filter-name>struts2</filter-name> ??????????????<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> ??????????????<init-param> ?????????????????????<param-name>config</param-name> ?????????????????????<param-value> struts-default.xml, struts-plugin.xml, ?../milodomain/autodeploy/${工程名称}/WEB-INF/config/struts/struts.xml </param-value> ??????????????</init-param> ???????</filter> ???????<filter-mapping> ??????????????<filter-name>struts2</filter-name> ??????????????<url-pattern>/*</url-pattern> ???????</filter-mapping> 同理我们修改log4j.properties中日志文件的路径也可以将日志文件放置在我们想要的位置。
详细解决方案
WebLogic支配SSH2项目的小结
热度:194 发布时间:2012-10-20 14:12:48.0
相关解决方案
- webLogic,该怎么解决
- weblogic API 怎么上载
- SSH2 Ajax异常
- weblogic 12c 怎么配置一般数据源
- SSH2+DWR框架有关问题~
- weblogic 调度项目出错
- ssh2 登陆提交表单出现空指针错误
- weblogic 文件下载有关问题
- SSH2 多次库操作 程序卡住,该怎么处理
- Weblogic Native IO 有关问题一则
- apache,weblogic,websphere这些web服务器,能用asp或asp.net吗?解决办法
- [高手]weblogic server 启动怎么不去部署以前部署过的项目
- weblogic 8.1 公布的应用程序每天老死掉! 在哪里看到日志关于死掉的原因
- 安装BEA.WebLogic.Server.9.1.for.Windows出现的有关问题
- weblogic 健康检查解决方法
- WebLogic Server/Express 8.1 with SP4便是weblogic9.0么
- weblogic 8.1 公布的这样很SQL到数据库 它为什么呢
- weblogic Adminserver起步后,console无法登录
- weblogic lisence.bea,该如何解决
- WEBLOGIC 上部署war
- WEBLOGIC 十 域的创建
- weblogic 端口有关问题
- 小弟我想问一上,用 WEBLOGIC 好,还是 WEBSPHERE好,还是JBUILDER好
- weblogic 监测,jmx,请求
- weblogic 运行几天突然关闭有关问题
- weblogic 8.1初学者级有关问题:关于setWLSEnv.cmd中的classpath
- WebLogic 中JSP标签嵌套有关问题
- weblogic 许可替换有关问题
- 请大家帮忙,“weblogic.servlet.jsp.CompilationException”出现这样的异常,是咋回事
- WEBLOGIC 10 域的创建解决方法