post请求 status:500 internal server error

将TP框架的代码上传到linux服务器上之后,利用Postman进行接口请求,返回的数据是正常的,但是Postman上的status值还是500,提示 internal server error 网上找了很多方法都没有解决,如下图:
图片说明

服务器的架构是lamp,希望大佬帮忙解决,万分感激!!!!

==========分割线==============

问题已经解决:

主要是项目文件的权限问题,我把项目的权限设为777,就解决了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
为什么这个php脚本导致“NetworkError:500 Internal Server Error”?

<div class="post-text" itemprop="text"> <p>Why is this php script causing "NetworkError: 500 Internal Server Error"? Its only a little script for the contact form on my website and every time I click on the button to send the form the error cums up and as you can see its not made by me so I can't find the error by myself.. Thank you in advance! </p> <pre><code> &lt;?php // My modifications to mailer script from: // http://blog.teamtreehouse.com/create-ajax-contact-form // Added input sanitizing to prevent injection // Only process POST reqeusts. if ($_SERVER["REQUEST_METHOD"] == 'POST') { // Get the form fields and remove whitespace. $name = strip_tags(trim($_POST["name"])); $name = str_replace(array(" "," "),array(" "," "),$name); $email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL); $message = trim($_POST["message"]); // Check that data was sent to the mailer. if ( empty($name) OR empty($message) OR !filter_var($email, FILTER_VALIDATE_EMAIL)) { // Set a 400 (bad request) response code and exit. http_response_code(400); echo "Oops! Etwas ist schief gelaufen, ihre Nachricht konnte leider nicht versendet werden."; exit; } // Set the recipient email address. // FIXME: Update this to your desired email address. $recipient = "hello@youremail.com"; // Set the email subject. $subject = "Eine neue Nachricht von $name"; // Build the email content. $email_content = "Name: $name "; $email_content .= "Email: $email "; $email_content .= "Message: $message "; // Build the email headers. $email_headers = "From: $name &lt;$email&gt;"; // Send the email. if (mail($recipient, $subject, $email_content, $email_headers)) { // Set a 200 (okay) response code. http_response_code(200); echo "Dankeschön! Ihre Nachricht wurde versendet."; } else { // Set a 500 (internal server error) response code. http_response_code(500); echo "Oops! Etwas ist schief gelaufen, ihre Nachricht konnte leider nicht versendet werden."; } } else { // Not a POST request, set a 403 (forbidden) response code. http_response_code(403); echo "Es gab ein Problem mit ihrer Eingabe, bitte versuchen sie es erneut."; } ?&gt; </code></pre> </div>

高并发下出现错误。500 Internal Server Error

1.高并发下会出现错误500 Internal Server Error 2. ``` 2019-05-21 19:31:50 -1985877 [http-bio-8002-exec-491] ERROR - A JSONObject text must begin with '{' at character 1 of <html> <head><title>500 Internal Server Error</title></head> <body bgcolor="white"> <center><h1>500 Internal Server Error</h1></center> <hr><center>nginx/1.9.9</center> </body> </html> net.sf.json.JSONException: A JSONObject text must begin with '{' at character 1 of <html> <head><title>500 Internal Server Error</title></head> <body bgcolor="white"> <center><h1>500 Internal Server Error</h1></center> <hr><center>nginx/1.9.9</center> </body> </html> at net.sf.json.util.JSONTokener.syntaxError(JSONTokener.java:512) at net.sf.json.JSONObject._fromJSONTokener(JSONObject.java:881) at net.sf.json.JSONObject._fromString(JSONObject.java:1102) at net.sf.json.JSONObject.fromObject(JSONObject.java:175) at net.sf.json.JSONObject.fromObject(JSONObject.java:145) at com.rebate.controller.IndexController.getByCertno(IndexController.java:179) at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 2019-05-21 19:31:49 -1985174 [http-bio-8002-exec-482] INFO - getRedPacket: mobile=null, resultJson=<html> <head><title>500 Internal Server Error</title></head> <body bgcolor="white"> <center><h1>500 Internal Server Error</h1></center> <hr><center>nginx/1.9.9</center> </body> </html> ``` 2.我想确人是因为程序原因报错,导致nginx出现错误。 还是ngnix转发原因出现,访问不到连接报错。

HTTP Status 500 – Internal Server Error是什么原因学生信息管理系统的

