2 Replies Latest reply on Apr 16, 2004 1:06 PM by Wouter Zoons

    Crazy: moving JBoss installation helps find precompiled JSPs

    Wouter Zoons Newbie


      *my apologies for the long post* -- Wouter

      I have written an application using Hibernate and Struts and I am deploying it as an .ear bundle under JBoss 3.2.3 w/ tomcat41, currently I'm using Windows XP.

      The application is generated using AndroMDA 3.0, AndroMDA generates the persistence and the web tier for 100% from a UML diagram. The web pages do not need manual editing before deployment (that's right) !

      The generation process sometimes outputs file names which are pretty long (>25 chars), furthermore, JSPs are put in a subdirectory resembling a Java package name (org.project.xyz).

      When I deploy the application I can browse through the pages without any problem, it works perfectly. The issue, however, appears when I precompile the JSP pages in the .war bundle, this one is obviously inside the .ear bundle.

      Precompilation is done during development using JspC. This is a must, I'm not putting JSPs on the server, that's final.

      At a certain point, when browsing, the jsp container will throw an exception complaining it is not able to load a servlet (=precompiled JSP), this problem does not occur if I deploy the JSP pages without the precompilation step.

      Strangely enough, other people have the same issue at other pages.

      I have experimented with some theories and it seems the servlet classname is too long: when I move the JBoss installation closer to the root of my drive the problem disappears. If I move the installation further away from the root the issue appears earlier. This explains why other people have the error at other locations: they have JBoss installed in another location.

      Think about it: what is the full URI to a precompiled JSP ? This URI will include the absolute path from the underlying filesystem, the EAR bundle, the WAR bundle and finally the fully qualified name of the servlet.

      Maybe I just going nuts, but tests have shown servlets with a full path of 255 chars or less are okay, others cannot be loaded (not found). Note: I am talking about the full path, something like this:


      So, I have my JSPs nicely precompiled and deployed, but because some of the full file:/ ... URIs are longer than 255 chars the classloader has an issue. It is trying to resolve a servlet class with the correct name (as shown in the error page) but my guess is that he cannot find this class because all classnames found are 255 chars or less.

      You can see that shortening the URI path by, for example, moving the JBoss installation to the root of the drive, or by shortening the classnames is only a silly workaround.

      So can anybody please tell me:
      1. Is this a Windows problem ? I tried creating files with a long name and Windows automatically truncates them after 255 chars.
      2. Is there a way to precompile JSPs (and put the in WEB-INF/classes) so that the classloader will correctly pick them up, no matter how long they are ?
      3. any tips ?

      thanks in advance

      ps: for those interested, the app is part of the AndroMDA distribution, go here: http://team.andromda.org/tiki/tiki-index.php?page=AndroMDA+From+Scratch for details on how to download the sources and build (it's using maven rc2+)

      after building, the .ear should be in your local maven repository under ''andromda-samples', it's called the animal quiz