JS加载websocket 报错 500 (Internal Server Error)

我用

的方式可以初始化websocket .
但是$(function(){ initWebSocket();})这种方式就会报错.
GET http://127.0.0.1/xiangmumingzi/controller/index?bussinessURLPara= 500 (Internal Server Error)
这是什么原因呢.
body onload和$(function()有什么区别.jsp页面的加载顺序是怎样的...求大神解答

3个回答

至今原因不明。都说是头写的不标准。但是跟其他地方是一样的。

<!-- onload="initWebSocket()" --> 这种方式可以初始化.我的天,竟然被解析了.

管理员在吗,你们网站有Bug啊.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
高并发下出现错误。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转发原因出现,访问不到连接报错。
boot客户管理系统登录报错HTTP Status 500 – Internal Server Error
HTTP Status 500 – Internal Server Error Type 异常报告 消息 Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 描述 服务器遇到一个意外的情况,阻止它完成请求。 Exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) ### The error may exist in com/ssm/core/dao/UserDao.xml ### The error may involve com.ssm.core.dao.UserDao.findUser ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) 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:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) Root Cause org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) ### The error may exist in com/ssm/core/dao/UserDao.xml ### The error may involve com.ssm.core.dao.UserDao.findUser ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) com.sun.proxy.$Proxy16.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) com.sun.proxy.$Proxy22.findUser(Unknown Source) com.ssm.core.service.impl.UserServiceImpl.findUser(UserServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 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.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy23.findUser(Unknown Source) com.ssm.core.web.controller.UserController.login(UserController.java:28) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) 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:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) Root Cause org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) ### The error may exist in com/ssm/core/dao/UserDao.xml ### The error may involve com.ssm.core.dao.UserDao.findUser ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) com.sun.proxy.$Proxy16.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) com.sun.proxy.$Proxy22.findUser(Unknown Source) com.ssm.core.service.impl.UserServiceImpl.findUser(UserServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 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.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy23.findUser(Unknown Source) com.ssm.core.web.controller.UserController.login(UserController.java:28) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) 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:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) Root Cause org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336) org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84) org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) com.sun.proxy.$Proxy16.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) com.sun.proxy.$Proxy22.findUser(Unknown Source) com.ssm.core.service.impl.UserServiceImpl.findUser(UserServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 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.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy23.findUser(Unknown Source) com.ssm.core.web.controller.UserController.login(UserController.java:28) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) 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:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) Root Cause java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2294) org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2039) org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533) org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336) org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84) org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) com.sun.proxy.$Proxy16.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) com.sun.proxy.$Proxy22.findUser(Unknown Source) com.ssm.core.service.impl.UserServiceImpl.findUser(UserServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 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.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy23.findUser(Unknown Source) com.ssm.core.web.controller.UserController.login(UserController.java:28) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) 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:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) Root Cause java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835) com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455) com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240) com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199) org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:39) org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:256) org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2304) org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2290) org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2039) org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533) org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82) org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68) org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:336) org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84) org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:62) org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324) org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109) org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148) org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141) org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) com.sun.proxy.$Proxy16.selectOne(Unknown Source) org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166) org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82) org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) com.sun.proxy.$Proxy22.findUser(Unknown Source) com.ssm.core.service.impl.UserServiceImpl.findUser(UserServiceImpl.java:21) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) 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.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) com.sun.proxy.$Proxy23.findUser(Unknown Source) com.ssm.core.web.controller.UserController.login(UserController.java:28) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.base/java.lang.reflect.Method.invoke(Method.java:566) 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:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ):注意 主要问题的全部 stack 信息可以在 server logs 里查看 Apache Tomcat/8.5.49
HTTP Status 500 – Internal Server Error
想问怎么解决 HTTP Status 500 – Internal Server Error Type 异常报告 消息 在 [78] 行处理 [/pages/stuList.jsp] 时发生异常 描述 服务器遇到一个意外的情况,阻止它完成请求。 Exception org.apache.jasper.JasperException: 在 [78] 行处理 [/pages/stuList.jsp] 时发生异常 75: StudentService stuService = new StudentServiceimp(); 76: GradeService gradeService = new GradeServiceimp(); 77: Grade grade = new Grade(); 78: List<Student> list = stuService.getAllStudent(); 79: session.setAttribute("list", list); 80: 81: %> Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:625) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:514) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) cn.filter.LoginFillter.doFilter(LoginFillter.java:37) cn.filter.CharEncodingFilter.doFilter(CharEncodingFilter.java:33) Root Cause java.lang.NullPointerException cn.dao.impl.StudentDaoimp.getAllStudent(StudentDaoimp.java:28) cn.service.impl.StudentServiceimp.getAllStudent(StudentServiceimp.java:26) org.apache.jsp.pages.stuList_jsp._jspService(stuList_jsp.java:200) 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:385) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) cn.filter.LoginFillter.doFilter(LoginFillter.java:37) cn.filter.CharEncodingFilter.doFilter(CharEncodingFilter.java:33) ![图片说明](https://img-ask.csdn.net/upload/201906/10/1560148866_968708.png)
java websocket报错302
WebSocket connection to 'ws://127.0.0.1:3333/buguback/websocket' failed: Error during WebSocket handshake: Unexpected response code: 302
webSocket报错问题如下,怎么解决呢?
严重: No error handling configured for [com.leimingtech.admin.module.anon.server.ChatSocket] and the following error occurred java.io.IOException: java.util.concurrent.ExecutionException: java.net.SocketException: Software caused connection abort: socket write error at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:286) at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:572) at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:495) at org.apache.tomcat.websocket.WsFrameBase.processDataControl(WsFrameBase.java:348) at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:290) at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:131) at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:67) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:204) at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:203) at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:93) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:635) 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) Caused by: java.util.concurrent.ExecutionException: java.net.SocketException: Software caused connection abort: socket write error at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:120) at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:281) ... 15 more Caused by: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) at java.net.SocketOutputStream.write(SocketOutputStream.java:159) at org.apache.coyote.http11.upgrade.BioServletOutputStream.doWrite(BioServletOutputStream.java:38) at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.writeInternal(AbstractServletOutputStream.java:153) at org.apache.coyote.http11.upgrade.AbstractServletOutputStream.write(AbstractServletOutputStream.java:121) at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.onWritePossible(WsRemoteEndpointImplServer.java:94) at org.apache.tomcat.websocket.server.WsRemoteEndpointImplServer.doWrite(WsRemoteEndpointImplServer.java:81) at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:456) at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:344) at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:276) ... 15 more
外网访问时websocket报错404何解?
使用tomcat的websocket,但是出现用域名绑定后内网访问websocket成功,但是外网访问websocket后页面报错404,后台无报错,百度了下都说是tomcat7下的jar包冲突,但尝试了好像并不是这么回事...求大佬解救一下!!!!![图片说明](https://img-ask.csdn.net/upload/201909/27/1569575833_322304.jpg)
springmvc 整合websocket 报错 404
第一: pom 配置文件: <dependency> <groupId>javax.websocket</groupId> <artifactId>javax.websocket-api</artifactId> <version>1.0</version> <scope>provided</scope><!--这个是从网上看的是为了解决jar包冲突的 --> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-websocket</artifactId> <version>4.1.6.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-messaging</artifactId> <version>4.1.6.RELEASE</version> </dependency> 第二步: 【注册,启动 websocket server 和 握手拦截器 】 @Configuration @EnableWebSocket public class WebSocketConfig implements WebSocketConfigurer { @Override public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) { System.out.println("....注册......"); registry.addHandler(myhandler(), "/websocket").addInterceptors(myInterceptors()).setAllowedOrigins("*"); registry.addHandler(myhandler(), "/sockjs/websocket").addInterceptors(myInterceptors()).withSockJS(); } @Bean public WebSocketHandler myhandler() { System.out.println("....服务端......"); return new WebsocketEndPoint(); } @Bean public HandshakeInterceptor myInterceptors() { System.out.println("....握手拦截器......"); return new HandshakeInterceptor(); } } public class WebsocketEndPoint extends TextWebSocketHandler { private Logger logger = LoggerFactory.getLogger(WebsocketEndPoint.class); @Override protected void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception { super.handleTextMessage(session, message); logger.debug("GOMA === > WebSocketEndPoint.handlerTextMessage..."); TextMessage returnMessage = new TextMessage(message.getPayload()+" received at server"); session.sendMessage(returnMessage); } } public class HandshakeInterceptor extends HttpSessionHandshakeInterceptor { private Logger logger = Logger.getLogger(getClass()); @Override public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception { logger.debug("GOMA ===> Before Handshake"); return super.beforeHandshake(request, response, wsHandler, attributes); } @Override public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception ex) { logger.debug("GOMA ===> After Handshake"); super.afterHandshake(request, response, wsHandler, ex); } } 第三步:页面 client 我的tomcat 的端口是 9018 socket = new WebSocket('ws://localhost:9018/testSocket/websocket'); 运行报错: WebSocket connection to 'ws://localhost:9018/testSocket/websocket' failed: Error during WebSocket handshake: Unexpected response code: 400 这是为啥? 都配置了 ,为啥 是404 奇怪~~~ 那个大神给我解决一下
autobahn android使用WebSocket 报错
我在做一个Android项目中用到了websocket,使用了autobahn-android.jar包,但是在建立连接之后报了错误。 ``` D/de.tavendo.autobahn.WebSocketReader: run() : WebSocketException (de.tavendo.autobahn.WebSocketException: RSV != 0 and no extension negotiated) D/de.tavendo.autobahn.WebSocketReader: ended D/de.tavendo.autobahn.WebSocketConnection: opening handshake received D/de.tavendo.autobahn.WebSocketConnection: fail connection [code = 4, reason = WebSockets protocol violation ``` 我查看了错误地点并且看了源码,错误发生在WebSocketReader的processData处,源码为: ``` if (mFrameHeader == null) { // need at least 2 bytes from WS frame header to start processing if (mFrameBuffer.position() >= 2) { byte b0 = mFrameBuffer.get(0); boolean fin = (b0 & 0x80) != 0; int rsv = (b0 & 0x70) >> 4; int opcode = b0 & 0x0f; byte b1 = mFrameBuffer.get(1); boolean masked = (b1 & 0x80) != 0; int payload_len1 = b1 & 0x7f; // now check protocol compliance if (rsv != 0) { throw new WebSocketException("RSV != 0 and no extension negotiated"); } ...(省略) ``` 背景: 服务端我使用了Spring+SpringMVC+Hibernate框架,并且搭建了WebSocket的服务端,在Web版本使用JavaScript连接WebSocket正常,地址保证没有任何问题。 探索: 遇到这个问题之后我百度&Google了很久,发现有GitHub和StackOverflow不少人提出来这个问题,但都没有得到有效解决,看了半天感觉靠谱的回答说是autobahn支持websocket版本的问题,,但是并没有给出行之有效的解决方法。我使用的WebSocket是Java7及以上自带的javax.websocket里面的方法,也没有具体的版本说明,希望做过或者了解的大神能够解答一下疑惑。是因为版本的问题么?如果是应该使用什么版本的WebSocket?如果不是,是因为什么原因导致的,应该如何解决呢? 先感谢阅读。
springMVC中使用websocket报错404
![图片说明](https://img-ask.csdn.net/upload/201612/01/1480567442_423163.png) ## 似乎是springmvc拦截了ws请求,怎么才能让springMVC不拦截WS呢 JS代码 ``` var websocket = null; //判断当前浏览器是否支持WebSocket if('WebSocket' in window){ websocket = new WebSocket("ws://localhost:8080/VM2.0/websocket"); } else{ alert('浏览器不支持websocket,请更换浏览器'); }; //连接发生错误的回调方法 websocket.onerror = function(){ console.log("websocket连接失败"); }; //连接成功建立的回调方法 websocket.onopen = function(event){ console.log("websocket连接成功"); }; ``` java代码 ``` //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 private static int onlineCount = 0; //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。若要实现服务端与单一客户端通信的话,可以使用Map来存放,其中Key可以为用户标识 private static CopyOnWriteArraySet<MySocket> webSocketSet = new CopyOnWriteArraySet<MySocket>(); //与某个客户端的连接会话,需要通过它来给客户端发送数据 private Session session; /** * 存储当前有效的session对象 */ private static Queue<Session> sessionSet = new ConcurrentLinkedQueue<Session>(); /** * 连接建立成功调用的方法 * @param session 可选的参数。session为与某个客户端的连接会话,需要通过它来给客户端发送数据 */ @OnOpen public void onOpen(Session currentSession){ if(sessionSet.contains(currentSession) == false){ sessionSet.add(currentSession); System.out.println("WebSocketTest.onOpen()================Add=" + sessionSet.size()); } System.out.println("Server say:Client connected"); } ```
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" %>
ajax在win2003上报500(internal server error)
HTTP Status 500 - Handler processing failed; nested exception is java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil type Exception report message Handler processing failed; nested exception is java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1303) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) cn.siggy.filter.CorsFilter.doFilter(CorsFilter.java:22) root cause java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil cn.siggy.dao.DataDao.findList(DataDao.java:38) cn.siggy.controller.AllController.arrayData(AllController.java:34) sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) cn.siggy.filter.CorsFilter.doFilter(CorsFilter.java:22) ![图片说明](https://img-ask.csdn.net/upload/201801/19/1516362712_884024.jpg)
频繁刷新页面websocket报错
![这是源码](https://img-ask.csdn.net/upload/201805/11/1526008581_435009.png) ![这是错误日志](https://img-ask.csdn.net/upload/201805/11/1526008594_278337.png) 求解
websocket server 返回给客户端数据报错
![图片说明](https://img-ask.csdn.net/upload/201611/03/1478166374_946184.png) 自己写了一个websocket server 客户端通过websocket 发送 111 给server, server 收到后返回111 给客户端, 客户端收到报错。 ![图片说明](https://img-ask.csdn.net/upload/201611/03/1478166687_970719.png) 是我组装的返回报文错了吗, 哪位大神帮忙看一下,谢谢!
.net websocket 实现 报错
Error during WebSocket handshake: Unexpected response code: 200 chrome控制台报的错误 action代码 ``` public HttpResponseMessage T() { if (System.Web.HttpContext.Current.IsWebSocketRequest) { System.Web.HttpContext.Current.AcceptWebSocketRequest(ProcessWSChat); } return new HttpResponseMessage(HttpStatusCode.SwitchingProtocols); //return View(); } private async Task ProcessWSChat(AspNetWebSocketContext context) { System.Net.WebSockets.WebSocket socket = context.WebSocket; while (true) { //ArraySegment<byte> buffer = new ArraySegment<byte>(new byte[1024]); //WebSocketReceiveResult result = await socket.ReceiveAsync( // buffer, CancellationToken.None); if (socket.State == WebSocketState.Open) { //string userMessage = Encoding.UTF8.GetString( // buffer.Array, 0, result.Count); string userMessage = DateTime.Now.ToString(); ArraySegment<byte> buffer = new ArraySegment<byte>( Encoding.UTF8.GetBytes(userMessage)); await socket.SendAsync( buffer, WebSocketMessageType.Text, true, CancellationToken.None); } else { break; } } } ``` js代码 ``` <script type="text/javascript"> var serverData,statusDiv,ws; //var SERVER_URL = "/Dou/T"; window.onload = function () { ws = new WebSocket("ws://" + window.location.host + "/Sun/T"); serverData = document.getElementById("serverData"); statusDiv = document.getElementById("statusDiv"); startlistenServer(); } function startlistenServer() { statusDiv.innerHTML="Start Connect Server..."; //var es = new EventSource(SERVER_URL); ws.onopen = openHandler; ws.onerror = errorHandler; ws.onmessage = messageHandler; } function openHandler(e) { statusDiv.innerHTML = "Server Open<br>"; } function errorHandler(e) { statusDiv.innerHTML = "Error<br>"+e.message; } function messageHandler(e) { serverData.innerHTML = e.data; } </script> ```
手机浏览器websocket,无法连接一直error
``` var websocket = null; if ('WebSocket' in window) { websocket = new WebSocket("ws://localhost:8080/springws/websocket/socketServer.do"); } else if ('MozWebSocket' in window) { websocket = new MozWebSocket("ws://localhost:8080/springws/websocket/socketServer.do"); } else { websocket = new SockJS("http://localhost:8080/springws/sockjs/socketServer.do"); } websocket.onopen = onOpen; websocket.onmessage = onMessage; websocket.onerror = onError; websocket.onclose = onClose; ``` 一直是监听到error,请问有了解的吗。 电脑端浏览器是正常的,手机浏览器检测有WebSocket
使用websocket时报错,求教各位大哥
在使用websocket的时候报错 <br> Uncaught TypeError: Cannot read property 'subscribe' of undefined <br> <br> ![图片说明](https://img-ask.csdn.net/upload/201910/07/1570445110_96154.png) <br> <br> 代码很简单 ```vue init() { let socket = new SockJS('http://127.0.0.1:8080/gs-guide-websocket'); this.stompClient = Stomp.over(socket); this.stompClient.connect({}, function (frame) { this.stompClient.subscribe('/topic/greetings', function (msg) { console.log(msg.body) }); }); }, ``` 不知道为啥报错 <br> 请教各位大哥,小弟谢过啦
有关tomcat7下用到websocket时报错的问题
我现在用eclipse+tomcat7时,用websocket时报错了,报错如下,请问是什么原因,该怎么解决呢??![图片说明](https://img-ask.csdn.net/upload/201708/29/1504001172_771133.png)
vue前端websocket连接不上springboot,报错Connection closed before receiving a handshake response
搞定了,我的代码写的基本没有问题,毕竟都是按着教程一步一步来的,主要问题在于,我的开发环境和教程不一致,我是前后端分离,请求8080即请求的前端项目,当然会超时然后建立连接失败。我查看了一下前后端各自的端口:前端8080,后端63000,然后把 ``` this.sock = new WebSocket("ws:localhost:8080/websocket");//建立连接 ``` 改成 ``` this.sock = new WebSocket("ws:localhost:63000/websocket");//建立连接 ``` 就可以了,换成后端的端口号。 --- 以下是原问题 --- 照着网上的教程写的例子,整合到自己的项目中。前端用vue写的,js里几乎和教程一模一样,主要问题在于 ``` this.sock = new WebSocket("ws:localhost:8080/websocket");//建立连接 ``` --- **创建的websocket内的方法都是null,如图:** ![图片说明](https://img-ask.csdn.net/upload/201909/24/1569293600_266157.png) --- **然后观察控制台内过了一段时间报错,提示:** ``` WebSocket connection to 'ws://localhost:8080/websocket' failed: Connection closed before receiving a handshake response ``` --- **控制台错误详情见图:** ![图片说明](https://img-ask.csdn.net/upload/201909/24/1569294057_247788.png) --- **前端代码:** ``` webSocket() { debugger; // 建立socket连接 if ('WebSocket' in window) {//判断当前浏览器是否支持webSocket // this.sock = new WebSocket("ws:localhost:8080/bootTest/websocket");//建立连接(带后端项目名) this.sock = new WebSocket("ws:localhost:8080/websocket");//建立连接(不带后端项目名) } else { alert('你的浏览器暂不支持websocket :('); } var sock = this.sock; console.log(sock); sock.onopen = function (e) {//成功建立连接 console.log(e); }; sock.onmessage = function (e) {//接收到消息 console.log(e) $(".message").append("<p><font color='red'>"+e.data+"</font>") }; sock.onerror = function (e) {//连接发生错误 console.log(e); }; sock.onclose = function (e) {//连接关闭 console.log(e); }; ////监听窗口关闭事件,当窗口关闭时,主动去关闭websocket连接,防止连接还没断开就关闭窗口,server端会抛异常。 window.onbeforeunload = function(){ websocket.close(); }; } ``` --- --- --- --- 后端代码: ``` import java.io.IOException; import java.util.concurrent.CopyOnWriteArraySet; import javax.websocket.server.PathParam; import javax.websocket.server.ServerEndpoint; import javax.websocket.*; import lombok.extern.slf4j.Slf4j; @Slf4j @ServerEndpoint("/websocket") public class WebSocketServer { //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。 private static int onlineCount = 0; //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 private static CopyOnWriteArraySet<WebSocketServer> webSocketSet = new CopyOnWriteArraySet<WebSocketServer>(); //与某个客户端的连接会话,需要通过它来给客户端发送数据 private Session session; /** * 连接建立成功调用的方法*/ @OnOpen public void onOpen(Session session) { this.session = session; webSocketSet.add(this); //加入set中 addOnlineCount(); //在线数加1 log.info("有新连接加入!当前在线人数为" + getOnlineCount()); try { sendMessage("连接成功"); } catch (IOException e) { log.error("websocket IO异常"); } } // //连接打开时执行 // @OnOpen // public void onOpen(@PathParam("user") String user, Session session) { // currentUser = user; // System.out.println("Connected ... " + session.getId()); // } /** * 连接关闭调用的方法 */ @OnClose public void onClose() { webSocketSet.remove(this); //从set中删除 subOnlineCount(); //在线数减1 log.info("有一连接关闭!当前在线人数为" + getOnlineCount()); } /** * 收到客户端消息后调用的方法 * @param message 客户端发送过来的消息 */ @OnMessage public void onMessage(String message, Session session) { log.info("来自客户端的消息:" + message); //群发消息 for (WebSocketServer item : webSocketSet) { try { item.sendMessage(message); } catch (IOException e) { e.printStackTrace(); } } } /** * 发生错误 * @param session * @param error */ @OnError public void onError(Session session, Throwable error) { log.error("发生错误"); error.printStackTrace(); } public void sendMessage(String message) throws IOException { this.session.getBasicRemote().sendText(message); } /** * 群发自定义消息 * */ public static void sendInfo(String message) throws IOException { log.info(message); for (WebSocketServer item : webSocketSet) { try { item.sendMessage(message); } catch (IOException e) { continue; } } } public static synchronized int getOnlineCount() { return onlineCount; } public static synchronized void addOnlineCount() { WebSocketServer.onlineCount++; } public static synchronized void subOnlineCount() { WebSocketServer.onlineCount--; } } ```
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私...
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小人工智障。 思路可以运用在不同地方,主要介绍的是思路。
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
阿里面试官问我:如何设计秒杀系统?我的回答让他比起大拇指
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图和个人联系方式,欢迎Star和指教 前言 Redis在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在Redis的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n...
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
Android性能优化(4):UI渲染机制以及优化
文章目录1. 渲染机制分析1.1 渲染机制1.2 卡顿现象1.3 内存抖动2. 渲染优化方式2.1 过度绘制优化2.1.1 Show GPU overdraw2.1.2 Profile GPU Rendering2.2 卡顿优化2.2.1 SysTrace2.2.2 TraceView 在从Android 6.0源码的角度剖析View的绘制原理一文中,我们了解到View的绘制流程有三个步骤,即m...
微服务中的Kafka与Micronaut
今天,我们将通过Apache Kafka主题构建一些彼此异步通信的微服务。我们使用Micronaut框架,它为与Kafka集成提供专门的库。让我们简要介绍一下示例系统的体系结构。我们有四个微型服务:订单服务,行程服务,司机服务和乘客服务。这些应用程序的实现非常简单。它们都有内存存储,并连接到同一个Kafka实例。 我们系统的主要目标是为客户安排行程。订单服务应用程序还充当网关。它接收来自客户的请求...
致 Python 初学者们!
作者| 许向武 责编 | 屠敏 出品 | CSDN 博客 前言 在 Python 进阶的过程中,相信很多同学应该大致上学习了很多 Python 的基础知识,也正在努力成长。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 Python 这门编程语言,从2009年开始单一使用 Python 应对所有的开发工作,直至今...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
字节跳动面试官这样问消息队列:分布式事务、重复消费、顺序消费,我整理了一下
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式和人才交流群,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip installselenium -ihttps://pypi.tuna.tsinghua.edu.cn/simple/ ...
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
SpringBoot2.x系列教程(三十六)SpringBoot之Tomcat配置
Spring Boot默认内嵌的Tomcat为Servlet容器,关于Tomcat的所有属性都在ServerProperties配置类中。同时,也可以实现一些接口来自定义内嵌Servlet容器和内嵌Tomcat等的配置。 关于此配置,网络上有大量的资料,但都是基于SpringBoot1.5.x版本,并不适合当前最新版本。本文将带大家了解一下最新版本的使用。 ServerProperties的部分源...
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ...... ...
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
2020年全新Java学习路线图,含配套视频,学完即为中级Java程序员!!
新的一年来临,突如其来的疫情打破了平静的生活! 在家的你是否很无聊,如果无聊就来学习吧! 世上只有一种投资只赚不赔,那就是学习!!! 传智播客于2020年升级了Java学习线路图,硬核升级,免费放送! 学完你就是中级程序员,能更快一步找到工作! 一、Java基础 JavaSE基础是Java中级程序员的起点,是帮助你从小白到懂得编程的必经之路。 在Java基础板块中有6个子模块的学...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
爬取薅羊毛网站百度云资源
这是疫情期间无聊做的爬虫, 去获取暂时用不上的教程 import threading import time import pandas as pd import requests import re from threading import Thread, Lock # import urllib.request as request # req=urllib.request.Requ...
如何优雅地打印一个Java对象?
你好呀,我是沉默王二,一个和黄家驹一样身高,和刘德华一样颜值的程序员。虽然已经写了十多年的 Java 代码,但仍然觉得自己是个菜鸟(请允许我惭愧一下)。 在一个月黑风高的夜晚,我思前想后,觉得再也不能这么蹉跎下去了。于是痛下决心,准备通过输出的方式倒逼输入,以此来修炼自己的内功,从而进阶成为一名真正意义上的大神。与此同时,希望这些文章能够帮助到更多的读者,让大家在学习的路上不再寂寞、空虚和冷。 ...
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名...
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计...
HTML5适合的情人节礼物有纪念日期功能
前言 利用HTML5,css,js实现爱心树 以及 纪念日期的功能 网页有播放音乐功能 以及打字倾诉感情的画面,非常适合情人节送给女朋友 具体的HTML代码 具体只要修改代码里面的男某某和女某某 文字段也可自行修改,还有代码下半部分的JS代码需要修改一下起始日期 注意月份为0~11月 也就是月份需要减一。 当然只有一部分HTML和JS代码不够运行的,文章最下面还附加了完整代码的下载地址 &lt;!...
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允许使用这...
相关热词 c# id读写器 c#俄罗斯方块源码 c# linq原理 c# 装箱有什么用 c#集合 复制 c# 一个字符串分组 c++和c#哪个就业率高 c# 批量动态创建控件 c# 模块和程序集的区别 c# gmap 截图
立即提问