![图片说明](https://img-ask.csdn.net/upload/201904/30/1556615867_5693.png)![图片说明](https://img-ask.csdn.net/upload/201904/30/1556615877_331413.png) 数据库的导入是不是有问题啊,圈起来的地方是灰色的![图片说明](https://img-ask.csdn.net/upload/201904/30/1556615942_509286.png)而且浏览器运行500

ajax返回500 (Internal Server Error)的问题

源码如下: $(function(){ $.validator.setDefaults({ submitHandler: function() { //表单验证成功并提交时执行 butsub(); } }); $("#submit_form_zzjs").validate(); var flag=true; function butsub(){ var formData = new FormData($("#submit_form_zzjs")[0]); if(flag){ $.ajax({ url: 'publish_server_chose.jsp', type: "POST", data: formData, cache: false, processData: false, contentType: false, beforeSend: function(){ flag=false; //防止发送两次请求 }, success: function (data) { flag = true; alert("发布成功!"); parent.location.href='personal_center_server.jsp'; }, error:function(){ alert("请先入驻实验室!"); } }); } } }); publish_server_chose.jsp: System.out.println("开始处理..."); String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; String trid=request.getSession().getAttribute("trid").toString(); if("".equals(trid)){ response.sendRedirect("login.jsp"); } int user_trid=Integer.parseInt(trid); System.out.println(user_trid); ci.adp.Table table = ci.adp.Table.getInstance("UT_JCW_SERVE"); DataRow row_one=Table.getInstance("ut_jcw_facilitor").queryDataRow("USERID="+user_trid+" AND PUBSTATE='已发布'"); DataRow row_two=table.newDataRow(); row_two.setValue("SSCID", row_one.getValueInt("TRID")); row_two.setValue("STATE", "正在审核"); row_two.setValue("ISDELETE", "否"); String message=""; //生成文件保存目录 String savePath = getServletConfig().getServletContext() .getRealPath("upload_publish"); //上传时生成的临时文件保存目录 String tempPath = getServletConfig().getServletContext() .getRealPath("temp_publish"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); String ymd = sdf.format(new Date()); savePath += "/" + ymd + ""; //创建文件夹 File dirFile = new File(savePath); if (!dirFile.exists()) { dirFile.mkdirs(); } tempPath += "/" + ymd + ""; //创建临时文件夹 File dirTempFile = new File(tempPath); if (!dirTempFile.exists()) { dirTempFile.mkdirs(); } //创建一个DiskFileItemFactory工厂,文件解析 DiskFileItemFactory factory = new DiskFileItemFactory(); factory.setSizeThreshold(20 * 1024 * 1024); //设定使用内存超过5M时,将产生临时文件并存储于临时目录中。 factory.setRepository(new File(tempPath)); //设定存储临时文件的目录。 ServletFileUpload upload = new ServletFileUpload(factory); upload.setHeaderEncoding("UTF-8"); upload.setFileSizeMax(1024 * 1024); // try { List<FileItem> items = upload.parseRequest(request); //获取formdata表单内容 for (FileItem item : items) { if (item.isFormField()) { //普通文本 String name = item.getFieldName(); String value = item.getString("UTF-8");//解决普通输入项的数据的中文乱码问题 if("bigclass".equals(name)){ row_two.setValue("DETAIL", value); }else if("smallclass_zzjs_net".equals(name)){ row_two.setValue("TYPEID", value); } row_two.setValue(name, value); System.out.println(name+"="+value); } else { //附件文件 if (item.getSize() > 0) { String filename = item.getName(); String fileFileName = item.getFieldName(); //获取name属性名称 if (filename.equals("")) { filename = "file"; } //获取文件名部分 filename = filename.substring(filename .lastIndexOf("\\") + 1); String fileExtName = filename.substring(filename .lastIndexOf(".")); System.out.println(filename); System.out.println(fileFileName); InputStream in = item.getInputStream(); String saveFilename = makeFileName(); saveFilename = URLEncoder.encode(saveFilename, "UTF-8"); //转码 //得到文件的保存目录 String realSavePath = makePath(saveFilename, savePath); String file_path = realSavePath + "" + saveFilename + fileExtName; file_path = file_path.replaceAll("\\\\", "/"); file_path=file_path.substring(file_path.indexOf("upload")); System.out.println(file_path); if ("IMAGE".equals(fileFileName)) { row_two.setValue("IMAGE", file_path); } //创建一个文件输出流 ,文件路径+生产的文件名.后缀 FileOutputStream out1 = new FileOutputStream( realSavePath + "" + saveFilename + fileExtName); //创建一个缓冲区 byte buffer[] = new byte[1024]; //判断输入流中的数据是否已经读完的标识 int len = 0; //循环将输入流读入到缓冲区当中,(len=in.read(buffer))>0就表示in里面还有数据 while ((len = in.read(buffer)) > 0) { //使用FileOutputStream输出流将缓冲区的数据写入到指定的目录(savePath + "\\" + filename)当中 out1.write(buffer, 0, len); } in.close(); out1.close(); message = "文件上传成功!"; } } } row_two.update(); JSONObject obj=new JSONObject(); obj.put("data",message ); out.println(obj); } catch (FileUploadBase.FileSizeLimitExceededException e) { response.getWriter().print("单个文件超出最大值!!!"); return; } catch (FileUploadBase.SizeLimitExceededException e) { e.printStackTrace(); response.getWriter().print("上传文件的总的大小超出限制的最大值!!!"); return; } catch (Exception e) { response.getWriter().print("文件上传失败!"); e.printStackTrace(); } 执行ajax,返回publish_server_chose.jsp 500 (Internal Server Error),已困扰一周时间,求大神点拨。

HTTP Status 500 – Internal Server Error – The server encountered an unexpected condition

各位前辈,我初学JAVA的 我根据一位热心群友的建议,将stuts.xml的namespace="/qiantai",改为namespace="/"; 今天遇到这么个情况:window端myeclipse做的一个工程,用的是jdk7+tomcat8. 500HTTP Status 500 – Internal Server Error Type Exception Report Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception java.lang.reflect.InvocationTargetException sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ........ Root Cause java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session; ............... Note The full stack trace of the root cause is available in the server logs. 初入门,各位前辈帮忙一下! 我试过用用jdk7+tomcat7.jdk7+tomcat8.jdk8+tomcat8. 都是<struts2.1+spring3.1+.hibernate4.1>此版本的项目都是一样不行;但是我用<struts2.1+spring2.0+.hibernate3.1>此版本重做个源代码基本相同的项目,居然是正常的! 帮下新手,请问如何在更高级的SSH框架下,不出现“HTTP Status 500 – Internal Server Error”错误呢?

我使用eclipse运行login时,传输数据出现HTTP Status 500 – Internal Server Error问题,请问这个怎么解决?

![图片说明](https://img-ask.csdn.net/upload/201912/18/1576647408_973159.jpg) ``` 控制器代码: String uname=request.getParameter("uname"); String upsw=request.getParameter("upsw"); if(uname!=null&&uname!=""){ SqlHelper daoTemp=new SqlHelper(); if(daoTemp.loginCheck(uname, upsw)) response.sendRedirect("/bsWeb/admin/Index.jsp"); else { String msg="登录失败!"; request.setAttribute("msg", msg); request.getRequestDispatcher("/Login/Login.jsp").forward(request, response); } } } 前台代码: <body> <% String msg=(String)request.getAttribute("msg"); if(msg!=null&&msg!="") out.print("<script>alert('"+msg+"')</script>"); %> <form action="/bsWeb/LoginCheck" method="post"> <div class="main"> <div class="mainin"> <h1>&nbsp;</h1> <div class="mainin1"> <ul> <li> <span>用户名:</span><input id="Text1" type="text" class="SearchKeyword" name="uname" /> </li> <li> <span>密码:</span><input id="Text1" type="text" class="SearchKeyword2" name="upwd" /> </li> <li> <input id="Button1" type="submit" class="tijiao" value="登录" /> </li> </ul> </div> </div> </div> </form> </body> 服务器代码: public class SqlHelper { String dbDriver="com.mysql.jdbc.Driver"; String url="jdbc:mysql://localhost:3306/bsweb?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false"; String dbuser="root"; String dbpsw=""; Connection conn; Statement stmt; ResultSet rs; //HttpSession session; public SqlHelper(){ } public CachedRowSetImpl getDataCache(String sql) { CachedRowSetImpl crTemp=null; try{ crTemp=new CachedRowSetImpl(); Class.forName(dbDriver); conn=DriverManager.getConnection(url,dbuser,dbpsw); stmt=conn.createStatement(); rs=stmt.executeQuery(sql); crTemp.populate(rs); }catch(Exception ex){ ex.printStackTrace(); }finally{ try { conn.close(); } catch (SQLException e) { e.printStackTrace(); } } return crTemp; } public Result getData(String sql){ Result rsTemp=null; try{ Class.forName(dbDriver); conn=DriverManager.getConnection(url,dbuser,dbpsw); stmt=conn.createStatement(); rs=stmt.executeQuery(sql); rsTemp=ResultSupport.toResult(rs); }catch(Exception e){ e.printStackTrace(); }finally{ try{ stmt.close(); conn.close(); }catch(Exception eOne){ eOne.printStackTrace(); } } return rsTemp; } public int userExecuteScalar(String sql){ int result=0; try{ Class.forName(dbDriver); conn=DriverManager.getConnection(url,dbuser,dbpsw); stmt=conn.createStatement(); result=stmt.executeUpdate(sql); }catch(Exception e){ e.printStackTrace(); }finally{ try{ stmt.close(); conn.close(); }catch(Exception eOne){ eOne.printStackTrace(); } } return result; } public boolean loginCheck(String uname,String upwd){ int count=0; String sql="select count(*) from admin where uname=? and upwd=?"; try{ Class.forName(dbDriver); conn=DriverManager.getConnection(url,dbuser,dbpsw); PreparedStatement preStmt=conn.prepareStatement(sql); preStmt.setString(1,uname); preStmt.setString(2,upwd); rs=preStmt.executeQuery(); while(rs.next()) count=rs.getInt(1); if(count>0) return true; }catch(Exception e){ e.printStackTrace(); }finally{ try{ stmt.close(); conn.close(); }catch(Exception eOne){ eOne.printStackTrace(); } } return false; } ```

转到API网关后面的AWS Lambda:自定义错误消息

<div class="post-text" itemprop="text"> <p>I'm trying to handle an error in a Lambda function written in Go.<br> The Lambda is triggered by API Gateway.<br> When I respond with a <strong><em>200</em></strong>, I get the correct response.<br> But when I respond with a <strong><em>500</em></strong> code, I always receive <code>{"message": "Internal server error"}</code></p> <p>Here is part of the code:</p> <pre><code>func newErrReponse(message string) (events.APIGatewayProxyResponse, error) { return events.APIGatewayProxyResponse{ Body: message, StatusCode: 500, }, errors.New(message) } func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) { return newErrReponse("some error") } func main() { lambda.Start(handleRequest) } </code></pre> <p>I was expecting <em>"some error"</em>, but I always get the internal server error. I tried JSON in the body but that didn't help. The integration request is of type LAMBDA_PROXY. That was the default.</p> <p>How can I control the error response?</p> </div>

asp.net 打开网页提示internal server error

如图所示,无论是用iis启动还是用vs启动都是这样,以前从来没有过的情况 (https://img-ask.csdn.net/upload/201603/02/1456895537_319641.png)

HTTP Status 500 – Internal Server Error(jspmaker生成,tomcat实现)

内容是用Jspmaker把数据库表生成jsp,然后用tomcat,结果出现了以下问题 网站报错代码如下: HTTP Status 500 – Internal Server ErrorType 异常报告 消息 在 [146] 行处理 [/jspmoon/customerlist.jsp] 时发生异常 描述 服务器遇到一个意外的情况,阻止它完成请求。 Exception org.apache.jasper.JasperException: 在 [146] 行处理 [/jspmoon/customerlist.jsp] 时发生异常 143: // Open Connection to the database 144: try{ 145: Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); 146: ResultSet rs = null; 147: // Build SQL 148: String strsql = "SELECT * FROM `customer`"; 149: whereClause = ""; Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:617) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:514) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) Root Cause java.lang.NullPointerException org.apache.jsp.jspmoon.customerlist_jsp._jspService(customerlist_jsp.java:585) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ):注意 主要问题的全部 stack 信息可以在 server logs 里查看 Apache Tomcat/8.5.50 jsp代码: <%@ page session="true" buffer="16kb" import="java.sql.*,java.util.*,java.text.*"%> <%@ page contentType="text/html; charset=UTF-8" %> <% response.setDateHeader("Expires", 0); // date in the past response.addHeader("Cache-Control", "no-store, no-cache, must-revalidate"); // HTTP/1.1 response.addHeader("Cache-Control", "post-check=0, pre-check=0"); response.addHeader("Pragma", "no-cache"); // HTTP/1.0 %> <% Locale locale = Locale.getDefault(); response.setLocale(locale);%> <% session.setMaxInactiveInterval(30*60); %> <%@ include file="db.jsp" %> <%@ include file="jspmkrfn.jsp" %> <% int displayRecs = 20; int recRange = 10; %> <% String tmpfld = null; String escapeString = "\\\\'"; String dbwhere = ""; String masterdetailwhere = ""; String searchwhere = ""; String a_search = ""; String b_search = ""; String whereClause = ""; int startRec = 0, stopRec = 0, totalRecs = 0, recCount = 0; %> <% // Get search criteria for basic search String pSearch = request.getParameter("psearch"); String pSearchType = request.getParameter("psearchtype"); if (pSearch != null && pSearch.length() > 0) { pSearch = pSearch.replaceAll("'",escapeString); if (pSearchType != null && pSearchType.length() > 0) { while (pSearch.indexOf(" ") > 0) { pSearch = pSearch.replaceAll(" ", " "); } String [] arpSearch = pSearch.trim().split(" "); for (int i = 0; i < arpSearch.length; i++){ String kw = arpSearch[i].trim(); b_search = b_search + "("; b_search = b_search + "`C_NAME` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_ADDRESS` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_PHONE` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_MATSEGMENT` LIKE '%" + kw + "%' OR "; b_search = b_search + "`C_COMMENT` LIKE '%" + kw + "%' OR "; if (b_search.substring(b_search.length()-4,b_search.length()).equals(" OR ")) { b_search = b_search.substring(0,b_search.length()-4);} b_search = b_search + ") " + pSearchType + " "; } }else{ b_search = b_search + "`C_NAME` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_ADDRESS` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_PHONE` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_MATSEGMENT` LIKE '%" + pSearch + "%' OR "; b_search = b_search + "`C_COMMENT` LIKE '%" + pSearch + "%' OR "; } } if (b_search.length() > 4 && b_search.substring(b_search.length()-4,b_search.length()).equals(" OR ")) {b_search = b_search.substring(0, b_search.length()-4);} if (b_search.length() > 5 && b_search.substring(b_search.length()-5,b_search.length()).equals(" AND ")) {b_search = b_search.substring(0, b_search.length()-5);} %> <% // Build search criteria if (a_search != null && a_search.length() > 0) { searchwhere = a_search; // Advanced search }else if (b_search != null && b_search.length() > 0) { searchwhere = b_search; // Basic search } // Save search criteria if (searchwhere != null && searchwhere.length() > 0) { session.setAttribute("customer_searchwhere", searchwhere); startRec = 1; // Reset start record counter (new search) session.setAttribute("customer_REC", new Integer(startRec)); }else{ if (session.getAttribute("customer_searchwhere") != null) searchwhere = (String) session.getAttribute("customer_searchwhere"); } %> <% // Get clear search cmd startRec = 0; if (request.getParameter("cmd") != null && request.getParameter("cmd").length() > 0) { String cmd = request.getParameter("cmd"); if (cmd.toUpperCase().equals("RESET")) { searchwhere = ""; // Reset search criteria session.setAttribute("customer_searchwhere", searchwhere); }else if (cmd.toUpperCase().equals("RESETALL")) { searchwhere = ""; // Reset search criteria session.setAttribute("customer_searchwhere", searchwhere); } startRec = 1; // Reset start record counter (reset command) session.setAttribute("customer_REC", new Integer(startRec)); } // Build dbwhere if (masterdetailwhere != null && masterdetailwhere.length() > 0) { dbwhere = dbwhere + "(" + masterdetailwhere + ") AND "; } if (searchwhere != null && searchwhere.length() > 0) { dbwhere = dbwhere + "(" + searchwhere + ") AND "; } if (dbwhere != null && dbwhere.length() > 5) { dbwhere = dbwhere.substring(0, dbwhere.length()-5); // Trim rightmost AND } %> <% // Load Default Order String DefaultOrder = ""; String DefaultOrderType = ""; // No Default Filter String DefaultFilter = ""; // Check for an Order parameter String OrderBy = request.getParameter("order"); if (OrderBy != null && OrderBy.length() > 0) { if (session.getAttribute("customer_OB") != null && ((String) session.getAttribute("customer_OB")).equals(OrderBy)) { // Check if an ASC/DESC toggle is required if (((String) session.getAttribute("customer_OT")).equals("ASC")) { session.setAttribute("customer_OT", "DESC"); }else{ session.setAttribute("customer_OT", "ASC"); } }else{ session.setAttribute("customer_OT", "ASC"); } session.setAttribute("customer_OB", OrderBy); session.setAttribute("customer_REC", new Integer(1)); }else{ OrderBy = (String) session.getAttribute("customer_OB"); if (OrderBy == null || OrderBy.length() == 0) { OrderBy = DefaultOrder; session.setAttribute("customer_OB", OrderBy); session.setAttribute("customer_OT", DefaultOrderType); } } // Open Connection to the database try{ Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = null; // Build SQL String strsql = "SELECT * FROM `customer`"; whereClause = ""; if (DefaultFilter.length() > 0) { whereClause = whereClause + "(" + DefaultFilter + ") AND "; } if (dbwhere.length() > 0) { whereClause = whereClause + "(" + dbwhere + ") AND "; } if (whereClause.length() > 5 && whereClause.substring(whereClause.length()-5, whereClause.length()).equals(" AND ")) { whereClause = whereClause.substring(0, whereClause.length()-5); } if (whereClause.length() > 0) { strsql = strsql + " WHERE " + whereClause; } if (OrderBy != null && OrderBy.length() > 0) { strsql = strsql + " ORDER BY `" + OrderBy + "` " + (String) session.getAttribute("customer_OT"); } //out.println(strsql); rs = stmt.executeQuery(strsql); rs.last(); totalRecs = rs.getRow(); rs.beforeFirst(); startRec = 0; int pageno = 0; // Check for a START parameter if (request.getParameter("start") != null && Integer.parseInt(request.getParameter("start")) > 0) { startRec = Integer.parseInt(request.getParameter("start")); session.setAttribute("customer_REC", new Integer(startRec)); }else if (request.getParameter("pageno") != null && Integer.parseInt(request.getParameter("pageno")) > 0) { pageno = Integer.parseInt(request.getParameter("pageno")); if (IsNumeric(request.getParameter("pageno"))) { startRec = (pageno-1)*displayRecs+1; if (startRec <= 0) { startRec = 1; }else if (startRec >= ((totalRecs-1)/displayRecs)*displayRecs+1) { startRec = ((totalRecs-1)/displayRecs)*displayRecs+1; } session.setAttribute("customer_REC", new Integer(startRec)); }else { startRec = ((Integer) session.getAttribute("customer_REC")).intValue(); if (startRec <= 0) { startRec = 1; // Reset start record counter session.setAttribute("customer_REC", new Integer(startRec)); } } }else{ if (session.getAttribute("customer_REC") != null) startRec = ((Integer) session.getAttribute("customer_REC")).intValue(); if (startRec==0) { startRec = 1; //Reset start record counter session.setAttribute("customer_REC", new Integer(startRec)); } } %> <%@ include file="header.jsp" %> <p><span class="jspmaker">TABLE: customer</span></p> <form action="customerlist.jsp"> <table border="0" cellspacing="0" cellpadding="4"> <tr> <td><span class="jspmaker">Quick Search (*)</span></td> <td><span class="jspmaker"> <input type="text" name="psearch" size="20"> <input type="Submit" name="Submit" value="GO"> &nbsp;&nbsp;<a href="customerlist.jsp?cmd=reset">Show all</a> </span></td> </tr> <tr><td>&nbsp;</td><td><span class="jspmaker"><input type="radio" name="psearchtype" value="" checked>Exact phrase&nbsp;&nbsp;<input type="radio" name="psearchtype" value="AND">All words&nbsp;&nbsp;<input type="radio" name="psearchtype" value="OR">Any word</span></td></tr> </table> </form> <form method="post"> <table border="0" cellspacing="1" cellpadding="4" bgcolor="#CCCCCC"> <tr bgcolor="#594FBF"> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_CUSTKEY","UTF-8") %>" style="color: #FFFFFF;">C CUSTKEY&nbsp;<% if (OrderBy != null && OrderBy.equals("C_CUSTKEY")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_NAME","UTF-8") %>" style="color: #FFFFFF;">C NAME&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_NAME")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_ADDRESS","UTF-8") %>" style="color: #FFFFFF;">C ADDRESS&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_ADDRESS")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_NATIONKEY","UTF-8") %>" style="color: #FFFFFF;">C NATIONKEY&nbsp;<% if (OrderBy != null && OrderBy.equals("C_NATIONKEY")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_PHONE","UTF-8") %>" style="color: #FFFFFF;">C PHONE&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_PHONE")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_ACCTBAL","UTF-8") %>" style="color: #FFFFFF;">C ACCTBAL&nbsp;<% if (OrderBy != null && OrderBy.equals("C_ACCTBAL")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_MATSEGMENT","UTF-8") %>" style="color: #FFFFFF;">C MATSEGMENT&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_MATSEGMENT")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td><span class="jspmaker" style="color: #FFFFFF;"> <a href="customerlist.jsp?order=<%= java.net.URLEncoder.encode("C_COMMENT","UTF-8") %>" style="color: #FFFFFF;">C COMMENT&nbsp;(*)<% if (OrderBy != null && OrderBy.equals("C_COMMENT")) { %><span class="ewTableOrderIndicator"><% if (((String) session.getAttribute("customer_OT")).equals("ASC")) {%>5<% }else if (((String) session.getAttribute("customer_OT")).equals("DESC")) { %>6<% } %></span><% } %></a> </span></td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <% // Avoid starting record > total records if (startRec > totalRecs) { startRec = totalRecs; } // Set the last record to display stopRec = startRec + displayRecs - 1; // Move to first record directly for performance reason recCount = startRec - 1; if (rs.next()) { rs.first(); rs.relative(startRec - 1); } long recActual = 0; if (startRec == 1) rs.beforeFirst(); else rs.previous(); while (rs.next() && recCount < stopRec) { recCount++; if (recCount >= startRec) { recActual++; %> <% String bgcolor = "#FFFFFF"; // Set row color %> <% if (recCount%2 != 0) { // Display alternate color for rows bgcolor = "#F5F5F5"; } %> <% String x_C_CUSTKEY = ""; String x_C_NAME = ""; String x_C_ADDRESS = ""; String x_C_NATIONKEY = ""; String x_C_PHONE = ""; String x_C_ACCTBAL = ""; String x_C_MATSEGMENT = ""; String x_C_COMMENT = ""; // Load Key for record String key = ""; key = String.valueOf(rs.getLong("C_CUSTKEY")); // C_CUSTKEY x_C_CUSTKEY = String.valueOf(rs.getLong("C_CUSTKEY")); // C_NAME if (rs.getString("C_NAME") != null){ x_C_NAME = rs.getString("C_NAME"); }else{ x_C_NAME = ""; } // C_ADDRESS if (rs.getString("C_ADDRESS") != null){ x_C_ADDRESS = rs.getString("C_ADDRESS"); }else{ x_C_ADDRESS = ""; } // C_NATIONKEY x_C_NATIONKEY = String.valueOf(rs.getLong("C_NATIONKEY")); // C_PHONE if (rs.getString("C_PHONE") != null){ x_C_PHONE = rs.getString("C_PHONE"); }else{ x_C_PHONE = ""; } // C_ACCTBAL x_C_ACCTBAL = String.valueOf(rs.getDouble("C_ACCTBAL")); // C_MATSEGMENT if (rs.getString("C_MATSEGMENT") != null){ x_C_MATSEGMENT = rs.getString("C_MATSEGMENT"); }else{ x_C_MATSEGMENT = ""; } // C_COMMENT if (rs.getString("C_COMMENT") != null){ x_C_COMMENT = rs.getString("C_COMMENT"); }else{ x_C_COMMENT = ""; } %> <tr bgcolor="<%= bgcolor %>"> <td><span class="jspmaker"><% out.print(x_C_CUSTKEY); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_NAME); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_ADDRESS); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_NATIONKEY); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_PHONE); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_ACCTBAL); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_MATSEGMENT); %></span>&nbsp;</td> <td><span class="jspmaker"><% out.print(x_C_COMMENT); %></span>&nbsp;</td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customerview.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">View</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customeredit.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Edit</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customeradd.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Copy</a></span></td> <td><span class="jspmaker"><a href="<% key = rs.getString("C_CUSTKEY"); if (key != null && key.length() > 0) { out.print("customerdelete.jsp?key=" + java.net.URLEncoder.encode(key,"UTF-8")); }else{ out.print("javascript:alert('Invalid Record! Key is null');"); } %>">Delete</a></span></td> </tr> <% // } } } %> </table> </form> <% // Close recordset and connection rs.close(); rs = null; stmt.close(); stmt = null; conn.close(); conn = null; }catch(SQLException ex){ out.println(ex.toString()); } %> <table border="0" cellspacing="0" cellpadding="10"><tr><td> <% boolean rsEof = false; if (totalRecs > 0) { rsEof = (totalRecs < (startRec + displayRecs)); int PrevStart = startRec - displayRecs; if (PrevStart < 1) { PrevStart = 1;} int NextStart = startRec + displayRecs; if (NextStart > totalRecs) { NextStart = startRec;} int LastStart = ((totalRecs-1)/displayRecs)*displayRecs+1; %> <form> <table border="0" cellspacing="0" cellpadding="0"><tr><td><span class="jspmaker">Page</span>&nbsp;</td> <!--first page button--> <% if (startRec==1) { %> <td><img src="images/firstdisab.gif" alt="First" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=1"><img src="images/first.gif" alt="First" width="20" height="15" border="0"></a></td> <% } %> <!--previous page button--> <% if (PrevStart == startRec) { %> <td><img src="images/prevdisab.gif" alt="Previous" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=PrevStart%>"><img src="images/prev.gif" alt="Previous" width="20" height="15" border="0"></a></td> <% } %> <!--current page number--> <td><input type="text" name="pageno" value="<%=(startRec-1)/displayRecs+1%>" size="4"></td> <!--next page button--> <% if (NextStart == startRec) { %> <td><img src="images/nextdisab.gif" alt="Next" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=NextStart%>"><img src="images/next.gif" alt="Next" width="20" height="15" border="0"></a></td> <% } %> <!--last page button--> <% if (LastStart == startRec) { %> <td><img src="images/lastdisab.gif" alt="Last" width="20" height="15" border="0"></td> <% }else{ %> <td><a href="customerlist.jsp?start=<%=LastStart%>"><img src="images/last.gif" alt="Last" width="20" height="15" border="0"></a></td> <% } %> <td><a href="customeradd.jsp"><img src="images/addnew.gif" alt="Add new" width="20" height="15" border="0"></a></td> <td><span class="jspmaker">&nbsp;of <%=(totalRecs-1)/displayRecs+1%></span></td> </td></tr></table> </form> <% if (startRec > totalRecs) { startRec = totalRecs;} stopRec = startRec + displayRecs - 1; recCount = totalRecs - 1; if (rsEof) { recCount = totalRecs;} if (stopRec > recCount) { stopRec = recCount;} %> <span class="jspmaker">Records <%= startRec %> to <%= stopRec %> of <%= totalRecs %></span> <% }else{ %> <span class="jspmaker">No records found</span> <p> <a href="customeradd.jsp"><img src="images/addnew.gif" alt="Add new" width="20" height="15" border="0"></a> </p> <% } %> </td></tr></table> <%@ include file="footer.jsp" %>

HTTP 错误 500.19 - Internal Server Error

报错信息 ![图片说明](https://img-ask.csdn.net/upload/201808/08/1533665527_242450.png) 自动生成的web.config长这个样子…… ![图片说明](https://img-ask.csdn.net/upload/201808/08/1533665541_924914.png) VS2017 .net core 第一次学着做网站,制作的时候在电脑上运行的蛮好,发布到服务器上就出现了这种错误。

Laravel:为什么我的ajax请求返回“500(内部服务器错误)”?

<div class="post-text" itemprop="text"> <p>I'm trying to make AJAX request with button in Laravel 5.5. Console returns me POST: 500 (Internal Server Error).</p> <p><a href="https://i.stack.imgur.com/ea7bi.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ea7bi.gif" alt="enter image description here"></a></p> <p>My Javascript code here:</p> <pre><code>&lt;script type="text/javascript"&gt; $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); $('#insertForm').on('submit', function(e){ e.preventDefault(); var data = $(this).serialize(); var url = $(this).attr('action'); var post = $(this).attr('method'); $.ajax({ type: post, url: url, data: data, dataType: 'json', success:function(data) { console.log(data) } }) }) &lt;/script&gt; </code></pre> <p>My HTML form code:</p> <pre><code>&lt;form action="{{ URL::to('add') }}" class="translation-form" method="POST" id="insertForm"&gt; &lt;div class="language-area"&gt; &lt;textarea class="form-control wow fadeIn" data-wow-duration="0.5s" name="words" id="lang-input" rows="10"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;p class="upload-info wow fadeInDown" data-wow-duration="0.5s" data-wow-delay="0.3s"&gt; Add words from file &lt;input type="file" name="file-1" id="file-1" class="inputfile inputfile-1" data-multiple-caption="{count} files selected" multiple /&gt; &lt;label for="file-1"&gt;&lt;span&gt;"doc" or "docx"&lt;/span&gt;&lt;/label&gt; &lt;/p&gt; &lt;div class="clearfix"&gt;&lt;/div&gt; &lt;div class="text-center translate-option"&gt; &lt;button type="submit" class="btn btn-green btn-instant-translate wow fadeIn" data-wow-duration="0.5s"&gt; Add &lt;/button&gt; &lt;/div&gt; &lt;/form&gt; </code></pre> <p>My AjaxController:</p> <pre><code>class AjaxController extends Controller { public function store(Request $request) { if($request-&gt;$ajax()) { return "True request!"; } } } </code></pre> <p>And my route:</p> <pre><code>Route::post('/add', ['uses'=&gt;'AjaxController@store', 'as'=&gt;'ajaxAdd']); </code></pre> <p>Why does such an error occur? Ajax worked when I tried to just output the data in the console without usage requests to AjaxController.</p> </div>

Prestashop 1.6 Webservice Order

<div class="post-text" itemprop="text"> <p>I'm trying to finish my custom module to import clients, addresses, carts and orders from a webservice.</p> <p>Clients, Adresses and Carts imports works fine but when trying to insert new Order, it returns this error:</p> <pre><code>This call to PrestaShop Web Services failed and returned an HTTP status of 500. That means: Internal Server Error. </code></pre> <p>If i take a look to my apache2 error.log I can see this error:</p> <pre><code> PHP Fatal error: Call to a member function validateOrder() on boolean in /var/www/html/prestashop_pool/myshop/classes/order/Order.php on line 1463 </code></pre> <p>This piece of code is the ones related to the order adittion via WebService:</p> <pre><code>// Getting the structure of an order $xml = $webService-&gt;get(array('url' =&gt; PS_SHOP_PATH .'api/orders/?schema=blank')); // Adding dinamic and required fields // Required $xml-&gt;order-&gt;id_address_delivery = $id_address; // Customer address $xml-&gt;order-&gt;id_address_invoice = $id_address; $xml-&gt;order-&gt;id_cart = $id_cart; $xml-&gt;order-&gt;id_currency = $id_currency; $xml-&gt;order-&gt;id_lang = $id_lang; $xml-&gt;order-&gt;id_customer = $id_customer; $xml-&gt;order-&gt;id_carrier = $id_carrier; $xml-&gt;order-&gt;module = $order_module; $xml-&gt;order-&gt;payment = $order_payment; $xml-&gt;order-&gt;total_paid = $total_paid; $xml-&gt;order-&gt;total_paid_real = $total_paid_real; $xml-&gt;order-&gt;total_products = $total_products; $xml-&gt;order-&gt;total_products_wt = $total_products_wt; $xml-&gt;order-&gt;conversion_rate = 1; // Others $xml-&gt;order-&gt;valid = 1; $xml-&gt;order-&gt;current_state = $id_status; $xml-&gt;order-&gt;total_discounts = $total_discounts; $xml-&gt;order-&gt;total_discounts_tax_incl = $total_discounts_tax_incl; $xml-&gt;order-&gt;total_discounts_tax_excl = $total_discounts_tax_excl; $xml-&gt;order-&gt;total_paid_tax_incl = $total_paid_tax_incl; $xml-&gt;order-&gt;total_paid_tax_excl = $total_paid_tax_excl; $xml-&gt;order-&gt;total_shipping = $total_shipping; $xml-&gt;order-&gt;total_shipping_tax_incl = $total_shipping_tax_incl; $xml-&gt;order-&gt;total_shipping_tax_excl = $total_shipping_tax_excl; // Order Row. Required $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;product_id = $products[0]['id_product']; $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;product_attribute_id = $products[0]['id_product_attribute']; $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;product_quantity = $products[0]['quantity']; // Order Row. Others $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;product_name = $products[0]['name']; $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;product_reference = $products[0]['reference']; $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;product_price = $products[0]['product_price']; $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;unit_price_tax_incl = $products[0]['product_price']; $xml-&gt;order-&gt;associations-&gt;order_rows-&gt;order_row[0]-&gt;unit_price_tax_excl = $products[0]['product_price']; // Creating the order $opt = array( 'resource' =&gt; 'orders' ); $opt['postXml'] = $xml-&gt;asXML(); $xml = $webService-&gt;add( $opt ); $id_order = $xml-&gt;order-&gt;id </code></pre> <p>Anyone knows how to fix it?</p> </div>

使用AFN发送post请求,报了一个500的错,但是安卓和postman能请求的到数据

我使用AFN发送一个post请求,报了以下的错误,但是安卓和postman能请求的到数据,跪求各位大神帮我看一下问题出在哪里 Error Domain=com.alamofire.error.serialization.response Code=-1011 "Request failed: internal server error (500)" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x600000425e00> { URL: http://123.207.232.93/api/Cart/cart_list } { status code: 500, headers { Server = Apache; Content-Type = text/html; charset=UTF-8; Pragma = no-cache; Cache-Control = no-store, no-cache, must-revalidate, post-check=0, pre-check=0; Date = Thu, 22 Jun 2017 09:33:30 GMT; Content-Length = 0; Expires = Thu, 19 Nov 1981 08:52:00 GMT; Connection = close; } }, NSErrorFailingURLKey=http://123.207.232.93/api/Cart/cart_list, com.alamofire.serialization.response.error.data=<>, NSLocalizedDescription=Request failed: internal server error (500)}

内部服务器错误 - Opencart

<div class="post-text" itemprop="text"> <p>I've downloaded an opencart installation in my local server in order to use it as a test and i'm not able to view the site. When i use the default htaccess file the browser returns a 500 error and when i remove the htaccess file the seo - links do not work. (404)</p> <p>Any ideas?</p> <p>My .htaccess file</p> <pre><code># 1.To use URL Alias you need to be running apache with mod_rewrite enabled. # 2. In your opencart directory rename htaccess.txt to .htaccess. # For any support issues please visit: http://www.opencart.com Options +FollowSymlinks # Prevent Directoy listing Options -Indexes # Turn on Expires and set default to 0 ExpiresActive On ExpiresDefault A0 # Set up caching on media files for 5 weeks &lt;FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"&gt; ExpiresDefault A3024000 Header append Cache-Control "public" &lt;/FilesMatch&gt; # Set up caching on media files for 5 weeks &lt;FilesMatch "\.(gif|jpg|jpeg|png|swf)$"&gt; ExpiresDefault A3024000 Header append Cache-Control "public" &lt;/FilesMatch&gt; # Set up 1 day caching on commonly updated files &lt;FilesMatch "\.(xml|txt|html|js|css)$"&gt; ExpiresDefault A86400 Header append Cache-Control "proxy-revalidate" &lt;/FilesMatch&gt; # Force no caching for dynamic files &lt;FilesMatch "\.(php|cgi|pl|htm)$"&gt; ExpiresActive Off Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform" Header set Pragma "no-cache" &lt;/FilesMatch&gt; &lt;IfModule mod_deflate.c&gt; &lt;filesMatch "\.(js|css|html|php)$"&gt; SetOutputFilter DEFLATE &lt;/filesMatch&gt; &lt;/IfModule&gt; # Prevent Direct Access to files &lt;FilesMatch "\.(tpl|ini|log)"&gt; Order deny,allow Deny from all &lt;/FilesMatch&gt; # SEO URL Settings RewriteEngine On # If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] RewriteRule ^download/(.*) /index.php?route=error/not_found [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA] ### Additional Settings that may need to be enabled for some servers ### Uncomment the commands by removing the # sign in front of it. ### If you get an "Internal Server Error 500" after enabling any of the following settings, restore the # as this means your host doesn't allow that. # 1. If your cart only allows you to add one item at a time, it is possible register_globals is on. This may work to disable it: # php_flag register_globals off # 2. If your cart has magic quotes enabled, This may work to disable it: # php_flag magic_quotes_gpc Off # 3. Set max upload file size. Most hosts will limit this and not allow it to be overridden but you can try # php_value upload_max_filesize 999M # 4. set max post size. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields # php_value post_max_size 999M # 5. set max time script can take. uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields # php_value max_execution_time 200 # 6. set max time for input to be recieved. Uncomment this line if you have a lot of product options or are getting errors where forms are not saving all fields # php_value max_input_time 200 # 7. disable open_basedir limitations # php_admin_value open_basedir none </code></pre> </div>

jsp+struts2+jquery ajax返回Internal server error

架构: struts2+jsp+jquery 关键代码: jQuery.ajax({ url: 'business/xxxx.action', data: 'id='+id, type: 'POST', dataType:"json", error: function(request,textStatus,errorThrown) { alert(errorThrown); //前台打出:internal server error alert(request.status); //前台打出: 500 alert(request.readyState); //前台打出:4 alert(textStatus);//前台打出: 空字符串 }, 1.后台程序不报错,返回的json字符串也没有问题(已跟踪过代码) 应该是struts往前台传值的时候出了问题,可是看不到报错,不得而知 2.怀疑是json长度的问题,因为如果把长度改小,就可以正常显示数据,不会走error方法了 所以,和json格式也无关。 求问到底怎么修改?

HTTP Status 500 求助

HTTP Status 500 - type Exception report message description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.NullPointerException casecom.Service.LoginService.checkPassword(LoginService.java:18) casecom.Servlet.Servlet.doPost(Servlet.java:74) javax.servlet.http.HttpServlet.service(HttpServlet.java:650) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.77 logs. Apache Tomcat/7.0.77 java的课程作业,这是最后一步了,非常心碎,求大神解决!

springcloud zuul fallback 回退返回数据异常

我的eureka中注册了user服务 和 gateway-zuul-fallback 服务 直接访问user服务localhost:8081/user/getUser?id=1 没问题 通过zuul访问userlocalhost:8097/user/user/getUser?id=1 也没问题 zuul服务yml配置: ![图片说明](https://img-ask.csdn.net/upload/201805/22/1526957296_9037.png) fallbackConfig ![图片说明](https://img-ask.csdn.net/upload/201805/22/1526957384_939838.png) 我把 user服务挂掉,通过zuul代理访问报以下错误:(怎么返回的不是fallback error string) 2018-05-22 10:46:33.835 WARN 9020 --- [nio-8097-exec-9] o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering com.netflix.zuul.exception.ZuulException: null at org.springframework.cloud.netflix.zuul.util.ZuulRuntimeException.<init>(ZuulRuntimeException.java:33) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE] at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:119) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE] Caused by: java.lang.NullPointerException: null at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.forward(RibbonRoutingFilter.java:159) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE] at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:111) ~[spring-cloud-netflix-core-1.4.4.RELEASE.jar:1.4.4.RELEASE] ... 66 common frames omitted 页面返回: { "timestamp": 1526956683342, "status": 500, "error": "Internal Server Error", "exception": "com.netflix.zuul.exception.ZuulException", "message": "No message available" }

求助:Curl返回成功,但显示500错误,内部服务器错误

<div class="post-text" itemprop="text"> <p>我使用 curl 访问 web 服务时,有时会得到响应,但有时会因为内部服务器错误而失败,即使我实际上收到了预期的 xml 文件。问题出在哪?</p> <pre><code>$header = array( "Content-type: text/xml;charset=\"utf-8\"", "Accept: text/xml", "Cache-Control: no-cache", "Pragma: no-cache", "Content-length: ".strlen($send), ); $URL = 'https:ip:port/xxxxx'; $ch = curl_init(); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); curl_setopt($ch, CURLOPT_TIMEOUT, 120); curl_setopt($ch, CURLOPT_URL, $URL ); curl_setopt($ch, CURLOPT_POST, true ); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //array('Content-Type: text/xml')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt($ch, CURLOPT_POSTFIELDS, $send ); //curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13'); try { $result = curl_exec($ch); curl_close($ch); $f = fopen("./Response.xml", "w"); fwrite($f, $result); fclose($f); } catch (Exception $e) { $payments = "&lt;DIV class = 'alert alert-danger'&gt;Failed Transaction. Please try again&lt;/DIV&gt;"; $error = Date("Y-m-d h:i:s")." Error Number:".curl_errno($soap_do)." "; $error .= "Error String:".curl_error($ch)." Matrucule: ".$matricule." ------------------------ "; $f = fopen("./Payment_Error_Log.txt", "w"); fwrite($f, $error); fclose($f); } </code></pre> </div>

POST 500(内部服务器错误)jquery

<div class="post-text" itemprop="text"> <p>Alright , After I made a landing page , I got a problem with the jquery ERROR which I dont get </p> <blockquote> <p>Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://****/contact.blade.php</p> </blockquote> <p>this is contact.blade.php</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;title&gt;landin page&lt;/title&gt; &lt;script type="text/javascript" src="{{ asset('js/jquery-1.11.3.min.js') }}"&gt;&lt;/script&gt; &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt; &lt;script type="text/javascript" src="{{ asset('js/class.FormValidation.js') }}"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="{{asset('js/landin_validation.js' ) }}"&gt;&lt;/script&gt; @include('messages.form_val') @include('messages.form_handler') &lt;/head&gt; &lt;body&gt; </code></pre> </div>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Linux 会成为主流桌面操作系统吗?

整理 |屠敏出品 | CSDN(ID:CSDNnews)2020 年 1 月 14 日,微软正式停止了 Windows 7 系统的扩展支持,这意味着服役十年的 Windows 7,属于...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

学习总结之HTML5剑指前端(建议收藏,图文并茂)

前言学习《HTML5与CSS3权威指南》这本书很不错,学完之后我颇有感触,觉得web的世界开明了许多。这本书是需要有一定基础的web前端开发工程师。这本书主要学习HTML5和css3,看...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

记一次腾讯面试,我挂在了最熟悉不过的队列上……

腾讯后台面试,面试官问:如何自己实现队列?

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

冒泡排序动画(基于python pygame实现)

本项目效果初始截图如下 动画见本人b站投稿:https://www.bilibili.com/video/av95491382 本项目对应github地址:https://github.com/BigShuang python版本:3.6,pygame版本:1.9.3。(python版本一致应该就没什么问题) 样例gif如下 ======================= 大爽歌作,mad

Redis核心原理与应用实践

Redis核心原理与应用实践 在很多场景下都会使用Redis,但是到了深层次的时候就了解的不是那么深刻,以至于在面试的时候经常会遇到卡壳的现象,学习知识要做到系统和深入,不要把Redis想象的过于复杂,和Mysql一样,是个读取数据的软件。 有一个理解是Redis是key value缓存服务器,更多的优点在于对value的操作更加丰富。 安装 yum install redis #yum安装 b...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

立即提问
相关内容推荐