[ https://issues.apache.org/jira/browse/LUCENE-1666?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Uwe Schindler updated LUCENE-1666: ---------------------------------- Attachment: LUCENE-1666.patch Mike, you were a little bit too fast :-) I worked out a better solution (the problem also ocurred on tests, when no manifest file was available, because it is only in the JAR file, not in the classpath during tests). The attached patch does not use such "hacks" like opening the manifest directly. It just uses LucenePackage to get the implementation information. If it is NULL (because no manifest), it uses the same algorithm for resolving like you proposed. > Constants causing NullPointerException when fetching metadata "Implementation > Version" in MANIFEST > -------------------------------------------------------------------------------------------------- > > Key: LUCENE-1666 > URL: https://issues.apache.org/jira/browse/LUCENE-1666 > Project: Lucene - Java > Issue Type: Bug > Components: Other > Environment: os=Linux, os.version=2.6.28-11-generic, source=flush, > lucene.version=2.9-dev, os.arch=i386, java.version=1.6.0_13, java.vendor=Sun > Microsystems Inc. > Reporter: Renaud Delbru > Assignee: Michael McCandless > Fix For: 2.9 > > Attachments: LUCENE-1666.patch, LUCENE-1666.patch > > > If the MANIFEST.MF file does not contain the metadata IMPLEMENTATION_VERSION, > a null value is returned, causing NullPointerException during commit: > Exception in thread "main" java.lang.NullPointerException > at org.apache.lucene.store.IndexOutput.writeString(IndexOutput.java:109) > at > org.apache.lucene.store.IndexOutput.writeStringStringMap(IndexOutput.java:229) > at org.apache.lucene.index.SegmentInfo.write(SegmentInfo.java:558) > at org.apache.lucene.index.SegmentInfos.write(SegmentInfos.java:337) > at > org.apache.lucene.index.SegmentInfos.prepareCommit(SegmentInfos.java:808) > at > org.apache.lucene.index.IndexWriter.startCommit(IndexWriter.java:5319) > at > org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:3895) > at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3956) > This happened after having build a jar assembly using Maven, the original > MANIFEST.MF of lucene jar has been overwritten, and didn't contain anynore > the implementation version metadata. > Path attached. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org