Comments (4)
I can be a bit more precise on the error: it appears I am missing a dependency:
PatentPublicData patrick$ java -cp BulkDownloader/target/BulkDownloader-0.0.1-SNAPSHOT.jar gov.uspto.bulkdata.cli2.BulkData -cp BulkDownloader/target/dependency-jars/
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: joptsimple/OptionParser
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: joptsimple.OptionParser
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
from patentpublicdata.
The error you received "NoClassDefFoundError" states that java can not find the class file, might be other classes it can not find but java will complain on the first class it can not initiate. The usual cause is the jar holding the class file is not in your classpath. This particular class is located within jar file dependency-jars/jopt-simple . Check that the jar file exists. If it does your classpath is not setup correctly. Since I chose not to package the third party jars into the main jar, the classpath must include the third party dependency jars on the classpath as well as the application jar.
Classspath should contain both:
target*
target\dependency-jars*
Windows classpath, note semicolon as separator:
BulkDownloader\target*;BulkDownloader\target\dependency-jars*
Linux classpath, colon as separator:
BulkDownloader/target/:BulkDownloader/target/dependency-jars/
Correct Classpath in Use:
java -cp BulkDownloader/target/:BulkDownloader/target/dependency-jars/ gov.uspto.bulkdata.cli2.BulkData --type application --years="2016" --limit=1 --outdir="download"
Example scripts can be located here.
https://github.com/USPTO/PatentPublicData/tree/master/resources/scripts
Also as a suggestion, might be easiest to package as a zip file using"mvn clean package", the generated zip file PatentPublicData/target/PatentPublicData-0.0.1.SNAPSHOT.zip will contain the typical directory structure and setup for an application.
Hope this helps, if you are still having issues feel free to contact me again.
Brian
from patentpublicdata.
Updated comment the star symbol was not showing up
from patentpublicdata.
Brian,
Thank you for the rapid response!
OK, I got it working. I knew I was in classpath hell, the very reason I use Java infrequently enough to never remember how to resolve it. I didn't realize I needed both directories in the CP.
For my Mac I had to do a couple of minor changes to your download.sh script (lib->target; Project path was up two, down one; the parameters were for .cli not .cli2), but those were easy to investigate. If it is useful, I can send the resulting file.
But the core insight was how to get the two directories in the CP.
Thanks again. (You can resolve this.)
from patentpublicdata.
Related Issues (20)
- `mvn clean package` fails with `unmappable character` errors HOT 5
- transformer tool java.lang.IllegalArgumentException
- transformer tool java.lang.IllegalArgumentException
- Fails to read APS format
- Re issue patent gets classified as UNDEFINED
- Fails on documents with particularly long headers
- Is continuity information in the normalized Patent Object Model? HOT 2
- Error parsePatentGreenbook(gov.uspto.document.parser.dom4j.PatentParserTest) HOT 3
- Download Single document from USPTO HOT 2
- grants-bibliographic 2001-2004 transforms failing with java.io.IOException: Stream closed. HOT 2
- CVE-2020-10683 introduced by dom4j version 2.1.1
- Bulk converter crashes on ipg210921.zip
- Bulk data server stopped accepting byte ranges HOT 1
- Bulk transformer crashes on the ipa230126.zip file
- Could not resolve dependencies HOT 1
- Exception in thread "main" java.lang.NullPointerException HOT 1
- Transformer Unknown output type: xml HOT 1
- null pointer exception when transforming pftaps file to a bulk of jsons HOT 4
- Read Me missing a Getting Started section HOT 1
- transformer tool java.lang.StringIndexOutOfBoundsException
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patentpublicdata.