Jbuilder集成OC4J配置:
1.把oc4j_extended.zip(oracle站点download)文件拷贝到本机,解压缩到目录OC4J
2.在Dos模式下,进入目录C:/oc4j/j2ee/home,执行java -jar oc4j.jar -install ,输入密码
3.再进入C:/oc4j/j2ee/home/config,修改http-web-site.xml文件,斜体加粗为修改部分
<web-site port="8888"
display-name="Oracle9iAS Containers for J2EE HTTP Web Site">
8888修改为5555,(避开7777,保持原来机器的Oracle9ias可用)
然后配置data-sources.xml,例
<data-source class="com.evermind.sql.DriverManagerDataSource" name="OracleDS"
location="jdbc/OracleCoreDS"
xa-location="jdbc/xa/OracleXADS"
ejb-location="xxxxxx"
connection-driver="oracle.jdbc.driver.OracleDriver"
username="xxxx"
password="xxxx"
url="jdbc:oracle:thin:@172.16.113.2:1521:orcl" inactivity-timeout="90"/>
4. 配置jbuilder9的服务器,选择菜单:tools->configure servers
oracle server 903的配置项如下:
Home Directory选择为C:/oc4j/j2ee/home
server para : -config C:/oc4j/j2ee/home/config/server.xml
CUSTOM配置面板里:
输入password,然后新建一个oc4j deployment target
5. 配置工程属性:选择菜单Project -> project properties
server配置面板里:
勾选single server for all services in project
服务器选择为Oracle9i Application Server 903
Project -> project properties->run配置面板里:
新建一个(New…)运行环境
Name: 随意(例如oc4j启动)
Build target选择为None
Type: 选择为Server
6 . 配置JDK, 选择菜单Tools -> Configure JDKs
选择jdk1.3,如果没有,新配置一个。(必须选择jdk1.3)
7. 以xx工程为例,在工程下面的Oracle9i_Application_Server里新建目录
/applications/cas/conf/mappings/GA_hoiku/hoiku,然后添加mappings.xml文件到mappings目录下,hoiku_mappings.xml文件拷贝到
/applications/cas/conf/mappings/GA_hoiku/hoiku,再把gengo.xml拷贝到conf目录中
mappings.xml文件内容如下:
<!DOCTYPE mappings [
<!ENTITY hoiku_mappings SYSTEM
"file:applications/cas/conf/mappings/GA_hoiku/hoiku/hoiku_mappings.xml">
]>
<mappings>
&hoiku_mappings;
</mappings >
8.环境配置完毕,点击刚才新建的run time(oc4j启动) 运行服务器
9. 修改程序的启动路径,http-web-site.xml:
<web-app application="cas" name="GA_hoiku" root="/cas/GA_hoiku" />
10.选择hoiku.eargrp,右键选择Deploy Options for “cas.ear”-> Deploy
11.运行http://localhost:5555/cas/GA_hoiku,注意端口号是前面的http-web-site.xml文件里指定的端口号
控制台命令:
1. 关闭服务器
java -jar admin.jar ormi://localhost:23791 admin(用户) admin(密码) –shutdown
2. 手工部署ear文件
java -jar admin.jar ormi://localhost:23791 admin admin -deploy -file
E:/login/ear/login.ear(ear文件的位置) -deploymentName login(配布的application名称)
3. 手工启动服务器 java -jar oc4j.jar