PureAquatica / jing-trang

Automatically exported from code.google.com/p/jing-trang
0 stars 0 forks source link

NullPointerException running trang 20131210 #177

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The changes introduced in revision 2354 
(http://code.google.com/p/jing-trang/source/detail?r=2354#) result in a 
NullPointerException when trang is run without specifying a catalogue URI via 
the "-C" argument.  This occurs because 'resolver' is set to null in main() and 
so the ResolverUriEntityManager object gets constructed with a null resolver.  
Therefore a NullPointerException is generated when 
ResolverUriEntityManager::open() attempts to call resolver.open().  The stack 
trace is as follows:

Exception in thread "main" java.lang.NullPointerException
    at com.thaiopensource.xml.em.ResolverUriEntityManager.open(ResolverUriEntityManager.java:56)
    at com.thaiopensource.xml.em.ResolverUriEntityManager.open(ResolverUriEntityManager.java:27)
    at com.thaiopensource.xml.dtd.parse.DtdParserImpl.parse(DtdParserImpl.java:14)
    at com.thaiopensource.relaxng.input.dtd.DtdInputFormat.load(DtdInputFormat.java:144)
    at com.thaiopensource.relaxng.translate.Driver.run(Driver.java:135)
    at com.thaiopensource.relaxng.translate.Driver.main(Driver.java:44)

The attached patch fixes this problem by instantiating a UriEntityManager 
instead of a ResolverUriEntityManager when no resolver is available.

Original issue reported on code.google.com by zztop...@gmail.com on 31 Jan 2014 at 1:18

Attachments:

GoogleCodeExporter commented 8 years ago
I can reproduce the bug, and confirm that the patch fixes it.

Original comment by julian.r...@googlemail.com on 9 Jan 2015 at 12:49

GoogleCodeExporter commented 8 years ago

Original comment by j...@jclark.com on 10 Jan 2015 at 1:59