熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java開源技術 >> 正文

EOS對應JBOSS相關配置介紹

2022-06-13   來源: Java開源技術 

  EOS自帶的JBOSS和目前的JBOSS版本是有不小的區別的本文主要介紹EOS部署在JBOSS以上版本的配置技巧

   ERROR: invalid console appender config detected console stream is looping

  配置介紹

  日志的配置

  JBOSS集成了logj所以在啟動eos後發現日志出現一下錯誤ERROR invalid console appender config detected console stream is looping

  這主要是EOS應用自己的   logj和jboss集成的logj沖突解決方法是

  使用jboss的logj轉移eos的log配置到jboss的 server/default/conf/logjxml裡類似以下配置

  

  <appender class=orgjbossloggingappenderRollingFileAppender name=R>

  <errorHandler class=orgjbossloggingutilOnlyOnceErrorHandler/>

  <param name=File value=${EOS_HOME}/logs/eosloglog/>

  <param name=Append value=true/>

  <param name=MaxFileSize value=KB/>

  <param name=MaxBackupIndex value=/>

  <layout class=orgapachelogjPatternLayout>

  <param name=ConversionPattern value=%d %p [%c] %m%n/>

  </layout> </appender>

  <logger name=service>

  <level value=DEBUG />

  <appenderref ref=R />

  </logger>

  修改server/default/conf/jbossservicexml

  

  <mbean code=orgjbossloggingLogjService

  name=jbosssystemtype=LogjServiceservice=Logging

  xmbeandd=resourcexmdesc/LogjServicexmbeanxml>

  <attribute name=ConfigurationURL>resourcelogjxml</attribute>

  <attribute name=CatchSystemOut>false</attribute>

  <!—— Set the orgapachelogjhelpersLogLogsetQuiteMode As of logj

  this needs to be set to avoid a possible deadlock on exception at the

  appender level See bug#

  ——>

  <attribute name=LogjQuietMode>true</attribute>

  <!—— How frequently in seconds the ConfigurationURL is checked for changes ——>

  <attribute name=RefreshPeriod></attribute>

  </mbean>

  修改server/default/deploy/jbosswebtomcatsar/METAINF/jbossservicexml

  

  <attribute name=JavaClassLoadingCompliance>true</attribute>

  <!—— A flag indicating if the JBoss Loader should be used This loader

  uses a unified class loader as the class loader rather than the tomcat

  specific class loader

  The default is false to ensure that wars have isolated class loading

  for duplicate jars and jsp files

  ——>

  <attribute name=UseJBossWebLoader>true</attribute>

  事務控制的配置

  Jboss事務處理也有相應配置server/default/conf/jbossservicexml

  

  <mbean code=orgjbosstmTransactionManagerService

  name=jbossservice=TransactionManager

  xmbeandd=resourcexmdesc/TransactionManagerServicexmbeanxml>

  <attribute name=TransactionTimeout></attribute> <!—— set to false to disable transaction demarcation over IIOP ——>

  <attribute name=GlobalIdsEnabled>true</attribute>

  <depends optionalattributename=XidFactory>jbossservice=XidFactory</depends>

  <!—— Transaction Integrity Checking ——>

  <!—— Force a rollback if another thread is associated with the transaction at commit ——>

  <!——depends optionalattributename=TransactionIntegrityFactory

  proxytype=orgjbosstmintegrityTransactionIntegrityFactory> <mbean code=orgjbosstmintegrityFailIncompleteTransaction

  name=jbossservice=TransactionManagerplugin=TransactionIntegrity/>

  </depends——> </mbean>

  如果要一台機器使用多個jboss server那麼需要修改的文件server/default/conf/jbossservicexml server/default/deploy/jbosswebtomcatsar/serverxml

  server/default/deploy/jbosswebtomcatsar/serverxml配置要點

  

  <Connector port= address=${jbossbindaddress}

  maxThreads= strategy=ms maxHttpHeaderSize=

  emptySessionPath=true

  enableLookups=false redirectPort= acceptCount=

  connectionTimeout= disableUploadTimeout=true URIEncoding=GBK/>

  注acceptCount是排隊請求的數量應該將線程數(最大線程數)設置比最大預期負載(同時並發的點擊)多%(經驗規則)應該將minSpareThread設置比正常負載多一些

  應該將maxSpareThread設置比峰值負載多一些

  minSpareThread指啟動以後總是保持該數量的線程空閒等待

  maxSpareThread指如果超過了minSpareThread然後總是保持該數量的線程空閒等待

  刪除不需要的valve和日志如果不使用JBoss的安全刪除JBoss的安全valve預編譯JSP(內置的編譯器編譯速度相當快對於小的站點就沒有必要預先編譯了)

  關閉sever/slim/jbosswebtomcatsar/conf/webxml中的development模式URIEncoding=GBK 基本解決了亂碼問題

  安全連接配置

  

  <!—— SSL/TLS Connector configuration using the admin devl guide keystore ——>

  <Connector port= address=${jbossbindaddress}

  maxThreads= strategy=ms maxHttpHeaderSize=

  emptySessionPath=true

  scheme=https secure=true clientAuth=false

  keystoreFile=${jbossserverhomedir}/conf/chapkeystore

  keystorePass=changeit sslProtocol = TLS />


From:http://tw.wingwit.com/Article/program/Java/ky/201311/28880.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.