tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sabari Gandhi <SGan...@kivasystems.com>
Subject Invalid Jar Index : Java 6/tomcat 5.5/linux
Date Mon, 16 Sep 2013 13:36:22 GMT

Hi,

I am sending this  error again with more details:

I am currently using Java 6 and tomcat 5.5 and my environment is linux. I see an mysterious
exception when I try to access a simple jsp page after tomcat is started. When I added a new
maven project (which in turn will create a new jar) I see the exception when i am trying to
access an simple index.jsp. When I name the project and jar as mhs-beacon-agent I see the
following error and when the project is renamed as mhs-sample-agent I don't see this error.
We also set up remote debugging in linux and see the exception is happening when it is trying
to look up for "javax/servlet" , since sun.misc.URLClassPath is suns own proprietary code
i am not able to debug the code. When I extracted two jar file and did an folder / folder
comparison I don't see any differences in index.list file or manifest.mf apart from the name
differences. I am seeing this exception only in linux environment and not on mac (which is
my developer environment)Any help is greatly appreciated. Thanks !!

Exception:

sun.misc.InvalidJarIndexException: Invalid index
sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:931)
sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:840)
sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:810)
sun.misc.URLClassPath.findResource(URLClassPath.java:176)
java.net.URLClassLoader$2.run(URLClassLoader.java:551)
java.net.URLClassLoader$2.run(URLClassLoader.java:549)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findResource(URLClassLoader.java:548)
java.lang.ClassLoader.getResource(ClassLoader.java:1139)
java.net.URLClassLoader.getResourceAsStream(URLClassLoader.java:227)
org.apache.catalina.loader.WebappClassLoader.getResourceAsStream(WebappClassLoader.java:1177)
org.apache.jasper.servlet.JasperLoader.getResourceAsStream(JasperLoader.java:144)
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:194)
org.apache.jasper.compiler.JDTCompiler$1.findType(JDTCompiler.java:179)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:119)
org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:178)
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:407)
org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.checkAndSetImports(CompilationUnitScope.java:167)
org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:190)
org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:301)
org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:315)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:425)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:300)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)


Code:
For complete code see the following URL.
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#URLClassPath.JarLoader.validIndex%28java.lang.String%29<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#URLClassPath.JarLoader.validIndex(java.lang.String)>


 /* Note that the addition of the url to the list of visited

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

850<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#850>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                      * jars incorporates a check for presence in the hashmap

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

851<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#851>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                      */

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

852<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#852>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                     boolean visitedURL = !visited.add<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/Set.java#Set.add%28java.lang.Object%29>(url);

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

853<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#853>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                     if (!visitedURL) {

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

854<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#854>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         try {

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

855<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#855>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                             newLoader.ensureOpen<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#URLClassPath.JarLoader.ensureOpen%28%29>();

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

856<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#856>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         } catch (IOException<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/io/IOException.java#IOException>
e) {

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

857<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#857>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                             throw (InternalError<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/InternalError.java#InternalError>)
new InternalError<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/InternalError.java#InternalError>().initCause<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/Throwable.java#Throwable.initCause%28java.lang.Throwable%29>(e);

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

858<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#858>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         }

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

859<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#859>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         final JarEntry<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/jar/JarEntry.java#JarEntry>
entry = newLoader.jar.getJarEntry<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/jar/JarFile.java#JarFile.getJarEntry%28java.lang.String%29>(name);

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

860<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#860>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         if (entry != null) {

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

861<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#861>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                             return newLoader.checkResource<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#URLClassPath.JarLoader.checkResource%28java.lang.String%2Cboolean%2Cjava.util.jar.JarEntry%29>(name,
check, entry);

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

862<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#862>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         }

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

863<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#863>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>



[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

864<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#864>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         /* Verify that at least one other resource with the

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

865<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#865>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                          * same package name as the lookedup resource is

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

866<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#866>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                          * present in the new jar

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

867<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#867>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                          */

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

868<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#868>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         if (!newLoader.validIndex<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#URLClassPath.JarLoader.validIndex%28java.lang.String%29>(name))
{

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

869<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#869>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                             /* the mapping is wrong */

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

870<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#870>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                             throw new InvalidJarIndexException<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/InvalidJarIndexException.java#InvalidJarIndexException>("Invalid
index");

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

871<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#871>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                         }

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]

872<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#872>

[cid:F10EAD3B-790F-44C6-9C25-0326B613C290@kivasystems.com]<http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/sun/misc/URLClassPath.java#>

                     }



Thanks and Regards,
SG



Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message