jboss (3)

💻 Programming/WAS

[JBoss 7] module.xml 에서 모듈 설정하기

Jboss AS 7 에서 module.xml 설정을 위한 간략한 설명을 적어놓은 좋은 자료를 찾아서 포스팅 해봅니다.

영문이긴하지만 어려운 말은 없으니 한번 읽어보시길 바랍니다 ^-^ 



Full module.xml example with comments 


    <?xml version="1.0" encoding="UTF-8"?> 
     
    <module xmlns="urn:jboss:module:1.1" name="org.jboss.msc"> 
     
        <!-- Main class to use when launched as a standalone jar. --> 
        <main-class name="org.jboss.msc.Version"/> 
     
        <!-- Properties readable through Modules API. Not to be confused with Java system properties. --> 
        <properties> 
            <!-- jboss.api=private means that the module is not part of the JBoss AS 7 public API - basically saying, "Don't use it's packages in your apps." --> 
            <property name="jboss.api" value="private"/> 
        </properties> 
     
        <resources> 
            <!-- Basically, list of jars to load classes and resources from. --> 
            <resource-root path="jboss-msc-1.0.1.GA.jar"/> 
            ... 
        </resources> 
     
        <dependencies> 
     
            <!--  Export paths and packages from the class loader which loaded JBoss Modules (usually the system's application CL). --> 
            <system export="true"> 
                <!-- List of exported paths. Mandatory. --> 
                <paths> 
                   <path name="org/jboss/modules"/> 
                   <path name="org/jboss/modules/log"/> 
                </paths> 
                <!-- Optional limitation of what's exported. --> 
                <exports> 
                     <include path="META-INF/"/> 
                </exports> 
            </system> 
     
            <!-- Dependencies on other modules. Classloader of this module will have their classes visible. --> 
            <module name="javax.api"/> 
            <module name="org.jboss.logging"/> 
     
            <!-- services="import/export/none" controls whether services defined in META-INF/services are also visible to/from this module. 
                   I.e. services="export" will make the services of this module visible to the dependency. Import will do the other way around. 
                   Defaults to "none". --> 
            <!-- export="true" controls whether own exports of this dependency are visible. --> 
            <module name="org.jboss.ws.native.jbossws-native-core" services="export" export="true"> 
                <!-- You can limit what packages in dependency modules are allowed  
                       to be seen from this module's point of view (import), or vice versa (export). 
                       By default, all are imported/exported. When you specify <imports> or <exports>, only those listed are. --> 
                <imports> 
                   <include path="META-INF"/> 
                   <include path="dtd"/> 
                   <include path="schema"/> 
                   <exclude-set> 
                       <path name="org.jboss.example.tests"/> 
                   </exclude-set> 
                </imports> 
                <exports> 
                    <include path="META-INF"/> 
                    <include path="dtd"/> 
                    <include path="schema"/> 
                </exports> 
            </module> 
     
            <!-- Optional deps --> 
            <module name="javax.inject.api" optional="true"/> 
        </dependencies> 
    </module> 


- See more at: https://developer.jboss.org/people/ozizka/blog/2012/11/12/about-modulexml-in-jboss-as-7#sthash.oZ0bLEzI.dpuf



출처 : https://developer.jboss.org/people/ozizka/blog/2012/11/12/about-modulexml-in-jboss-as-7




💻 Programming/WAS

[JBoss 7] LogManager 오류

standalone으로 jboss 실행시켰을 때 아래처럼 오류가 발생하는 경우가 있습니다.


1.

Exception in thread "main" java.lang.ExceptionInInitializerError
        at org.jboss.as.server.Main.main(Main.java:73)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.modules.Module.run(Module.java:260)
        at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
        at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
        at org.jboss.logmanager.log4j.BridgeRepositorySelector.<clinit>(BridgeRepositorySelector.java:42)
        ... 7 more



2.

WARNING: Failed to load the specified log manager class org.jboss.logmanager.LogManager
Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.jboss.as.server.Main.main(Main.java:73)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.jboss.modules.Module.run(Module.java:260)
    at org.jboss.modules.Main.main(Main.java:291)
Caused by: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
    at org.jboss.logmanager.Logger.getLogger(Logger.java:60)
    at org.jboss.logmanager.log4j.BridgeRepositorySelector.(BridgeRepositorySelector.java:42)
    ... 7 more



위 두 개 오류를 해결하려면 아래처럼 해주시면 됩니다.

standalone.conf 파일을 열어서 아래 라인처럼 생긴 곳을 찾은다음에 아래처럼 수정해주시면됩니다.

확인하셔야 할 부분(없는 경우 추가해야하는 부분)을 붉은 색으로 표시했습니다.


if [ "x$JBOSS_MODULES_SYSTEM_PKGS" = "x" ]; then
    JBOSS_MODULES_SYSTEM_PKGS="org.jboss.byteman,org.jboss.logmanager"
fi
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
JAVA_OPTS="$JAVA_OPTS -Xbootclasspath/p:$JBOSS_HOME/modules/org/jboss/logmanager/main/jboss-logmanager-1.3.1.jar"


💻 Programming/WAS

JBoss 7 리눅스에 설치하기


1. 준비사항
리눅스 서버 환경에 JAVA 를 설치합니다.

2. JBOSS 다운로드 및 설정

3. JBOSS start/stop/restart 스크립트 만들기

 

4. JBOSS 바인딩 변경

5. 웹접속 확인
웹브라우저 주소창에 http://IP어드레스:8080 입력하여 접속합니다.

jboss

6. JBOSS Admin 콘솔접속

 

웹브라우저 창에 http://ip어드레스:9990 하여 관리콘솔로 접속 합니다.

jboss2

jboss3

참조 : http://www.davidghedini.com/pg/entry/install_jboss_7_on_centos