Opened 14 years ago

Closed 13 years ago

#1041 closed defect (fixed)

ZipException: error in opening zip file in JarClassLoader if a JAR file given on class path doesn't exists

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.8
Component: core Version:
Keywords: Cc:

Description

Here is the interesting parts of the stacktrace:

14:37:31,384 ERROR ExtensionsFile:425 - Error loading extensions from JAR file: /home/auster/nicklas/program/tomcat/webapps/base2/WEB-INF/extensions/base-ftpserver.jar
java.util.zip.ZipException: error in opening zip file
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:114)
	at java.util.jar.JarFile.<init>(JarFile.java:133)
	at java.util.jar.JarFile.<init>(JarFile.java:97)
	at net.sf.basedb.util.JarClassLoader.loadJarFile(JarClassLoader.java:269)
	at net.sf.basedb.util.JarClassLoader.loadJarFile(JarClassLoader.java:297)
	at net.sf.basedb.util.JarClassLoader.<init>(JarClassLoader.java:205)
	at net.sf.basedb.util.JarClassLoader.getInstance(JarClassLoader.java:117)
	at net.sf.basedb.clients.web.extensions.ExtensionsFile.loadJar(ExtensionsFile.java:420)

The starting JAR file passed to JarClassLoader?.getInstance() has a MANIFEST.MF file where the Class-Path entry lists a non-existing file. The call loadJarFile(JarClassLoader.java:297) is a recursive call to load the non-existing file which fails. I think non-existing files should be ignored and maybe a warning-level message should be logged.

Change History (4)

comment:1 Changed 14 years ago by Nicklas Nordborg

Status: newassigned

comment:2 Changed 14 years ago by Nicklas Nordborg

Resolution: fixed
Status: assignedclosed

(In [4321]) Fixes #1041: ZipException?: error in opening zip file in JarClassLoader? if a JAR file given on class path doesn't exists

comment:3 Changed 13 years ago by Nicklas Nordborg

Resolution: fixed
Status: closedreopened

This fix was broken by #1043. The JarClassLoader? should not throw an exception if a listed JAR file is missing.

comment:4 Changed 13 years ago by Nicklas Nordborg

Resolution: fixed
Status: reopenedclosed

(In [4389]) Fixes #1041: ZipException?: error in opening zip file in JarClassLoader? if a JAR file given on class path doesn't exists

Note: See TracTickets for help on using tickets.