Eclipse WTP Server start hangs… on Windows…
We have a strange animal: A web application with really lots of jars. (Today total of 273 JARs.)
We use Maven 2, Eclipse with WTP, Tomcat, Q4E, etc.., but from these technologies only Eclipse, WTP and Tomcat are relevant for the problem I’d like to describe. Most of developer machines runs Windows XP, and some Windows 2000, and just few Linux.
As we use Maven 2, the jars came form ${user.home}/.m2/repository/ folder. We just let Q4E set up the path for our projects inside Eclipse. For some reason we stack with Q4E 0.3.0, and we tweaked the WTP Server (Tomcat) launch settings, to have all JARs included. We did not used “served modules without publishing”, nor “J2EE Module Dependencies” for few (here) non-relevant reasons.
After adding few new modules (JARs) to the webapp, for few developers the Tomcat Server just failed to start. No log, and nothing in the debug view, nor in the error view. Eclipse WTP were just waiting for Tomcat to start… forever… We were bitterly searching for solution/bug. With no luck. After adding even more JARs, even more developers were complaining: the same problem.
The first reaction was, we added something bad to our webapp, and starting to remove JARs. As we removed the JARs just added, Tomcat started again, and everything looked just fine. Then, to isolate the “bad JAR”, we started to pack back JARs. First in groups, than one by one. We thought we found the bad JARs, and started to look for the reason. But there were no reason… Fortunately, on one machine the “bug” represented itself in a different manner. There were one line in a debug view. We looked at process properties, copied out the “command line” – it was quite huge, – and paste it into a command line… and… ouch. The line was just too big for Windows to digest it. Nasty limit. And there is no way to change that limit. Search… search…
From Microsoft TechNet Archive:
Finally, the maximum allowed length of a shell command appears to be undocumented by Microsoft. Simple testing shows that the Windows NT command shell allows very long commands—in excess of 4,000 characters. Practically speaking, there is no significant upper limit to the length of a command.
Well… this limit gave us a real head-ache for more than 2 weeks… and for us it was significant. – And the limit is there for XP/2000/….
Fast hack we provided: shortened the path for the JARs. This will do for some time. Now our local Maven repository is under c:\m2repo for Windows workstations. But the real solution is to use newer Q4E (with WTP support), use J2EE dependencies and set “server modules without publishing”.
I consider this as a WTP (or Eclipse) bug: it did not reported Tomcat start failure, and as a Windows XP/2000/… limitation.
Note: there is no such issue under Linux.
I still have to isolate the bug, to report it. I hope I’ll find a time for it,… and a machine…
(No windows here.)
Great article and informativ. I have this bookmarked. Thanks