You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sabari Gandhi <SG...@kivasystems.com> on 2013/09/16 15:36:22 UTC

Invalid Jar Index : Java 6/tomcat 5.5/linux

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



Re: Invalid Jar Index : Java 6/tomcat 5.5/linux

Posted by Daniel Mikusa <dm...@gopivotal.com>.
On Sep 16, 2013, at 9:36 AM, Sabari Gandhi <SG...@kivasystems.com> wrote:

> 
> Hi,
> 
> I am sending this  error again with more details:
> 
> I am currently using Java 6 and tomcat 5.5

Don't use Tomcat 5.5.  It has not been supported for almost a year now.  Upgrade ASAP.

> 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

Sounds like your JAR might be corrupted.  If this is a custom JAR, rebuild it.  If it's a dependency you've downloaded with Maven, you might try clearing out the folders for the problem JAR(s) under "~/.m2/repository" and rebuilding.  If a JAR downloaded by Maven is corrupted, the corrupted file it will sit on your local HD forever and cause problems.  Manually deleting the Maven folders for the JAR usually clears up the problem.

Other thought.  Upgrade your JVM.  If it's as old as your Tomcat version, you could be simply hitting a bug.

Dan

> 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
> 
>  /* Note that the addition of the url to the list of visited
>   850                         * jars incorporates a check for presence in the hashmap
>   851                         */
>   852                        boolean visitedURL = !visited.add(url);
>   853                        if (!visitedURL) {
>   854                            try {
>   855                                newLoader.ensureOpen();
>   856                            } catch (IOException e) {
>   857                                throw (InternalError) new InternalError().initCause(e);
>   858                            }
>   859                            final JarEntry entry = newLoader.jar.getJarEntry(name);
>   860                            if (entry != null) {
>   861                                return newLoader.checkResource(name, check, entry);
>   862                            }
>   863    
>   864                            /* Verify that at least one other resource with the
>   865                             * same package name as the lookedup resource is
>   866                             * present in the new jar
>   867                             */
>   868                            if (!newLoader.validIndex(name)) {
>   869                                /* the mapping is wrong */
>   870                                throw new InvalidJarIndexException("Invalid index");
>   871                            }
>   872                        }
> 
> 
> 
> Thanks and Regards,
> SG
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Invalid Jar Index : Java 6/tomcat 5.5/linux

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Sabari,

On 9/16/13 9:36 AM, Sabari Gandhi wrote:
> I am sending this  error again with more details:
> 
> I am currently using Java 6 and tomcat 5.5 and my environment is
> linux.

You are about to hear this from every reply: upgrade. Tomcat 5.5 is no
longer supported. I am unaware of any critical security issues in
Tomcat 5.5.latest, but if any are identified, they will not be fixed.

You should upgrade as soon as possible to Tomcat 7.0. Most webapps
should have no trouble running with the new version of Tomcat, as the
servlet spec is supposed to be (mostly) backward-compatible. Newer
versions of Tomcat are more strict with a lot of spec concepts,
though, so you may have to make some modifications in order to upgrade.

But you really need to do it ASAP.

> 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*.
> 
> [...]
> 
> 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)

Looks like a damaged JAR file. What happens if you try this from the
command-line:

$ jar tf /path/to/file.jar

> 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.

How are you transferring the JAR file from your Mac to Linux? Possibly
a newline-mangling during FTP? (I'm reaching, here).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJSNxJxAAoJEBzwKT+lPKRYuMAQAJmjgNGGlwl4b83vk6MdUCXe
uDFVBQqo9BAj2MDXV8o7FxmCm35xDDlHcDkV5fpg5jAvHscaMf409NjNXZBIE3om
IVbere8KTlSu0VekjhJ35O/guto/B/j/gOu/g6iL3ARPfo9tAnIAGAAWlB+Up+cr
62+7bBbUB67VR8GiOxwboD5J27LSCt5mq8t3N9HfKb264HBpdb9ssYeopGQXD5p7
zAijNYULjL3Dp7I0hnH+RFWXID6OC7OuE02iYwmUy6sbPU6vnMWDTKa1fRTLXsPd
lnvto3a91e3RvdVC8PczXsS3qfvWokANZOaDU93qqV1IJEfGW5ZTBSuAGcR/scWu
0+3wB/ocdtN4NbNGSO9v39f5NkJxGUpDIhucW4Eq+NMUJabNCTp1mwz/iUf3h1O1
XnEEwwqSxUGb2xdECfjXeFO9hdaY59TONbr5FKmO5iWniBPYAZNYYiSQnN9DnPRM
1t7ob34uQRYloV5+FR8X0oSwwvKhTEPgxrDx/LJDOFx4NhuFVY4i1g8iuPvhqK/3
pq3wgExD9cMDIa2MaJqnNV9pi395Mnlkj7gEgi+jtGhgSJ6A6WvfZxQryA0zyLO4
tcZwO/Potpq+oOJvehwMD8kAN1v73FC10pWM1gSm6bpMzwF3wXr9jSPJDxRPUiHH
0fXuVGWFjwn1JXgnRJ8Y
=mwfN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org