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

![图片说明](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 报错 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运行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启动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实现实时向页面推送消息

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

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

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

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谢谢了

求助: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)

spring mvc4.1+Websocket 链接时报错!

信息: Initializing Spring FrameworkServlet 'springmvc' WebSocketConfig new systemWebSocketHandler Before Handshake After Handshake 一月 19, 2017 3:41:06 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [springmvc] in context with path [/main] threw exception [Request processing failed; nested exception is org.springframework.web.socket.server.HandshakeFailureException: Uncaught failure for request http://localhost:8080/main/webSocketServer; nested exception is java.lang.NoSuchMethodError: org.apache.tomcat.websocket.server.WsServerContainer.doUpgrade(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/websocket/server/ServerEndpointConfig;Ljava/util/Map;)V] with root cause java.lang.NoSuchMethodError: org.apache.tomcat.websocket.server.WsServerContainer.doUpgrade(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;Ljavax/websocket/server/ServerEndpointConfig;Ljava/util/Map;)V at org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy.upgradeInternal(TomcatRequestUpgradeStrategy.java:72) at org.springframework.web.socket.server.standard.AbstractStandardUpgradeStrategy.upgrade(AbstractStandardUpgradeStrategy.java:118) at org.springframework.web.socket.server.support.DefaultHandshakeHandler.doHandshake(DefaultHandshakeHandler.java:215) at org.springframework.web.socket.server.support.WebSocketHttpRequestHandler.handleRequest(WebSocketHttpRequestHandler.java:120) at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 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:112) 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:223) 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) pom.xml <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>com.scrx.ymg</groupId> <artifactId>main</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <name>YMG</name> <description/> <properties> <webVersion>3.1</webVersion> <hibernate-version>5.1.0.Final</hibernate-version> <hibernate-validator-version>5.2.4.Final</hibernate-validator-version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>javax.servlet.jsp.jstl</artifactId> <version>1.2.2</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-instrument</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-instrument-tomcat</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.3.0.RELEASE</version> </dependency> <dependency> <groupId>aopalliance</groupId> <artifactId>aopalliance</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>commons-pool</groupId> <artifactId>commons-pool</artifactId> <version>1.6</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.8.2</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc-portlet</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jms</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>4.1.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-core</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-acl</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-aspects</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-cas</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-crypto</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-ldap</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-openid</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-remoting</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>3.2.5.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-webflow</artifactId> <version>2.4.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-binding</artifactId> <version>2.4.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-js</artifactId> <version>2.4.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework.webflow</groupId> <artifactId>spring-js-resources</artifactId> <version>2.4.0.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>4.3.0.RELEASE</version> </dependency> <dependency> <groupId>opensymphony</groupId> <artifactId>ognl</artifactId> <version>2.6.11</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>${hibernate-version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>${hibernate-version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-jpamodelgen</artifactId> <version>${hibernate-version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>${hibernate-validator-version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator-annotation-processor</artifactId> <version>${hibernate-validator-version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator-cdi</artifactId> <version>${hibernate-validator-version}</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-pool</groupId> <artifactId>commons-pool</artifactId> <version>1.6</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.40</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>javax.el-api</artifactId> <version>2.2.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.1</version> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>javax.el</artifactId> <version>2.2.4</version> </dependency> <dependency> <groupId>xml-apis</groupId> <artifactId>xml-apis</artifactId> <version>1.4.01</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-websocket</artifactId> <version>4.0.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-messaging</artifactId> <version>4.0.1.RELEASE</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> </project>

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

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

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

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

在Idea上的springmvc项目运行tomcat时,访问主页显示404,求解?

# 运行tomcat后,访问主页显示404,求解 ## Javaspringmvc 10-Sep-2019 22:22:36.195 警告 [RMI TCP Connection(3)-127.0.0.1] org.apache.tomcat.util.descriptor.web.WebXml.setVersion Unknown version string [4.0]. Default version will be used. 10-Sep-2019 22:22:41.178 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 10-Sep-2019 22:22:41.803 警告 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [406] milliseconds. [2019-09-10 10:22:41,959] Artifact itheima_spring_mvc:war exploded: Artifact is deployed successfully [2019-09-10 10:22:41,959] Artifact itheima_spring_mvc:war exploded: Deploy took 7,623 milliseconds 10-Sep-2019 22:22:44.084 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [D:\develop\apache-tomcat-8.5.31\webapps\manager] 10-Sep-2019 22:22:44.490 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\develop\apache-tomcat-8.5.31\webapps\manager] has finished in [406] ms

js 连接rabbitMq 实现消息推送 后台是 java springMVC框架

js 连接rabbitMq 实现消息推送 后台是 java springMVC框架 Spring + STOMP + RabbitMQ消息推送 不是Spring boot框架

本地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呢?

springmvc在tomcat上运行时无法注入mongoTemlate

背景:springmvc+mongodb 问题:程序部署到服务器上可以正常运行并未报错,但是运行的时候无法获得注入的mongoTemplate,但是使用junit进行单元测试的时候却可以获得并正常运行。

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

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

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

springmvc spring hibernate 怎么配置连接两个数据库

persistent.xml配置 ``` <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> <persistence-unit name="userPU" transaction-type="RESOURCE_LOCAL"> <!--jpa的提供者--> <provider>org.hibernate.ejb.HibernatePersistence</provider> <properties> <!--声明数据库连接的驱动--> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <!--jdbc数据库的连接地址--> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/manager?characterEncoding=gbk"/> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.connection.password" value="123456"/> <!--配置方言--> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/> <!--激活查询日志功能--> <property name="hibernate.show_sql" value="true"/> <!--优雅地输出Sql--> <property name="hibernate.format_sql" value="true"/> <!--添加一条解释型标注--> <property name="hibernate.use_sql_comments" value="false"/> <!--配置如何根据java模型生成数据库表结构,常用update,validate--> <property name="hibernate.hbm2ddl.auto" value="update"/> </properties> </persistence-unit> </persistence> ``` applicationContext.xml配置 ``` <!--第二步--> <!--定义实体的工厂bean--> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="persistenceUnitName" value="userPU" /> <property name="persistenceXmlLocation" value="classpath:persistence.xml"></property> </bean> <!--第三步--> <!--定义事务管理器--> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/> </bean> ``` 以上是连接MySql的配置,现在我想在连接SqlServer,应该怎么配置,在写一个persistent和applicationContext?

软件测试入门、SQL、性能测试、测试管理工具

软件测试2小时入门,让您快速了解软件测试基本知识,有系统的了解; SQL一小时,让您快速理解和掌握SQL基本语法 jmeter性能测试 ,让您快速了解主流来源性能测试工具jmeter 测试管理工具-禅道,让您快速学会禅道的使用,学会测试项目、用例、缺陷的管理、

计算机组成原理实验教程

西北工业大学计算机组成原理实验课唐都仪器实验帮助,同实验指导书。分为运算器,存储器,控制器,模型计算机,输入输出系统5个章节

Java 最常见的 200+ 面试题:面试必备

这份面试清单是从我 2015 年做了 TeamLeader 之后开始收集的,一方面是给公司招聘用,另一方面是想用它来挖掘在 Java 技术栈中,还有那些知识点是我不知道的,我想找到这些技术盲点,然后修复它,以此来提高自己的技术水平。虽然我是从 2009 年就开始参加编程工作了,但我依旧觉得自己现在要学的东西很多,并且学习这些知识,让我很有成就感和满足感,那所以何乐而不为呢? 说回面试的事,这份面试...

winfrom中嵌套html,跟html的交互

winfrom中嵌套html,跟html的交互,源码就在里面一看就懂,很简单

玩转Python-Python3基础入门

总课时80+,提供源码和相关资料 本课程从Python零基础到纯Python项目实战。内容详细,案例丰富,覆盖了Python知识的方方面面,学完后不仅对Python知识有个系统化的了解,让你从Python小白变编程大牛! 课程包含: 1.python安装 2.变量、数据类型和运算符 3.选择结构 4.循环结构 5.函数和模块 6.文件读写 7.了解面向对象 8.异常处理

程序员的兼职技能课

获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:itxy41)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

