#230 1.3.0: "Prefix string too short" when deploying jar-files

1.3.0 (final)
closed-fixed
4
2006-04-07
2006-04-03
Anonymous
No

I get a Java Exception when I have added
external jar-files that has names that are shorter than
3 characaters.

This is because when I run my project in XINS
servlet-container, than when it tries to unpack the
jar-file in the class ServletClassLoader.java it does:

File tempjarFile = File.createTempFile(libName, ".jar");

The problem with this of cours being libName is shorter
than 3 characters and than it createTempFile throws an
exception.

It is an easy fix:

File tempjarFile = File.createTempFile("tmp"+libName,
".jar");

(Line 131, in the stable version 1.3.0)

Thank you for a great piece of software.

Peter.Skov@liu.se

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Same problem for 1.4.0-beta2.

    Peter.Skov@liu.se

     
  • Ernst de Haan

    Ernst de Haan - 2006-04-04

    Logged In: YES
    user_id=11053

    Confirming your issue. See also:
    http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html#createTempFile\(java.lang.String,%20java.lang.String)

    Your suggested change looks good as well. Perhaps "tmp_" is
    slightly better than "tmp", since then the relationship with
    the original file name is more clear. But that's a minor thing.

    I expect this fix to go into the next release on the 1.4
    series, being either 1.4.0-beta3 or 1.4.0-rc1. Note,
    however, that the SourceForge CVS is currently inaccessible.
    See:
    http://sourceforge.net/docs/A04/

     
  • Anthony Goubard

    Anthony Goubard - 2006-04-04
    • assigned_to: nobody --> agoubard
     
  • Anthony Goubard

    Anthony Goubard - 2006-04-04
    • milestone: --> 1.3.0 (final)
    • priority: 5 --> 4
     
  • Anthony Goubard

    Anthony Goubard - 2006-04-04

    Logged In: YES
    user_id=987589

    I've changed the code with your suggestions.
    As Ernst says, this fix to go into the next release on the 1.4
    series, being either 1.4.0-beta3 or 1.4.0-rc1.

    Anthony

     
  • Anthony Goubard

    Anthony Goubard - 2006-04-07
    • status: open --> closed
     
  • Anthony Goubard

    Anthony Goubard - 2006-04-07
    • status: closed --> closed-fixed
     
  • Anthony Goubard

    Anthony Goubard - 2006-04-07

    Logged In: YES
    user_id=987589

    Fixed, is available in the 1.4.0 beta 3 release.

     

Log in to post a comment.