最近在使用weblogic的过程中碰到了一个NumberFormatException的错误,导致weblogic无法启动。错误信息如下:
<Notice> <Management> <BEA-140005> <Loading domain configuration from configuration repository at D:\bea\user_projects\domains\mydomain\config.xml.>
<2011-8-12 上午01时14分48秒 GMT> <Notice> <Log Management> <BEA-170019> <The server log file D:\bea\user_projects\domains\mydomain\myserver\myserver.log is opened. All server side log events will be written to this file.>
<2011-8-12 上午01时14分48秒 GMT> <Critical> <WebLogicServer> <BEA-000364> <Server failed during initialization. Exception:java.lang.NumberFormatException: null
把服务器重启后,问题依然存在。通过分析日志我们可以知道 NumberFormatException: null 的异常是Weblogic启动是找不到一个参数。经过查阅资料,最终把问题解决。以下是解决方案:
在 bea\user_projects\domains 中查找 replicas.prop ,编辑这个文件,删除掉所有的内容并且添加以下内容:
replica.num=0
这个文件会随weblogic正常启动而被修改,其中记录有正常启动所存储的信息。按照此操作,Weblogic正常启动了。
具体查找文件可以通过命令: Find ./ -name replicas.prop 找到并修改。