Is it really possible to work using J2EE modules in 5.1? I am pulling my hair out. Really. Its almost all gone now.
I put together 6 modules, set up all the inter-module dependencies as well as external jars -- its all worked out. Its like this:
comps(jar) - dep on fw
ejb1(ejb) - dep on fw and comps
ejb2(ejb) - dep on fw and comps (exactly the same structure as ejb1, diff ejb code)
app1(app) - dep on ejb1
app2(app) - dep on ejb2
I can do a project build, and it works. I can even deploy to Weblogic 8.1 (using exploded dirs of course), and everything is fine. Sounds pretty good so far, eh? Of course it took hours to get all that set up right. But now I figure it is clear sailing and I can concentrate on my own code.
So I modify a few bits of code, remake the project. The first and maybe second time, this works. But after that, I cannot seem to get any code changes to make. I try rebuilding the entire project of course, but no difference. I figure the server is not handling the modified exploded code very well, so I restart the server, and generally try everything possible there. No luck. After another hour or so I finally track down the culprit. There is a fw.jar in the exploded directory. It is changing its timestamp each time I do the build, but if I look inside, I see none of the contents have changed for about an hour and a half. What is up with that?
Anyway, I figure I will just delete the jar and force it to be rebuilt. I have real work to get done and I have now wasted about 6 hours doing none of that. After the rebuild, still no luck. I recheck the fw.jar. Yep, still really old contents. Thing is, I have already checked the classes folder for that module (fw) and I know those classes are nice and up to date.
So I am extremely confused. Since I need to eat, I set off a whole computer search to find out where fw.jar is getting those old .classes. Later, after dinner, I check the results. I looked on the entire computer, and there is nowhere that those .class files exist at the date that shows up in fw.jar. No, really -- is that even possible?
I change every setting that looks like it could solve my problem, and rebuild. This time the fw.jar is correctly updated and I can continue working. Which I do. I finally test out my changes from 3 hours ago, only to find a bug (a tricky one, no less -- good thing the debugger is still functioning).
Of course you know what happens next. New rebuild, old classes in fw.jar. I really cannot fathom what it is that can make these classes update.
It seems like maybe if I close the project and reopen, I can get it to rebuild. I just did this and it worked. Of course, that is probably just a lucky coincidence, and I won't be able to reproduce it again, on the off chance my latest bug fix isn't the perfect solution. Even if it does work, it is a pretty clumsy (and slow) workaround.
This is hardly pleasurable, I assure you.
Does anyone know how to get past this problem? Or does everyone just work off their own handcrafted build.xmls (like I used to)?
Note: I tried using the latest EAP build and had even worse (and more frustrating) problems working with multi-module projects there.