500错误添加数据时报错Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: The current request is not a multipart request

报错:求大神指点
图片说明

jsp代码

//添加一条数据
function addLea(){
//addImg();
//alert("test");
var renttitle1 =$("#renttitle1").val();
var rentarea1 = $("#rentarea1").val();
var areadetail1 = $("#areadetail1").val();
var rentroomType1 = $("#rentroomtype1").val();
var rentroomtype1;
if(rentroomType1==0){
rentroomtype1 = "整租";
}else if(rentroomType1 == 1){
rentroomtype1 = "主卧";
}else if(rentroomType1 == 2){
rentroomtype1 = "次卧";
}
var rentprize1 = $("#rentprize1").val();
var genderRequire1 = $("#genderrequire1").val();
var genderrequire1;
if(genderRequire1==0){
genderrequire1 = "不限男女";
}else if(genderRequire1 == 1){
genderrequire1 = "男";
}else if(genderRequire1 == 2){
genderrequire1 = "女";
}
var rentstartdate1 = $("#rentstartdate1").val();
var rentenddate1 = $("#rentenddate1").val();
var formData = new FormData();
for (var i=0;i<$('#roompictureurl1')[0].files.length;i++){
formData.append('file',$('#roompictureurl1')[0].files[i]);
}
/* console.log(formData.getAll('file')); */
formData.append('renttitle1',renttitle1);
formData.append('rentpublisher1',1004);
formData.append('rentarea1',rentarea1);
formData.append('areadetail1',areadetail1);
formData.append('rentroomtype1',rentroomtype1);
formData.append('rentprize1',rentprize1);
formData.append('genderRequire1',genderRequire1);
formData.append('rentstartdate1',rentstartdate1);
formData.append('rentenddate1',rentenddate1);
$.ajax({

url: '<%=request.getContextPath()%>/insertOne.do',
type: 'post',

data: formData,

dataType:'json',

cache: false,

processData: false,

contentType: 'multipart/form-data',
success : function(data) {
$('#myModal').modal('hide');
$('#back').hide();
$('#sure').hide();
$("#showContent").text('添加成功!');
setTimeout(function () {$('#delModal').modal('show');}, 500);
setTimeout(function () {$("#delModal").modal('hide');}, 1500);
setTimeout(function () {window.location.reload(); },2000);

    }
})

}
点击提交按钮时会报错

1个回答