基于VHDL的16位ALU简易设计

基于VHDL的16位ALU简易设计,可完成基本的加减、带进位加减、或、与等运算。

MFC一站式终极全套课程包

该套餐共包含从C小白到C++到MFC的全部课程,整套学下来绝对成为一名C++大牛!!!

利用Verilog实现数字秒表(基本逻辑设计分频器练习)

设置复位开关。当按下复位开关时,秒表清零并做好计时准备。在任何情况下只要按下复位开关,秒表都要无条件地进行复位操作,即使是在计时过程中也要无条件地进行清零操作。 设置启/停开关。当按下启/停开关后,将

董付国老师Python全栈学习优惠套餐

购买套餐的朋友可以关注微信公众号“Python小屋”,上传付款截图,然后领取董老师任意图书1本。

Python可以这样学(第一季:Python内功修炼)

董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。

计算机操作系统 第三版.pdf

计算机操作系统 第三版 本书全面介绍了计算机系统中的一个重要软件——操作系统(OS),本书是第三版,对2001年出版的修订版的各章内容均作了较多的修改,基本上能反映当前操作系统发展的现状,但章节名称基

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

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

Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂

微信公众平台开发入门

本套课程的设计完全是为初学者量身打造,课程内容由浅入深,课程讲解通俗易懂,代码实现简洁清晰。通过本课程的学习,学员能够入门微信公众平台开发,能够胜任企业级的订阅号、服务号、企业号的应用开发工作。 通过本课程的学习,学员能够对微信公众平台有一个清晰的、系统性的认识。例如,公众号是什么,它有什么特点,它能做什么,怎么开发公众号。 其次,通过本课程的学习,学员能够掌握微信公众平台开发的方法、技术和应用实现。例如,开发者文档怎么看,开发环境怎么搭建,基本的消息交互如何实现,常用的方法技巧有哪些,真实应用怎么开发。

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

