码迷,mamicode.com
首页 > Web开发 > 详细

部署SSH项目到weblogic server

时间:2015-04-09 12:07:32      阅读:479      评论:0      收藏:0      [点我收藏+]

标签:tomcat   weglogic   

本地WebServer为Tomcat7,最终部署到Weblogic 11g。以下方法全部为Google结果。


1. 部署后说ClassNotFoundException

 

weblogic类加载顺序问题,在WEB-INF目录下创建weblogic.xml。

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-web-app http://www.bea.com/ns/weblogic/weblogic-web-app/1.0/weblogic-web-app.xsd">
    <container-descriptor>
        <index-directory-enabled>true</index-directory-enabled>
        <prefer-web-inf-classes>true</prefer-web-inf-classes>
        <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    </container-descriptor>
</weblogic-web-app>

表示让weblogic先加载WEB-INF/lib下面的jar包


2. unable to instantiate action


weblogic中的web.xml不支持通配符的写法,如:

部署到tomcat中可以这样写

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:/applicationContext*.xml</param-value>
</context-param>

 

但是在weblogic中必须这样写

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value> 
        classpath:/applicationContext.xml
        classpath:/applicationContext-bean.xml  
    </param-value> 
</context-param>


3. SessionFactory配置

Tomcat下:

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="configLocation" value="classpath:hibernate.cfg.xml"/>
</bean>


Weblogic使用datasource:

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean" >
    <property name="jndiName">
        <value>jdbc/TESTDS</value>
    </property>
</bean>
    
<bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="mappingResources">
        <list>
            <value>com/pojo/Refresh.hbm.xml</value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
            <prop key="hibernate.connection.release_mode">auto</prop>
            <prop key="hibernate.current_session_context_class">jta</prop>
            <prop key="hibernate.transaction.manager_lookup_class">
                org.hibernate.transaction.WeblogicTransactionManagerLookup
            </prop>
        </props>
    </property>
</bean>


参考链接:http://simon-fish.iteye.com/blog/1136438

部署SSH项目到weblogic server

标签:tomcat   weglogic   

原文地址:http://knight1111.blog.51cto.com/1188392/1630390

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!