Bugs item #515537, was opened at 2002-02-10 08:18
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=515537&group_id=22866
Category: JBossServer
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: Georg Schmid (giorgio42)
Assigned to: Nobody/Anonymous (nobody)
Summary: Deployer loops on failed deployment
Initial Comment:
Deployer loops on failed deployment
Basic info:
INFO JBoss (MX MicroKernel) 3.0.0DR1(200202092237)
[RABBIT-HOLE]
...
11:40:24,734 INFO [Info] Java version: 1.3.1_02,Sun
Microsystems Inc.
11:40:24,734 INFO [Info] Java VM: Java HotSpot(TM)
Client VM 1.3.1_02-b02,Sun Microsystems Inc.
11:40:24,734 INFO [Info] OS-System: Windows 2000
5.0,x86
Bug:
Failed deployment puts Deployer into endless loop.
Although the deployment fails, the deployer puts it on
the watch list
and treats it as if the deployment succeeded:
2002-02-10 12:34:52,265 DEBUG
[org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.Mainte
nanceEB] jar:file:/I:/jboss/jboss-
3.0.0DR1/tmp/deploy/66.entity-beans.jar!/META-
INF/jbosscmp-jdbc.xml found. Overriding defaults
2002-02-10 12:34:52,625 ERROR
[org.jboss.ejb.EJBDeployer] Could not deploy
file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-beans.jar
org.jboss.deployment.DeploymentException: Role: module-
belongs-to-facility with multiplicity many using
foreign-key mapping is not allowed to have key-fields
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshi
pRoleMetaData.loadKeyFields
(JDBCRelationshipRoleMetaData.java:352)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationshi
pRoleMetaData.init
(JDBCRelationshipRoleMetaData.java:157)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMet
aData.<init>(JDBCRelationMetaData.java:308)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplication
MetaData.<init>(JDBCApplicationMetaData.java:383)
at
org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoad
er.load(JDBCXmlFileLoader.java:75)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDB
CEntityMetaData(JDBCStoreManager.java:503)
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.create
(JDBCStoreManager.java:277)
at
org.jboss.ejb.plugins.CMPPersistenceManager.create
(CMPPersistenceManager.java:134)
at org.jboss.ejb.EntityContainer.create
(EntityContainer.java:342)
at org.jboss.ejb.Application.start
(Application.java:214)
at org.jboss.ejb.EJBDeployer.deploy
(EJBDeployer.java:431)
at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:396)
at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:362)
at org.jboss.deployment.MainDeployer.scan
(MainDeployer.java:243)
at org.jboss.deployment.MainDeployer.run
(MainDeployer.java:229)
at java.lang.Thread.run(Unknown Source)
2002-02-10 12:34:52,937 DEBUG
[org.jboss.deployment.MainDeployer] Watching new file:
file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-beans.jar
2002-02-10 12:34:52,937 WARN
[org.jboss.deployment.MainDeployer] operation failed;
ignoring
java.lang.NullPointerException
at
org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.stop
(JDBCStoreManager.java:346)
at
org.jboss.ejb.plugins.CMPPersistenceManager.stop
(CMPPersistenceManager.java:180)
at org.jboss.ejb.EntityContainer.stop
(EntityContainer.java:408)
at org.jboss.ejb.Application.stop
(Application.java:240)
at org.jboss.ejb.EJBDeployer.deploy
(EJBDeployer.java:444)
at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:396)
at org.jboss.deployment.MainDeployer.deploy
(MainDeployer.java:362)
at org.jboss.deployment.MainDeployer.scan
(MainDeployer.java:243)
at org.jboss.deployment.MainDeployer.run
(MainDeployer.java:229)
at java.lang.Thread.run(Unknown Source)
2002-02-10 12:35:03,437 INFO
[org.jboss.deployment.MainDeployer] Undeploying
file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-beans.jar
2002-02-10 12:35:03,437 ERROR
[org.jboss.deployment.MainDeployer] Undeployment
failed: file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-
beans.jar
org.jboss.deployment.DeploymentException: URL not
deployed
at org.jboss.ejb.EJBDeployer.undeploy
(EJBDeployer.java:472)
at org.jboss.ejb.EJBDeployer.undeploy
(EJBDeployer.java:461)
at org.jboss.deployment.MainDeployer.undeploy
(MainDeployer.java:315)
at org.jboss.deployment.MainDeployer.scan
(MainDeployer.java:258)
at org.jboss.deployment.MainDeployer.run
(MainDeployer.java:229)
at java.lang.Thread.run(Unknown Source)
2002-02-10 12:35:08,562 INFO
[org.jboss.deployment.MainDeployer] Undeploying
file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-beans.jar
2002-02-10 12:35:08,578 ERROR
[org.jboss.deployment.MainDeployer] Undeployment
failed: file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-
beans.jar
org.jboss.deployment.DeploymentException: URL not
deployed
at org.jboss.ejb.EJBDeployer.undeploy
(EJBDeployer.java:472)
at org.jboss.ejb.EJBDeployer.undeploy
(EJBDeployer.java:461)
at org.jboss.deployment.MainDeployer.undeploy
(MainDeployer.java:315)
at org.jboss.deployment.MainDeployer.scan
(MainDeployer.java:258)
at org.jboss.deployment.MainDeployer.run
(MainDeployer.java:229)
at java.lang.Thread.run(Unknown Source)
2002-02-10 12:35:13,734 INFO
[org.jboss.deployment.MainDeployer] Undeploying
file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-beans.jar
2002-02-10 12:35:13,734 ERROR
[org.jboss.deployment.MainDeployer] Undeployment
failed: file:/I:/jboss/jboss-3.0.0DR1/deploy/entity-
beans.jar
The problem occurs in MainDeployer.java. In the deploy
(DeploymentInfo)'s finally {...} clause
the deployer does not check whether the deployment has
succeeded.
Fix:
- Naive idea: Add a check for success: if
(deployment.status.equals("Deployed")) { ... }.
I tried that and it does not work, but creates lots of
NPEs, because most of the time the status is null,
even for succeeded deployments. And this is because
the "subordinate" deployers, like the EJBDeployer
do not know, that they should set a flag in the
DeploymentInfo after a successful deployment.
The real problem is that any deployment is always
added to the watch list, whether the deployment
succeeded or not (... finally {...}).
But the undeployment stops, if it did not succeed
(which it cannot, because the deployment did not
succeed...).
So the MainDeployer keeps calling undeploy on the (in
this case) EJBDeployer on each scan.
Moving the biggest part of undeploy() to a finally
{...} clause reduces the problem to inconsistent
messages on the console.
This is not a fix, only half a workaround:
diff -u -r1.11 MainDeployer.java
--- MainDeployer.java 9 Feb 2002 16:09:17 -
0000 1.11
+++ MainDeployer.java 10 Feb 2002 16:16:16 -0000
@@ -314,6 +314,11 @@
// Tell the respective deployer to undeploy
this one
if (di.deployer != null) di.deployer.undeploy
(di);
+ }
+ catch (Exception e) {
+ log.error("Undeployment failed: " + di.url,
e);
+ }
+ finally {
// remove from local maps
deployments.remove(di.url);
if (deploymentsList.lastIndexOf(di) != -1)
deploymentsList.remove(deploymentsList.lastIndexOf
(di));
@@ -322,11 +327,7 @@
di.cleanup(log);
if (infoEnabled)
- log.info("Undeployed "+di.url);
-
- }
- catch (Exception e) {
- log.error("Undeployment failed: " + di.url,
e);
+ log.info("Undeployed "+di.url);
}
}
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=376685&aid=515537&group_id=22866
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development