History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: RIO-76
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Minor Minor
Assignee: Arjohn Kampman
Reporter: Peter Ansell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Rio

RdfParserRegistry prints error to logs when it doesn't find a built-in parser factory

Created: 20/Jun/11 08:31 AM   Updated: 24/Jun/11 01:22 PM
Component/s: Rio API
Affects Version/s: None
Fix Version/s: None

Environment: sesame-2.4.0


 Description   
I have only imported the rio packages that I require using Maven, however, there are errors printed for the missing packages, ie, Trig and Trix. These should be warnings or informational at most, as the package still operates properly without the missing parser factories.

See below for a stack trace.

ERROR (org.openrdf.rio.RDFParserRegistry:58) Failed to instantiate service
sun.misc.ServiceConfigurationError: org.openrdf.rio.RDFParserFactory: Provider org.openrdf.rio.trig.TriGParserFactory not found
at sun.misc.Service.fail(Service.java:129)
at sun.misc.Service.access$000(Service.java:111)
at sun.misc.Service$LazyIterator.next(Service.java:273)
at info.aduna.lang.service.ServiceRegistry.<init>(ServiceRegistry.java:42)
at info.aduna.lang.service.FileFormatServiceRegistry.<init>(FileFormatServiceRegistry.java:20)
at org.openrdf.rio.RDFParserRegistry.<init>(RDFParserRegistry.java:33)
at org.openrdf.rio.RDFParserRegistry.getInstance(RDFParserRegistry.java:26)
at org.openrdf.rio.Rio.createParser(Rio.java:167)
at org.openrdf.rio.Rio.createParser(Rio.java:188)
at org.openrdf.repository.base.RepositoryConnectionBase.addInputStreamOrReader(RepositoryConnectionBase.java:373)
at org.openrdf.repository.base.RepositoryConnectionBase.add(RepositoryConnectionBase.java:277)

I would prefer not to have to filter these messages, as I would like to see Sesame/Rio errors in my logs if they are legitimate.

 All   Comments   Change History      Sort Order:
Comment by Arjohn Kampman [21/Jun/11 11:28 AM]
These errors are printed because your classpath contains a file that specifies the availability of this parser. Please make sure that the file(s) called /META-INF/services/org.openrdf.rio.RDFParserFactory only specify the parsers that are available.

Comment by Peter Ansell [24/Jun/11 01:24 AM]
Thanks for that knowledge!

I went and looked at my imported files and found the file in the common-1.2.jar file that is published by https://github.com/joshsh/sesametools

I am using that package for its rdf-json parser and writer, and didn't realise that it was including other parser regitry entries that it doesn't provide. I have filed a bug with that project to remove the unnecessary files.

It is a very neat way of publishing this information by the way!