ajax 请求里携带了图片或文件了吧? 首先确保你的controller方法声明的是可以接受文件流的,然后就是Ajax请求的方式了,参考下这篇 https://blog.csdn.net/ukyu200/article/details/90516999

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Request processing failed
@ResponseBody @RequestMapping("/loginPost") public boolean login(@RequestParam("user")String username,@RequestParam("password")String pwd,Map<String,Object> map,HttpSession session){ System.out.println("------------login"); Personner personner = personnerService.login(username,pwd); if(personner != null){ System.out.println("------------person"); Personner_Role_Organization per = personnerService.queryId(personner.getPs_id()); Personnel_Organization_Role perkkk = personnerService.queryPersonner(personner.getPs_id()); session.setAttribute("ghgh", perkkk); session.setAttribute("personner",personner); session.setAttribute("perroor", per); System.out.println("true------"+true); return true; } return false; } # ## 为什么这段登录代码报错,报这个错,怎么解决 ** Request processing failed; nested exception is java.lang.IllegalArgumentException: No converter found for return value of type: class java.lang.Boolean **
HTTP Status 500 - Request processing failed;
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select group_concat(distinct concat( 'max(if(cname = ''',cname, ' at line 2 ### The error may exist in file [UsercourseMapping.xml] ### The error may involve defaultParameterMap ### The error occurred while setting parameters ### SQL: set @sql = null; select group_concat(distinct concat( 'max(if(cname = ''',cname, ''', score, 0)) as ''', cname, '''' ) ) into @sql from usercourse; set @sql = concat('select uid as 学号, uname as 姓名,sum(score) as 总分, ', @sql, ' from usercourse where bid=1 group by uid '); prepare stmt from @sql; execute stmt; deallocate prepare stmt; ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select group_concat(distinct concat( 'max(if(cname = ''',cname, ' at line 2 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select group_concat(distinct concat( 'max(if(cname = ''',cname, ' at line 2 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:963) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:842) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:827) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:91) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
centos7 Request processing failed; nested exception is com.github.tobato.fastdfs.exception.FdfsIOException: 客户端连接服务端出现了io异常:socket io exception occured while receive
<!doctype html> <html lang="en"> <head> <title>HTTP Status 500 – Internal Server Error</title> <style type="text/css"> h1 { font-family: Tahoma, Arial, sans-serif; color: white; background-color: #525D76; font-size: 22px; } h2 { font-family: Tahoma, Arial, sans-serif; color: white; background-color: #525D76; font-size: 16px; } h3 { font-family: Tahoma, Arial, sans-serif; color: white; background-color: #525D76; font-size: 14px; } body { font-family: Tahoma, Arial, sans-serif; color: black; background-color: white; } b { font-family: Tahoma, Arial, sans-serif; color: white; background-color: #525D76; } p { font-family: Tahoma, Arial, sans-serif; background: white; color: black; font-size: 12px; } a { color: black; } a.name { color: black; } .line { height: 1px; background-color: #525D76; border: none; } </style> </head> <body> <h1>HTTP Status 500 – Internal Server Error</h1> <hr class="line" /> <p><b>Type</b> Exception Report</p> <p><b>Message</b> Request processing failed; nested exception is com.github.tobato.fastdfs.exception.FdfsIOException: 客户端连接服务端出现了io异常:socket io exception occured while receive content</p> <p><b>Description</b> The server encountered an unexpected condition that prevented it from fulfilling the request. </p> <p><b>Exception</b></p> <pre>org.springframework.web.util.NestedServletException: Request processing failed; nested exception is com.github.tobato.fastdfs.exception.FdfsIOException: 客户端连接服务端出现了io异常:socket io exception occured while receive content org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) javax.servlet.http.HttpServlet.service(HttpServlet.java:661) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) com.shiwaixiangcun.core.filters.MonkeyCharacterEncodingFilter.doFilterInternal(MonkeyCharacterEncodingFilter.java:29) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) </pre> <p><b>Root Cause</b></p> <pre>com.github.tobato.fastdfs.exception.FdfsIOException: 客户端连接服务端出现了io异常:socket io exception occured while receive content com.github.tobato.fastdfs.proto.AbstractFdfsCommand.execute(AbstractFdfsCommand.java:48) com.github.tobato.fastdfs.conn.ConnectionManager.execute(ConnectionManager.java:71) com.github.tobato.fastdfs.conn.ConnectionManager.executeFdfsCmd(ConnectionManager.java:56) com.github.tobato.fastdfs.service.DefaultFastFileStorageClient.uploadThumbImage(DefaultFastFileStorageClient.java:166) com.github.tobato.fastdfs.service.DefaultFastFileStorageClient.uploadImageAndCrtThumbImage(DefaultFastFileStorageClient.java:83) com.github.tobato.fastdfs.service.DefaultFastFileStorageClient.uploadImageAndCrtThumbImage(DefaultFastFileStorageClient.java:65) com.shiwaixiangcun.core.plugin.upload.impl.FastdfsFileServiceImpl.uploadImageAndCrtThumbImage(FastdfsFileServiceImpl.java:69) com.shiwaixiangcun.core.plugin.upload.impl.FastdfsFileServiceImpl.store(FastdfsFileServiceImpl.java:56) com.shiwaixiangcun.core.plugin.upload.impl.AbstractFileService.tempImageAndCrtThumbImage(AbstractFileService.java:127) com.shiwaixiangcun.core.plugin.upload.impl.AbstractFileService.tempImageAndCrtThumbImage(AbstractFileService.java:139) com.shiwaixiangcun.core.web.controller.UploadFileController.uploadImages(UploadFileController.java:129) com.shiwaixiangcun.core.web.controller.UploadFileController$$FastClassBySpringCGLIB$$752e37e5.invoke(&lt;generated&gt;) org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) com.shiwaixiangcun.core.context.ControllerAspect.around(ControllerAspect.java:99) sun.reflect.GeneratedMethodAccessor249.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) com.shiwaixiangcun.core.web.controller.UploadFileController$$EnhancerBySpringCGLIB$$8d35bb21.uploadImages(&lt;generated&gt;) sun.reflect.GeneratedMethodAccessor706.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) javax.servlet.http.HttpServlet.service(HttpServlet.java:661) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) com.shiwaixiangcun.core.filters.MonkeyCharacterEncodingFilter.doFilterInternal(MonkeyCharacterEncodingFilter.java:29) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) </pre> <p><b>Root Cause</b></p> <pre>java.net.SocketTimeoutException: Read timed out java.net.SocketInputStream.socketRead0(Native Method) java.net.SocketInputStream.socketRead(SocketInputStream.java:116) java.net.SocketInputStream.read(SocketInputStream.java:171) java.net.SocketInputStream.read(SocketInputStream.java:141) java.net.SocketInputStream.read(SocketInputStream.java:127) com.github.tobato.fastdfs.proto.ProtoHead.createFromInputStream(ProtoHead.java:94) com.github.tobato.fastdfs.proto.AbstractFdfsCommand.receive(AbstractFdfsCommand.java:99) com.github.tobato.fastdfs.proto.AbstractFdfsCommand.execute(AbstractFdfsCommand.java:45) com.github.tobato.fastdfs.conn.ConnectionManager.execute(ConnectionManager.java:71) com.github.tobato.fastdfs.conn.ConnectionManager.executeFdfsCmd(ConnectionManager.java:56) com.github.tobato.fastdfs.service.DefaultFastFileStorageClient.uploadThumbImage(DefaultFastFileStorageClient.java:166) com.github.tobato.fastdfs.service.DefaultFastFileStorageClient.uploadImageAndCrtThumbImage(DefaultFastFileStorageClient.java:83) com.github.tobato.fastdfs.service.DefaultFastFileStorageClient.uploadImageAndCrtThumbImage(DefaultFastFileStorageClient.java:65) com.shiwaixiangcun.core.plugin.upload.impl.FastdfsFileServiceImpl.uploadImageAndCrtThumbImage(FastdfsFileServiceImpl.java:69) com.shiwaixiangcun.core.plugin.upload.impl.FastdfsFileServiceImpl.store(FastdfsFileServiceImpl.java:56) com.shiwaixiangcun.core.plugin.upload.impl.AbstractFileService.tempImageAndCrtThumbImage(AbstractFileService.java:127) com.shiwaixiangcun.core.plugin.upload.impl.AbstractFileService.tempImageAndCrtThumbImage(AbstractFileService.java:139) com.shiwaixiangcun.core.web.controller.UploadFileController.uploadImages(UploadFileController.java:129) com.shiwaixiangcun.core.web.controller.UploadFileController$$FastClassBySpringCGLIB$$752e37e5.invoke(&lt;generated&gt;) org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85) com.shiwaixiangcun.core.context.ControllerAspect.around(ControllerAspect.java:99) sun.reflect.GeneratedMethodAccessor249.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629) org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618) org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656) com.shiwaixiangcun.core.web.controller.UploadFileController$$EnhancerBySpringCGLIB$$8d35bb21.uploadImages(&lt;generated&gt;) sun.reflect.GeneratedMethodAccessor706.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:498) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) javax.servlet.http.HttpServlet.service(HttpServlet.java:661) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) com.shiwaixiangcun.core.filters.MonkeyCharacterEncodingFilter.doFilterInternal(MonkeyCharacterEncodingFilter.java:29) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) </pre> <p><b>Note</b> The full stack trace of the root cause is available in the server logs.</p> <hr class="line" /> <h3>Apache Tomcat/8.5.41</h3> </body> </html> 23000 22122 centos7 端口都开启了一直报错
刚刚学有点懵逼了500 - Request processing failed
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111 ; uncategorized SQLException for SQL []; SQL state [99999]; error code [17004]; 无效的列类型: 1111; nested exception is java.sql.SQLException: 无效的列类型: 1111 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:948) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:648) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) root cause org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #1 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: 无效的列类型: 1111 ; uncategorized SQLException for SQL []; SQL state [99999]; error code [17004]; 无效的列类型: 1111; nested exception is java.sql.SQLException: 无效的列类型: 1111 org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:364) com.sun.proxy.$Proxy8.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43) com.sun.proxy.$Proxy16.loginman(Unknown Source) com.dlsp.dao.impl.UserLoginDaoImpl.loginman(UserLoginDaoImpl.java:23) com.dlsp.controller.PaiMaicontroler.denglu(PaiMaicontroler.java:46) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:648) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) root cause java.sql.SQLException: 无效的列类型: 1111 oracle.jdbc.driver.OracleStatement.getInternalType(OracleStatement.java:3900) oracle.jdbc.driver.OraclePreparedStatement.setNullCritical(OraclePreparedStatement.java:4406) oracle.jdbc.driver.OraclePreparedStatement.setNull(OraclePreparedStatement.java:4388) oracle.jdbc.driver.OraclePreparedStatementWrapper.setNull(OraclePreparedStatementWrapper.java:1281) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:63) com.sun.proxy.$Proxy18.setNull(Unknown Source) org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:39) org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:77) org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:77) org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:58) org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:71) org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:56) org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259) org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:104) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98) org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:62) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:354) com.sun.proxy.$Proxy8.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:159) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43) com.sun.proxy.$Proxy16.loginman(Unknown Source) com.dlsp.dao.impl.UserLoginDaoImpl.loginman(UserLoginDaoImpl.java:23) com.dlsp.controller.PaiMaicontroler.denglu(PaiMaicontroler.java:46) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) java.lang.reflect.Method.invoke(Unknown Source) org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838) javax.servlet.http.HttpServlet.service(HttpServlet.java:648) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
eclipse出现服务器错误500有一天严重的这怎么解决啊,求大佬帮助,错误如下
严重: Servlet.service() for servlet [DispatcherServlet] in context with path [/HotelSSM] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
本地运行.py文件的时候一直提示 ERROR:gcm_channel_status_request.cc(145)] GCM channel request failed
![如图所示,这个是什么问题?](https://img-ask.csdn.net/upload/202002/19/1582104572_703276.png)
PAT乙级1004不使用结构体时全测试点格式错误
初学者,因为无法独自解决此问题,所以想请教一下各位大大 之前有看过论坛里面一些大大写的此题的代码,但是最后的cout语句基本是一样的 所以不太明白格式错误是什么问题导致的... 代码如下(C++语言,提交时编译器为C++(g++)),提交时没有加入注释内容 ``` #include<string> #include<iostream> using namespace std; int main(void) { int n, i, j, max,min; string s[10000];//因为题目只提及n>0 string num[10000];//所以声明了较大的数组 int grade[10000]; cin >> n;//输入学生数量 for (i = 1; i <= n; i++) { cin >> s[i] >> num[i] >> grade[i]; cout << endl; }//依次输入学生信息 max = min = 1; for (j = 1; j <= n; j++) { if (grade[j] > grade[max]) max = j; if (grade[j] < grade[min]) min = j; }//比较成绩的高低 cout << s[max] << " " << num[max] << endl;//最高 cout << s[min] << " " << num[min] << endl;//最低 return 0; } ``` ![提交结果](https://img-ask.csdn.net/upload/202002/22/1582348088_456167.png) 在上面的代码里我并没有使用结构体,这道题是一定要用结构体的吗? 另外还看到有的大大没有在输出最低成绩的行末尾加endl,我尝试之后也是一样的格式错误结果... orz 参考过其他大大的文章: [PAT乙级1004-作者strivinging](https://blog.csdn.net/qq_22194315/article/details/52590854 "") [PAT 1004成绩排序(解决部分正确的原因)-作者linluoluo](https://blog.csdn.net/qq_43228218/article/details/88404911 "") [PAT 1004 成绩排名 (20 分)-fyy_lufan](https://blog.csdn.net/fyy_lufan/article/details/86835946?ops_request_misc=%7B%22request%5Fid%22%3A%22158218671619726867845415%22%2C%22scm%22%3A%2220140713.130056874..%22%7D&request_id=158218671619726867845415&biz_id=0&utm_source=distribute.pc_search_result.none-task "") (主要还是看了这位大大的文章才考虑不用结构体) 提前感谢各位大大的解答!
解決element-admin 模板 登錄報405問題request failed with status code 405
![图片说明](https://img-ask.csdn.net/upload/201912/27/1577435456_116169.jpg) request failed with status code 405 需要將main.js 的環境設置為development就可以啦 因為clone下來的模板是請求到production 中 ``` import { mockXHR } from '../mock' if (process.env.NODE_ENV === 'development') { mockXHR() } ```
跨域请求:Proxy error: Could not proxy request 时不时的报这个错误,不知道为啥?
最近在做毕设,前端用的react,后台是node+express+mongodb,接口都写 好了,postman测试也没问题,因为项目里有聊天的功能,所以加入了websocket 进行即时聊天,后台的接口是locahost:4000,socket也是,可就在调接口的时候 浏览器一直报Proxy error,前期一直以为跨域设置的问题,看了很多文档,试了 很多,感觉应该不是跨域的问题,后来又去查是不是端口被占用,发现4000端口 就是我用的浏览器和node在占用,没有别的程序占用,停止了再重启服务器和 客户端还是没用, 重点来了:1.每次开机时,启动项目后,数据调用一切正常 可只要我退出登录再重新登录的时候,就又有很多的500错误proxy error; 2.就是当我某个用户在浏览器上一直处于登录着的状态时,过一段时间后,它就又可以愉快的调数据了,无报错 我试过把后台的连接socket的端口改为了5000,还是不行,我感觉可能是重新登录后,项目是不是又重新连接了服务器啥的,导致端口被占用,所以总是报500 错误,想问下各位大佬,有没有遇到过这种问题,总结一下就是:接口时好时坏, 总是有proxy error的错误,难受我好几天了。。。个人感觉不是前端跨域的问题,求各位大佬出来帮小弟 指点迷津啊,在此感激不尽啊!!! ![图片说明](https://img-ask.csdn.net/upload/202002/12/1581490300_538416.png) ![图片说明](https://img-ask.csdn.net/upload/202002/12/1581490314_869475.png)
unittest,selenium驱动浏览器的时候,浏览器只能打开一次是什么问题????、?
源码: ``` from selenium import webdriver driver=webdriver.Chrome() import unittest class Test_selenium(unittest.TestCase): def setUp(self) -> None: driver.get('https://cn.bing.com/') def tearDown(self) -> None: driver.quit() def test_add1(self): pass def test_add2(self): pass if __name__ == '__main__': unittest.main() ``` 报错信息 ``` Testing started at 20:40 ... E:\GitHub\Web_Framework\venv\Scripts\python.exe "E:\Program Files\JetBrains\PyCharm Community Edition 2019.2.5\helpers\pycharm\_jb_unittest_runner.py" --target test1.Test_selenium Launching unittests with arguments python -m unittest test1.Test_selenium in E:\GitHub\Python_Study\20200221 Error Traceback (most recent call last): File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connection.py", line 156, in _new_conn conn = connection.create_connection( File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection raise err File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connectionpool.py", line 665, in urlopen httplib_response = self._make_request( File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connectionpool.py", line 387, in _make_request conn.request(method, url, **httplib_request_kw) File "E:\Program Files\Python\Python3.8\lib\http\client.py", line 1230, in request self._send_request(method, url, body, headers, encode_chunked) File "E:\Program Files\Python\Python3.8\lib\http\client.py", line 1276, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "E:\Program Files\Python\Python3.8\lib\http\client.py", line 1225, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "E:\Program Files\Python\Python3.8\lib\http\client.py", line 1004, in _send_output self.send(msg) File "E:\Program Files\Python\Python3.8\lib\http\client.py", line 944, in send self.connect() File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connection.py", line 184, in connect conn = self._new_conn() File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connection.py", line 168, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x0000020FBA782100>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:\Program Files\Python\Python3.8\lib\unittest\case.py", line 60, in testPartExecutor yield File "E:\Program Files\Python\Python3.8\lib\unittest\case.py", line 672, in run self._callSetUp() File "E:\Program Files\Python\Python3.8\lib\unittest\case.py", line 630, in _callSetUp self.setUp() File "E:\GitHub\Python_Study\20200221\test1.py", line 8, in setUp driver.get('https://cn.bing.com/') File "E:\Program Files\Python\Python3.8\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get self.execute(Command.GET, {'url': url}) File "E:\Program Files\Python\Python3.8\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 319, in execute response = self.command_executor.execute(driver_command, params) File "E:\Program Files\Python\Python3.8\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 374, in execute return self._request(command_info[0], url, body=data) File "E:\Program Files\Python\Python3.8\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 397, in _request resp = self._conn.request(method, url, body=body, headers=headers) File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\request.py", line 79, in request return self.request_encode_body( File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\request.py", line 171, in request_encode_body return self.urlopen(method, url, **extra_kw) File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\poolmanager.py", line 330, in urlopen response = conn.urlopen(method, u.request_uri, **kw) File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen return self.urlopen( File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen return self.urlopen( File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connectionpool.py", line 747, in urlopen return self.urlopen( File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\connectionpool.py", line 719, in urlopen retries = retries.increment( File "E:\Program Files\Python\Python3.8\lib\site-packages\urllib3\util\retry.py", line 436, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=13604): Max retries exceeded with url: /session/5a91f5a3ba7b7efd9309a569fffeeb9d/url (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000020FBA782100>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。')) Assertion failed Ran 2 tests in 12.993s FAILED (errors=1) Process finished with exit code 1 Assertion failed Assertion failed ```
简单vue+springboot的多条件查询问题(数据回显不会写,求教)
## 前言 想做个放吉他谱的小网站,sprigboot+vue, my=民谣 ## 现在想完成的功能: 根据谱名/作者名查询出来回显到下方列表中(url:my/findMys) ![图片说明](https://img-ask.csdn.net/upload/202002/22/1582302704_47317.png) + 已完成部分:后端逻辑已经写好,且本地测试成功 ![图片说明](https://img-ask.csdn.net/upload/202002/22/1582302896_218033.png) 测试 ![图片说明](https://img-ask.csdn.net/upload/202002/22/1582302983_38465.png) --- ## 不会的部分求解 + 前端vue部分 (axios已经封装) my.api (条件查询方法不知道有没有写错) ~~~js import request from "@/utils/request" export default { // 分页获取列表 search(page, size) { return request({ url: `/my/list/search/${page - 1}/${size}`, method: 'post', // data: searchMap }) }, // 上方根据曲名和作者名模糊查询 findMys(searchMap) { return request({ url: `/my/findMys`, method: 'post', data: searchMap }) } } ~~~ + my.vue(就是这不会写,那个搜索方法) ~~~js <!-- 上方区域 --------------------------------------------------------------------------> <el-form ref="searchForm" :inline="true" :model="searchMap" style="margin-top: 20px;margin-left:70px"> <el-form-item prop="name"> <el-input v-model="searchMap.name" placeholder="曲谱名称" style="width: 200px;"></el-input> </el-form-item> <el-form-item prop="author"> <el-input v-model="searchMap.author" placeholder="作者名称" style="width:200px;"></el-input> </el-form-item> <el-form-item> <el-button type="success" icon="el-icon-search" circle @click="findMys"></el-button> <el-button type="info" round @click="resetForm('searchForm')">重置</el-button> <!-- <el-button type="warning" round icon="el-icon-circle-plus-outline" @click="handleAdd">新增</el-button> --> </el-form-item> </el-form> ~~~ ~~~js <script> import myApi from "@/api/my"; export default { data() { return { list: [], total: 0, // 总记录数 currentPage: 1, // 当前页, 默认第1页 pageSize: 10, // 每页显示条数, 10条 searchMap: { name: "", author: "" }, }; }, // 钩子函数获取数据 created() { this.fetchData(); }, methods: { //列表获取 fetchData() { myApi .search(this.currentPage, this.pageSize) .then(response => { // const resp = response.data; const resp = response.data; this.total =resp.totalElements; // this.total =resp.total; this.list = resp.content; // console.log(this.list); console.log(response) }); }, // 上方查询 findMys(){ myApi.findMys (this.searchMap).then(response => { const resp = response.data.data; // this.name =resp.name; // this.author = resp.author; this.searchMap = resp.content; console.log(response) }); }, //分页改变 handleSizeChange(val) { this.pageSize = val; this.fetchData(); }, //分页改变 handleCurrentChange(val) { this.currentPage = val; this.fetchData(); }, // 表单重置, // 在 el-form-item 标签属性 prop 上, 指定了字段名, 重置才会生效 resetForm(formName) { this.$refs[formName].resetFields(); }, } }; </script> ~~~ ## api定义了findMys方法,vue文件中调用方法,然后回显到下方列表 ## api和vue里的方法瞎写的, --- # 请大佬指点,my.api和my.vue文件的方法怎么写
关于使用macvlan网络连通不同host上挂载不同vlan网络的到哦才可瑞容器之前无法ping通的问题
所做的使用macvlan网络不同host不同vlan上的docker主机之间通信实验内容如下网址所示https://www.cnblogs.com/CloudMan6/p/7400580.html 使用了一个物理主机作为虚拟路由器,确认了net.ipv4.ip\_forwad = 1,添加了两块vlan虚拟网口.10和.20(vboxnet0.10和vboxnet0.20),并且如实验内容所示设置了iptables规则。两个虚拟机上都添加了一块host-only网卡并设置了混杂模式为全部允许。最后用host2上的容器bbox4(172.16.20.11)去ping另一个host上的bbox1(172.16.10.10)时发现ping不同。通过tcpdump在物理主机上监视网口vboxnet0.10和vboxnet0.20时监视到了ping的request请求但是没有回复,如下所示 ``` tcpdump -i vboxnet0.10 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on vboxnet0.10, link-type EN10MB (Ethernet), capture size 262144 bytes 16:50:21.695134 IP 172.16.10.1 > 172.16.10.10: ICMP echo request, id 22016, seq 0, length 64 16:50:22.696067 IP 172.16.10.1 > 172.16.10.10: ICMP echo request, id 22016, seq 1, length 64 16:50:23.697093 IP 172.16.10.1 > 172.16.10.10: ICMP echo request, id 22016, seq 2, length 64 16:50:24.698213 IP 172.16.10.1 > 172.16.10.10: ICMP echo request, id 22016, seq 3, length 64 16:50:26.695480 ARP, Request who-has 172.16.10.10 tell 172.16.10.1, length 28 16:50:26.696233 ARP, Reply 172.16.10.10 is-at 02:42:ac:10:0a:0a (oui Unknown), length 46 ``` ``` tcpdump -i vboxnet0.20 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on vboxnet0.20, link-type EN10MB (Ethernet), capture size 262144 bytes 16:52:02.183159 IP 172.16.20.11 > 172.16.10.10: ICMP echo request, id 23296, seq 0, length 64 16:52:03.183624 IP 172.16.20.11 > 172.16.10.10: ICMP echo request, id 23296, seq 1, length 64 16:52:04.184620 IP 172.16.20.11 > 172.16.10.10: ICMP echo request, id 23296, seq 2, length 64 16:52:05.185323 IP 172.16.20.11 > 172.16.10.10: ICMP echo request, id 23296, seq 3, length 64 16:52:07.191131 ARP, Request who-has 172.16.20.1 tell 172.16.20.11, length 46 16:52:07.191146 ARP, Reply 172.16.20.1 is-at 0a:00:27:00:00:00 (oui Unknown), length 28 ``` 请问有没有大神帮忙看看问题可能出在哪儿?(实验步骤完全按照https://www.cnblogs.com/CloudMan6/p/7400580.html)
django➕dwebsocket➕nginx报错301怎么解决?
最近在做网站的站内消息,使用的django➕dwebsocket➕nginx 但是在上到服务器的时候,访问建立连接的函数,报错301永久重定向了,我nginx也配置了。但是就是连接不上。 ``` nginx配置如下 server { listen 80 default_server; listen [::]:80 default_server; server_name _; # gzip config gzip on; gzip_min_length 1k; gzip_comp_level 9; gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; gzip_vary on; gzip_disable "MSIE [1-6]\."; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location /api { rewrite ^/api/(.*)$ /$1 break; proxy_pass http://39.97.166.114:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_connect_timeout 60; proxy_read_timeout 600; proxy_send_timeout 600; } ``` ``` 后台代码 clients = [] @accept_websocket def echo(request): if request.is_websocket: try: clients.append(request.websocket) print(clients) for message in request.websocket: print(message) me = eval(message) # 将字符串类型的消息转换为字典型 print(type(me)) print(me["name"]) me['id']=1 me['username']=2 print(me) # print(request.websocket.count_messages()) if not message: break for client in clients: # print(client.count_messages()) print(client) # print(client.has_messages()) client.send(message) finally: clients.remove(request.websocket) ``` ``` 前端代码 <!DOCTYPE html> <html> <head> <title>django-websocket</title> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script type="text/javascript">//<![CDATA[ $(function () { //创建WebSocket对象获得连接 $('#connect_websocket').click(function () { if(window.websocket){ window.websocket.close() } var websocket = new WebSocket("ws://saas111.com/api/user/echo"); websocket.onopen = function () { console.log('WebSocket open'); }; websocket.onmessage = function (responseData) { console.log('message: ' + responseData.data);//浏览器控制台打印返回的数据 var jsondata = eval('(' + responseData.data + ')'); //将返回的数据转换为json对象 $('#messagecontainer').prepend('<p>' + jsondata.name + '</p>'); //展示数据 }; window.websocket = websocket; }); //发送消息 $('#send_message').click(function () { if(!window.websocket){ alert("Please connect server."); }else{ {# window.s.send($('#message').val());#} //发送字符串数据类型 window.websocket.send(JSON.stringify({"name":$('#message').val()}));//发送json数据类型 } }); //关闭websocket连接 $('#close_websocket').click(function () { if(window.websocket){ window.websocket.close(); } }); }); //]]></script> </head> <body> <br> <input type="text" id="message" value="Hello, World!" /> <button type="button" id="connect_websocket">连接websocket</button> <button type="button" id="send_message">发送消息</button> <button type="button" id="close_websocket">关闭websocket</button> <h1>接收消息</h1> <div id="messagecontainer"> </div> </body> </html> ```
score = li.xpath('@data-score')[0] IndexError: list index out of range 报错,如何解决
import requests from lxml import etree from urllib import request headers = { 'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.87 Safari/537.36', 'Referer': 'https://movie.douban.com/' } url = 'https://movie.douban.com/cinema/nowplaying/zhengzhou/' response = requests.get(url,headers=headers) text = response.text html = etree.HTML(text) ul = html.xpath("//ul[@class='lists']")[0] lis = ul.xpath("./li") fns_num = 1 num = len(lis) for li in lis: title = li.xpath('@data-title')[0] score = li.xpath('@data-score')[0] poster = li.xpath('.//img/@src')[0] request.urlretrieve(poster, 'D:/A/' + score + title + '.jpg') print("\r完成进度: {:.2f}%".format(fns_num * 100 / num), end="") fns_num += 1
android studio 调用 webservice 莫名闪退
编译的APP,电机按钮就会闪退! 下面是代码,求助看看有没有问题! ``` package com.zt.lesson2_4; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.TextView; import android.widget.Button; import android.widget.EditText; import android.view.View.OnClickListener; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; import android.os.AsyncTask; import java.util.regex.Matcher; import java.util.regex.Pattern; public class MainActivity extends AppCompatActivity { private String result1; private TextView textView1; private TextView textView2; private TextView textView3; private EditText editText1; private Button button1; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView1=(TextView)findViewById(R.id.textView2 ); textView2=(TextView)findViewById(R.id.textView4 ); textView3=(TextView)findViewById(R.id.textView6 ); editText1=(EditText)findViewById(R.id.editText); button1=(Button)findViewById(R.id.button); button1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { QueryTask newQuery=new QueryTask(); newQuery.execute(editText1.getText().toString()); } }); } private class QueryTask extends AsyncTask<String,Integer,String>{ @Override protected String doInBackground(String... params) { try{ getRemoteInfo(params[0]); } catch (Exception e){ e.printStackTrace(); } return null; } @Override protected void onPostExecute(String result) { textView3.setText("返回数据是:\n\r" + result1); Pattern pattern1 = Pattern.compile("string=(.+?);"); Matcher matcher1 = pattern1.matcher(result1); int j = 0; String[] strings = new String[5]; while (matcher1.find()) { strings[j] = matcher1.group(); j = j + 1; } textView1.setText(strings[3].substring(7)); textView2.setText(strings[1].substring(7)); } } private void getRemoteInfo(String en_word) throws Exception{ String Target_URI = "http://fy.webxml.com.cn/webservices/EnglishChinese.asmx"; String namespace = "http://WebXml.com.cn/";//namespace String methodName = "TranslatorString";//要调用的方法名称TranslatorString SoapObject request = new SoapObject(namespace, methodName); // 设置需调用WebService接口需要传入的参数wordKey request.addProperty("wordKey", en_word); //创建SoapSerializationEnvelope 对象,同时指定soap版本号 SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapSerializationEnvelope.VER12); envelope.bodyOut = request;//由于是发送请求,所以是设置bodyOut envelope.dotNet = true; HttpTransportSE httpTransportSE = new HttpTransportSE(Target_URI); httpTransportSE.call(null, envelope);//调用 // 获取返回的数据 SoapObject object = (SoapObject) envelope.bodyIn; // 获取返回的结果 result1 = object.getProperty(0).toString(); } } ```
javaMail发邮件报错,网上说的是两个包冲突
发送邮件报错 HTTP Status 500 - Request processing failed; nested exception is java.lang.UnsupportedOperationException: Method not yet implemented
小白请问这串代码哪里出了问题?为什么不能将图片储存进手机?
``` ```photo_button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { checkPermission_Camera(); //Action here } }); ``` ```private void checkPermission_Camera(){ RxPermissions rxPermissions = new RxPermissions(ObjectInformationActivity.this); rxPermissions.request(android.Manifest.permission.CAMERA) .subscribe(new io.reactivex.functions.Consumer<Boolean>() { @Override public void accept(Boolean aBoolean) throws Exception { if (aBoolean) { // 用户已经同意该权限 takePhoto(); } else { // 用户拒绝了该权限,并且选中『不再询问』 ToastUtils.showLong(getResources().getString(R.string.ask_for_permission)); } } }); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode==RESULT_OK&&requestCode==REQUEST_CODE_CAMERA) { Toast.makeText(this, "保存照片成功", Toast.LENGTH_SHORT).show(); Bitmap bitmap =(Bitmap) Objects.requireNonNull(data.getExtras()).get("data"); picture_of_object.setImageBitmap(bitmap); } super.onActivityResult(requestCode, resultCode, data); }} ``` ``` ``` private void takePhoto(){ //初始化照片路径 Intent intent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File file = new File(getExternalFilesDir(null)+File.separator+"myPicture"); if(!file.exists()){ file.mkdirs(); } String pictureName =new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())+".jpg"; File saveFile= new File(file,pictureName); uri = FileProvider.getUriForFile(this,"univ.buaa.icabinet.activity",saveFile); intent.putExtra(MediaStore.EXTRA_OUTPUT,uri);//根据这个uri保存照片 startActivityForResult(intent,REQUEST_CODE_CAMERA);//结果返回onActivityResult函数 } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(resultCode==RESULT_OK&&requestCode==REQUEST_CODE_CAMERA) { Toast.makeText(this, "保存照片成功", Toast.LENGTH_SHORT).show(); Bitmap bitmap =(Bitmap) Objects.requireNonNull(data.getExtras()).get("data"); picture_of_object.setImageBitmap(bitmap); } super.onActivityResult(requestCode, resultCode, data); }} ```
Servlet3.0注释 写入代码后无法找到Servlet报404错误
Servlet3.0注释 : 在这个Servlet写入些简单的代码可以找到这个Servlet. (response.getWriter().print("简单的代码")) 如果在这个Servlet中创建些对象调用这个Servlet 就会报404错误: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { /** * 调用业务层: * 页面跳转: */ try { // 调用业务层: ProductFindService productService = new ProductFindService(); List<Product> list = productService.findall(); // 页面跳转: request.setAttribute("list", list); request.getRequestDispatcher("/ProductCUID/product.jsp").forward(request, response); } catch (Exception e) { // TODO: handle exception } } 尝试过去掉注释 然后自己配置web.xml就会报java.lang.ClassfounException错误 小弟感激不尽感激涕零感慨万分感谢 (* ̄︶ ̄)
javaweb插入数据失败,无返回值,但没有报错是怎么回事
问题应该出在在dao层,断点打过setObject也没异常,是怎么回事? public int addNews(News n) { int count = -1; String sql = "insert into news values(@,?,?,?,?)"; Connection conn = null; PreparedStatement pstmt = null; conn = DBUtil.getConn(); try { pstmt = conn.prepareStatement(sql); pstmt.setObject(1, n.getTitle()); pstmt.setObject(2, n.getContent()); pstmt.setObject(3, n.getDate()); pstmt.setObject(3, n.getType()); count = pstmt.executeUpdate(); } catch (Exception e) { // TODO: handle exception }finally{ DBUtil.closeAll(conn, pstmt, null); } return count; } dbutil在其他serlvet中连接正常 private static String driver = "com.mysql.jdbc.Driver"; private static String url = "jdbc:mysql://localhost:3306/on?useUnicode=true&characterEncoding=utf-8&useAffectRows=true"; private static String user = "root"; private static String password = "123456"; 前端的值也能拿过来 String title = request.getParameter("title"); String content =request.getParameter("content"); String date =request.getParameter("date"); String type =request.getParameter("type"); News n=new News(title,content,date,type); System.out.print(n.getTitle()); System.out.print(n.getContent()); System.out.print(n.getDate()); System.out.print(n.getType()); int addNews = NewsService.addNews(n); System.out.println(addNews); request.getRequestDispatcher("index").forward(request, response); }
动态规划入门到熟悉,看不懂来打我啊
持续更新。。。。。。 2.1斐波那契系列问题 2.2矩阵系列问题 2.3跳跃系列问题 3.1 01背包 3.2 完全背包 3.3多重背包 3.4 一些变形选讲 2.1斐波那契系列问题 在数学上,斐波纳契数列以如下被以递归的方法定义:F(0)=0,F(1)=1, F(n)=F(n-1)+F(n-2)(n&gt;=2,n∈N*)根据定义,前十项为1, 1, 2, 3...
程序员,职场上请远离这种人!
对有些职场人来讲,甩锅就是一种生存手段。01.从大学打篮球说起上大学的时候喜欢打篮球,然后我又特别喜欢抢篮板,经常是跳起来的时候没事,落下来的时候偶尔会踩到别人的脚上,于...
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私...
对计算机专业来说学历真的重要吗?
我本科学校是渣渣二本,研究生学校是985,现在毕业五年,校招笔试、面试,社招面试参加了两年了,就我个人的经历来说下这个问题。 这篇文章很长,但绝对是精华,相信我,读完以后,你会知道学历不好的解决方案,记得帮我点赞哦。 先说结论,无论赞不赞同,它本质就是这样:对于技术类工作而言,学历五年以内非常重要,但有办法弥补。五年以后,不重要。 目录: 张雪峰讲述的事实 我看到的事实 为什么会这样 ...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch, ...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
一个读研让我损失了一百万的真实故事
关注我!只要10分钟,包你学会数据分析 毕业后,应该就业还是考研? 我刚出国留学那会儿,就惊讶的发现,外国local95%都不会选择读研 他们说,硕士学费很贵,时间宝贵,老板不认,所以很费 当几乎所有人都是本科学历时,硕士学历反而像个异类 在老板眼里,三年硕士远远不如3年的工作经验实用 他们甚至专门为拒绝高学历者发明了一个词,叫overoccupie...
Python 植物大战僵尸代码实现(2):植物卡片选择和种植
这篇文章要介绍的是: - 上方植物卡片栏的实现。 - 点击植物卡片,鼠标切换为植物图片。 - 鼠标移动时,判断当前在哪个方格中,并显示半透明的植物作为提示。
西游记团队中如果需要裁掉一个人,会先裁掉谁?
2019年互联网寒冬,大批企业开始裁员,下图是网上流传的一张截图: 裁员不可避免,那如何才能做到不管大环境如何变化,自身不受影响呢? 我们先来看一个有意思的故事,如果西游记取经团队需要裁员一名,会裁掉谁呢,为什么? 西游记团队组成: 1.唐僧 作为团队teamleader,有很坚韧的品性和极高的原则性,不达目的不罢休,遇到任何问题,都没有退缩过,又很得上司支持和赏识(直接得到唐太宗的任命,既给
shell脚本:备份数据库、代码上线
备份MySQL数据库 场景: 一台MySQL服务器,跑着5个数据库,在没有做主从的情况下,需要对这5个库进行备份 需求: 1)每天备份一次,需要备份所有的库 2)把备份数据存放到/data/backup/下 3)备份文件名称格式示例:dbname-2019-11-23.sql 4)需要对1天以前的所有sql文件压缩,格式为gzip 5)本地数据保留1周 6)需要把备份的数据同步到远程备份中心,假如...
聊聊C语言和指针的本质
坐着绿皮车上海到杭州,24块钱,很宽敞,在火车上非正式地聊几句。 很多编程语言都以 “没有指针” 作为自己的优势来宣传,然而,对于C语言,指针却是与生俱来的。 那么,什么是指针,为什么大家都想避开指针。 很简单, 指针就是地址,当一个地址作为一个变量存在时,它就被叫做指针,该变量的类型,自然就是指针类型。 指针的作用就是,给出一个指针,取出该指针指向地址处的值。为了理解本质,我们从计算机模型说起...
为什么你学不过动态规划?告别动态规划,谈谈我的经验
动态规划难吗?说实话,我觉得很难,特别是对于初学者来说,我当时入门动态规划的时候,是看 0-1 背包问题,当时真的是一脸懵逼。后来,我遇到动态规划的题,看的懂答案,但就是自己不会做,不知道怎么下手。就像做递归的题,看的懂答案,但下不了手,关于递归的,我之前也写过一篇套路的文章,如果对递归不大懂的,强烈建议看一看:为什么你学不会递归,告别递归,谈谈我的经验 对于动态规划,春招秋招时好多题都会用到动态...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
字节跳动面试官这样问消息队列:分布式事务、重复消费、顺序消费,我整理了一下
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
如何安装 IntelliJ IDEA 最新版本——详细教程
IntelliJ IDEA 简称 IDEA,被业界公认为最好的 Java 集成开发工具,尤其在智能代码助手、代码自动提示、代码重构、代码版本管理(Git、SVN、Maven)、单元测试、代码分析等方面有着亮眼的发挥。IDEA 产于捷克,开发人员以严谨著称的东欧程序员为主。IDEA 分为社区版和付费版两个版本。 我呢,一直是 Eclipse 的忠实粉丝,差不多十年的老用户了。很早就接触到了 IDEA...
面试还搞不懂redis,快看看这40道面试题(含答案和思维导图)
Redis 面试题 1、什么是 Redis?. 2、Redis 的数据类型? 3、使用 Redis 有哪些好处? 4、Redis 相比 Memcached 有哪些优势? 5、Memcache 与 Redis 的区别都有哪些? 6、Redis 是单进程单线程的? 7、一个字符串类型的值能存储最大容量是多少? 8、Redis 的持久化机制是什么?各自的优缺点? 9、Redis 常见性...
大学四年自学走来,这些珍藏的「实用工具/学习网站」我全贡献出来了
知乎高赞:文中列举了互联网一线大厂程序员都在用的工具集合,涉及面非常广,小白和老手都可以进来看看,或许有新收获。
为什么要推荐大家学习字节码?
配套视频: 为什么推荐大家学习Java字节码 https://www.bilibili.com/video/av77600176/ 一、背景 本文主要探讨:为什么要学习 JVM 字节码? 可能很多人会觉得没必要,因为平时开发用不到,而且不学这个也没耽误学习。 但是这里分享一点感悟,即人总是根据自己已经掌握的知识和技能来解决问题的。 这里有个悖论,有时候你觉得有些技术没用恰恰是...
【超详细分析】关于三次握手与四次挥手面试官想考我们什么?
在面试中,三次握手和四次挥手可以说是问的最频繁的一个知识点了,我相信大家也都看过很多关于三次握手与四次挥手的文章,今天的这篇文章,重点是围绕着面试,我们应该掌握哪些比较重要的点,哪些是比较被面试官给问到的,我觉得如果你能把我下面列举的一些点都记住、理解,我想就差不多了。 三次握手 当面试官问你为什么需要有三次握手、三次握手的作用、讲讲三次三次握手的时候,我想很多人会这样回答: 首先很多人会先讲下握...
压测学习总结(1)——高并发性能指标:QPS、TPS、RT、吞吐量详解
一、QPS,每秒查询 QPS:Queries Per Second意思是“每秒查询率”,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。互联网中,作为域名系统服务器的机器的性能经常用每秒查询率来衡量。 二、TPS,每秒事务 TPS:是TransactionsPerSecond的缩写,也就是事务数/秒。它是软件测试结果的测量单位。一个事务是指一...
新程序员七宗罪
当我发表这篇文章《为什么每个工程师都应该开始考虑开发中的分析和编程技能呢?》时,我从未想到它会对读者产生如此积极的影响。那些想要开始探索编程和数据科学领域的人向我寻求建议;还有一些人问我下一篇文章的发布日期;还有许多人询问如何顺利过渡到这个职业。我非常鼓励大家继续分享我在这个旅程的经验,学习,成功和失败,以帮助尽可能多的人过渡到一个充满无数好处和机会的职业生涯。亲爱的读者,谢谢你。 -罗伯特。 ...
2019年Spring Boot面试都问了什么?快看看这22道面试题!
Spring Boot 面试题 1、什么是 Spring Boot? 2、Spring Boot 有哪些优点? 3、什么是 JavaConfig? 4、如何重新加载 Spring Boot 上的更改,而无需重新启动服务器? 5、Spring Boot 中的监视器是什么? 6、如何在 Spring Boot 中禁用 Actuator 端点安全性? 7、如何在自定义端口上运行 Sprin...
【图解】记一次手撕算法面试:字节跳动的面试官把我四连击了
字节跳动这家公司,应该是所有秋招的公司中,对算法最重视的一个了,每次面试基本都会让你手撕算法,今天这篇文章就记录下当时被问到的几个算法题,并且每个算法题我都详细着给出了最优解,下面再现当时的面试场景。看完一定让你有所收获 一、小牛试刀:有效括号 大部分情况下,面试官都会问一个不怎么难的问题,不过你千万别太开心,因为这道题往往可以拓展出更多有难度的问题,或者一道题看起来很简单,但是给出最优解,确实很...
面试官:关于Java性能优化,你有什么技巧
通过使用一些辅助性工具来找到程序中的瓶颈,然后就可以对瓶颈部分的代码进行优化。 一般有两种方案:即优化代码或更改设计方法。我们一般会选择后者,因为不去调用以下代码要比调用一些优化的代码更能提高程序的性能。而一个设计良好的程序能够精简代码,从而提高性能。 下面将提供一些在JAVA程序的设计和编码中,为了能够提高JAVA程序的性能,而经常采用的一些方法和技巧。 1.对象的生成和大小的调整。 J...
【图解算法面试】记一次面试:说说游戏中的敏感词过滤是如何实现的?
版权声明:本文为苦逼的码农原创。未经同意禁止任何形式转载,特别是那些复制粘贴到别的平台的,否则,必定追究。欢迎大家多多转发,谢谢。 小秋今天去面试了,面试官问了一个与敏感词过滤算法相关的问题,然而小秋对敏感词过滤算法一点也没听说过。于是,有了下下事情的发生… 面试官开怼 面试官:玩过王者荣耀吧?了解过敏感词过滤吗?,例如在游戏里,如果我们发送“你在干嘛?麻痹演员啊你?”,由于“麻痹”是一个敏感词,...
GitHub 标星 1.6w+,我发现了一个宝藏项目,作为编程新手有福了!
大家好,我是 Rocky0429,一个最近老在 GitHub 上闲逛的蒟蒻… 特别惭愧的是,虽然我很早就知道 GitHub,但是学会逛 GitHub 的时间特别晚。当时一方面是因为菜,看着这种全是英文的东西难受,不知道该怎么去玩,另一方面是一直在搞 ACM,没有做一些工程类的项目,所以想当然的以为和 GitHub 也没什么关系(当然这种想法是错误的)。 后来自己花了一个星期看完了 Pyt...
杭漂程序员2019的心路历程,还不起助学贷款,交不起房租,披荆斩棘终雨过天晴
一个杭漂2019的心酸历程,一路披荆斩棘终于还是雨过天晴。
我采访了同事,让他掏出了每天都会浏览的干货网站
前言只有光头才能变强。文本已收录至我的GitHub精选文章,欢迎Star:https://github.com/ZhongFuCheng3y/3y在周六的晚上,我日常去到公司写文章。想写...
相关热词 c#时间格式化 不带- c#替换字符串中指定位置 c# rdlc 动态报表 c# 获取txt编码格式 c#事件主动调用 c#抽象工厂模式 c# 如何添加类注释 c# static块 c#处理浮点数 c# 生成字母数字随机数
立即提问

相似问题

2
ssm框架 将数据从数据库显示在jsp上报错
2
axios请求报错 Error: Request failed with status code 404
1
dubbo,zookeeper的报错, Failed to invoke the method doLogin
2
springboot 上传文件时报错
3
实例化合约报错:chaincode registration failed
5
SpringMVC+ajax上传文件+提交表单数据报错The current request is not a multipart request
1
springboot mybatis atomikos 事务超时未提交 求解
1
SSM上传文件时报Required request part 'file' is not present
1
Mac os SSM框架链接数据库出现问题
2
在线等!!!linux服务器连接mysql5.7数据库报错 Could not get JDBC Connection; nested exception is com.alibaba.druid.pool.GetConnectionTimeoutException
1
安卓开发JDBC连接数据库No static method metafactory错误怎么解决?
2
(Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:618)'),)) ssl618错误代表什么?
1
从svn考到笔记本上报错,考到另一台式电脑不报错,笔记本重启、新建eclipse工作环境、配置还是出现以下问题,不知道原因,是不是电脑问题?哪位大佬解决下?
1
python+request创建cookies对象报错
1
springboot项目,在linux上,上传文件(导入word、excel文档)时报错SocketTimeoutException:null ;在本地正常,怎么解决?
2
单点登陆时报这个错,求大佬解答
1
使用gesim.downloader.load()加载数据集出现URLError
1
vue axios发送post请求 数据为Form Data格式,怎么设置成Request Payload的json数据格式
1
boot客户管理系统登录报错HTTP Status 500 – Internal Server Error
2
微信小程序本地测试没问题,体验版没问题,审核时报错被驳回