How should I try to fix java.lang.IllegalStateException in JBoss “is already registered”?

陌路散爱 提交于 2019-12-07 18:50:12

问题


I have a web application. When I try to deploy it via Netbeans, the JBoss server throws the following error:

DEPLOYMENTS IN ERROR:
  Deployment "vfs:///path/to/my/Application.ear" is in error due to the following reason(s): java.lang.IllegalStateException: Container jboss.j2ee:ear=Application.ear,jar=Application-ejb.jar,name=Another,service=EJB3,VMID=583c10bfdbd326ba:71d035f1:132a4c6a8ba:-7ffd + is already registered

    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]
    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]
    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.GA]
    at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.0.0.Final]
    at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
    at org.jboss.profileservice.plugins.deploy.actions.DeploymentStartAction.doPrepare(DeploymentStartAction.java:104) [:0.2.2]
    at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:101) [:0.2.2]
    at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
    at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
    at org.jboss.profileservice.plugins.deploy.AbstractDeployHandler.startDeployments(AbstractDeployHandler.java:168) [:0.2.2]
    at org.jboss.profileservice.management.upload.remoting.DeployHandlerDelegate.startDeployments(DeployHandlerDelegate.java:74) [:6.0.0.Final]
    at org.jboss.profileservice.management.upload.remoting.DeployHandler.invoke(DeployHandler.java:156) [:6.0.0.Final]
    at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:898) [:6.0.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:791) [:6.0.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:744) [:6.0.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:548) [:6.0.0.Final]
    at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234) [:6.0.0.Final]

I found many results when I google this, so this kind of error seems to appear quite often. But all results I saw were posts in forums which didn't show how to fix it in a general way.

The problem seems to be that the application is already registered in JBoss. Where can I get a list of registered JBoss applications? How can I de-register an application (if this could help).

What is a good way to try to fix this kind of problem?


回答1:


There are chances that you may have multiple class files deployed in your .jar directory/archive one of which is places all by mistake. If you have deployed in exploded from on unix you may search the class file by below command for above raised issue as:

find . -name Another -print

there after remove the unrequired file and restart the server and the above problem should have been solved/fixed/resolved.




回答2:


Delete Application.ear from this path: /path/to/my/Application.ear and then DELETE EAR from "jboss-5.1.0.GA\server\default\deploy" because you might have EAR in JBOSS. DELETE log,data,temp,work folder in jboss-5.1.0.GA\server\default.

If you are using eclipse then remove the EAR from JBOSS server and clean the server. Start the server wihtout EAR and after server gets started directly add EAR without stoping the server and let it publish itself.



来源:https://stackoverflow.com/questions/7552929/how-should-i-try-to-fix-java-lang-illegalstateexception-in-jboss-is-already-reg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!