SEIR课程设计源码与相关城市数据.rar

SEIR结合学报与之前博客结合所做的一些改进,选择其中三个城市进行拟合仿真SEIR结合学报与之前博客结合所做的一些改进,选择其中三个城市进行拟合仿真SEIR结合学报与之前博客结合所做的一些改进,选择其

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

2019 AI开发者大会

2019 AI开发者大会(AI ProCon 2019)是由中国IT社区CSDN主办的AI技术与产业年度盛会。多年经验淬炼,如今蓄势待发:2019年9月6-7日,大会将有近百位中美顶尖AI专家、知名企业代表以及千余名AI开发者齐聚北京,进行技术解读和产业论证。我们不空谈口号,只谈技术,诚挚邀请AI业内人士一起共铸人工智能新篇章!

Java面试题大全(2020版)

发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

GIS程序设计教程 基于ArcGIS Engine的C#开发实例

张丰,杜震洪,刘仁义编著.GIS程序设计教程 基于ArcGIS Engine的C#开发实例.浙江大学出版社,2012.05

人工智能-计算机视觉实战之路(必备算法+深度学习+项目实战)

系列课程主要分为3大阶段:(1)首先掌握计算机视觉必备算法原理,结合Opencv进行学习与练手,通过实际视项目进行案例应用展示。(2)进军当下最火的深度学习进行视觉任务实战,掌握深度学习中必备算法原理与网络模型架构。(3)结合经典深度学习框架与实战项目进行实战,基于真实数据集展开业务分析与建模实战。整体风格通俗易懂,项目驱动学习与就业面试。 建议同学们按照下列顺序来进行学习:1.Python入门视频课程 2.Opencv计算机视觉实战(Python版) 3.深度学习框架-PyTorch实战/人工智能框架实战精讲:Keras项目 4.Python-深度学习-物体检测实战 5.后续实战课程按照自己喜好选择就可以

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

微信小程序开发实战之番茄时钟开发

微信小程序番茄时钟视频教程,本课程将带着各位学员开发一个小程序初级实战类项目,针对只看过官方文档而又无从下手的开发者来说,可以作为一个较好的练手项目,对于有小程序开发经验的开发者而言,可以更好加深对小程序各类组件和API 的理解,为更深层次高难度的项目做铺垫。

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

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

去除异常值matlab程序

数据预处理中去除异常值的程序,matlab写成

用verilog HDL语言编写的秒表

在秒表设计中,分模块书写。用在七段数码管上显示。输入频率是1KHZ.可以显示百分秒,秒,分。如要显示小时,只需修改leds里的代码和主模块代码。改程序以通过硬件电路验证。完全正确。

[透视java——反编译、修补和逆向工程技术]源代码

源代码。

相关热词 c#中如何设置提交按钮 c#帮助怎么用 c# 读取合并单元格的值 c#带阻程序 c# 替换span内容 c# rpc c#控制台点阵字输出 c#do while循环 c#调用dll多线程 c#找出两个集合不同的
立即提问