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

Class-Path in jna-platform's manifest cause exception #776

Closed
zhanhb opened this issue Mar 15, 2017 · 7 comments
Closed

Class-Path in jna-platform's manifest cause exception #776

zhanhb opened this issue Mar 15, 2017 · 7 comments

Comments

@zhanhb
Copy link

zhanhb commented Mar 15, 2017

There is a line Class-Path: lib/jna.jar lib/test-classes/ in jna-platform.jar/META-INF/MANIFEST.MF which may raise an exception as the following when deploy to a tomcat server since jna 4.3.0.

java.io.FileNotFoundException: F:\work\m2\repository\net\java\dev\jna\jna-platform\4.4.0\lib\jna.jar (系统找不到指定的路径。)
	at java.util.zip.ZipFile.open(Native Method) ~[na:1.8.0_121]
	at java.util.zip.ZipFile.<init>(ZipFile.java:219) ~[na:1.8.0_121]
	at java.util.zip.ZipFile.<init>(ZipFile.java:149) ~[na:1.8.0_121]
	at java.util.jar.JarFile.<init>(JarFile.java:166) ~[na:1.8.0_121]
	at java.util.jar.JarFile.<init>(JarFile.java:130) ~[na:1.8.0_121]
	at org.apache.tomcat.util.scan.JarFileUrlJar.<init>(JarFileUrlJar.java:60) ~[tomcat-embed-core-8.5.12.jar:8.5.12]
	at org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49) ~[tomcat-embed-core-8.5.12.jar:8.5.12]
	at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:338) ~[tomcat-embed-core-8.5.12.jar:8.5.12]
	at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:288) ~[tomcat-embed-core-8.5.12.jar:8.5.12]
	at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262) [tomcat-embed-jasper-8.5.12.jar:8.5.12]
	at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:104) [tomcat-embed-jasper-8.5.12.jar:8.5.12]
	at org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101) [tomcat-embed-jasper-8.5.12.jar:8.5.12]
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5205) [tomcat-embed-core-8.5.12.jar:8.5.12]
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [tomcat-embed-core-8.5.12.jar:8.5.12]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419) [tomcat-embed-core-8.5.12.jar:8.5.12]
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409) [tomcat-embed-core-8.5.12.jar:8.5.12]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
@zhanhb
Copy link
Author

zhanhb commented Mar 15, 2017

matthiasblaesing added a commit to matthiasblaesing/jna that referenced this issue Mar 15, 2017
The netbeans copylibs task copies the dependend libraries and modifies
the jar MANIFEST.MF to reference the copied libs.

The task is reimplemented in the build.xml to override the base definition
in build-impl.xml, as build-impl.xml comes from the netbeans project template,
future updates could destroy the change if it is not done in build.xml, which
is considered project depended.

Closes: java-native-access#776
matthiasblaesing added a commit to matthiasblaesing/jna that referenced this issue Mar 15, 2017
The netbeans copylibs task copies the dependend libraries and modifies
the jar MANIFEST.MF to reference the copied libs.

The task is reimplemented in the build.xml to override the base definition
in build-impl.xml, as build-impl.xml comes from the netbeans project template,
future updates could destroy the change if it is not done in build.xml, which
is considered project depended.

Closes: java-native-access#776
@matthiasblaesing
Copy link
Member

matthiasblaesing commented Mar 15, 2017

@zhanhb thank you for your finding. Could you please have a look at this changeset:

https://github.com/matthiasblaesing/jna/tree/remove_classpath

And the test build: jna.zip

Please check if that fixes the problem for you.

@zhanhb
Copy link
Author

zhanhb commented Mar 15, 2017

Yeah, it's ok now with these 2 jars

@matthiasblaesing
Copy link
Member

Thanks for checking. Will be part of next release.

@igreenfield
Copy link

igreenfield commented Jul 10, 2017

@matthiasblaesing When is this release planned?

@matthiasblaesing
Copy link
Member

@igreenfield I'm a bit occupied currently. As 4.5 will also contain changes to the MANIFEST required to be compatible with java 9, Java 9 GA will be my final dead line. If you need a nearer date, please speak up and give me some reasons.

@igreenfield
Copy link

igreenfield commented Jul 11, 2017 via email

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

No branches or pull requests

3 participants