2014-03-19 5 views
1

나는 conn.py이라는 스크립트를 가지고 있으며 conn()이라는 함수가 있습니다. connect(username,password,url)을 사용하여 weblogic 도메인에 연결합니다. 그리고 스크립트 createServer.py 있습니다나는 독립적으로 wlst에 연결하여 다른 스크립트에이 함수를 사용할 수 있습니다.

__main__: 
    import conn 
conn.conn() 
cmo.createServer() 

내가 createServer()에 오류가 발생, 내가 아직이 방법에 의해 WLST 온라인 기능을 사용하는 방법, 자동 차단 기능() 내가 conn.conn()를 실행 한 후 보인다?

--------------------- 내 콘솔 반환 -------------

starting the script .... 
input your user name : weblogic 
input your user password : weblogic456 
Connecting to t3://localhost:7001 with userid weblogic ... 
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'demo'. 

Warning: An insecure protocol was used to connect to the 
server. To ensure on-the-wire security, the SSL port or 
Admin port should be used instead. 

connect OK. 

You will need to be connected to a running server to execute this command 


You will need to be connected to a running server to execute this command 

Error: No domain or domain template has been read. 
Problem invoking WLST - Traceback (innermost last): 
    File "/home/chopperlee/Program/Workspace/configWL/wlst/createServer.py", line 84, in ? 
    File "/home/chopperlee/Program/Workspace/configWL/wlst/createServer.py", line 37, in createServer 
AttributeError: 'NoneType' object has no attribute 'createServer' 
+0

뭐가 잘못 됐어? – Nilesh

+0

'이 명령을 실행하려면 실행중인 서버에 연결해야합니다. '및 AttributeError :'NoneType '객체에'createServer'속성이 없습니다. createServer()를 실행하기 전에 연결 해제됩니다. –

+0

전체 트랙 트랙 ? – Nilesh

답변

0

당신이 할 수있는 createServer.py "줄 37, 84 줄에 인자가 빠져 있는지 확인하십시오.

0

WLST 연결 함수는 파이썬에서 실제로 전역 모듈 인 전역 변수를 설정합니다 - 경우에 따라 conn 모듈 - 전체 파이썬 런타임이 아님

그래서 conn는 conn 모듈의 컨텍스트에서 실제로 작동합니다. - 및 che에 의존하는 다른 WLST 명령 ck for - conn 모듈 내부에서 호출하면 연결이 작동합니다.

그러나 conn 모듈의 연결을 기록하는 전역 변수는 기본 스크립트 나 거기에서 호출 된 WLST 명령에 표시되지 않으므로 기본 스크립트에서 실행될 때 연결이 필요한 WLST 명령이 실패합니다.