`
itcareerist
  • 浏览: 20554 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

WebLogic10.3.3部署SSH2

阅读更多

    以下描述在如下环境测试通过:
    JDK1.6+Windows2003/RedHat Enterprise Linux5.2+Struts2.1.8+Spring2.5.6+Hibernate3.3.2+DWR2.1

  1. Spring3和Hibernate2.5都需要antlr 2.7.5包的支持,在Weblogic10.3中集成的antlr的版本不够高,所以在部署时会出错。解决方法,修改启动的环境变量。
    先把antlr 2.7.5包拷贝到“域根目录/lib”下。
    Linux版本修改“域根目录/bin”下的startWebLogic.sh文件,大约在113行的:
    CLASSPATH="${CLASSPATH}${CLASSPATHSEP}${MEDREC_WEBLOGIC_CLASSPATH}"
     修改为(注意antlr 2.7.5一定要在weblogic.jar包之前加载):
    ANTLR_CP="${DOMAIN_HOME}/lib/antlr-2.7.6.jar"
    CLASSPATH="${ANTLR_CP}${CLASSPATH}${CLASSPATHSEP}${MEDREC_WEBLOGIC_CLASSPATH}"
      Windows版本修改“域根目录/bin”下的startWebLogic.cmd文件,大约在120行之后(即CLASSPATH设置完成后)增加如下内容(注意antlr 2.7.5一定要在weblogic.jar包之前加载,并且在if语句块之外):
    set ANTLR_CP=%DOMAIN_HOME%\lib\antlr-2.7.6.jar
    set CLASSPATH=%ANTLR_CP%;%CLASSPATH%
     
  2. 修改“域根目录/config”下的config.xml,在“admin-server-name”节点前增加如下内容(xxx根据实际Web应用名修改):
    <app-deployment>
      <name>xxx</name>
      <target>AdminServer</target>
      <module-type>war</module-type>
      <source-path>autodeploy/xxx</source-path>
      <security-dd-model>DDOnly</security-dd-model>
      <staging-mode>nostage</staging-mode>
    </app-deployment>
     
  3. 将Web应用拷贝至“域根目录/autodeploy”,目录名要求与config.xml中的“source-path”一致。
  4. WDR支持。由于项目中使用了DWR来显示树型菜单,因此,按照如上方式设置后启动服务器,登录后会提示“Session Error”。通过DWR官网上的一则Bug记录(http://directwebremoting.org/jira/browse/DWR-450),DWR需要Session Cookies的支持,而Weblogic默认情况下Session Cookies被禁止。在Web应用的WEB-INF目录下增加weblogic.xml文件,内容如下(xxx表示的context路径根据实际情况设置):
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <weblogic-web-app
      xmlns="http://www.bea.com/ns/weblogic/90"
      xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd"> 
    
      <context-root>/xxx</context-root>
      <session-descriptor>
      	<cookie-http-only>false</cookie-http-only>
      </session-descriptor>
    </weblogic-web-app>
     Weblogic官方文档对cookie-http-only属性的描述如下:
    Specifies whether HttpOnly cookies are enabled. When this element is set to true, all session cookies would be unavailable to the browser scripts. The default value is true. Therefore, HttpOnly cookies are enabled by default.
  5. 重新启动Weblogic,在地址栏中输入http://ip:port/xxx,即可访问到Web应用的首页。
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics