Flutter报错:setState() called after dispose()

展开阅读全文
博主设置当前文章不允许评论。

javax.servlet.ServletException: response.getWriter() called after response.getOutputStream()

03-09

我要从数据库里取出一个图片,显示在页面rnservlet中的代码:rnServletOutputStream out = response.getOutputStream();rnbyte buf[] =。。。。//从数据库里取出大文本,调试过,可以正常取出rnout.write(buf);rnout.flush();rn页面代码:rn执行报错:rnjavax.servlet.ServletException: response.getWriter() called after response.getOutputStream()rn at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:214)rn at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)rn at net.sf.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:153)rn at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)rn at net.sf.acegisecurity.wrapper.ContextHolderAwareRequestFilter.doFilter(ContextHolderAwareRequestFilter.java:50)rn at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)rn at net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:225)rn at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)rn at net.sf.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)rn at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:125)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:166)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:146)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:594)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)rn at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)rn at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)rn at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)rn at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)rn at java.lang.Thread.run(Unknown Source)rnrn 论坛

运行时错误: terminate called after throwing an instance of 'std::out_of_range'

06-15

terminate called after throwing an instance of 'std::out_of_range'rn what(): vector::_M_range_checkrnrnProgram received signal SIGABRT, Aborted.rn0x00002ace363f5765 in raise () from /lib/libc.so.6rn(gdb) wherern#0 0x00002ace363f5765 in raise () from /lib/libc.so.6rn#1 0x00002ace363f71c0 in abort () from /lib/libc.so.6rn#2 0x00002ace35cf07b4 in __gnu_cxx::__verbose_terminate_handler () from /usr/lib/libstdc++.so.6rn#3 0x00002ace35cee746 in ?? () from /usr/lib/libstdc++.so.6rn#4 0x00002ace35cee773 in std::terminate () from /usr/lib/libstdc++.so.6rn#5 0x00002ace35cee85a in __cxa_throw () from /usr/lib/libstdc++.so.6rn#6 0x00002ace35c8a35a in std::__throw_out_of_range () from /usr/lib/libstdc++.so.6rn#7 0x000000000041b19c in std::vector >::_M_range_check (rn this=0x20063b10, __n=3) at /usr/include/c++/4.1.3/bits/stl_vector.h:503rn#8 0x000000000041b1bb in std::vector >::at (this=0x20063b10, rn __n=3) at /usr/include/c++/4.1.3/bits/stl_vector.h:521rn#9 0x0000000000404838 in find_spliced_mapping (reads=@0x7fff7509c850, reads_unmapped=@0x7fff7509c6d0, rn spliced_mapping=@0x7fff7509c7d0) at srmap_spliced.cpp:1020rn#10 0x0000000000408910 in main (argc=1, argv=0x7fff7509ca38) at srmap_spliced.cpp:1230rnrnrnfind_spliced_mapping() 内部错误。。。。rnrn struct seed_regionrnrn seed_region(const unsigned short a,const unsigned int b,const unsigned int c,const bool d,const bool e):rn chrom_id(a),start(b),end(c),seed_position(d),strand(e)rn rn unsigned short chrom_id;rn unsigned int start;rn unsigned int end; rn bool seed_position;rn bool strand;rn;rnrn struct read_infornrn read_info(const string n,const string s,const string r) :rn name(n),seq(s),rev_seq(r) rn string name;rn string seq;rn string rev_seq;rn;rnrnrn void find_spliced_mapping(vector &reads,hash_map > &reads_unmapped,vector &spliced_mapping)rnrn cout< >::iterator it = reads_unmapped.begin(); rn for(;it!=reads_unmapped.end();it++)rn rn int count=it->second.size(); rn int flag;rn sort(it->second.begin(),it->second.end(),less_strand);rn for(int i=0;isecond.at(i).strand==1)rn rn flag=i;rn break;rn rn rn for(int j=0;jsecond.at(j).seed_position!=it->second.at(h).seed_position)rn rn if(2second.at(j).end-it->second.at(h).end) && abs(it->second.at(j).end-it->second.at(h).end)<3000)rn rn if((it->second.at(j).end+it->second.at(h).end-it->second.at(j).start-it->second.at(h).start)>=35) rn rn out<<"read"<first<<": "<second.at(j).start<<" "<second.at(j).end<<" "<second.at(j).seed_position<<" "<second.at(j).strand<<" and "<second.at(h).start<<" "<second.at(h).end<<" "<second.at(h).seed_position<<" "<second.at(h).strand<second.at(j).seed_position!=it->second.at(h).seed_position)rn rn if(2second.at(j).end-it->second.at(h).end) && abs(it->second.at(j).end-it->second.at(h).end)<3000)rn rn if((it->second.at(j).end+it->second.at(h).end-it->second.at(j).start-it->second.at(h).start)>=35) rn rn out<<"read"<first<<": "<second.at(j).start<<" "<second.at(j).end<<" "<second.at(j).seed_position<<" "<second.at(j).strand<<" and "<second.at(h).start<<" "<second.at(h).end<<" "<second.at(h).seed_position<<" "<second.at(h).strand< 论坛

