tomcat编译后的项目:
1. WEB-INF/lib下添加servlet-api.jar和jsp-api.jar;
2. 添加WEB-INF/下添加weblogic.xml文件(见项目中文件)
关键部分:
<context-root>/test</context-root>
<container-descriptor>
<!-- 指示优先从部署项目的WEB-INF/lib目录下加载jar包,解决WegLogic与项目包冲突问题 -->
<prefer-web-inf-classes> false</prefer-web-inf-classes>
<prefer-application-packages>
<package-name>javax.xml.bean.*</package-name>
<package-name>org.apache.log4j.*</package-name>
<package-name>org.apache.commons.*</package-name>
<package-name>org.apache.beehive.*</package-name>
<package-name>org.apache.struts.*</package-name>
<package-name>org.apache.xerces.*</package-name>
<package-name>org.apache.oro.*</package-name>
<package-name>org.apache.taglibs.*</package-name>
<package-name>org.springframework.*</package-name>
<package-name>com.bea.json.*</package-name>
<package-name>com.bea.netuix.*</package-name>
<package-name>com.bea.portlet.*</package-name>
<package-name>com.bea.wsrp.*</package-name>
<package-name>com.bea.p13n.*</package-name>
<package-name>com.bea.campaign.*</package-name>
<package-name>com.bea.commerce.*</package-name>
<package-name>com.jesims.*</package-name>
<package-name>mappings.*</package-name>
<package-name>messages.*</package-name>
</prefer-application-packages>
</container-descriptor>
以上Package中可能有不需要的,未测试
3.修改WEB-INF/下的web.xml文件:
不支持通配符
<context-param><param-name>
contextConfigLocation
</param-name>
<param-value> classpath*:spring-context.xml,classpath*:spring-context-shiro.xml,classpath*:spring-context-message.xml,classpath*:spring-context-async.xml,classpath*:spring-context-activiti.xml
</param-value>
</context-param>
<servlet>
<servlet-name>springServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value> classpath:spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
3. 修改weblogic 安装目录D:\Oracle\Middleware\wlserver_10.3\common\bin中的commEnv.cmd文件:
:sun
if "%PRODUCTION_MODE%" == "true" goto sun_prod_mode
set JAVA_VM=-client
set MEM_ARGS= -Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:+UseSpinning
set JAVA_OPTIONS=%JAVA_OPTIONS% -Xverify:none
goto continue
:sun_prod_mode
set JAVA_VM=-server
set MEM_ARGS= -Xms256m -Xmx512m -XX:MaxPermSize=512m -XX:+UseSpinning
goto continue
4.访问localhost:7001/test