-
1. Re: JBoss 4.0.4rc1 deployment performance problem
bill.burke Mar 23, 2006 5:40 PM (in response to jeffbrooks)Can you explain a bit more the structure of your ear and application.xml?
-
2. Re: JBoss 4.0.4rc1 deployment performance problem
bill.burke Mar 23, 2006 5:50 PM (in response to jeffbrooks)what I could do is add a switch that states whether .jar files should be ignored and only .ejb3 and .par files should be scanned....
Please though, tell me your ear structure in more detail so that I can figure out if this is a deployer issue or just that we're screwed because we just have to scan every .jar -
3. Re: JBoss 4.0.4rc1 deployment performance problem
jeffbrooks Mar 23, 2006 6:18 PM (in response to jeffbrooks)The structure of the ear looks like this:
meta-inf/application.xml
module1.jar
module2.jar
...
module14.jar
lib1.jar
lib2.jar
...
lib20.jar
The application.xml contains a list of all the modules. Nothing special there.
The only thing interesting for each module is in the manifest there is a Class-Path entry that contains the list of libraries.
What appears to be happening is:
foreach module do
classpath = get module classpath
for each item in classpath do
deploy classpath item (includes scan of jar)
end
end
If the above was switched do this it would be MUCH faster:
foreach module do
classpath = get module classpath
for each item in classpath do
if classpath item hasn't been deployed
deploy classpath item (includes scan of jar)
end
end
end
It appears the libraries are getting scanned once per module that has a classpath entry that references it.
The scanning of the jars appears to take about 22 seconds. The problem is 22 seconds * 14 modules is more than 5 minutes.
I have no problem with jboss scanning the jars. I just would like jboss changed so it only scans them once per ear, instead of once per module in the ear.
Jeff Brooks -
4. Re: JBoss 4.0.4rc1 deployment performance problem
jeffbrooks Mar 23, 2006 7:09 PM (in response to jeffbrooks)I did some checking in the code.
In EJB3Deployer there is a method called accept. This method does some simple checks to see if something has the possiblity of being an ejb3 jar and if it is it exits quickly. If it can't determine if it's an ejb3 jar it eventually calls hasEjbAnnotation which scans the jar for class files with ejb3 annotations.
The problem is it won't find any annotations for libraries so it will end up scanning all the class files in it.
I'm new to the code for the jboss deployer but I think something like this should fix the problem:
rename the hasEjbAnnotation method to scanForEJB3Annotation
Add this to the EJB3Deployerprivate Map annotationCache = new HashMap(); public boolean hasEjbAnnotation(DeploymentInfo di) { Boolean bool = (Boolean)annotationCache.get(di.url); if (bool == null) { bool = Boolean.valueOf(scanForEJB3Annotation(di)); annotationCache.put(di.url, bool); } return bool.booleanValue(); }
There may be a better way to do this if jboss keeps track of the libraries deployed (won't need the cache).
Jeff Brooks -
5. Re: JBoss 4.0.4rc1 deployment performance problem
bill.burke Mar 23, 2006 9:10 PM (in response to jeffbrooks)I don't think this would work for redeploy. Plus, it inherently leaks. The real question is why Class-path entries in the manifest are being added to the scan. Looking into that...