我有一个解析大型 xml 文件并将数据存储在 sqlite 数据库中的 Android 服务。这种架构运行没有太多问题,但最近在几款不同型号的摩托罗拉手机上出现了问题。
这是错误:
12-05 08:41:23.708: I/SqliteDatabaseCpp(19152): sqlite returned: error code = 14, msg = cannot open file at line 27360 of [8609a15dfa], db=/data/data/com.dsndata.sds2mobile.status.activities/databases/jobs.db
12-05 08:41:23.708: I/SqliteDatabaseCpp(19152): sqlite returned: error code = 14, msg = os_unix.c: open() at line 27360 - "" errno=24 path=/data/data/com.dsndata.sds2mobile.status.activities/databases, db=/data/data/com.dsndata.sds2mobile.status.activities/databases/jobs.db
12-05 08:41:23.708: I/SqliteDatabaseCpp(19152): sqlite returned: error code = 14, msg = statement aborts at 28: [INSERT INTO JOBNAMETechnip_All_x_x_x_x_units_submaterial(Main,Description,Grade,Weight,Piecemark,Length,Finish,MaterialType,MemberGuid,ManufacturingGUID) VALUES (?,?,?,?,?,?,?,?,?,?)] , db=/data/data/com.dsndata.sds2mobile.status.activities/databases/jobs.db
12-05 08:41:23.802: E/SQLiteDatabase(19152): Error inserting Main=0 Description=FB11GAx1 Grade=310SS Weight=0.481653435459 Piecemark=FB63 Length=14.3125 Finish=None MaterialType=Flat bar MemberGuid=1f3e95c0-7289-4132-9218-296fcfcbcaad ManufacturingGUID=55d0399a-782d-476d-8619-5612c466905c
12-05 08:41:23.802: E/SQLiteDatabase(19152): android.database.sqlite.SQLiteCantOpenDatabaseException: error code 14: unable to open database file
12-05 08:41:23.802: E/SQLiteDatabase(19152): at android.database.sqlite.SQLiteStatement.native_executeInsert(Native Method)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:113)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1827)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1700)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at com.dsndata.sds2mobile.provider.JobProvider.insert(JobProvider.java:164)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at android.content.ContentProvider$Transport.insert(ContentProvider.java:189)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at android.content.ContentResolver.insert(ContentResolver.java:730)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at com.dsndata.sds2mobile.xml.MobileParser.endElement(MobileParser.java:494)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.xml.sax.helpers.XMLReaderAdapter.endElement(XMLReaderAdapter.java:353)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:156)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.apache.harmony.xml.ExpatParser.appendChars(Native Method)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:497)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:484)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:309)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:267)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at javax.xml.parsers.SAXParser.parse(SAXParser.java:359)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at com.dsndata.sds2mobile.xml.MobileParser.parse(MobileParser.java:172)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at com.dsndata.sds2mobile.xml.MobileParser.parse(MobileParser.java:144)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at com.dsndata.sds2mobile.services.ImportService$ServiceWorker.run(ImportService.java:58)
12-05 08:41:23.802: E/SQLiteDatabase(19152): at java.lang.Thread.run(Thread.java:856)
12-05 08:41:23.802: W/System.err(19152): android.database.SQLException: Failed to insert row into content://com.dsndata.sds2mobile.jobprovider/JOBNAMETechnip_All_x_x_x_x_units/submaterial/55d0399a-782d-476d-8619-5612c466905c
12-05 08:41:23.802: W/System.err(19152): at com.dsndata.sds2mobile.provider.JobProvider.insert(JobProvider.java:187)
12-05 08:41:23.802: W/System.err(19152): at android.content.ContentProvider$Transport.insert(ContentProvider.java:189)
12-05 08:41:23.809: W/System.err(19152): at android.content.ContentResolver.insert(ContentResolver.java:730)
12-05 08:41:23.809: W/System.err(19152): at com.dsndata.sds2mobile.xml.MobileParser.endElement(MobileParser.java:494)
12-05 08:41:23.809: W/System.err(19152): at org.xml.sax.helpers.XMLReaderAdapter.endElement(XMLReaderAdapter.java:353)
12-05 08:41:23.809: W/System.err(19152): at org.apache.harmony.xml.ExpatParser.endElement(ExpatParser.java:156)
12-05 08:41:23.809: W/System.err(19152): at org.apache.harmony.xml.ExpatParser.appendChars(Native Method)
12-05 08:41:23.809: W/System.err(19152): at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:497)
12-05 08:41:23.809: W/System.err(19152): at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:484)
12-05 08:41:23.809: W/System.err(19152): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:309)
12-05 08:41:23.809: W/System.err(19152): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:267)
12-05 08:41:23.809: W/System.err(19152): at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
12-05 08:41:23.809: W/System.err(19152): at javax.xml.parsers.SAXParser.parse(SAXParser.java:359)
12-05 08:41:23.809: W/System.err(19152): at com.dsndata.sds2mobile.xml.MobileParser.parse(MobileParser.java:172)
12-05 08:41:23.809: W/System.err(19152): at com.dsndata.sds2mobile.xml.MobileParser.parse(MobileParser.java:144)
12-05 08:41:23.809: W/System.err(19152): at com.dsndata.sds2mobile.services.ImportService$ServiceWorker.run(ImportService.java:58)
12-05 08:41:23.817: W/System.err(19152): at java.lang.Thread.run(Thread.java:856)
最奇怪的部分是 xml 解析和存储工作到一定程度,然后失败并出现错误 14。
此外,此消息有许多日志:
2-05 08:39:15.700: D/ActivityThread(19152): Loading provider com.dsndata.sds2mobile.jobprovider: com.dsndata.sds2mobile.provider.JobProvider
这不会出现在其他品牌的设备上。
我问了谷歌,没有发现任何有用的东西。有没有其他人有这个问题?或者至少有类似的东西可以为我指明正确的方向?