Jboss-eap-5.1 starting up note

本文详细介绍了从JBoss Enterprise Platform 4迁移到5.1版本的过程,包括预安装要求、安装步骤、启动前配置、启动过程中的错误解决、生产启动、查看JMX控制台、热部署服务设置、本地事务数据源添加、应用部署等关键步骤。通过实操经验分享,帮助开发者顺利过渡并充分利用新平台的功能。

Jboss enterprise platform 5 have some big change compared with platform 4(Jboss-eap-4.3), to explore this changes, so we started our Jboss-eap-5.1 studying, this section we just point to platform 5's starting up.

Step 1: Pre-installation-Requisites

      From Jboss-eap-5.1 documents, there do not need some special requisite, compare with platform 4, the biggest change is JBoss Enterprise Application Platform 5 requires Java JDK1.6. this is very easy to accomplish, I installed jdk-6u21 to my pc as document decribed.

Step 2: Jboss-eap-5.1 installation

      The same operation like old version jboss installation, use green installing, just need unzip the zip file on you Disk, and its done. I am really care server folder structure, so navigate to this folder, this folder has been expended in platform 5 version 2 new folder has been added like bellow figure show:

    

 

Step 3 : pre-Starting up

      The same action like platform 4 jboss, we should do some Security Configure before we start up our jboss.

1> Edit the file $JBOSS_HOME/server/$PROFILE/conf/props/jmx-consoleusers.properties;

2> Create a username = password pair, use commended 'admin=admin', we just need remove '#'

3> If need someother configure we can do more, but in this test is enough.

Step 4: Starting up

      The same script 'run.bat' can be found under $JBOSS_HOME/bin, so triger the run.bat starting up jboss, unfortunately jboss crushed in the begining of start, the error as follow:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Press any key to continue . . .

 this is a very simple error:memory is not big enough, but intersting is there isn't any infomation about JVM starting Option in 'run.bat', check more careful find another difference with Jboss platform 4, 'run.conf.bat' can be found under $JBOSS_HOME/bin, open this batch file contains a series of configurable selections of JVM params, quickly I found the following line configuration:

JAVA_OPTS=-Xms1303m -Xmx1303m -XX:MaxPermSize=256m

 Obviously, this is for high performance Server machine, we need change this as the nexy line:

JAVA_OPTS=-Xms128m -Xmx512m -XX:MaxPermSize=128m

 exexute 'run.bat' again, and this time on the right way.

Step 5: Starting production

      In order to see more output info in jboss console, so before start production, we modify log4j.xml file where under $JBOSS_HOME/server/production/conf first.

then exexute 'run.bat' with params like start platform 4 Jboss, like following:

run.bat -c production -b 0.0.0.0

absolutlely, this times also on the right way, start production spend 40 minutes from concole output we can know.

Step 6: Test the installation

      Open http://192.168.1.103:8080/  in a web browser on the server machine, and the result The JBoss Enterprise Application Platform server homepage is displayed. the server homepage also has some differrence with eap-4.3: diffrerence interface layout, color decorated word, etc.

Step 7: View JMX-console

      Using http://192.168.1.103:8080/jmx-console/ can view new version Jboss JMX-console, By default, the JMX console is secured and will prompt you for a username and password, Use the username and password we defined in Step 3. The JMX Console is the JBoss Management Console which provides a raw view of the JMX MBeans which make up the server. They can provide a lot of information about the running server and allow you to modify its configuration, start and stop components and so on.

Step 8: Hot deployment service

      One of the Highlight features in Jboss is Hot-deployment service, Jboss plamtform 5 use absolute JMX Mbean control the  Hot-deployment service, Hot deployment of services in the server is controlled by the HDScanner MC bean configured in JBOSS_HOME\server\production\deploy\hdscanner-jboss-beans.xml as following:

<bean name="HDScanner" class="org.jboss.system.server.profileservice.hotdeploy.HDScanner">
        <property name="deployer"><inject bean="ProfileServiceDeployer"/></property>
        <property name="profileService"><inject bean="ProfileService"/></property>
        <property name="scanPeriod">60000</property>
        <property name="scanThreadName">HDScanner</property>
</bean>

 the default scanPeriod is set to 6 seconds.

Step 9: Add a local trasaction Datasource for Oracle DB

      Create a text file in the deploy directory named oracle-ds.xml with the following datasource descriptor:

<datasources>
  <local-tx-datasource>
    <jndi-name>HomeTestOracleDS</jndi-name>
    <connection-url>jdbc:oracle:thin:@192.168.1.105:1521:orcl</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>IPCUSER</user-name>
    <password>tibco</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <metadata>
         <type-mapping>Oracle10g</type-mapping>
      </metadata>
  </local-tx-datasource>
</datasources>

 Add this file to JBOSS_HOME\server\production\deploy folder restart server, and so far configuring datasource for Oracle DS has completed. to check added datasource we can through:

1. JMX-console jboss.jca module

2. JNDI View -> List -> java: Namespace

Step 10: Deploy an Web appliation to Jboss-eap-5.1

1. copy Oracle JBDC jar 'ojdbc14.jar' to JBOSS_HOME\server\production\lib

2. create homeTest-eap-5.1.war only contain a file 'index.jsp' as following:

 <%@page contentType="text/html"
