Android Volley ServerError(Android Volley ServerError)
我将所有字符串的数据发布到服务器中的varchar变量,但我得到凌乱的服务器错误或badnetwork性能错误417。
我正在使用以下功能来调用服务器,如果出现错误,请帮我解决。
public void signUpWS() { avi.show(); StringRequest strReq = new StringRequest(StringRequest.Method.POST, Constants.SIGN_UP, new Response.Listener<String>() { @Override public void onResponse(String response) { Snackbar.make(mainlayout, response.toString(), Snackbar.LENGTH_LONG).show(); Log.e("Responce from server", response.toString()); avi.hide(); if (!response.toString().contains("User")) { spEdit.putString(getString(R.string.uaccount), response.toString()); spEdit.commit(); Intent intent = new Intent(SignUp.this, Products.class); intent.putExtra(getString(R.string.uemail), Email_Address); intent.putExtra(getString(R.string.uphone), Phone_Number); intent.putExtra(getString(R.string.upass), Password); startActivity(intent); finish(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { avi.hide(); Log.e("Volley Error", error.toString()); if (error.toString().contains("NoConnectionError")) { Snackbar.make(mainlayout, "Internet Not Available!", Snackbar.LENGTH_LONG).show(); } else { Snackbar.make(mainlayout, "Webservice not responding!", Snackbar.LENGTH_LONG).show(); } } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> headers = new HashMap<>(); headers.put("Content-Type", "application/json; charset=utf-8"); return headers; } @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> data = new HashMap<String, String>(); String name[] = Name.split(" "); String first = "", last = ""; boolean firstb = true; for (int i = 0; i < name.length; i++) { if (firstb) { first += name[i]; firstb = false; } else { if (i == name.length - 1) { last = name[i]; } else { first += " "; first += name[i]; } } } data.put("FirstName", first); data.put("LastName", last); data.put("LoginName", Login_Name); data.put("PrimaryEmail", Email_Address); data.put("PrimaryPasscode", Encrypted_Password); data.put("SecondaryPasscode", Encrypted_Password); data.put("PhoneNumber", Phone_Number); data.put("PrimaryCellNumber", Phone_Number); data.put("AccountType", UserType); data.put("ProfileRateSequence", "" + 0); data.put("MemberShipType", "BASIC"); data.put("CityName", "null"); data.put("CountryId", "" + 0); data.put("StateId", "" + 0); data.put("IsVerified", "" + 1); data.put("IsBlocked", "" + 0); data.put("IsBlackListed", "" + 0); data.put("IsActive", "" + 1); data.put("IsDeleted", "" + 0); return data; } }; AppController.getInstance().addToRequestQueue(strReq, REQ_TAG); }[![The Error which i get on logcat.][1]][1]
I am posting data all strings to varchar variables in server, but i am getting volley server error or badnetwork performance error 417.
I am using the following fuction to call the server, help me out if there is an error.
public void signUpWS() { avi.show(); StringRequest strReq = new StringRequest(StringRequest.Method.POST, Constants.SIGN_UP, new Response.Listener<String>() { @Override public void onResponse(String response) { Snackbar.make(mainlayout, response.toString(), Snackbar.LENGTH_LONG).show(); Log.e("Responce from server", response.toString()); avi.hide(); if (!response.toString().contains("User")) { spEdit.putString(getString(R.string.uaccount), response.toString()); spEdit.commit(); Intent intent = new Intent(SignUp.this, Products.class); intent.putExtra(getString(R.string.uemail), Email_Address); intent.putExtra(getString(R.string.uphone), Phone_Number); intent.putExtra(getString(R.string.upass), Password); startActivity(intent); finish(); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { avi.hide(); Log.e("Volley Error", error.toString()); if (error.toString().contains("NoConnectionError")) { Snackbar.make(mainlayout, "Internet Not Available!", Snackbar.LENGTH_LONG).show(); } else { Snackbar.make(mainlayout, "Webservice not responding!", Snackbar.LENGTH_LONG).show(); } } }) { @Override public Map<String, String> getHeaders() throws AuthFailureError { Map<String, String> headers = new HashMap<>(); headers.put("Content-Type", "application/json; charset=utf-8"); return headers; } @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> data = new HashMap<String, String>(); String name[] = Name.split(" "); String first = "", last = ""; boolean firstb = true; for (int i = 0; i < name.length; i++) { if (firstb) { first += name[i]; firstb = false; } else { if (i == name.length - 1) { last = name[i]; } else { first += " "; first += name[i]; } } } data.put("FirstName", first); data.put("LastName", last); data.put("LoginName", Login_Name); data.put("PrimaryEmail", Email_Address); data.put("PrimaryPasscode", Encrypted_Password); data.put("SecondaryPasscode", Encrypted_Password); data.put("PhoneNumber", Phone_Number); data.put("PrimaryCellNumber", Phone_Number); data.put("AccountType", UserType); data.put("ProfileRateSequence", "" + 0); data.put("MemberShipType", "BASIC"); data.put("CityName", "null"); data.put("CountryId", "" + 0); data.put("StateId", "" + 0); data.put("IsVerified", "" + 1); data.put("IsBlocked", "" + 0); data.put("IsBlackListed", "" + 0); data.put("IsActive", "" + 1); data.put("IsDeleted", "" + 0); return data; } }; AppController.getInstance().addToRequestQueue(strReq, REQ_TAG); }[![The Error which i get on logcat.][1]][1]
原文:https://stackoverflow.com/questions/42365565
最满意答案
您需要选中该框以使库可用于您的项目。 通过导出这些jar,您可以将它们用于引用该库的任何项目。
“Eclipse Freezing”是什么意思? 它只是一个新的模拟器需要很长时间> 30分钟才能启动? 这在平均的窗户盒子上并不罕见。 如果没有,请检查错误日志。
You need to check that box to make the library available to your project. By exporting those jars you are making them available to any project that references that library.
What do you mean by "Eclipse Freezing" ? Is it just a new emulator taking a long time > 30 mins to start ? That would not be unusual on an average windows box. If not, check the error logs .
相关问答
更多-
您收到错误是因为您的'this'操作符指向new AdapterView.OnItemSelectedListener() (您创建的新侦听器)。 要修复此替换为:
.this 。 此外,我不确定你要做什么,但在听众中对新的adpater进行贴花并不是一个好主意。 最好在那里初始化它。 You are getting the error because your 'this' operator points to new AdapterView.OnItemSelectedLi ... -
以下是实现此目的的两种方法。 1)通过在包含Cell 的Row上调用removeCell来删除单元Cell 。 这也将删除单元格上的任何格式或样式。 row.removeCell(cellToMakeEmpty); 2)使用Cell的setCellType方法将单元格的单元格类型设置为CELL_TYPE_BLANK 。 这将清除单元格上的任何值,但它保持格式和样式完整。 cellToMakeEmpty.setCellType(Cell.CELL_TYPE_BLANK); Here are two way ...
-
Android正在使用与Java正则表达式引擎略有不同的ICU正则表达式库。 看到这个参考 : Unicode脚本,块,类别和二进制属性使用Perl中的\p和\P结构编写。 如果输入具有属性prop,则\p{prop}匹配,而如果输入具有该属性,则\P{prop}不匹配。 因此,模式应该写成 Pattern nonAlphabeticPattern = Pattern.compile("\\P{L}"); Android is using ICU regex library that is a bit ...
-
根据此Apache POI FAQ条目 , 不支持在不同版本之间混合POI jar,并且会以各种方式中断,例如您找到的那些。 不要这样做! 您需要在同一版本中使用所有POI罐。 我建议最新版本,可在此处获取 (目前为3.15) 您还应该查看组件及其依赖项页面 ,以确保您拥有使用Apache POI所需的所有jar文件。 好吧,或使用像Maven或Gradle这样的依赖管理工具为您处理! As per this Apache POI FAQ entry, mixing POI jars between dif ...
-
Apache POI提供了一个组件页面 ,其中详细介绍了项目的所有不同部分,您需要什么样的jar以及您需要的Maven工件。 如果你看那里,你会看到以下内容: |Component | Application type | Maven artifactId | Notes |Common SS | Excel XLS and XLSX | poi-ooxml | WorkbookFactory and friends all require poi-ooxml, not just core poi | ...
-
Android上使用Apache POI的NoClassDefFoundError(NoClassDefFoundError with Apache POI on Android)[2022-08-12]
您需要选中该框以使库可用于您的项目。 通过导出这些jar,您可以将它们用于引用该库的任何项目。 “Eclipse Freezing”是什么意思? 它只是一个新的模拟器需要很长时间> 30分钟才能启动? 这在平均的窗户盒子上并不罕见。 如果没有,请检查错误日志。 You need to check that box to make the library available to your project. By exporting those jars you are making them availab ... -
检查您的manifest.hda并确保将“Component Name”/ libs添加为componentExtra或componentLib,否则这些libs库将不会在组件安装时部署到内容服务器的文件系统(因此这些类将不会在运行)。 如果您查看有问题的user_project的WCC实例的文件系统,则可以检查此假设。 类加载器可能包含已加载的一个SAX实现的类。 尝试从类路径中完全删除xml-apis-1.0.b2.jar。 我敢打赌,在兼容的类路径中已经存在竞争的SAX实现。 Check your m ...
-
Apache POI JAR文件不在您的运行时类路径上。 使用MANIFEST.MF文件中的以下清单条目重建Test.jar Class-Path: poi-3.9-20121203.jar The Apache POI JAR file is not on your runtime classpath. Rebuild Test.jar with the following manifest entry in the MANIFEST.MF file Class-Path: poi-3.9-201212 ...
-
将评论提升为答案... Apache POI具有少量依赖关系 ,这些依赖关系完全列在网站的“ 组件”页面上。 您需要包含您正在使用的任何POI模块的依赖项。 在您的情况下,您获得的异常表明Commons Codec库缺失,并补充说明了解决问题。 Promoting a comment to an answer... Apache POI has a small number of dependencies, which are fully listed on the Components page on t ...
-
我们当然可以在Android中移植Apache POI API。 我做的示例代码是在Apache POI的帮助下计算功率点演示中的幻灯片数量。 We can certainly port Apache POI API in Android. The example code that i made is to count the number of slides in a power point presentation with the help of Apache POI.