cannot open file at line 30176 of [00bb9c9ce4]
(14) os_unix.c:30176: (24) open(/data/data/c/databases/pos-db-journal) -
(14) cannot open file at line 30176 of [00bb9c9ce4]
(14) os_unix.c:30176: (24) open(/data/data/c/pos-db-journal) -
(14) statement aborts at 14: [SELECT T."_id",T."PRINTDATA",T."POSITION",T."DOUBLEFORMAT",
T."PRINTERMODE",T."INSERTTIME" FROM "PRINT_DATA_ITEM" T] unable to open database file
E/SQLiteQuery: exception: unable to open database file (code 14); query: SELECT T."_id",T.
"PRINTDATA",T."POSITION",T."DOUBLEFORMAT",T."PRINTERMODE",T."INSERTTIME" FROM "PRINT_DATA_ITEM" T
private PrinterTask(Context context) {
this.mContext = context;
helper = new DaoMaster.DevOpenHelper(context, "pos-db", null);
db = helper.getWritableDatabase();
mDaoMaster = new DaoMaster(db);
mDaoSession = mDaoMaster.newSession();
mPrintDataItemDao = mDaoSession.getPrintDataItemDao();
mRequestDataItemDao = mDaoSession.getRequestDataItemDao();
}
//
public void startPrintThread() {
dataIsExist = true;
//
if (!threadIsRuning) {
thread = new Thread() {
@Override
public void run() {
super.run();
threadIsRuning = true;
List<PrintDataItem> list;
while (dataIsExist) {
list = mPrintDataItemDao.loadAll();
if (list != null && list.size() > 0) {
KLog.d("startPrintThread", String.valueOf(++count) + " " + String.valueOf(list.size()));
}
threadIsRuning = false;
}
};
thread.start();
}
当计数增加到大约 600000 时,app 将无任何征兆地存在。然后 logcat 输出这些信息。
(1)Could not create epoll instance. errno=24
(2)CursorWindow(26673): Could not allocate CursorWindow of size 2097152 due to error -24
(3)F/Looper (26673): Could not create wake pipe. errno=24
I/qtaguid (20825): Failed write_ctrl(s 0 10051) res=-1 errno=1
FATAL EXCEPTION: Thread-118`enter code here`
我该怎么做才能解决这个问题?我会感激的!
最佳答案
这些代码没问题。我发现其他代码加载这些异常。 我使用 intentservice 和 AlarmManager 进行循环服务。 我放弃了 AlarmManager。然后像这样更改代码: 有用。异常不再出现。
new Thread(new Runnable() {
@Override
public void run() {
mRequestDataItem = DBHelper.getInstance(getApplicationContext()).getTopFailedNetRequestInDataBase();
while (isRunning) {
CommonUtilLog.d("reRequestTask Loop", String.valueOf(countLoop++));
if (!isPosting) {
if (reRequestTask == null) {
if (mRequestDataItem != null) {
CommonUtilLog.d("reRequestTask", String.valueOf(count++));
reRequestTask = new ReRequestTask(mRequestDataItem);
}
}
}
try {
Thread.sleep(CommonConstant.THREAD_SLEEP_RETRY_REQUEST_SERVICE);
} catch (InterruptedException e) {
e.printStackTrace();
}
mRequestDataItem = DBHelper.getInstance(getApplicationContext()).getTopFailedNetRequestInDataBase();
}
}
}).start();
发现问题的方法: 来自这篇博客的博主:http://ju.outofmemory.cn/entry/247095 “差错”,逐步注解代码,找出出错的真凶。
关于android - 由于错误 -24,无法分配大小为 2097152 的 CursorWindow '/pos-db',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36300821/
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t
在railstutorial中,作者为什么选择使用这个(代码list10.25):http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-usersnamespace:dbdodesc"Filldatabasewithsampledata"task:populate=>:environmentdoRake::Task['db:reset'].invokeUser.create!(:name=>"ExampleUser",:email=>"example@railstutorial.org",:passwo
我对最新版本的Rails有疑问。我创建了一个新应用程序(railsnewMyProject),但我没有脚本/生成,只有脚本/rails,当我输入ruby./script/railsgeneratepluginmy_plugin"Couldnotfindgeneratorplugin.".你知道如何生成插件模板吗?没有这个命令可以创建插件吗?PS:我正在使用Rails3.2.1和ruby1.8.7[universal-darwin11.0] 最佳答案 随着Rails3.2.0的发布,插件生成器已经被移除。查看变更日志here.现在
我在我的项目中添加了一个系统来重置用户密码并通过电子邮件将密码发送给他,以防他忘记密码。昨天它运行良好(当我实现它时)。当我今天尝试启动服务器时,出现以下错误。=>BootingWEBrick=>Rails3.2.1applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Callwith-dtodetach=>Ctrl-CtoshutdownserverExiting/Users/vinayshenoy/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.2.1/lib/action_mailer
我尝试运行2.x应用程序。我使用rvm并为此应用程序设置其他版本的ruby:$rvmuseree-1.8.7-head我尝试运行服务器,然后出现很多错误:$script/serverNOTE:Gem.source_indexisdeprecated,useSpecification.Itwillberemovedonorafter2011-11-01.Gem.source_indexcalledfrom/Users/serg/rails_projects_terminal/work_proj/spohelp/config/../vendor/rails/railties/lib/r
在MRIRuby中我可以这样做:deftransferinternal_server=self.init_serverpid=forkdointernal_server.runend#Maketheserverprocessrunindependently.Process.detach(pid)internal_client=self.init_client#Dootherstuffwithconnectingtointernal_server...internal_client.post('somedata')ensure#KillserverProcess.kill('KILL',
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我已经从我的命令行中获得了一切,所以我可以运行rubymyfile并且它可以正常工作。但是当我尝试从sublime中运行它时,我得到了undefinedmethod`require_relative'formain:Object有人知道我的sublime设置中缺少什么吗?我正在使用OSX并安装了rvm。 最佳答案 或者,您可以只使用“require”,它应该可以正常工作。我认为“require_relative”仅适用于ruby1.9+ 关于ruby-主要:Objectwhenrun