---
title: "SSH项目从tomcat6迁移到weblogic11"
author: "guanfish"
date: "2011-08-15T16:45:16Z"
tags: []
categories: ["编程语言"]
slug: "ssh-tomcat6-weblogic11"
draft: false
lastmod: "2011-08-15T17:40:56Z"
id: 1149702
url: "https://mywork.iteye.com/blog/1149702"
---

今天做了一次把STRUTS2 + HIBERNATE3.6+SPRING2.5项目从TOMCAT6.0迁移到WEBLOGIC11。在迁移过程中发现了一些错误，也解决了一些错误。记录如下：

  1.ClassNotFoundException: org.hibernate.hql.ast.HqlToken  异常：

     在hibernate下执行hql语句出现上述错误。

    解决方法：

    在hibernate.cfg.xml文件中配置如下属性即可：

   

```
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
```

 2.session丢失：

    用户登录时设置了用户的session信息，在后续的应用中娶不到该session值。

   原因：weblogic中默认session是关闭的，所以需要在weblogic.xml中打开。

   解决办法：

   1、在bea的跟目录下增加文件夹beahomelist。即C:\\bea11\\beahomelist。即可解决问题。

   2、在weblogic.xml中配置如下

  

```
<session-descriptor>
	    <timeout-secs>3600</timeout-secs>
	    <invalidation-interval-secs>60</invalidation-interval-secs>
	    <cookie-name>ADMINCONSOLESESSION</cookie-name>
	    <cookie-max-age-secs>-1</cookie-max-age-secs>
	    <cookie-http-only>false</cookie-http-only>
	    <url-rewriting-enabled>false</url-rewriting-enabled>
	  </session-descriptor>
```