EjbDeploy on Windows

I do not think WebSphere was ever intended to run on Windows.

It is so easy to create applications with deep package hierarchies that result in deployed files that cannot be accessed on Windows via DOS path semantics. Allegedly UNC paths do not have the 254-ish character limit, so in theory there is a way to make it work, but in practice, it is not used.

We need to be able to catch this unfortunate situation at build time, because WebSphere is not really helpful in its error messages when this happens. Resulting in much head scratching and use of foul language before the cause is found. Followed by more foul language (I imagine) when the developers have to refactor their code to suit the platform limitations.

But that will be the issue of a future blog entry, because in this one I will deal with another DOS/Windows-imposed limit that causes frustrating breakage in WebSphere's support tools.

When generating Ejb stubs with the ejbdeploy script, it is not hard to exceed DOS's command line length limit if there is a big classpath.

I have experienced it at Systematic and here at Jyske Bank. At Systematic I think the solution we chose was to shorten the path to jars by mounting a DOS drive at a suitable location - possibly combined with merging jars into fewer files. I don't remember exactly.

But I remembered the problem when I saw it again, so I decided to fix the broken tool instead of working around it.

The result is a decompiled version of IBM's EjbDeploy class, where I have modified the -cp argument handling to read the classpath from a file instead of from the command line.

In front of that I have an Ant task that translates an Ant path reference into a string and writes it out to a file. It also runs IBM's setupCmdLine.bat script and records the defined environment variables. Then IBM's hacked class is invoked with the environment it expects and loads the long classpath from the file.

Works like a charm.

Which begs the question why IBM does not ship their expensive product with a similar solution. Probably because they see it as an AIX sales lead when customers complain...


The two files are placed at Buildmeister@Kenai.

No comments:

Post a Comment