mediaRecorder 报错stop called in an invalid state:1

06-04

我在做android 开发,大概是做一个聊天软件。其中有个 语音聊天功能。操作和 微信 聊天界面差不多。rn大概是设置一个button,然后 按下(onTouch)的时候录音,松开 则保存及发送录音。rnrn今天我用mediaRecord写了这个功能。但奇怪的事情发生了。rn当我按下 按钮时,能正常录音,但当我松开按钮,调用 mediaRecorder. stop()时,却发生如下exceptionrn---stop called in an invalid state:1rnrn网上查了很久,墙内外都搜过。rn答案无外乎以下几种rnrn1.没有设置好权限,但实际上,我已经设置好了 读写sd card的permission 和 录音的 permissiom,应该不存在权限的问题。rnrn2.调用 stop()之前,MediaRecorder的状态不是 prepare ,或没有先调用 start()。但我是严格按照google文档所描述的程序进行录音的。之前已经调用了reset(). prepare(),然后调用start(),最后才调用 stop()。rnrn3.录音的时间太短。应该不存在这个可能性,因为我录了100多秒都还是有同样的报错。rnrn。。rn最奇怪的是,尽管系统报错,程序自动退出,但我查了一个sd card,实际上已经生成了我想要的录音文件。rn更奇怪的是,这个录音文件有时是有声音,而有时却是一个空的没声音的音频文档。。rnrn以下是我的代码,烦请协助研究一下问题出在何处。rnpublic class MainActivity extends ActionBarActivity rnpublic MediaRecorder mr;rn @Overridern protected void onCreate(Bundle savedInstanceState) rn super.onCreate(savedInstanceState);rn setContentView(R.layout.activity_main);rn Button btnRecord=(Button)findViewById(R.id.record);rn rn btnRecord.setOnTouchListener(new View.OnTouchListener() rn @Overridern public boolean onTouch(View v, MotionEvent mv) rn rn if(mr==null)mr=new MediaRecorder();Log.i("EE","build new med obj");rn //must new a MediaRecorder object .or it would occur a NullPointrn mr.reset();rn if(mv.getAction()==MotionEvent.ACTION_DOWN)rn tryrn mr=new MediaRecorder();rn mr.setAudioSource(MediaRecorder.AudioSource.MIC);rn mr.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);rn mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);rn mr.setMaxDuration(10000);rn mr.setOutputFile(Environment.getExternalStorageDirectory().getPath()+File.separator+"fisii77s.3gp");rn mr.prepare();rn mr.start();rn Log.i("Record","Record Start");rn rn rn //recordStart();rn return false;rn catch(Exception e)Log.e("Record","RRE"+e.toString());return true;rn rn rn if(mv.getAction()==MotionEvent.ACTION_UP)rn if(mr!=null)rn Log.i("111","1112");rn mr.stop();rn mr.release();rn return true;rn rn elseLog.i("NUll","mr is null");rn rn ;rn rn rn return false;rn rn rn );rn rn rn rnrn rnrn-------下面是manifest.xmlrnrnrnrnrn rnrn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rnrn 论坛

没有更多推荐了,返回首页