Android Xerces解析器ExceptionInitializerError

时间:2012-03-09 12:25:13

标签: android parsing jar xerces

我正在使用Xerces解析器开发Android应用程序。我在项目中添加了Xerces解析器,并将其包含在构建路径中。

但是在尝试运行应用程序时仍然收到一条奇怪的错误消息:

03-09 12:15:41.479: E/AndroidRuntime(25087): FATAL EXCEPTION: main
03-09 12:15:41.479: E/AndroidRuntime(25087): java.lang.ExceptionInInitializerError
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.parsers.XML11Configuration.configurePipeline(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.parsers.XIncludeAwareParserConfiguration.configurePipeline(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.util.XMLSchemaValidator2.validate(XMLSchemaValidator2.java:30)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.validation.gpx.schemas.StrategyGPXSchema1_0.validate(StrategyGPXSchema1_0.java:12)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.validation.gpx.schemas.GPXSchemaValidatorGeneral.executeStrategy(GPXSchemaValidatorGeneral.java:13)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.validation.gpx.GPXValidator.isValidAgainstSchema(GPXValidator.java:87)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.validation.gpx.GPXValidator.validate(GPXValidator.java:29)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.validation.ValidatorGeneral.executeStrategy(ValidatorGeneral.java:15)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.MecheTrackParser.isValidMecheFile(MecheTrackParser.java:55)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.inputhandling.MecheTrackParser.parse(MecheTrackParser.java:30)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.statePattern.states.InitState.selectFile(InitState.java:33)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.Meche.main.MecheModel.selectFile(MecheModel.java:39)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.pe60t0.meche.MecheActivity$1.onClick(MecheActivity.java:98)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:899)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at android.widget.AdapterView.performItemClick(AdapterView.java:284)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at android.widget.ListView.performItemClick(ListView.java:3569)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:1831)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at android.os.Handler.handleCallback(Handler.java:587)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at android.os.Handler.dispatchMessage(Handler.java:92)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at android.os.Looper.loop(Looper.java:150)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at android.app.ActivityThread.main(ActivityThread.java:4385)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at java.lang.reflect.Method.invokeNative(Native Method)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at java.lang.reflect.Method.invoke(Method.java:507)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at dalvik.system.NativeStart.main(Native Method)
03-09 12:15:41.479: E/AndroidRuntime(25087): Caused by: java.lang.ExceptionInInitializerError
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.xs.XMLSchemaValidator.<clinit>(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    ... 30 more
03-09 12:15:41.479: E/AndroidRuntime(25087): Caused by: java.lang.ExceptionInInitializerError
03-09 12:15:41.479: E/AndroidRuntime(25087):    at java.lang.Class.newInstanceImpl(Native Method)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at java.lang.Class.newInstance(Class.java:1409)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.ObjectFactory.newInstance(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.xs.SchemaGrammar$BuiltinSchemaGrammar.<init>(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.xs.SchemaGrammar.<clinit>(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    ... 31 more
03-09 12:15:41.479: E/AndroidRuntime(25087): Caused by: java.lang.NoClassDefFoundError: org.apache.xerces.impl.xpath.regex.ParserForXMLSchema
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.xpath.regex.RegularExpression.setPattern(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.xpath.regex.RegularExpression.setPattern(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.xpath.regex.RegularExpression.<init>(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets1(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.xs.BaseSchemaDVFactory.createBuiltInTypes(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    at org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.<clinit>(Unknown Source)
03-09 12:15:41.479: E/AndroidRuntime(25087):    ... 38 more
03-09 12:15:41.499: W/ActivityManager(1377):   Force finishing activity com.pe60t0.meche/.MecheActivity

也许值得指出的是,解析的逻辑在另一个项目中,我也包含在Android项目的构建路径中。

如果有人可能有线索,我会非常感激。

0 个答案:

没有答案