springmvc websocket +tomcat,同时支持的连接数太小了 怎么办?

问题:我想通过tomcat发布一个websocket程序,代码都已经调通。但是,前端并发最多只能支持260websocket连接就上不去了,以下是我的前端测试代码和tomcat的配置。请大家帮我看看是我写错了么,还是说单个tomcat的瓶颈就是如此?
前端代码

 <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script src=" <%=request.getContextPath() %>/js/jquery/jquery-1.11.3.js"></script>
<script src=" <%=request.getContextPath() %>/js/others/sockjs-0.3.min.js"></script>
<script src=" <%=request.getContextPath() %>/js/others/stomp-2.3.3.js"></script>
</head>
<body>
<input type="button" value="连接" onclick="opens()" />
<input type="button" value="断开" onclick="closes()" />
<select id="type">
    <option value=1>点对点</option>
    <option value=2>订阅</option>
    <option value=3>主题订阅</option>
</select>
<input type="button" value="发送" onclick="send()"/>
用户名:<input type="text" id="name" value="bulbuls"/>
<hr/>
<table>
    <tr>
        <td>消息</td>
        <td><input type="text" id="msg"/></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td><td></td>
    </tr>
    <tr>
        <td>message</td>
        <td><div id="message"></div></td>
        <td>返回的消息</td>
        <td><div id="recode"></div></td>
    </tr>
</table>
<hr/>

<script>
    var i = 0;
    function opens(){
        i++;
        if(i>300){
            return;
        }
        var socket = new SockJS("http://127.0.0.1:8080/hello");
        var stompClient = Stomp.over(socket);
        stompClient.connect({}, function(frame) {
            message("连接成功....:"+i);
            //全域广播
            stompClient.subscribe('/topic', function(greeting){
                $("#recode").append("<div>"+greeting.body+"</div>");
            });
            opens();
            //主题广播
            /* stompClient.subscribe('/topic/'+$("#name").val(), function(greeting){
                $("#recode").append("<div>"+greeting.body+"</div>");
            }); */
            //点对点方式回调
            /* stompClient.subscribe('/user/'+$("#name").val()+'/point', function(message){
                $("#recode").append("<div>"+message.body+"</div>");
            }); */
        }); 
    }
    function closes(){
        if (stompClient != null) {
            stompClient.disconnect();
            message("断开连接....")
        }
    }
    function send(){
        if(!stompClient || !stompClient.connected){
            message("警告:连接已经断开");
            return;
        }
        var msg = $("#msg").val();
        var name = $("#name").val();
        var type = $("#type").val();
        if(type==1){
            stompClient.send("/app/point", {}, JSON.stringify({"user":"bulbuls","destination":"/point","message":"来自手机的消息"}));
        }else if(type==2){
            stompClient.send("/app/topic", {}, JSON.stringify({"user":"bulbuls","destination":"/topic","message":"来自手机的消息"}));
        }else if(type==3){
            stompClient.send("/app/topic/bulbuls", {}, JSON.stringify({"user":"bulbuls","destination":"/point","message":"来自手机的消息"}));
        }

    }
    function message(mess){
        $("#message").append("<div>"+mess+"</div>");
    }
</script>

</body>
</html>

tomcat server.xml配置

 <Service name="Catalina">

    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="400" minSpareThreads="4"/>

    <Connector connectionTimeout="20000" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="8443" maxThreads="300"/>

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>

    <Engine defaultHost="localhost" name="Catalina">

      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      </Realm>

      <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">


        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/>

      <Context docBase="C:\soft\apache-tomcat-7.0.73\wtpwebapps\websocket" path="/" reloadable="true" source="org.eclipse.jst.j2ee.server:websocket"/></Host>
    </Engine>
  </Service>

图片说明

图片说明

2个回答

已经解决,原来除了tomcat的连接数限制以外, 浏览器本身对websocket的连接数也有限制,谷歌261左右 IE:16个左右

tomcat在并发数达到250之后性能会下降,可以考虑集群

bulbuls
bulbuls 就是不想搞集群,而且我这个tomcat只用来维持长连接,线程不会平凡的销毁和创建,线程间不会频繁切换,所以线程数可以设置大一点也没关系
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
springmvc websocket +tomcat,同时支持的连接数太小了 怎么办?

