Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to scan [file:/var/tomcat8/webapps/source/WEB-INF/lib/annotations-19.0.0.jar] #3390

Open
vladak opened this issue Dec 2, 2020 · 6 comments
Labels
bug webapp web application

Comments

@vladak
Copy link
Member

vladak commented Dec 2, 2020

After #3387 there is one remaining jar that needs to be addressed:

02-Dec-2020 23:23:35.081 WARNING [localhost-startStop-1] org.apache.tomcat.util.scan.StandardJarScanner.processURLs Failed to scan [file:/var/tomcat8/webapps/source/WEB-INF/lib/annotations-19.0.0.jar] from classloader hierarchy
        java.io.IOException: java.lang.reflect.InvocationTargetException
                at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:205)
                at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:65)
                at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49)
                at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:385)
                at org.apache.tomcat.util.scan.StandardJarScanner.processURLs(StandardJarScanner.java:320)
                at org.apache.tomcat.util.scan.StandardJarScanner.doScanClassPath(StandardJarScanner.java:283)
                at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:234)
                at org.apache.catalina.startup.ContextConfig.processJarsForWebFragments(ContextConfig.java:1916)
                at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1130)
                at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
                at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5053)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1858)
                at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
                at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                at java.base/java.lang.Thread.run(Thread.java:834)
        Caused by: java.lang.reflect.InvocationTargetException
                at java.base/jdk.internal.reflect.GeneratedConstructorAccessor7.newInstance(Unknown Source)
                at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
                at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
                at org.apache.tomcat.util.compat.Jre9Compat.jarFileNewInstance(Jre9Compat.java:202)
                ... 23 more
        Caused by: java.nio.file.NoSuchFileException: /var/tomcat8/webapps/source/WEB-INF/lib/annotations-19.0.0.jar
                at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
                at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
                at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
                at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
                at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:149)
                at java.base/java.nio.file.Files.readAttributes(Files.java:1763)
                at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1225)
                at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:727)
                at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844)
                at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:247)
                at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:177)
                at java.base/java.util.jar.JarFile.<init>(JarFile.java:348)
                ... 27 more
@vladak vladak added bug webapp web application labels Dec 2, 2020
@vladak
Copy link
Member Author

vladak commented Dec 2, 2020

Interestingly opengrok-indexer.pom has the annotations artifact at 20.1.0 and the web app has also another version:

# find /var/tomcat8/webapps/source/ -name 'annotations*.jar' -type f
/var/tomcat8/webapps/source/WEB-INF/lib/annotations-12.0.jar
/var/tomcat8/webapps/source/WEB-INF/lib/annotations-20.1.0.jar

Looks like one of the .jar files has a dependency on 19.0.0 however it is not opengrok.jar.

I went through all the META-INF/MANIFEST.MF files for all the .jar files shipped with OpenGrok in the dist directory and there is no mention of annotations-19.0.0.

@vladak
Copy link
Member Author

vladak commented Dec 2, 2020

I can see this only when Tomcat is restarted. For the record, the only other applications are the manager and host-manager.

@vladak
Copy link
Member Author

vladak commented Dec 2, 2020

Going through https://mvnrepository.com/artifact/org.jetbrains/annotations/19.0.0/usages?p=1 I noticed chronicle-map related artifacts. Namely chronicle-bytes-2.20.80.jar depends on annotations-19.0.0.jar. Even the latest version of chronicle-bytes-2.20.105 depends on annotations-19.0.0.jar so upgrade will not fix that.

@mamh2021
Copy link

mamh2021 commented Jun 2, 2021

can we add dependency to opengrok-indexer pom.xml and opengrok-web pom.xml ??? both of them version fix to 19.0.0

        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>19.0.0</version>
        </dependency>

@ahornace
Copy link
Contributor

ahornace commented Jun 2, 2021

No, we cannot. 19.0.0 is old and that would be also wrong as annotations is only compile time dependency so there is no need to actually include it in the release jar. For now the best "fix" is to disable jar scanning on the tomcat level until chronicle will fix their libraries.

@ahornace
Copy link
Contributor

ahornace commented Jun 9, 2021

Created an issue for jetbrains annotations dependency in chronicle-map (OpenHFT/Chronicle-Map#289)

I think there is still a couple of other errors with the same cause (if I recall correctly, it was javax.el from cron-utils).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug webapp web application
Projects
None yet
Development

No branches or pull requests

3 participants