JacORB安裝及配置指南

來源:互聯網
上載者:User

安裝前需要注意,JAVA_HOME配置的路徑不能含有空格(例如/Program Files/),另外Ant可以正常使用

1.  從svn上下載JacORB-2.3.0-bin.zip(不包含源碼)或者JacORB-2.3.0-src.zip(包含源碼)

2.  解壓的任意目錄下,如E:/JacORB

3.  在E:/JacORB下建立一個目錄classes

4.  添加如下的系統內容變數

1)  JACORB_HOME=E:/JacORB

2)  Path環境變數添加%JACORB_HOME%/bin

3)  Classpath環境變數添加%JACORB_HOME%/lib/idl.jar;%JACORB_HOME%/lib/jacorb.jar;%JACORB_HOME%/lib/logkit-1.2.jar;%JACORB_HOME%/lib/avalon-framework-4.1.5.jar;%JACORB_HOME%/classes;

5.  % JACORB_HOME%下的etc目錄有一個檔案jacorb_properties.template,將此檔案copy到步驟3所建立的classes目錄下,並修改檔案為jacorb.properties

6.  編輯jacorb.properties檔案,將其中的ORBInitRef.NameService對應的索引值更改為file:/c:/NS_Ref,如下:

ORBInitRef.NameService=file:/c:/NS_Ref

7.  % JACORB_HOME%下的etc目錄有一個檔案orb.properties,修改其中的jacorb.config.dir對應的索引值為e:/JacORB,如下:

jacorb.config.dir=e:/JacORB

8.% JACORB_HOME%下的etc目錄有一個檔案commom.xml,定位到如下位置:

       <path id="path.base" >

<!--      <pathelement location="${dirs.base}/classes"/> -->

      <pathelement location="${basedir}/classes"/>

      <!-- include all jars located in lib except the jacorb.jar -->

      <fileset dir="${basedir}/lib" >

         <include name="*.jar" />

         <exclude name="jacorb.jar" />

         <!--  

         <exclude name="idl.jar" />

         -->

      </fileset>

      <pathelement path="${java.class.path}"/>

      <pathelement path="${sun.boot.class.path}"/>

   </path>

       修改為粗體部分

9.  定位到% JACORB_HOME%下的bin目錄,發現存在下列4個檔案:

a)         idl.bat.tpl

b)        idl.tpl

c)         jaco.bat.tpl

d)        jaco.tpl

分別將上述4個檔案的tpl尾碼去掉(tpl表示template模板,不知為何從官方網站下載的檔案會出現這樣的問題,不修改直接導致jacorb無法工作)

10.              修改jaco.bat:

原先內容:

@JAVA_CMD@ -Djava.endorsed.dirs=@JACORB_HOME@/lib -Djacorb.home=@JACORB_HOME@ -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton -classpath %CLASSPATH% %*

修改後為:

JAVA -Djava.endorsed.dirs=%JACORB_HOME%/lib -Djacorb.home=%JACORB_HOME% -Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB -Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton -classpath %CLASSPATH% %*

11.              修改idl.bat:

原先內容:

@JAVA_CMD@ -classpath "@JACORB_HOME@/lib/idl.jar;@JACORB_HOME@/lib/logkit-1.2.jar;%CLASSPATH%" org.jacorb.idl.parser %*

修改後為:

JAVA -classpath "%JACORB_HOME%/lib/idl.jar;%JACORB_HOME%/lib/logkit-1.2.jar;%CLASSPATH%" org.jacorb.idl.parser %*

 

完成上述步驟無誤後,可以測試一下jacorb是否正確安裝,測試步驟如下:

 

1.  命令列視窗定位到% JACORB_HOME%下的demo/grid/目錄,輸入ant後直接斷行符號開始ant編譯,出現BUILD SUCCESSED表示編譯成功

2.  這樣會進行idl編譯server.idl檔案,在% JACORB_HOME%/demo/grid/generated下產生corba所需的源檔案 ,同時,ant會編譯所有的java源檔案,% JACORB_HOME%/classes下面產生 .class檔案