问题:我想通过tomcat发布一个websocket程序,代码都已经调通。但是,前端并发最多只能支持260websocket连接就上不去了,以下是我的前端测试代码和tomcat的配置。请大家帮我看看是我写错了么,还是说单个tomcat的瓶颈就是如此? 前端代码 ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script src=" <%=request.getContextPath() %>/js/jquery/jquery-1.11.3.js"></script> <script src=" <%=request.getContextPath() %>/js/others/sockjs-0.3.min.js"></script> <script src=" <%=request.getContextPath() %>/js/others/stomp-2.3.3.js"></script> </head> <body> <input type="button" value="连接" onclick="opens()" /> <input type="button" value="断开" onclick="closes()" /> <select id="type"> <option value=1>点对点</option> <option value=2>订阅</option> <option value=3>主题订阅</option> </select> <input type="button" value="发送" onclick="send()"/> 用户名:<input type="text" id="name" value="bulbuls"/> <hr/> <table> <tr> <td>消息</td> <td><input type="text" id="msg"/></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td><td></td> </tr> <tr> <td>message</td> <td><div id="message"></div></td> <td>返回的消息</td> <td><div id="recode"></div></td> </tr> </table> <hr/> <script> var i = 0; function opens(){ i++; if(i>300){ return; } var socket = new SockJS("http://127.0.0.1:8080/hello"); var stompClient = Stomp.over(socket); stompClient.connect({}, function(frame) { message("连接成功....:"+i); //全域广播 stompClient.subscribe('/topic', function(greeting){ $("#recode").append("<div>"+greeting.body+"</div>"); }); opens(); //主题广播 /* stompClient.subscribe('/topic/'+$("#name").val(), function(greeting){ $("#recode").append("<div>"+greeting.body+"</div>"); }); */ //点对点方式回调 /* stompClient.subscribe('/user/'+$("#name").val()+'/point', function(message){ $("#recode").append("<div>"+message.body+"</div>"); }); */ }); } function closes(){ if (stompClient != null) { stompClient.disconnect(); message("断开连接....") } } function send(){ if(!stompClient || !stompClient.connected){ message("警告:连接已经断开"); return; } var msg = $("#msg").val(); var name = $("#name").val(); var type = $("#type").val(); if(type==1){ stompClient.send("/app/point", {}, JSON.stringify({"user":"bulbuls","destination":"/point","message":"来自手机的消息"})); }else if(type==2){ stompClient.send("/app/topic", {}, JSON.stringify({"user":"bulbuls","destination":"/topic","message":"来自手机的消息"})); }else if(type==3){ stompClient.send("/app/topic/bulbuls", {}, JSON.stringify({"user":"bulbuls","destination":"/point","message":"来自手机的消息"})); } } function message(mess){ $("#message").append("<div>"+mess+"</div>"); } </script> </body> </html> ``` tomcat server.xml配置 ``` <Service name="Catalina"> <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="400" minSpareThreads="4"/> <Connector connectionTimeout="20000" port="8080" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="8443" maxThreads="300"/> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/> <Engine defaultHost="localhost" name="Catalina"> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true"> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/> <Context docBase="C:\soft\apache-tomcat-7.0.73\wtpwebapps\websocket" path="/" reloadable="true" source="org.eclipse.jst.j2ee.server:websocket"/></Host> </Engine> </Service> ``` ![图片说明](https://img-ask.csdn.net/upload/201611/16/1479293125_809781.png) ![图片说明](https://img-ask.csdn.net/upload/201611/16/1479293133_835956.png)

请问springmvc+websocket为什么总是连接不上,报404

![图片说明](https://img-ask.csdn.net/upload/201707/31/1501496072_609731.png) ![图片说明](https://img-ask.csdn.net/upload/201707/31/1501496082_272303.png)

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 奇怪~~~ 那个大神给我解决一下

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"); } ```

springMVC + websocket实现实时向页面推送消息

场景是这样:服务器获取到数据,通过springMVC框架,运用websocket,实时向页面推送1000条信息。 不需要做信息交互,信息是服务器接收到的,直接推送到前端页面就好。 有什么教程吗?或者代码?

springmvc启动tomcat后访问404

配置了个简单的springmvc 以下是我的配置和项目结构。启动tomcat没有报错, 浏览器访问时404 ![图片说明](https://img-ask.csdn.net/upload/201705/23/1495507941_148613.png) ![图片说明](https://img-ask.csdn.net/upload/201705/23/1495507954_560633.png) ![图片说明](https://img-ask.csdn.net/upload/201705/23/1495507964_675435.png) ![图片说明](https://img-ask.csdn.net/upload/201705/23/1495507973_288647.png) ![图片说明](https://img-ask.csdn.net/upload/201705/23/1495507987_409278.png) ![图片说明](https://img-ask.csdn.net/upload/201705/23/1495508003_643901.png) 奇怪的是web.xml我编辑的时候没有报错,编译完输出的部署在tomcat上的这个web.xml有报错,不是很明白求大神帮忙看看 ![报错文件](https://img-ask.csdn.net/upload/201705/23/1495508104_755432.png)

用springMVC+websocket做消息通知实时推送的问题

所有的代码没有区别,都是从svn上挡下来的,tomcat 7 jdk 也是一样的,没有任何区别, 而我的电脑就好使,可能创建对象,别的电脑js创建对象的时候ws都报404,放到外网上也不好使,有没有相同的兄弟,或者有解决方法。

学习springmvc运行tomcat启动后报错

初学springmvc 自己练习一下最简单的实力 但是报错 下面是错误代码 type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet springmvc threw exception org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Thread.java:744) root cause org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/springmvc-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xml] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) javax.servlet.GenericServlet.init(GenericServlet.java:212) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Thread.java:744) root cause java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvc-servlet.xml] org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:118) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328) org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465) org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442) org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458) org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339) org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306) org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127) javax.servlet.GenericServlet.init(GenericServlet.java:212) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Thread.java:744) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs. 这里是我的配置文件 web配置 <servlet> <servlet-name>springmvc</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> springmvc配置 <bean id="testController" name="/hello.do" class="cn.springmvc.TestController"></bean> <!-- 配置视图解析器 ViewResoler --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <!-- 前缀 --> <property name="prefix" value="/WEB-INF/jsp/"></property> <!-- 后缀 --> <property name="suffix" value=".jsp"></property> </bean> 请问大神们 这是什么问题 怎么解决

