19得票5回答
何时抛出IllegalStateException和IllegalArgumentException?

让我们从Javadocs开始: IllegalStateException(非法状态异常) 表示在不合适或不恰当的时间调用了方法。换句话说,Java环境或Java应用程序对所请求的操作不处于适当状态。 IllegalArgumentException(非法参数异常) 表示已向方法...

20得票5回答
非法状态异常:片段<ThisFragment>当前未在片段管理器中

我在追踪我的应用程序崩溃原因时遇到困难。我有一个显示 ListView 的片段,还有一个 SlidingMenu 用于搜索字段。当我进行搜索时,ListView 项目将根据搜索结果重新填充。现在,当我尝试从新填充的结果中打开 ListView 项时,我的应用程序会崩溃。 异常是在这里触发的:...

12得票3回答
Grails错误:未找到线程绑定请求:您是否正在引用请求属性...安装Spring Security Core后。

我刚刚创建了一个新的grails-app, 一切都很顺利,直到我决定 安装Spring Security Core。 安装完Spring Security Core后, 运行s2-quickstart并执行grails run-app时, 出现了以下错误:URI /test1/ Clas...

47得票5回答
添加<h:form>导致java.lang.IllegalStateException: Cannot create a session after the response has been committed。

在一个非常简单的JSF 2页面中添加&lt;h:form&gt;后,我遇到了以下异常:java.lang.IllegalStateException: Cannot create a session after the response has been committed at or...

15得票1回答
MongoDB: java.lang.IllegalStateException: 状态应该为:打开

我有一个应用程序,从一个数据源中提取数据并将其插入到MongoDB。有时候提取过程需要很长时间,当应用程序尝试将一行数据推送到MongoDB时,可能会引发以下异常,可能是由于超时问题导致:com.mongodb.MongoSocketReadException: Prematurely rea...

7得票3回答
java.lang.IllegalStateException: 在非UI线程中调用View方法

尝试在我的Nexus 4上使用Android 4.4(Kit kat)打开Webview时,我会收到以下错误消息: Calling View methods on another thread than the UI thread.; java.lang.IllegalStateExcep...

35得票10回答
java.lang.IllegalStateException: 在 DialogFragment 的 onSaveInstanceState 后无法执行此操作

我在使用DialogFragment / getSupportFragmentManager / Android版本4.x时遇到了问题。01-10 19:46:48.228: E/AndroidRuntime(9879): java.lang.IllegalStateException: Ca...

35得票12回答
非法状态异常: <MyFragment> 当前未在 FragmentManager 中

我知道这听起来像是FragmentStatePagerAdapter IllegalStateException: &lt;MyFragment&gt; is not currently in the FragmentManager的重复,但他提供的解决方案对我的情况不适用。 我偶尔会遇到以...

10得票3回答
如何在Firestore中计算集合下文档的数量?

我正在尝试获取在Cloud Firestore上存在的CollectionReference计数,我已经尝试使用以下方法来获取:FirebaseFirestore db = FirebaseFirestore.getInstance(); final CollectionReferen...

17得票1回答
Android在结束Activity时出现了IllegalStateException异常。

我得到了这个异常&quot;java.lang.IllegalStateException: Can not be called to deliver a result&quot; 一开始我也不明白为什么会这样。以下是我的回答,希望能对某些人有所帮助。