`
hotjava
  • 浏览: 178847 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

RMI,webStart配置

阅读更多

    今天搞了一整天部署,头都大了,发现部署这事也这么讨厌,记录一下。要不然以我的惊人的记忆力,不出48小时一定会忘记的。

spring服务器端的配置

xml 代码
  1.     <bean id="room" class="oss.rms.inventory.geo.business.impl.RoomImpl">  
  2.     <property name="roomDao">  
  3.         <ref bean="roomDao"/>  
  4.     </property>  
  5. </bean>  
  6.   
  7. <bean class="org.springframework.remoting.rmi.RmiServiceExporter">  
  8.     <property name="serviceName"><value>oss.rms.inventory.geo.business.IRoom</value></property>  
  9.     <property name="service"><ref bean="room"/></property>  
  10.     <property name="serviceInterface"><value>oss.rms.inventory.geo.business.IRoom</value></property>  
  11.     <property name="registryPort"><value>1099</value></property>  
  12. </bean>  

 

spring客户端的配置

xml 代码
  1. <bean id="room" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">  
  2.     <property name="serviceUrl"><value>rmi://192.168.140.1:1099/oss.rms.inventory.geo.business.IRoom</value></property>  
  3.     <property name="serviceInterface"><value>oss.rms.inventory.geo.business.IRoom</value></property>  
  4. </bean>  

打JAR包:

打jar包的时候,在Eclipse的工程选择Export....,JAR file,注意一定选上Main class。就是你程序运行的启动类。

然后导出JAR包,并给Jar包签名。

1。先用keytool -genkey -alias keystore算出一个密钥,密码可以任意输入。

2。jarsigner -signedjar a.jar b.jar keystore把b.jar签名为a.jar.

3.配置jnlp文件。格式如下:

xml 代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <jnlp spec="1.0+" codebase="http://10.48.44.5:7001/rms" href="rms.jnlp">  
  3.   <information>  
  4.     <title>rms</title>  
  5.     <vendor>cattsoft</vendor>  
  6.     <homepage href="rms.html" />  
  7.   </information>  
  8.   <security>  
  9.     <all-permissions/>  
  10.   </security>  
  11.   <resources>  
  12.     <j2se version="1.5+" max-heap-size ="512M"/>  
  13.     <jar href="rms_sign.jar" />  
  14.     <jar href="rms_util.jar" />  
  15.   </resources>  
  16.   <application-desc main-class="oss.rms.RmsMain" />  
  17. </jnlp>  

index.htm文件如下:

java 代码
  1. <html>   
  2. <head>   
  3. <meta http-equiv="Content-Type" content="text/html; charset=GBK" />   
  4. <title>rms</title>   
  5. <script type="text/javascript">   
  6. var javawsInstalled = false;   
  7. var isIE = false;   
  8. var isICE = navigator.userAgent.indexOf("ICEBrowser") >= 0;   
  9. if (navigator.mimeTypes && navigator.mimeTypes.length)   
  10.   javawsInstalled = navigator.mimeTypes['application/x-java-jnlp-file'];   
  11. else  
  12.   isIE = true;   
  13. function insertLink(url, name) {   
  14.   if (javawsInstalled) {   
  15.     document.write("</p><a href=\"" + url + "\">"  + name + "</a>");   
  16.   } else {   
  17.     if (isICE) {   
  18.       document.write("JBuilder's Web View does not support Web Start (no appropriate Web Start plugin is available). ");   
  19.       document.write("Other popular (external) browsers are supported");   
  20.     } else {   
  21.       document.write("Need to install Java Web Start");   
  22.     }   
  23.     document.write(" -- for more information, visit ");   
  24.     document.write("<a href=\"http://java.sun.com/products/javawebstart/\">" );   
  25.     document.write("the Java Web Start page");   
  26.     document.write("</a></p>");   
  27.   }   
  28. }   
  29. </script>   
  30. <script type="text/vbscript">   
  31. on error resume next   
  32. If isIE Then   
  33.   If Not(IsObject(CreateObject("JavaWebStart.IsInstalled"))) Then   
  34.     javawsInstalled = false  
  35.   Else   
  36.     javawsInstalled = true  
  37.   End If   
  38. End If   
  39. </script>   
  40. </head>   
  41. <body>   
  42. <h1>Java Web Start application</h1>   
  43. <script type="text/javascript">   
  44. <!--   
  45. insertLink("rms.jnlp","接入网");   
  46. insertLink("rms.jnlp","交换网");   
  47. insertLink("rmsgeo.jnlp","空间资源");   
  48. insertLink("rmsdata.jnlp","基础数据网");   
  49. insertLink("rmsnode.jnlp","物理设备");   
  50. // -->   
  51. </script>   
  52. <noscript>   
  53. <a href="rms.jnlp">rms</a>   
  54. </noscript>   
  55. </body>   
  56. </html>   

然后打war包,jar -cvf rms.war *,并部署到weblogic下。

Linux的Server端启动文件

java 代码
  1. #! /usr/bin/ksh   
  2.   
  3. if [[ -z "$JAVA_HOME" ]]   
  4. then   
  5.     echo "Please set the JAVA_HOME environment variable"  
  6. fi   
  7. echo "********************"  
  8. JAVA="/home/wls/bea/jdk150_04/bin/java"  
  9. LIB="../lib"  
  10. # set the classpath   
  11. CP=$(echo ${LIB}/*.jar ./*.jar | tr ' ' ':')   
  12. CP=${CP}:../lib/:../conf:..   
  13. #======================================   
  14. echo  ${CP}   
  15. #======================================   
  16. nohup ${JAVA} -Xmx512m -cp ${CP} oss.rms.RmsServer &   
  17.   

在Linux下执行此脚本,就能启动oss.rms.RmsServer这个jar包了,此时server端就启动了

 

分享到:
评论
2 楼 hotjava 2006-12-08  
累死我了.......搞了半天
1 楼 hotjava 2006-12-08  
aaaaa

相关推荐

Global site tag (gtag.js) - Google Analytics