springmvc+tomcat7+jndi如何配置,我配置老报错用的oracle数据库

我的配置如下: 1、首先在jdbc.properties.xml配置 jnidoracle=java:comp/env/jdbc/pumsdb 2、然后在applicationcontext.xml加载数据源 <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="order" value="1"></property> <property name="ignoreUnresolvablePlaceholders" value="true"></property> <property name="locations" value="/WEB-INF/classes/config/jdbc.properties"> </property> </bean> <!-- 数据源定义 --> <bean id="dataSourcejs" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="${jnidoracle}"/> </bean> <!-- 配置Jdbctemplate --> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSourcejs"> <ref bean="dataSourcejs" /> </property> </bean> 3、然后定义tomcat7 jndi全局数据源,在tomcat7 server.xml中配置 <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/> <resource auth="Container" driverclassname="oracle.jdbc.OracleDriver" maxactive="50" maxidle="10" maxwait="600000" name="jdbc/pumsdb" password="exam" type="javax.sql.DataSource" url="jdbc:oracle:thin:@192.168.8.247:1521/kszx" username="exam" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"></resource> </GlobalNamingResources> 4、在tomcat7 context.xml中配置 <ResourceLink global="jdbc/pumsdb" name="jdbc/pumsdb" type="javax.sql.DataSource"/> 然后运行程序报错报错代码如下 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSourcejs' defined in class path resource [config/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/pumsdb] is not bound in this Context. Unable to find [jdbc]. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:377) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4973) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5467) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: javax.naming.NameNotFoundException: Name [jdbc/pumsdb] is not bound in this Context. Unable to find [jdbc]. at org.apache.naming.NamingContext.lookup(NamingContext.java:819) at org.apache.naming.NamingContext.lookup(NamingContext.java:167) at org.apache.naming.factory.ResourceLinkFactory.getObjectInstance(ResourceLinkFactory.java:92) at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source) at org.apache.naming.NamingContext.lookup(NamingContext.java:842) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.NamingContext.lookup(NamingContext.java:830) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.NamingContext.lookup(NamingContext.java:830) at org.apache.naming.NamingContext.lookup(NamingContext.java:153) at org.apache.naming.NamingContext.lookup(NamingContext.java:830) at org.apache.naming.NamingContext.lookup(NamingContext.java:167) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:156) at javax.naming.InitialContext.lookup(Unknown Source) at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154) at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152) at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178) at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95) at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105) at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201) at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1479) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) ... 21 more

mybatis整合springMVC启动tomcat错误求助

你好在用您提供的代码mybatis和springMVC集成的时候启动tomcat报错不知什么原因![图片说明](https://img-ask.csdn.net/upload/201502/12/1423707486_582407.png) ![图片说明](https://img-ask.csdn.net/upload/201502/12/1423707502_448339.png) ![图片说明](https://img-ask.csdn.net/upload/201502/12/1423707473_282153.png) ![图片说明](https://img-ask.csdn.net/upload/201502/12/1423707485_243904.png) 以上是错误提示!还有一点不明白 mvc-dispatcher-servlet.xml是做什么的里面配置的内容有什么作用,如果方便请加qq603800857谢谢了

在idea新建springmvc项目无法部署到tomcat

![图片说明](https://img-ask.csdn.net/upload/201703/27/1490584736_402581.png) 报错信息如上

求助:springmvc tomcat启动时异常

信息: Initializing Spring FrameworkServlet 'springServlet' 2016-12-21 15:10:18,790 WARN [springframework.web.context.support.XmlWebApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'articleController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.admin.cms.service.ArticleService com.admin.cms.controller.ArticleController.articleService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'articleService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected com.admin.framework.persistence.CrudDao com.admin.framework.service.CrudService.dao; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.admin.framework.persistence.CrudDao] is defined: expected single matching bean but found 33: actDao,articleDao,articleDataDao,categoryDao,commentDao,guestbookDao,linkDao,siteDao,genDataBaseDictDao,genSchemeDao,genTableColumnDao,genTableDao,genTemplateDao,leaveDao,oaNotifyDao,oaNotifyRecordDao,testAuditDao,areaDao,dictDao,logDao,menuDao,officeDao,roleDao,userDao,authorityApplyDao,ttHolidayDao,personalConfigDao,personalInfoDao,lagTagDao,iamUserDao,interfaceLogDao,unitDao,activitiDao at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:290) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1148) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:664) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:630) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:678) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:549) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:490) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

求springmvc加websocket实现多个房间聊天怎么做啊

在网上找了很多资料,http://blog.csdn.net/jrn1012/article/details/42079821 就这位博主 的东西符合我的要求,可惜代码不全啊,求大神们支援啊 ![图片说明](https://img-ask.csdn.net/upload/201608/18/1471492345_986399.png)

本地SpringMVC工程,Tomcat成功启动,成功进入静态欢迎页面,但是访问其他却是404

过程, 1、启动tomcat,没有报错 2、访问localhost,成功进入静态欢迎页面 3、访问localhost/login![图片说明](https://img-ask.csdn.net/upload/201609/05/1473063268_403165.jpg).action,请求404,后台没报错。 问题 : 既然localhost可以访问,为何又会是404呢?

websocket发起链接时找不到方法! 求大神搭救!!!

使用springmvc+spring+websocket搭建环境. 启动Tomcat时运行正常, 使用WebSocket创建链接时报异常. 在Myeclipse 下使用Ctrl+Shift+T 查找到 ReflectionUtils 类 进入里面发现并没有 doWithLocalFields()方法! 严重: StandardWrapper.Throwable java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.doWithLocalFields(Ljava/lang/Class;Lorg/springframework/util/ReflectionUtils$FieldCallback;)V at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.buildPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:418) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:397) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:333) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:924) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:220) at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465) at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:658) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:672) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:543) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:484) at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) at javax.servlet.GenericServlet.init(GenericServlet.java:160) at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1235) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1148) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:830) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:137) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:107) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:75) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:934) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:90) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:494) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1009) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:632) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1592) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1550) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

自己写的一个springmvc例子,tomcat启动报错,页面不能跳转,报500错误

这是控制台输出的错误 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:\Develop\workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\springmvc_1\WEB-INF\classes\com\zbw\springmvc\Handler\HelloWord.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: file [D:\Develop\workplace\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\springmvc_1\WEB-INF\classes\com\zbw\springmvc\Handler\HelloWord.class]; nested exception is java.lang.IllegalArgumentException

maven 管理的springMVC web项目 tomcat没有报错 网页无法显示

是springMVC官网上的hello word例子 pom.xml ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.springframework</groupId> <artifactId>gs-serving-web-content</artifactId> <version>0.1.0</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.RELEASE</version> </parent> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <properties> <java.version>1.8</java.version> </properties> <!-- <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> --> </project> ``` ``` package hello; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } } ``` ``` package hello; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @Controller public class GreetingController { @RequestMapping("/greeting") public String greeting(@RequestParam(value="name", required=false, defaultValue="World") String name, Model model) { model.addAttribute("name", name); return "greeting"; } } ``` 代码都是粘贴的,避免出错 mvn install success ,运行 tomcat7.0 浏览器输入:http://localhost:8080/greeting 显示404

springmvc+mybatis tomcat加载时出错,JUNIT测试通过

springmvc+mybatis tomcat加载时出错,JUNIT测试通过,就是tomcat起不来,请各位大神帮帮忙 ``` 十月 25, 2015 6:18:41 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 十月 25, 2015 6:18:42 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 十月 25, 2015 6:18:42 下午 org.springframework.web.context.ContextLoader initWebApplicationContext 信息: Root WebApplicationContext: initialization started 十月 25, 2015 6:18:42 下午 org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh 信息: Refreshing Root WebApplicationContext: startup date [Sun Oct 25 18:18:42 CST 2015]; root of context hierarchy 十月 25, 2015 6:18:42 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions 信息: Loading XML bean definitions from class path resource [applicationContext.xml] 十月 25, 2015 6:18:43 下午 org.springframework.jdbc.datasource.DriverManagerDataSource setDriverClassName 信息: Loaded JDBC driver: com.mysql.jdbc.Driver 十月 25, 2015 6:18:43 下午 org.springframework.web.context.support.XmlWebApplicationContext refresh 警告: Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDaoImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.mybatis.spring.SqlSessionTemplate org.mydemo.dao.impl.UserDaoImpl.sqlSessionTemplate; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionTemplate' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sqlSessionFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [org/mydemo/mapper/*.xml]: ServletContext resource [/org/mydemo/mapper/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) ```

求助大佬们,springMVC运行启动Tomcat失败报错“子容器启动失败”怎么解决?

相应的版本是Tomcat9.0,jdk10.0,spring5.0。 jar包检查过应该都下载完毕了, 截取部分异常如下 ``` 严重: 子容器启动失败 java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: 初始化组件[org.apache.catalina.webresources.JarResourceSet@35beb15e]失败。 Caused by: org.apache.catalina.LifecycleException: 初始化组件[org.apache.catalina.webresources.JarResourceSet@35beb15e]失败。 Caused by: java.lang.IllegalArgumentException: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature) Caused by: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature) WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by org.apache.catalina.loader.WebappClassLoaderBase (file:/D:/apache-tomcat-9.0.27/lib/catalina.jar) to field java.io.ObjectStreamClass$Caches.localDescs WARNING: Please consider reporting this to the maintainers of org.apache.catalina.loader.WebappClassLoaderBase WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release ``` web.xml文件中 ``` <url-pattern>/</url-pattern> ``` 求助大神们帮忙,非常感谢!!!

springmvc+mybatis 如何让tomcat启动时就加载所有的controller?

springmvc+mybatis 如何让tomcat启动时就加载所有的controller?

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

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

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

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

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

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

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

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

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

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

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

Linux命令学习神器!命令看不懂直接给你解释!

大家都知道,Linux 系统有非常多的命令,而且每个命令又有非常多的用法,想要全部记住所有命令的所有用法,恐怕是一件不可能完成的任务。 一般情况下,我们学习一个命令时,要么直接百度去搜索它的用法,要么就直接用 man 命令去查看守冗长的帮助手册。这两个都可以实现我们的目标,但有没有更简便的方式呢? 答案是必须有的!今天给大家推荐一款有趣而实用学习神器 — kmdr,让你解锁 Linux 学习新姿势...

和黑客斗争的 6 天!

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

史上最全的 python 基础知识汇总篇,没有比这再全面的了,建议收藏

网友们有福了,小编终于把基础篇的内容全部涉略了一遍,这是一篇关于基础知识的汇总的文章,请朋友们收下,不用客气,不过文章篇幅肯能会有点长,耐心阅读吧爬虫(七十)多进程multiproces...

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

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

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

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

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

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

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

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

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

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

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

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

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

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

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

大学一路走来,学习互联网全靠这几个网站,最终拿下了一把offer

大佬原来都是这样炼成的

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

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

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

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

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

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

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

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

立即提问
相关内容推荐