JBoss5.1GA啓動異常

轉:http://www.cnblogs.com/zhmore/archive/2010/09/25/1834700.html


1.報錯:java.rmi.server.ExportException: Port already in use: 1098; nested exception is:
        java.net.BindException: Address already in use: JVM_Bind
此錯誤常在4.2版本中出現。
需要修改的文件的路徑:jboss-4.2.2.GA\server\default\conf\jboss-service.xml   把1098改爲其它號碼即可,一直改到它成功爲止

<attribute name="Port">1099</attribute>
     
<attribute name="RmiPort">1098</attribute>

2.報錯:java.net.BindException:   Address   already   in   use:   JVM_Bind:8080
需要修改的文件的路徑:jboss-4.2.2.GA\server\default\deploy\jboss-web.deployer\server.xml
把8080改爲其它號碼即可,一直改到它成功爲止,修改後一定記得要保存.如安裝eclipse插件可以打開服務直接修改Port即可。
此錯誤在各個版本都常見。

JBOSS裏面這個異常說明端口1098被其他進程佔用了,查看佔用進程的方法爲:


1)命令行cmd -> netstat -ano | findstr "1098",得到佔用端口1098的pID
2)ctrl+alt+del,進入任務管理器,點擊“查看‘,選擇pid後,查看是那個進程佔用的,結束即可


3.報錯:Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]
具體:
...
16:15:28,605 ERROR [AbstractKernelController] Error installing to Instantiated: name=AttachmentStore state=Described  
java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]  
    at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)  
    at org.jboss.reflect.plugins.introspection.ReflectionUtils.newInstance(ReflectionUtils.java:153)  
    at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.newInstance(ReflectConstructorInfoImpl.java:106)  
    at org.jboss.joinpoint.plugins.BasicConstructorJoinPoint.dispatch(BasicConstructorJoinPoint.java:80)  
    at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.createTarget(AOPConstructorJoinpoint.java:282)  
    at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:103)  
    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)  
    at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)  
    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)  
    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)  
    at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:66)  
    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)  
    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)  
    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)  
    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)  
    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)  
    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)  
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)  
    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)  
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)  
    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)  
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)  
    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)  
    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:319)  
    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:297)  
    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)  
    at org.jboss.kernel.plugins.deployment.BasicKernelDeployer.deploy(BasicKernelDeployer.java:76)  
    at org.jboss.bootstrap.microcontainer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:91)  
    at org.jboss.bootstrap.microcontainer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:161)  
    at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:138)  
    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:450)  
    at org.jboss.Main.boot(Main.java:221)  
    at org.jboss.Main$1.run(Main.java:556)  
    at java.lang.Thread.run(Thread.java:619)  
Failed to boot JBoss:  
java.lang.IllegalStateException: Incompletely deployed:  
 
DEPLOYMENTS IN ERROR:  
  Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]  
 
DEPLOYMENTS MISSING DEPENDENCIES:  
  Deployment "ProfileServicePersistenceDeployer" is missing the following dependencies:  
    Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")  
  Deployment "ProfileServiceDeployer" is missing the following dependencies:  
    Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")  
  Deployment "ProfileService" is missing the following dependencies:  
    Dependency "ProfileServiceDeployer" (should be in state "Installed", but is actually in state "Instantiated")  
    Dependency "jboss.kernel:service=KernelController" (should be in state "Installed", but is actually in state "**ERROR**")  
  Deployment "ProfileServiceBootstrap" is missing the following dependencies:  
    Dependency "ProfileService" (should be in state "Installed", but is actually in state "Instantiated")  
    Dependency "jboss.kernel:service=Kernel" (should be in state "Installed", but is actually in state "**ERROR**")  
 
    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)  
    at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)  
    at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:142)  
    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:450)  
    at org.jboss.Main.boot(Main.java:221)  
    at org.jboss.Main$1.run(Main.java:556)  
    at java.lang.Thread.run(Thread.java:619)  
16:15:29,515 INFO  [ServerImpl] Runtime shutdown hook called, forceHalt: true 
16:15:29,523 INFO  [ServerImpl] Shutdown complete  
Shutdown complete  
Halting VM  


此錯誤常在5.1版本中出現。
這個錯誤是配置文件profile.xml內的一個bug,文件路徑爲:$JBOSS_HOME/server/<serverName>/conf/bootstrap/profile.xml
把其中的節點:
<bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore">
 <constructor><parameter><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter></constructor>
修改爲:
<bean name="AttachmentStore" class="org.jboss.system.server.profileservice.repository.AbstractAttachmentStore">
 <constructor><parameter class="java.io.File"><inject bean="BootstrapProfileFactory" property="attachmentStoreRoot" /></parameter></constructor>

4.錯誤信息:
ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss:service=NamingProviderURLWriter state=Create mode=Manual requiredState=Installed
java.io.IOException: Access is denied

解決辦法:停止windows的Indexing Service服務。出現錯誤原因如下:
It seemed that a file was being locked for some reason, and that file was obviously necessary for JBoss to start. Some further investigation (ok, I admit, I just tried to delete all of JBoss with the faith that it would fail on the locked file), it turns out that file was some file called jnp-service.url in the data directory of the default server. After downloading and installing the handy Unlocker tool (http://ccollomb.free.fr/unlocker/), it turns out that cidaemon.exe (aka the Windows Indexing Service) was locking the file for some reason. Turning off the Indexing Service solved that problem.

The second issue came when I attempted to deploy my WAR file with my JAX-WS service into my new JBoss server. Again, I could not get it to deploy, and a review of the log files showed
"vfsfile:/C:/dev/Workspaces/BeliefNet/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_5.1_Server/deploy/RAFTSOA.war/" is in error due to the following reason(s): java.lang.StringIndexOutOfBoundsException: String index out of range: -1
A strange and cryptic error indeed. As you can see, I was using the JBoss tools integration with Eclipse, so I tried just exporting the WAR file and copying it manually to the JBoss deploy directory, but still no luck. With nightmares of "pouring through source code to see what JBoss is doing when it throws this exception" dancing in my head, luckily Google gave a bunch of pieces to the puzzle to what might be causing this. It turns out that JBoss requires all servlets and such to be inside a package. This was not the case when I was just deploying in Tomcat alone, but luckily this is among the easiest problems to fix.
Happy to say, after those issues were resolved, my sample JAX-WS application is up and running. Now I just have to unlock the puzzle of JAX-WS, JAXB, and how everything lives in harmony to create a viable SOA solution....

5.啓動正常在但是使用JBoss Tool3.1的插件JBossAS Tool發佈無效(JBoss5.1 Runtime Server發佈無效),但是在默認Runtime路徑“workspace\.metadata\.plugins\org.jboss.ide.eclipse.as.core\JBoss_5.1_Runtime_ServerXXX”內可以看到發佈的項目,啓動JBoss卻無法訪問發佈信息,這個問題鬱悶了我兩天,最終發現一個令人無語的問題,那就是在創建JBoss的項目的時候項目物理路徑內不能存在空格,比如路徑“Ejb3 Project”等帶有空格目錄的項目發佈後將無法被JBoss正確加載(真佩服這幫程序員)。

解決辦法:在開發JBoss的項目時候項目路徑一定不要帶空格或者其它比較少用的特殊字符,JBoss對路徑特別敏感。

OK,可以正常啓動了。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章