3.  開啟一個命令列視窗,輸入ns或ns.bat,出現如下資訊:

C:/Documents and Settings/muning>ns.bat

[jacorb.orb.print_ver] INFO :

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        JacORB V 2.3.0, www.jacorb.org

        (C) The JacORB project 17-Feb-2007

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[jacorb.orb] INFO : Property "jacorb.hashtable_class" is set to: java.util.Hasht

able

[org.jacorb.orb.codes] WARN : Warning - unknown codeset (GBK) - defaulting to IS

O-8859-1

[jacorb.orb.intercept] INFO : InterceptorManager started with 0 Server Intercept

ors, 0 Client Interceptors and 1 IOR Interceptors

[jacorb.orb.singleton] INFO : created ORBSingleton

[jacorb.naming] INFO : NS up

[jacorb.orb] INFO : ORB run

表示JacORB正常啟動

4.  開啟一個新的命令列視窗,輸入jaco demo.grid.Server,出現如下資訊:

[jacorb.orb.print_ver] INFO :

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        JacORB V 2.3.0, www.jacorb.org

        (C) The JacORB project 17-Feb-2007

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[jacorb.orb] INFO : Property "jacorb.hashtable_class" is set to: java.util.Hasht

able

[org.jacorb.orb.codes] WARN : Warning - unknown codeset (GBK) - defaulting to IS

O-8859-1

[jacorb.orb.intercept] INFO : InterceptorManager started with 0 Server Intercept

ors, 0 Client Interceptors and 1 IOR Interceptors

[jacorb.poa] INFO : oid:

00 15 23 22 0E 02 3C 18 01 2C 37                            ..#"..<..,7

object is activated

[jacorb.poa] INFO : Using server ID (7483177760) for transient POA

[jacorb.orb.singleton] INFO : created ORBSingleton

[jacorb.orb.giop] INFO : ClientConnectionManager: created new ClientGIOPConnecti

on to 192.168.100.47:1407 (9f671b)

[jacorb.orb.iiop] INFO : Connected to 192.168.100.47:1407 from local port 1409

[jacorb.orb] INFO : ORB run

 

同時在步驟3開啟的視窗中出現:

[jacorb.naming] INFO : re-Bound name: grid.example

 

表示測試範例的ORB服務端正常啟動

5.  開啟一個新的命令列視窗,輸入,出現如下資訊:

[jacorb.orb.print_ver] INFO :

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        JacORB V 2.3.0, www.jacorb.org

        (C) The JacORB project 17-Feb-2007

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[jacorb.orb] INFO : Property "jacorb.hashtable_class" is set to: java.util.Hasht

able

[org.jacorb.orb.codes] WARN : Warning - unknown codeset (GBK) - defaulting to IS

O-8859-1

[jacorb.orb.intercept] INFO : InterceptorManager started with 0 Server Intercept

ors, 0 Client Interceptors and 1 IOR Interceptors

[jacorb.orb.singleton] INFO : created ORBSingleton

[jacorb.orb.giop] INFO : ClientConnectionManager: created new ClientGIOPConnecti

on to 192.168.100.47:1407 (1db699b)

[jacorb.orb.iiop] INFO : Connected to 192.168.100.47:1407 from local port 1419

[jacorb.orb.giop] INFO : ClientConnectionManager: created new ClientGIOPConnecti

on to 192.168.100.47:1408 (cbf30e)

[jacorb.orb.iiop] INFO : Connected to 192.168.100.47:1408 from local port 1420

Height = 31

Width = 14

Old value at (30,13): 0.21

Setting (30,13) to 470.11

New value at (30,13): 470.11

MyException, reason: This is only a test exception, no harm done

[jacorb.orb] INFO : prepare ORB for shutdown...

[jacorb.orb] INFO : ORB going down...

[jacorb.orb.iiop] INFO : Client-side TCP transport to 192.168.100.47:1408 closed

.

[jacorb.orb.iiop] INFO : Client-side TCP transport to 192.168.100.47:1407 closed

.

[jacorb.orb] INFO : ORB shutdown complete

 

看到這些表示你已經成功的運行了一個極其簡單的例子

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.