Bugs item #580190, was opened at 2002-07-11 12:31
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=580190&group_id=22866
Category: JBossServer
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 7
Submitted By: Stephen Davidson (northgorky)
Assigned to: Nobody/Anonymous (nobody)
Summary: Ear Deployer Broken (Infinite Looping)
Initial Comment:
When trying to deploy an ear which has jars with
multiple interdependincies, JBoss Deployer goes into an
infinite loop, and eventually starts throwing
StackOverflow and OutOfMemory Exceptions.
Sample Ear file that demonstrates this behaviour attached.
----------------------------------------------------------------------
>Comment By: Stephen Davidson (northgorky)
Date: 2002-07-15 11:24
Message:
Logged In: YES
user_id=490856
Sorry that I have not come up with a complete solution. I
have my own deadlines right now, and this has thrown me
behind. The proposed patches allow me to work around the
current issues, until a permanent solution can be implemented.
To patch this for the moment, and address future circularity
issues, I am proposing the following patches;
diff -u -r1.28.2.13 MainDeployer.java
--- system/src/main/org/jboss/deployment/MainDeployer.java
26 Jun 2002 19:18:48 -0000 1.28.2.13
+++ system/src/main/org/jboss/deployment/MainDeployer.java
15 Jul 2002 16:03:28 -0000
@@ -845,6 +845,7 @@
*/
private void parseManifestLibraries(DeploymentInfo sdi)
throws DeploymentException
{
+ log.debug("Parsing Manifest for: " + sdi.shortName);
String classPath = null;
Manifest mf = sdi.getManifest();
@@ -879,13 +880,15 @@
{
lib = new URL(sdi.url, tk);
}
-
- if (!isDeployed(lib))
+/* SPDBUG: Bad idea. If the jar really should be deployed,
there should be
+ *an entry in the ear application.xml file.
+ if (!(isDeployed(lib) || sdi.hasParent(lib)))
{
// Try having it as a full subdeployment
sub = new DeploymentInfo(lib, sdi,
getServer());
deploy(sub);
}
+ */
}
catch (Exception ignore)
{
#################
diff -u -r1.5.2.8 DeploymentInfo.java
--- system/src/main/org/jboss/deployment/DeploymentInfo.java
29 Jun 2002 21:17:40 -0000 1.5.2.8
+++ system/src/main/org/jboss/deployment/DeploymentInfo.java
15 Jul 2002 16:16:16 -0000
@@ -190,6 +190,26 @@
// Do we have an XML descriptor only deployment?
isXML = shortName.toLowerCase().endsWith("xml");
}
+
+ public boolean hasParent(final URL url){
+ //SPDDBG:
+ System.out.println("Checking for parent: " + url);
+ if (this.parent == null){
+ //No Parents
+ //SPDDBG:
+ System.out.println("No Parents");
+ return(false);
+ }
+ //else
+ //Check to see if parent is the URL we are trying to
compare, or if we
+ //are a grandchild of this URL;
+ //SPDDBG:
+ System.out.println("ShortName: " + shortName);
+ System.out.println("Parent.shortName: " +
parent.shortName);
+ System.out.println("Test ShortName: " +
getShortName(url.getFile()));
+ return(
parent.shortName.equalsIgnoreCase(getShortName(url.getFile()))
+ || parent.hasParent(url));
+ }
#######
diff -u -r1.12.2.10 EARDeployer.java
--- server/src/main/org/jboss/deployment/EARDeployer.java
30 Jun 2002 00:26:19 -0000 1.12.2.10
+++ server/src/main/org/jboss/deployment/EARDeployer.java
15 Jul 2002 16:20:56 -0000
@@ -190,13 +190,19 @@
try
{
URL url = new URL(urlPrefix + name);
+ log.debug("Checking if Deployable
(name|URL):" + name + '|' + url);
if (isDeployable(name, url))
{
// Obtain a jar url for the nested jar
URL nestedURL =
JarUtils.extractNestedJar(url, this.tempDeployDir);
// and store in it in map
+ log.debug("Storing name|nestedURL: " +
name + '|' + nestedURL);
extractedJars.put(name, nestedURL);
}
+ else
+ {
+ log.debug("Jar file not Deployable
(name|URL):" + name + '|' + url);
+ }
}
catch (MalformedURLException mue)
{
@@ -226,6 +232,10 @@
{
// The nested jar url was placed into
extractedJars above
URL nestedURL = (URL)
extractedJars.get(fileName);
+ //NOTE: If nulls show up in the next
line, check to make sure
+ //that ALL jars listed in the Ear's
application.xml file are
+ //actually present.
+ log.info("Creating subdeployment for
(filename|URL): " + fileName + '|' + nestedURL);
sub = new DeploymentInfo(nestedURL, di,
getServer());
}
// Set the context-root on web modules
-Steve
----------------------------------------------------------------------
Comment By: Stephen Davidson (northgorky)
Date: 2002-07-15 11:11
Message:
Logged In: YES
user_id=490856
After examing the MainDeployer.parseManifest function, I
have an issue with it. It is trying to do a FULL deploy of
all the jars listed in a jar file. This is a bad idea, for
several reasons. The only jars that should be fully
deployed are the ones listed in the Ear's application.xml
file, or that one of the scanners have decided to deploy.
What I view as the biggest flaw in this concept is that fact
that trying to deploy jars from jar manifest files gives two
places that an application in an Ear file could be deployed
from. When the deployer is reading from an Ear file, the
jars are in inconsistent states, and this can generate
problems like what we are seeing.
Therefore, I propose the following concept;
The parseManifest function should NOT try to fully deploy a
listed jar, but should instead make sure that the listed jar
is loaded by a Classloader, so that its classes are
available for usage. Until this is done, I recommend two
patches (to be listed in my next posting).
-Steve
----------------------------------------------------------------------
Comment By: Stephen Davidson (northgorky)
Date: 2002-07-12 15:49
Message:
Logged In: YES
user_id=490856
This was working from JBoss3.0 RC3 through 2 weeks ago.
When I updated this week was when my copy broke.
The ear file submitted is only a fraction of the entire
project. Unfortunately, it is not possible to execute the
suggested reconfiguration.
Common has base classes that Admin and Security classes both
extend.
Common also does some of the basic Security Authorization
(as JAAS was still under development when the Security model
was implemented), and therefore needs to talk to the
Security classes.
One of the Security EJBs needs to access an Admin EJB and
some Admin objects to do its thing.
And the Admin objects need to check security privileges
before deciding what and how to execute.
Hence the circularity.
These are the only Jars in the project where this is an
issue. The other Jars only normally rely on Security and
Common.
Thanks in advance for chasing down what broke. The way the
log and stack trace was going, I wonder if the issue is that
the Jars are not actually getting to the point where they
are deployed, or condsidered deployed? The Manifest appears
to be causing JBoss to try to deploy the Jars listed in the
Manifest before it deploys the one it is working on.
-Steve
----------------------------------------------------------------------
Comment By: Julien Viet (cooperfbi)
Date: 2002-07-12 14:46
Message:
Logged In: YES
user_id=337141
This problem come from the fact there are cross references
between jar libraries via classpath manifest :
Security.jar references Common.jar and Admin.jar
Common.jar references Security.jar
Admin.jar references Security.jar and Common.jar
I think the problem can be solved at first sight by breaking
circular references between libraries.
However there is something wrong in
MainDeployer.parseManifestLibraries().
There is a loop because the jar being deployed is not seen as
deployed by parseManifestLibraries.
I will try to solve the problem.
----------------------------------------------------------------------
Comment By: Stephen Davidson (northgorky)
Date: 2002-07-12 14:25
Message:
Logged In: YES
user_id=490856
This is a show stopper for me. I can not currently deploy
my EAR file because of this bug. Please somebody help?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=580190&group_id=22866
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development