import="java.util.*,javax.naming.*,javax.sql.DataSource,java.sql.*" %> <%
   
  DataSource ds = null;
  Connection con = null; 
  PreparedStatement pr = null; 
  InitialContext ic; 
  try {
  ic = new InitialContext();
  ds = (DataSource)ic.lookup( "java:/HomeTestOracleDS" );
  con = ds.getConnection(); 
  out.println("<br> " + con);
  }catch(Exception e){
  out.println("Exception thrown " +e); 
  }finally{
  if(con != null){
  con.close();
 }      
 } %>

 3. deploy homeTest-eap-5.1.war to JBOSS_HOME\server\production\deply, deploy successful info will be output from server console

 4. Test deploy result through http://192.168.1.103:8080/homeTest-eap-5.1/index.jsp

the following will turn out:



 As below show local transction connection has been created.

提供了基于BP(Back Propagation)神经网络结合PID(比例-积分-微分)控制策略的Simulink仿真模型。该模型旨在实现对杨艺所著论文《基于S函数的BP神经网络PID控制器及Simulink仿真》中的理论进行实践验证。在Matlab 2016b环境下开发,经过测试,确保能够正常运行,适合学习和研究神经网络在控制系统中的应用。 特点 集成BP神经网络:模型中集成了BP神经网络用于提升PID控制器的性能,使之能更好地适应复杂控制环境。 PID控制优化:利用神经网络的自学习能力,对传统的PID控制算法进行了智能调整,提高控制精度和稳定性。 S函数应用:展示了如何在Simulink中通过S函数嵌入MATLAB代码,实现BP神经网络的定制化逻辑。 兼容性说明:虽然开发于Matlab 2016b,但理论上兼容后续版本,可能会需要调整少量配置以适配不同版本的Matlab。 使用指南 环境要求:确保你的电脑上安装有Matlab 2016b或更高版本。 模型加载: 下载本仓库到本地。 在Matlab中打开.slx文件。 运行仿真: 调整模型参数前,请先熟悉各模块功能和输入输出设置。 运行整个模型,观察控制效果。 参数调整: 用户可以自由调节神经网络的层数、节点数以及PID控制器的参数,探索不同的控制性能。 学习和修改: 通过阅读模型中的注释和查阅相关文献,加深对BP神经网络与PID控制结合的理解。 如需修改S函数内的MATLAB代码,建议有一定的MATLAB编程基础。
### JBoss EAP 6.4 日志配置与查看方法 #### 配置日志路径和级别 在 JBoss EAP 6.4 中,默认的日志框架基于 Log Manager 和 JBoss Logging。可以通过修改 `$JBOSS_HOME/standalone/configuration/standalone.xml` 文件来调整日志的相关设置。 1. **更改日志存储位置** 默认情况下,JBoss 将日志写入 `standalone/log/server.log` 文件。如果需要自定义日志路径,可以编辑 `<file-handler>` 节点中的路径属性: ```xml <periodic-rotating-file-handler name="FILE" autoflush="true"> <formatter> <named-formatter name="PATTERN"/> </formatter> <file relative-to="jboss.server.log.dir" path="custom-server.log"/> <suffix value=".yyyy-MM-dd"/> <append value="true"/> </periodic-rotating-file-handler> ``` 上述代码片段展示了如何将默认日志文件名更改为 `custom-server.log`[^1]。 2. **调整日志级别** 可以通过修改 `<root-logger>` 或特定的 `<logger>` 来控制日志记录的详细程度。例如,将根日志器的级别设为 `INFO`: ```xml <root-logger> <level name="INFO"/> <handlers> <handler name="CONSOLE"/> <handler name="FILE"/> </handlers> </root-logger> ``` 如果希望针对某个模块启用调试模式,则可以在 `<loggers>` 节点中添加如下内容: ```xml <logger category="com.example.myapp"> <level name="DEBUG"/> </logger> ``` 3. **屏蔽自带日志功能或指定依赖库** 当存在多个版本的 logging 库时,可能会发生冲突。为了防止此类问题,可以选择禁用 JBoss 自带的日志组件或将项目内的日志实现优先加载。具体操作方式已在引用材料中提及。 #### 查看日志文件 运行期间产生的所有消息都会被记录到上述配置所指向的目标文件中(通常是 `server.log`)。以下是几种常见的访问途径: 1. **本地环境** - 登录至应用服务器所在主机; - 导航到 `${JBOSS_HOME}/standalone/log/` 目录下读取最新生成的日志条目; 2. **远程监控** 假如无法直接接触物理机器,可通过 SSH 连接执行命令实时跟踪更新情况: ```bash tail -f ${JBOSS_HOME}/standalone/log/server.log ``` 3. **Web 控制台界面** 对于某些高级场景而言,还可以借助内置管理工具在线浏览历史数据。启动服务之后打开浏览器输入地址 http://localhost:9990/console/App.html 并登录成功后,在导航菜单里寻找对应选项卡完成进一步探索[^5]。 ```python # 示例 Python脚本用于解析 server.log并提取错误信息 import re def extract_errors(log_file_path): pattern = r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} ERROR' with open(log_file_path, 'r') as file: content = file.read() matches = re.findall(pattern, content) return matches errors = extract_errors('/path/to/jboss/standalone/log/server.log') print(errors) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值