views:

107

answers:

1

I'm creating a custom taglib with .tag files. Everything works great, except when I load 2 pages at the same time. It seems the .tag files are re-compiled on every request and the concurrency causes the compilation to fail.

Is this normal behavior for .tag files? I would have expected them to be compiled only once. Is there some way to prevent re-compilation?

The .tag files are in a jar file, which is included as in the lib directory of my war file. I'm deploying to JBoss 4.2.1, if that matters.

Thanks.

+1  A: 

How do you know JBoss is recompiling the tag on each request? Do you have any direct evidence, or just the concurrency problem? What is this concurrency problem? A stack trace? If so, please post it.

When JBoss compiles a JSP or tagfile, it keeps the compiler version in its tmp/ or work/ directory (can't remember which). Have a look around in there to see if you can find it (it'll be a .class file with a name that looks similar to the tagfile). If the tag is indeed being recompiled every time, that file will be refreshed each time. If yoy can't find the class file at all, it may that JBoss cann't create the temporary compiled version (maybe due to a file permission problem), and so is forced to recompile every time.

skaffman
I know it's being re-compiled each time because the time stamp on the .java and .class files in the work directory are updated with every request.From your answer it seems that it is in fact NOT normal for the .tag to be recompiled each time. My understanding is that it would be re-compiled if the original .tag file has changed (checksum or timestamp?). Any other circumstances that would cause that? I don't have the stacktrace right now (had to abandon for now to meet a deadline), but I really don't think it's relevant since it only fails during concurrent recompiles.
msmithi33
It's relevant because the JSP compiler should have no concurrency problems, so I doubt that's what it is.
skaffman