免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 805 | 回复: 0
打印 上一主题 下一主题

GT4发布服务 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-24 20:27 |只看该作者 |倒序浏览
一 启动数据库
   su postgre
   cd /usr/local/pgsql/bin
   ./postmaster -S -i
二 启动container.
    出现错误:说找不到CASService.因为我以前配过CAS,让container启动时候自动启动CAS服务
    ,但是没配好使,所以出现这种错误,可以修改$GLOBUS_LOCATION/etc/globus_cas_service/server-config.wsdd
    把注释掉.
三 将java ws core发布到Tomcat中
  1 以globus用户执行
    cd $GLOBUS_LOCATION/gt4.0
    ant -f share/globus_wsrf_common/tomcat/tomcat.xml deploySecureTomcat -Dtomcat.dir=/home/tools/jakarta-tomcat-5.0.28
    出现错误:BUILD FAILED
     /home/globus/gt4.0/share/globus_wsrf_common/tomcat/tomcat.xml:152: Following error occured while executing this line
     /home/globus/gt4.0/share/globus_wsrf_common/tomcat/tomcat.xml:79: Directory /home/tools/jakarta-tomcat-5.0.28/webapps/wsrf creation was not successful for an unknown reason
     因为globus对tomcat这个目录没有操作权限,所以创建不了文件夹,最后chmod o+rwx /home/tools/jakarta-tomcat-5.0.28
  2 修改文件/conf/server.xml
    1) 把HTTP Connector加到 section中并修改相应的参数
      
    2) Add a HTTPS Valve in the  section
      
  3  Enabling local invocations
     将/home/tools/jakarta-tomcat-5.0.28/common/lib/axis-url.jar加到classpath中
  4 调试
    可以配置让其产生一些调试信息
  5 创建war文件
  6 测试
    用root用户,要不没有权限,要删除的时候不能删除,创建的时候不能创建
    ant -f share/globus_wsrf_test/runtests.xml runServer \
       -Dtests.jar=$GLOBUS_LOCATION/lib/wsrf_test_interop.jar\
    ant -f share/globus_wsrf_test/runtests.xml runServer \
       -Dtests.jar=$GLOBUS_LOCATION/lib/wsrf_test_unit.jar -DbasicTestsOnly=true
  7 发布服务
    首先要用globus-deploy-gar 工具将服务发布到gt中,然后再发布到Tomcat中
四 发布服务
    一共五步:1 定义服务接口:用wsdl
              2 实现服务:用Java
       3 定义部署参数:用wsdd和JNDI
       4 编译并生成GAR文件:用Ant
       5 部署服务:用GT4工具
    生成服务的gar文件的时候,说是stub文件出了错误,把这个文件该了以后重新生成还是不好使,所以
    我就把build。xml文件中的那个stub这个target给注销了,后来就好使了。
    后来发现是版本问题
    2 用客户端调用
      source $GLOBUS_LOCATION/etc/globus-devel-env.sh
      错误:java.io.IOException: No socket factory for 'https' protocol
      解决办法:在客户端程序中加入
      import org.globus.axis.util.Util;
      ...
      static {
         Util.registerTransport();
       }
      ...
      错误:broken pipe错误.
      原因:服务端用的是https协议,而客户端用的是http协议.做的时候一定要认真,将container中的服务
           拷过来.
  五 发布自己的服务,
     发布服务的文件放在:/home/globus/gt4.0/webservice/sheji中。
     发布生成证书的服务AttrCert.调用的方法:generate,资源属性:result
     1 写自己的wsdl文件AttrCert.wsdl,可以根据接口函数生成。
       放在/home/globus/gt4.0/webservice/sheji/schema/AttrCertService_instance中
       注意修改里面的服务名字,名字空间和函数名,以及类变量名.注意:location="../../wsrf/properties/WS-ResourceProperties.wsdl
       由于我们的目录比例子的目录少了一层,所以是../而不是../../
     2 用java实现服务
       写AttrCertQName.java和AttrCertService.java
       AttrCertQName.java中为定义的属性定义个QName。
       AttrCertService.java
       注意修改里面的包名和类名.
       放在/home/globus/gt4.0/webservice/sheji/org/globus/services/core/first/impl中
     3 用wsdd和JNDI定义部署参数。
       deploy-server.wsdd.
       deploy-jndi-config.xml.
       中间也有要换得东西.我由于没改,结果和MathService的home重名了.
       放在/home/globus/gt4.0/webservice/sheji/org/globus/services/core/first中
     4 生成gar文件。
       用命令:./globus-build-service.sh -d org/globus/services/core/first/ -s schema/AttrCertService_instance/AttrCert.wsdl
       用到的文件:build.xml,build.mappings和namespace2package.mappings
       放在/home/globus/gt4.0/webservice/sheji/中
     5 生成Gar文件。
       放在了当前目录:org_globus_services_core_first.gar
       ./globus-build-service.sh first(在build.mappings中定义了first的映射)
     6 部署服务.
        globus-deploy-gar org_globus_services_core_first.gar
     7 启动container中有没有.
       1  Failed to start container: Container failed to initialize [Caused by: Failed to read '/home/globus/gt4.0/etc/org_globus_services_core_first/jndi-config.xml' JNDI configuration file]
          home重名错误,jndi文件有问题.
       2  Failed to start container: Failed to initialize 'core/first/AttrCertService' service [Caused by: Accessor method required for '{http://www.globus.org/namespaces/core/AttrCertService_instance}Result_str' property]
          有了重复定义.
     8 客户端调用:
       通过获得资源属性来获得变量的值.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/11237/showart_104355.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP