From: Raghava M. <m.v...@gm...> - 2013-06-28 11:31:01
|
Thank you for looking into it :). Regards, Raghava. On Fri, Jun 28, 2013 at 12:28 PM, Ignazio Palmisano < ipa...@gm...> wrote: > > On 28 Jun 2013 10:07, "Raghava Mutharaju" <m.v...@gm...> > wrote: > > > > Yes, it is strange. Following is the output of java -version on my > machine. > > > > Java(TM) SE Runtime Environment (build > pxa6460sr13ifix-20130303_02(SR13+IV37419)) > > IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux amd64-64 > jvmxa6460sr13-20130114_134867 (JIT enabled, AOT enabled) > > J9VM - 20130114_134867 > > JIT - r9_20130108_31100 > > GC - 20121212_AA) > > JCL - 20130303_02 > > > > Regards, > > Raghava. > > > > I'll try to reproduce, although I foresee this being hard :-) > I. > > > > > On Thu, Jun 27, 2013 at 11:25 PM, Ignazio Palmisano < > ipa...@gm...> wrote: > >> > >> On 27 June 2013 10:52, Raghava Mutharaju <m.v...@gm...> > wrote: > >> > I tried with version 3.4.4. I ran into the same issue after 1001. For > now, I > >> > am merging couple of owl files and then I will try again with lesser > number > >> > of files. > >> > > >> > >> I'm having troubles replicating this - I just tried with two thousand > >> files and parsing went well. Input streams are closed correctly after > >> parsing is complete, in a finally block. The null pointer exception is > >> thrown inside a simple setter method in XMLInputSource: > >> > >> public void setSystemId(String paramString) { > >> this.fSystemId = paramString; > >> } > >> > >> So there is no obvious reason why it should be thrown there. > >> > >> I'm running this on Oracle Java 7 - what's the VM you're using? > >> Cheers, > >> I. > >> > >> > Regards, > >> > Raghava. > >> > > >> > > >> > On Thu, Jun 27, 2013 at 10:42 AM, Ignazio Palmisano > >> > <ipa...@gm...> wrote: > >> >> > >> >> > >> >> On 27 Jun 2013 10:02, "Raghava Mutharaju" <m.v...@gm... > > > >> >> wrote: > >> >> > > >> >> > Hello Ignazio, > >> >> > > >> >> > At this point only this piece of code is running in my > application. I > >> >> > used a new manager for each iteration but the result is the same, > it gives a > >> >> > NullPointerException after processing 1001 files. loadOntology() > and > >> >> > saveOntology() should do the opening and closing of files. Can you > please > >> >> > check and let me know? Also, I am not using the latest version of > OWL API. > >> >> > Would it help in switching to the current release? > >> >> > > >> >> > Regards, > >> >> > Raghava. > >> >> > > >> >> > >> >> It's worth trying while I debug the issue. The latest release should > >> >> create one less file per save operation, so it's likely to work > until 2001 > >> >> files :-) > >> >> I. > >> >> > >> >> > > >> >> > On Thu, Jun 27, 2013 at 9:19 AM, Ignazio Palmisano > >> >> > <ipa...@gm...> wrote: > >> >> >> > >> >> >> > >> >> >> On 26 Jun 2013 20:57, "Raghava Mutharaju" < > m.v...@gm...> > >> >> >> wrote: > >> >> >> > > >> >> >> > Yes, thats why I had a hard time in figuring out the cause of > this > >> >> >> > exception. I haven't opened any files. > >> >> >> > >> >> >> I didn't mean explicitly in your code, I meant overall in your > >> >> >> application. There must be at least two streams opened, one for > reading and > >> >> >> one for writing. As you don't pass streams explicitly to the > manager, it > >> >> >> should take care to close any streams it opens - this might have > been > >> >> >> neglected. I'll check. > >> >> >> I. > >> >> >> > >> >> >> > There might be some in saveOntology(), but I guess closing the > files > >> >> >> > would have been appropriately handled there. I will try out > with a new > >> >> >> > manager in each iteration. > >> >> >> > > >> >> >> > Thank you. > >> >> >> > > >> >> >> > Regards, > >> >> >> > Raghava. > >> >> >> > > >> >> >> > > >> >> >> > On Wed, Jun 26, 2013 at 6:06 PM, Ignazio Palmisano > >> >> >> > <ipa...@gm...> wrote: > >> >> >> >> > >> >> >> >> On 26 June 2013 17:52, Raghava Mutharaju < > m.v...@gm...> > >> >> >> >> wrote: > >> >> >> >> > Hello all, > >> >> >> >> > > >> >> >> >> > I have the following code using which, in each iteration, I > load > >> >> >> >> > one > >> >> >> >> > ontology, work on it and save it. > >> >> >> >> > > >> >> >> >> > for(File owlFile : allFiles) { > >> >> >> >> > IRI documentIRI = IRI.create(owlFile); > >> >> >> >> > System.out.println("Working on file: " + > >> >> >> >> > owlFile.getName()); > >> >> >> >> > OWLOntology ontology = > manager.loadOntology(documentIRI); > >> >> >> >> > Normalizer normalizer = new Normalizer(manager, > ontology); > >> >> >> >> > OWLOntology normalizedOntology = normalizer.Normalize(); > >> >> >> >> > OWLXMLOntologyFormat owlxmlFormat = new > >> >> >> >> > OWLXMLOntologyFormat(); > >> >> >> >> > File file = new File(args[1] + File.separator + > >> >> >> >> > "Norm-" + owlFile.getName()); > >> >> >> >> > if(file.exists()) > >> >> >> >> > file.delete(); > >> >> >> >> > manager.saveOntology(normalizedOntology, > >> >> >> >> > owlxmlFormat, IRI.create(file)); > >> >> >> >> > manager.removeOntology(ontology); > >> >> >> >> > } > >> >> >> >> > > >> >> >> >> > After processing 1001 ontologies in this way, it gives out a > >> >> >> >> > NullPointerException at the line where ontology is loaded > using > >> >> >> >> > loadOntology(). If I try it separately, just on that ontology > >> >> >> >> > file, I don't > >> >> >> >> > get a NullPointerException. The owl file seems to be fine. In > >> >> >> >> > fact, it > >> >> >> >> > doesn't seem to be a problem with that particular owl file. > If I > >> >> >> >> > remove that > >> >> >> >> > owl file from the list, even then I get the same exception > after > >> >> >> >> > processing > >> >> >> >> > 1001 files. > >> >> >> >> > > >> >> >> >> > Any help is highly appreciated. > >> >> >> >> > > >> >> >> >> > Here is the exception > >> >> >> >> > > >> >> >> >> > >> >> >> >> The null pointer itself is deep inside Xerces, so hard to make > sense > >> >> >> >> of it. Since it happens after one thousand iterations, I > wonder if > >> >> >> >> you > >> >> >> >> might have too many open files and therefore running out of > file > >> >> >> >> handlers. I'd also try creating a new manager for each ontology > >> >> >> >> instead of reusing the same manager. > >> >> >> >> HTH, > >> >> >> >> I. > >> >> >> >> > >> >> >> >> > >> >> >> >> > Exception in thread "main" java.lang.NullPointerException > >> >> >> >> > at > >> >> >> >> > > org.apache.xerces.xni.parser.XMLInputSource.setSystemId(Unknown > >> >> >> >> > Source) > >> >> >> >> > at > >> >> >> >> > java.io.FilterInputStream.read(FilterInputStream.java:101) > >> >> >> >> > at > >> >> >> >> > org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown > Source) > >> >> >> >> > at > >> >> >> >> > > org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown > >> >> >> >> > Source) > >> >> >> >> > at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown > >> >> >> >> > Source) > >> >> >> >> > at > >> >> >> >> > > >> >> >> >> > > org.semanticweb.owlapi.rdf.syntax.RDFParser.parse(RDFParser.java:173) > >> >> >> >> > at > >> >> >> >> > > >> >> >> >> > > org.coode.owlapi.rdfxml.parser.RDFXMLParser.parse(RDFXMLParser.java:120) > >> >> >> >> > at > >> >> >> >> > > >> >> >> >> > > uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory.loadOWLOntology(ParsableOWLOntologyFactory.java:204) > >> >> >> >> > at > >> >> >> >> > > >> >> >> >> > > uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:726) > >> >> >> >> > at > >> >> >> >> > > >> >> >> >> > > uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:667) > >> >> >> >> > at > >> >> >> >> > > >> >> >> >> > > uk.ac.manchester.cs.owl.owlapi.OWLOntologyManagerImpl.loadOntology(OWLOntologyManagerImpl.java:641) > >> >> >> >> > > >> >> >> >> > Thank you. > >> >> >> >> > > >> >> >> >> > Regards, > >> >> >> >> > Raghava. > >> >> >> >> > > >> >> >> >> > > >> >> >> >> > > ------------------------------------------------------------------------------ > >> >> >> >> > This SF.net email is sponsored by Windows: > >> >> >> >> > > >> >> >> >> > Build for Windows Store. > >> >> >> >> > > >> >> >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> >> >> > _______________________________________________ > >> >> >> >> > Owlapi-developer mailing list > >> >> >> >> > Owl...@li... > >> >> >> >> > > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> >> >> >> > > >> >> >> >> > >> >> >> >> > >> >> >> >> > ------------------------------------------------------------------------------ > >> >> >> >> This SF.net email is sponsored by Windows: > >> >> >> >> > >> >> >> >> Build for Windows Store. > >> >> >> >> > >> >> >> >> http://p.sf.net/sfu/windows-dev2dev > >> >> >> >> _______________________________________________ > >> >> >> >> Owlapi-developer mailing list > >> >> >> >> Owl...@li... > >> >> >> >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > ------------------------------------------------------------------------------ > >> >> >> > This SF.net email is sponsored by Windows: > >> >> >> > > >> >> >> > Build for Windows Store. > >> >> >> > > >> >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> >> > _______________________________________________ > >> >> >> > Owlapi-developer mailing list > >> >> >> > Owl...@li... > >> >> >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> >> >> > > >> >> >> > >> >> >> > >> >> >> > >> >> >> > ------------------------------------------------------------------------------ > >> >> >> This SF.net email is sponsored by Windows: > >> >> >> > >> >> >> Build for Windows Store. > >> >> >> > >> >> >> http://p.sf.net/sfu/windows-dev2dev > >> >> >> _______________________________________________ > >> >> >> Owlapi-developer mailing list > >> >> >> Owl...@li... > >> >> >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> >> >> > >> >> > > >> >> > > >> >> > > >> >> > > ------------------------------------------------------------------------------ > >> >> > This SF.net email is sponsored by Windows: > >> >> > > >> >> > Build for Windows Store. > >> >> > > >> >> > http://p.sf.net/sfu/windows-dev2dev > >> >> > _______________________________________________ > >> >> > Owlapi-developer mailing list > >> >> > Owl...@li... > >> >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> >> > > >> >> > >> >> > >> >> > >> >> > ------------------------------------------------------------------------------ > >> >> This SF.net email is sponsored by Windows: > >> >> > >> >> Build for Windows Store. > >> >> > >> >> http://p.sf.net/sfu/windows-dev2dev > >> >> _______________________________________________ > >> >> Owlapi-developer mailing list > >> >> Owl...@li... > >> >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> >> > >> > > >> > > >> > > ------------------------------------------------------------------------------ > >> > This SF.net email is sponsored by Windows: > >> > > >> > Build for Windows Store. > >> > > >> > http://p.sf.net/sfu/windows-dev2dev > >> > _______________________________________________ > >> > Owlapi-developer mailing list > >> > Owl...@li... > >> > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > >> > > >> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by Windows: > >> > >> Build for Windows Store. > >> > >> http://p.sf.net/sfu/windows-dev2dev > >> _______________________________________________ > >> Owlapi-developer mailing list > >> Owl...@li... > >> https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > > > > > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by Windows: > > > > Build for Windows Store. > > > > http://p.sf.net/sfu/windows-dev2dev > > _______________________________________________ > > Owlapi-developer mailing list > > Owl...@li... > > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Owlapi-developer mailing list > Owl...@li... > https://lists.sourceforge.net/lists/listinfo/owlapi-developer > > |