2017-10-09 1 views
0

http rest appiを使用して、AS wildfly上にWebアプリケーションをデプロイ(再)することができました。 機能は動作しますが、問題があります。 だから、機能:web-appをアップロードして展開する機能が正しく動作しない

def upload_and_deploy(server, app): 
    try: 
     pass 
     files = {'file': open(distr_path + '/app-01.001.02-028.war', 'rb')} 
     response = requests.post('http://' + server + ':9990/management/add-content', files=files, auth=HTTPDigestAuth('login', 'password')).text 
     response_converted_to_json = json.loads(response) 
     bytes_value_from_response = response_converted_to_json["result"]["BYTES_VALUE"] 
     json_start = '{"content":[{"hash": {"BYTES_VALUE" : "' 
     json_end = '"}}], "address": [{"deployment":"'+ app + '"}], "operation":"add", "enabled":"true"}' 
     full_json_for_deploy_request = json_start+bytes_value_from_response+json_end 
     print '>>>>>>', full_json_for_deploy_request 
     response = requests.post('http://' + server + ':9990/management', auth=HTTPDigestAuth('login', 'password'), data= (full_json_for_deploy_request), headers=headers) 
     print "Start", app, "code -", response.status_code 

    except requests.exceptions.ConnectionError: 
     print 'Server - %s not run' % server 

結果はよさそうだ:ログAS

>>>>>> {"content":[{"hash": {"BYTES_VALUE" : "t3W62oVUihsqyINy9rRG/T3DuI4="}}], "address": [{"deployment":"app-name"}], "operation":"add", "enabled":"true"} 
Start app-name code - 200 

は一般的ではないように見えますが、エラーなし:

2017-10-09 10:07:07,688 INFO [org.jboss.as.repository] (XNIO-1 task-9) WFLYDR0001: Content added at location /opt/platform/wildfly-9.0.2.Final/standalone/data/content/b7/75bada85548a1b2ac88372f6b446fd3dc3b88e/content 
2017-10-09 10:07:07,704 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0027: Starting deployment of "app-name" (runtime-name: "app-name") 
2017-10-09 10:07:07,983 INFO [org.jboss.as.server] (XNIO-1 task-2) WFLYSRV0010: Deployed "app-name" (runtime-name : "app-name") 

だから、アプリケーションが実行されているが、機能していません。 誰かが私にキューを与えることができます、それは何が問題なのですか?

答えて

1

適切な処理が行われるように、展開名は有効なアーカイブ拡張子で終了する必要があります。あなたの場合、それは.warで終わるはずです。

json_endは次のようになります。

json_end = '"}}], "address": [{"deployment":"'+ app + '.war"}],"operation":"add", "enabled":"true"}' 
関連する問題