【问题标题】:war/ear file deployment using jython/python scrpting from remote location in webspehere从 websphere 中的远程位置使用 jython/python 脚本部署 war/ear 文件
【发布时间】:2016-07-27 19:47:45
【问题描述】:

我是 jython 和 python 脚本的新手。

我的新要求是使用脚本从 windows 客户端部署一个 war 文件到 windows 服务器。

我已经用过ant,在本地环境下完成了。从远程我做了研发,但我没有得到解决方案。

这就是我转向 jython 脚本的原因,并完成了本地环境部署。 但远程部署不起作用。

您能否分享任何想法以及如何将战争文件从我的环境部署到远程位置?

【问题讨论】:

  • 能否请您发布您自己尝试过的内容?

标签: java python maven deployment ant


【解决方案1】:

Murali,请参考http://www.jroller.com/holy/entry/was_6_0_ant_tasks。这有帮助吗。您是否收到特定错误。也可以参考:Using Ant to deploy EAR to remote websphere application server了解详情。

您可以使用服务任务进行部署,您可以提及远程服务器端口和主机名进行部署

<target name="_startEarApp" depends="" description="Start a deployed ear app on the WAS server">
            <wsStartApp wasHome="${was.root}" conntype="SOAP"
                        application="AppName"
                        host="my-remote-server" 
port="remote-server-soap-port"
                        user="me" password="pass"
                        failonerror="true"
                        />

对于其他 WS 版本也发现了这一点:https://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html

【讨论】:

  • 这是我为在本地 WAS 中部署 war 文件而编写的脚本,您能否分享任何文档或程序以在远程位置部署 war 文件。windows 或 linux
  • contextRoot = sys.argv[0] appPath = sys.argv[1] appName = sys.argv[2] projectName = sys.argv[3] 全局warFile for word in words: if word.结束('.war'):warFile=word print warFile nodeName= AdminControl.getNode() cellName=AdminControl.getCell() wsadminSvr = AdminControl.queryNames("node="+AdminControl.getNode()+",type=Server, *" ) wsadminServer = AdminControl.getAttribute(wsadminSvr, "name" )
  • appOptions = "[-server " + wsadminServer + " -node " + nodeName + " -contextroot " + '/'+contextRoot appOptions = appOptions + " -MapWebModToVH [["+"\"" +projectName+"\"" +" "+warFile+",WEB-INF/web.xml default_host ]]" appOptions = appOptions + " -appname " + appName appOptions = appOptions + "]" installedapps = AdminApp.list().splitlines () appManager = AdminControl.queryNames("cell="+cellName+",node="+nodeName+",type=ApplicationManager,process=server1,*") print installedapps if appName in installedapps: print 'app exists' isExist = 1 if ( isExist == 1 ):
  • print "stopping %s" % (appName) AdminControl.invoke(appManager, "stopApplication", appName) sleep(10) #如果存在,卸载应用程序 print "Uninstalling %s" % (appName) AdminApplication.uninstallApplication(appName) else: print 'app does not exist' #isExist = 0 print appOptions AdminApp.install(appPath, appOptions) print "保存前" AdminConfig.save() print "保存后"
  • print appManager print "before invoking" AdminControl.invoke(appManager, "startApplication", appName)
【解决方案2】:

每个人都建议将类路径设置为 wasanttask.jar 或 com.ibm.websphere.v61_6.1.100.ws_runtime.jar

并获取详细信息。

但在 WAS 8.5 中没有可用的同名 jars

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-12-10
    • 1970-01-01
    • 2018-05-10
    • 2011-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多