2013-12-09 1 views
0

프로그래밍 방식으로 glassfish 도메인을 시작, 중지, 설정하는 등의 작업이 필요합니다. 필자가 사용할 수있는 유일한 자원은 asadmin입니다. 따라서 나는Glassfish 도메인을 프로그래밍 방식으로 관리합니다.

$ asadmin list-domains 
Foo running 
domain1 not running 
Command list-domains executed successfully. 

그러나, 나는 실제로이 경우 기본 도메인, Foo 이외의 다른 도메인으로 이야기하는 방법 및 asadmin 말할 수있는 방법을 볼 수 있습니다. 그렇게하려면 Foo의 관리 서버 포트를 알아야하며 그 정보를 얻는 방법이없는 것 같습니다. 나는 이론적으로 Foodomain.xml을 파싱 할 수 있지만, 그게 어디 있는지 알고 싶습니다.

--domain Foo과 같은 asadmin 옵션 또는 적어도 Foo의 포트 또는 디렉토리를 가져 오는 방법이 이상적이지만 그 라인을 따라 아무것도 찾을 수없는 것 같습니다.

조언 감사합니다 ...

$ asadmin version 
Version string could not be obtained from Server [localhost:4848] for some reason. 
(Turn debugging on e.g. by setting AS_DEBUG=true in your environment, to see the details). 
Using locally retrieved version string from version class. 
Version = GlassFish Server Open Source Edition 3.1.2.2 (build 5) 
Command version executed successfully. 

UPDATE : 지금은 which asadmin를 통해 domain.xml의 위치를 ​​결정하는 더러운 해킹을 사용하고 경로를 자르고있어하십시오. 그런 다음 xml을 구문 분석하고 포트를 추출합니다. 이것은 끔찍한 해결책이므로 더 좋은 점이 있는지보기 위해 질문을 공개하고 있습니다.

답변

0

대부분의 asadmin 명령에는 사용자가 원하는만큼 거의 같은 target 옵션이 있습니다. 다음 피연산자 list-javamail-resources [--help] [target]

:

예를 들어 명령 list-javamail-resources이 구문은 다음

target 

    This operand specifies the target for which the JavaMail session 
    resources are to be listed. Valid values are: 

    server 
    Lists the resources for the default server instance. This is the default. 

    domain 
    Lists the resources for the domain. 

    cluster_name 
    Lists the resources for the specified cluster. 

    instance_name 
    Lists the resources for a particular server instance. 

명령 오퍼랜드의 상세한 관련 및 파라미터는 oracle documentation 참조.

+0

불행히도 glassfish 3.1.2에서 대상 옵션은 내가 확인한 명령에 대한 인수로 도메인을 사용하지 않습니다 ([example] (http://docs.oracle.com/cd/E26576_01/doc.312). /e24938/create-jvm-options.htm#create-jvm-options-1)). 3.1.1에서는 더 이상 사용되지 않으며 3.1.2에서는 제거 된 것처럼 보입니다. – elhefe

관련 문제