JBoss初学问题小记

博主因调研项目学习JBoss和AXIS WebService知识,调研中止后做小结。介绍了一些好的jboss资料,还分享了遇到的问题及解决办法,如将Tomcat应用部署到JBoss、让Jboss启动自动加载类,此外还提到使用开源代码的bug。

     前一段时间,因为一个调研项目的关系,开始学习JBoss和AXIS WebService方面的相关知识。这其中碰到了一些菜鸟级别的问题,可是周围的人都没有懂JBoss的,上网也找不到什么资料,只好自己瞎琢磨了。不久,由于各种原因,这个调研中止了,很遗憾。 做个小结,也算是对自己这段时间的一点回顾吧。
   经过多方了解,知道以下jboss资料是很好的,应该在网上都可以找到的:
《jboss管理与开发核心技术》
《Getting Started with Jboss4》
《基于JBoss 4.x 的J2EE 1.4 应用开发指南》
《OReilly.Jboss.A.Developers.Notebook.Jun.2005》
《OReilly.JBoss.at.Work.A.Practical.Guide.Oct.2005》


碰到了些问题,如下:

1.怎么把Tomcat下部署的应用(比如../Tomcat 5.0/webapps/Axis)放到JBoss下呢?
  只要把这个包(Axis)拷贝到JBoss下的deploy目录下,并把它的名字后缀加个.war(如Axis.war)就可以运行了。
 
2.如何在Jboss一启动就自动加载运行某个类?
  这是属于Jboss的MBean服务里的定时服务。通过配置conf目录下的jboss-service.xml文件,增加如下信息即可实现:
  <!-- Scheduler Initialization 定时操作                                                                   -->
<!--============================================================ -->
   <mbean code="org.jboss.varia.scheduler.Scheduler"
 name="jboss.Receiver.util:service=Scheduler">

 <attribute name="StartAtStartup">true</attribute>
 <attribute name="SchedulableClass">com.metarnet.test.ReceiverNew</attribute>
 <attribute name="SchedulableArguments"></attribute>
 <attribute name="SchedulableArgumentTypes"></attribute>
 <attribute name="InitialStartDate">NOW</attribute>
 <attribute name="SchedulePeriod">5000</attribute>
 <attribute name="InitialRepetitions">20</attribute>
 <!--name为任意但唯一,com.piosan.util.PiosanTimer为class名 -->
 </mbean>

   <!--SchedulableArguments的值为传递参数,如果没有参数则为空,在SchedulableArgumentTypes中体现了 -->
    <!--SchedulePeriod 的值为每隔5秒操作一次,以毫秒为单位 -->
<!--The Scheduler MBean service defines the manageable interface for a scheduler that allows you to request an org.jboss.util.Schedulable implementation be run periodically by the service.
The configurable attributes of the Scheduler service include the following:


SchedulableClass: The fully qualified class name of the org.jboss.util.Schedulable implementation to use with the Scheduler.


SchedulableArguments: The comma separated list of arguments for the Schedulable class. This list must have as many elements as the Schedulable Argument Type list; otherwise, the start of the Scheduler will fail. Currently only basic data types, string, and classes with a constructor with a string as only argument are supported.


SchedulableArgumentTypes: The comma separated list of argument types for the Schedulable class. This will be used to find the right constructor, and to create the right instances with which to call the constructor. This list must have as many elements as the Schedulable Arguments list; otherwise, the start of the Scheduler will fail. Currently only basic data types, string, and classes with a constructor with a string as only argument are supported.


SchedulePeriod: The time between two scheduled calls (after the initial call) in milliseconds. This value must be greater than 0.


InitialRepetitions: The number of periods for which the instance will be scheduled. Set to –1 for unlimited repetitions-->
以上为各个字段的解释。

3.用了apache 的pubscribe开源代码部分,发现在producer调用consumer的notify后总是出现如下错误,后来找了半天才发现
原来是开源代码的bug,由于pubscribe这个开源项目已经暂停,还好对系统没有什么影响,只好作罢。
java.lang.NullPointerException
>>        at
>>org.apache.axis.MessageContext.setCurrentMessage(MessageContext.java:630)
>>        at
>>org.apache.axis.MessageContext.setMessage(MessageContext.java:648)
>>        at
>>org.apache.ws.resource.handler.ResourceHandler.handleResponse(ResourceHandler.java:239)
>>        at
>>org.apache.ws.resource.handler.axis.ResourceProvider.invoke(ResourceProvider.java:210)
>>        at
>>org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
>>        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>>        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>>        at
>>org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
>>        at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
>>        at
>>org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>>        at
>>org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>        at
>>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
>>        at
>>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
>>        at
>>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
>>        at
>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>>        at
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>>        at
>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>>        at
>>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
>>        at
>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>>        at
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>>        at
>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>>        at
>>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
>>        at
>>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
>>        at
>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>>        at
>>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
>>        at
>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
>>        at
>>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
>>        at
>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
>>        at
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>>        at
>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>>        at
>>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
>>        at
>>org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
>>        at
>>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
>>        at
>>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>>        at
>>org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
>>        at
>>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
>>        at
>>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
>>        at
>>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)

内容概要:本文详细介绍了“考虑N-1故障集的电力系统安全约束经济调度(SCED)”的Matlab代码实现方案,聚焦于电力系统在满足N-1安全准则(即任一元件故障后系统仍能安全运行)条件下的经济性与安全性协同优化问题。资源通过构建精确的数学优化模型,在兼顾发电成本最小化的同时,确保系统在故障前后的运行安全性,涵盖潮流约束、机组出力限制及故障后安全恢复等多重约束条件。文中提供了完整的Matlab仿真代码,并集成YALMIP工具包进行高效求解,支持高水平学术研究的模型复现与结果验证,尤其适用于EI期刊、博士论文等科研场景。此外,资源附带详细的网盘链接,便于获取YALMIP开发包及其他配套材料,极大提升了科研复现效率。; 适合人群:具备电力系统分析、优化建模理论基础,熟悉Matlab编程语言,正在从事电力系统经济调度、安全稳定分析、新能源接入影响研究等相关方向的研究生、高校科研人员及电力行业工程技术开发者。; 使用场景及目标:① 深入学习并复现N-1安全约束下的SCED建模方法;② 掌握基于YALMIP与Matlab的优化问题建模与求解流程;③ 支撑高水平学术论文(如EI、SCI、博士论文)的仿真验证与结果再现;④ 为含高比例新能源接入的现代电力系统安全经济运行研究提供可扩展的技术框架与代码基础。; 阅读建议:建议结合文中提供的百度网盘资源与公众号“荔枝科研社”的配套资料,按照推荐目录顺序系统学习,重点关注模型构建的数学逻辑与代码实现细节,动手调试参数并尝试引入新能源不确定性、多故障场景(N-k)或分布鲁棒优化等前沿方向以拓展研究深度。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值