spring 整合websocket配置文件报错的问题

如题:
在这个类加@Configuaration标签,项目可以正常启动,当时只要访问页面,就会报cfg标签找不到,
如果不加这个标签,项目可以正常启动并且可以正常访问,但是访问websocket时,会报连接不上的错误
图片说明

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Struts2 Spring 整合WebSocket 问题
web.xml头部rn[code=text]rn[/code]rn所有filter增加了truernrnstruts.xml增加了过滤wsrn[code=text][/code]rnrnspring.xml部分rn[code=text][/code]rnrnWebSocketConfigrn[code=java]import org.springframework.context.annotation.Bean;rnimport org.springframework.context.annotation.Configuration;rnimport org.springframework.web.servlet.config.annotation.EnableWebMvc;rnimport org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;rnimport org.springframework.web.socket.WebSocketHandler;rnimport org.springframework.web.socket.config.annotation.EnableWebSocket;rnimport org.springframework.web.socket.config.annotation.WebSocketConfigurer;rnimport org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;rnrnimport com.clps.tmp.core.common.websocket.handle.SystemWebSocketHandler;rnimport com.clps.tmp.core.common.websocket.interceptor.HandshakeInterceptor;rnrnrn@Configurationrn@EnableWebMvcrn@EnableWebSocketrnpublic class WebSocketConfig extends WebMvcConfigurerAdapter implements WebSocketConfigurer rn rn public WebSocketConfig() rn rnrn @Overridern public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) rn /*注册websocket server实现类,第二个参数是访问websocket的地址*/rn registry.addHandler(systemWebSocketHandler(), "/ws").addInterceptors(new HandshakeInterceptor());rn /*使用Sockjs的注册方法*/rn registry.addHandler(systemWebSocketHandler(), "/sockjs/ws").addInterceptors(new HandshakeInterceptor()).withSockJS();rn System.out.println("************WebSocket Registed*******************");rn rnrn @Beanrn public WebSocketHandler systemWebSocketHandler() rn return new SystemWebSocketHandler();rn rn[/code]rnrnSystemWebSocketHandlerrn[code=java]import org.springframework.stereotype.Component;rnimport org.springframework.web.socket.CloseStatus;rnimport org.springframework.web.socket.TextMessage;rnimport org.springframework.web.socket.WebSocketHandler;rnimport org.springframework.web.socket.WebSocketMessage;rnimport org.springframework.web.socket.WebSocketSession;rn@Componentrnpublic class SystemWebSocketHandler implements WebSocketHandler rnrn @Overridern public void afterConnectionEstablished(WebSocketSession session) throws Exception rn System.out.println("connect to the websocket success......");rn session.sendMessage(new TextMessage("Server:connected OK!"));rn rnrn @Overridern public void handleMessage(WebSocketSession wss, WebSocketMessage wsm) throws Exception rn TextMessage returnMessage = new TextMessage(wsm.getPayload()rn + " received at server");rn System.out.println(wss.getHandshakeHeaders().getFirst("Cookie"));rn wss.sendMessage(returnMessage);rn rnrn @Overridern public void handleTransportError(WebSocketSession wss, Throwable thrwbl) throws Exception rn if(wss.isOpen())rn wss.close();rn rn System.out.println("websocket connection closed......");rn rnrn @Overridern public void afterConnectionClosed(WebSocketSession wss, CloseStatus cs) throws Exception rn System.out.println("websocket connection closed......");rn rnrn @Overridern public boolean supportsPartialMessages() rn return false;rn rn rn[/code]rnrnHandshakeInterceptorrn[code=java]import java.util.Map;rnrnimport org.springframework.http.server.ServerHttpRequest;rnimport org.springframework.http.server.ServerHttpResponse;rnimport org.springframework.stereotype.Component;rnimport org.springframework.web.socket.WebSocketHandler;rnimport org.springframework.web.socket.server.support.HttpSessionHandshakeInterceptor;rn@Componentrnpublic class HandshakeInterceptor extends HttpSessionHandshakeInterceptor rn rn @Overridern public boolean beforeHandshake(ServerHttpRequest request,rn ServerHttpResponse response, WebSocketHandler wsHandler,rn Map attributes) throws Exception rn rn //解决The extension [x-webkit-deflate-frame] is not supported问题rn if(request.getHeaders().containsKey("Sec-WebSocket-Extensions")) rn request.getHeaders().set("Sec-WebSocket-Extensions", "permessage-deflate");rn rn //return true;rn rn System.out.println("Before Handshake");rn return super.beforeHandshake(request, response, wsHandler, attributes);rn rn rn @Overridern public void afterHandshake(ServerHttpRequest request,rn ServerHttpResponse response, WebSocketHandler wsHandler,rn Exception ex) rn System.out.println("After Handshake");rn super.afterHandshake(request, response, wsHandler, ex);rn rnrn[/code]rnrn页面部分:rn[code=javascript] rn [/code]rnrn代码是参考网上的。目前项目启动时,websocket的服务能注册,但是页面请求建立websocket连接时,后端没接收到任何消息,过滤器/websocket的拦截器,处理器都没有收到,页面也直接alert出 connection closed。各位大神,有没有相关经验的,指点下呗
Spring MVC websocket整合
Spring MVC websocket整合
websocket整合spring
websockt与spring整合demo工程
Spring Boot -- 整合Websocket
spring boot整合websocket, 通过http请求给websocket server给websocket client发送消息.实现消息推送和网页聊天功能.
【笔记】Spring 整合 WebSocket
websocket WebSocket是什么? WebSocket 是基于TCP的一种网络通信协议。它实现了浏览器与服务器全双工通信——允许服务器主动发送信息给客户端。 为什么需要WebSocket ? HTTP 协议是一种无状态的、无连接的、单向的应用层协议。它采用了请求/响应模型。通信请求只能由客户端发起,服务端对请求做出应答处理,无法实现服务器主动向客户端发起消息。注定了如果...
Spring配置文件报错问题
项目中Spring的各种配置文件报错,在左边处显示红叉.问题一: 出现这种情况是标签头部有空格!. 问题二: 问题描述:配置文件傍边会报错,就是说找不到这个标签对应的约束等,spring-mvc.xml,spring-mybatis,applicationContext.xml等配置文件都会出现这样的错误. 查阅了网上的资料,说的各种解决方法,比如说是对应的约束jar包没有引入等等解决方案.但是我这
ssh整合+websocket报错org.springframework.beans.
rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.web.servlet.HandlerMapping org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport.webSocketHandlerMapping()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSockJsTaskScheduler' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport.defaultSockJsTaskScheduler()] threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.setRemoveOnCancelPolicy(Z)Vrn at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4751)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5175)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)rn at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1722)rn at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)rn at java.util.concurrent.FutureTask.run(FutureTask.java:262)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)rn at java.lang.Thread.run(Thread.java:745)rnCaused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.web.servlet.HandlerMapping org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport.webSocketHandlerMapping()] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultSockJsTaskScheduler' defined in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler org.springframework.web.socket.config.annotation.WebSocketConfigurationSupport.defaultSockJsTaskScheduler()] threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.setRemoveOnCancelPolicy(Z)Vrn
spring和springmvc的配置文件整合
spring和springmvc如何集成这里就不多做介绍了,本人在集成过程中,发现一个很严重的“小问题”。 在springmvc的controller中,是可以@Autowire任意的bean的,这是因为他们的容器是“共享的”,但是某些属性,例如jdbc的配置属性,在controller中是无法@到的,根本原因还是springmvc和spring他们的上下文是伪共享。 根据UCM的思想,任意属
spring和mybatis整合配置文件
spring和mybatis整合配置文件
spring与hibernate整合的配置文件
这个是beans.xml的配置文件 com/shenhua/bean/Person.hbm.xml hibernate.dialect=org.hibernat...
spring和hibernate配置文件整合
为了操作方便,我们经常在spring整合hibernate的WEB项目中省去了用hibernate.cfg.xml的麻烦,将hibernate的信息直接配置在 Spring配置文件中 下面的都是针对Spring整合Hibernate(注解方式的hibernate)来说的 hibernate.cfg.xml和applicationContext.xml原始配置组合方式: h...
spring与ibatis整合的配置文件
[color=green]然,要下载到ibatis和spring的jar包。然后,修改applicationContext.xml文件:如下所示: classpath:jdbc.properties ${jdbc.driver} ...
spring配置文件的整合
多个配置文件 spring-common.xml 位于 common文件下下 spring-conncetion.xml位于connection文件夹下 spring-moudule.xml位于module文件下 传统加载方式 ApplicationContext context = new ClassPathXmlApplicationContext(new String[]{
Spring之整合多个配置文件
  Spring 允许通过 <import> 将多个配置文件引入到一个文件中,进行配置文件的集成。这样在启动 Spring 容器时,仅需要指定这个合并好的配置文件就可以。 import 元素的 resource 属性支持 Spring 的标准的路径资源   <import resource="applicationContext.xml"/>   ...
ActiveMQ整合Spring的配置文件
首先是创建一个maven的jar工程 pom.xml的配置(导入相应的jar包)   4.0.0   cn.douyu.maven   activemq_spring   0.0.1-SNAPSHOT   activemq_spring                    org.springframework           spring-context
Spring MVC整合websocket遇到的问题
   https://blog.csdn.net/ab7253957/article/details/52502609      按照之前写过的一片博客做了websocket实现,遇到好多问题 其一,报404错误,找不到路径 /webSocketExportSettlement 是我定义的节点,见下图 找了很长时间原因,最后确定的是框架的问题,配置url是.do结尾的,被拒绝掉了...
spring配置文件报错
cvc-complex-type.2.3: Element 'beans' cannot have character [children], because the type's content type is element-only. 原因: 文档是从别处(主要是网络)复制后粘贴到配置文件中的,所以应该和复制内容的编码有关系,或者和内容中有特殊的字符有关系,如果是手工敲入则不会有问题。 ...
spring的dubbo配置文件报错
今天导入一个新的maven项目,spring的dubbo配置文件报错(有dubbo标签的都出现了),配置文件如下: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns:context="http://www.springframework.org/schema/context" xmlns:dubbo="
Spring配置文件报错org.springframework.beans.factory.BeanDefinitionStoreException
## 总共有三个相关联的配置文件,其中dataSource.properties是连接数据库,database.xml是数据库配置,applicationContext.xml再来引用了它们rn![图片说明](https://img-ask.csdn.net/upload/201605/02/1462181765_118234.png)rnrnrn![图片说明](https://img-ask.csdn.net/upload/201605/02/1462181774_107236.png)rnrnrn![图片说明](https://img-ask.csdn.net/upload/201605/02/1462181781_854675.png)rn## 报错如下:rnrnorg.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [database.xml]: Could not resolve placeholder 'dataSource.driverClassName' in string value "$dataSource.driverClassName"rn at org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209)rn at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:220)rn at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:84)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:669)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)rn at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5068)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5584)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1572)rn at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1562)rn at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)rn at java.util.concurrent.FutureTask.run(FutureTask.java:166)rn at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)rn at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)rn at java.lang.Thread.run(Thread.java:722)
spring配置文件报错,求解
rnrnrn rn rn rn rn rnrnrn报错:rnMultiple annotations found at this line:rn - cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'context:component-rn scan'.rn - schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/context/spring-rn context-3.2.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is rn not .
spring与websocket集成请求头报错
nn```一月 05, 2018 6:28:16 下午 org.apache.catalina.core.StandardWrapperValve invoken严重: Servlet.service() for servlet [Spring MVC Dispatcher Servlet] in context with path [/eLearningSystem] threw exception [Request processing failed; nested exception is org.springframework.web.socket.server.HandshakeFailureException: Uncaught failure for request http://127.0.0.1:8085/eLearningSystem/ws.do?CFAPP_USERNAME=admin; nested exception is java.lang.NoSuchMethodError: org.springframework.web.socket.WebSocketHttpHeaders.getUpgrade()Ljava/lang/String;] with root causenjava.lang.NoSuchMethodError: org.springframework.web.socket.WebSocketHttpHeaders.getUpgrade()Ljava/lang/String;n at org.springframework.web.socket.server.support.DefaultHandshakeHandler.doHandshake(DefaultHandshakeHandler.java:171)n at org.springframework.web.socket.server.support.WebSocketHttpRequestHandler.handleRequest(WebSocketHttpRequestHandler.java:120)n at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)n at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)n at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)n at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)n at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)n at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:73)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)n at cn.learning.filter.SessionFilter.doFilter(SessionFilter.java:55)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)n at cn.learning.pager.PagerFilter.doFilter(PagerFilter.java:28)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)n at cn.learning.filter.EncryptionRequestFilter.doFilter(EncryptionRequestFilter.java:199)n at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)n at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)n at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)n at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)n at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)n at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)n at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)n at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)n at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)n at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)n at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)n at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)n at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)n at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)n at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)n at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)n at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:442)n at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1082)n at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:623)n at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)n at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)n at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)n at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)n at java.lang.Thread.run(Thread.java:745)n n```n请各位大神帮帮忙,我下载的demo上传的时候Upgrade的值也是个字符串数组。 但是我集成到项目里就报这个错了,在网上搜了找解决方案,都没出现过这样的情况,不知道该怎么修改。nn
spring配置文件xsd报错
代码: 报错: Multiple annotations found at this line:     - cvc-elt.1: Cannot find the declaration of element 'beans'.     - schema_reference.4: Failed to read schema document 'http://www.springframewo...
Java Spring 配置文件报错
1,cvc-complex-type.2.3: Element 'beans' cannot have character [children],    2,because the type's content type is element-only.  这个错误,有的人说是配置处:  http://www.springframework.org/schema/aop中,aop应该写成conte...
spring +struts整合报错
Source not found for URLClassPath$JarLoader.getJarFile(URL) line: not available
maven整合Spring报错
[code=java]:rn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:rnPropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'systemPropertiesModeName' threw exception; nested exception is org.springframework.core.ConstantException: Field 'SYSTEM_PROPERTIES_MODE_ENVIRONMENT' not found in class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1361)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)rn at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:626)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4210)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)rn at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)rn at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)rn at org.apache.catalina.core.StandardService.start(StandardService.java:525)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:595)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:rnPropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'systemPropertiesModeName' threw exception; nested exception is org.springframework.core.ConstantException: Field 'SYSTEM_PROPERTIES_MODE_ENVIRONMENT' not found in class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer]rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:102)rn at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1358)rn ... 36 more[/code]rn求有经验的大神,指点下[img=https://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/54.gif][/img]
spring与quartz 整合报错
帮忙看看这个是什么问题,谢谢nn  n applicationContext.xml:nn    n  n  n 报告代码:nn  
Spring,ehcache整合报错
摘要:在做Spring整合ehcache配置的时候出现了下面的错误,提示如下:java.lang.ClassNotFoundException: org.springframework.cache.ehcache.EhCacheManagerFactoryBean,经过检查发现是因为org.springframework.cache.ehcache.EhCacheManagerFactoryBea...
spring与hibernate整合报错
-----------beans.xml配置---------rnrn rn rn rn rn rn rn rn rn rnrn---------错误信息-----------rnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [beans.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'initialSize' of bean class [org.apache.commons.dbcp.BasicDataSource]: No property 'initialSize' foundrn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)rn at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)rn at junit.test.PersonServiceTest.setUpBeforeClass(PersonServiceTest.java:18)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)rn at java.lang.reflect.Method.invoke(Unknown Source)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rn at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)rnCaused by: org.springframework.beans.InvalidPropertyException: Invalid property 'initialSize' of bean class [org.apache.commons.dbcp.BasicDataSource]: No property 'initialSize' foundrn at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:382)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1288)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1249)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn ... 29 morern
ssh整合struts配置文件报错?
我的都是自动生成的那种 我配置文件rn指向的是Spring配置文件但是报错如果改成具体类如下rnrn就启动时候不抱报错rn以下是web.xml配置文件:rnrnrn rn rn strutsrn org.apache.struts2.dispatcher.FilterDispatcherrn rn rn strutsrn /*rn rn rn org.springframework.web.context.ContextLoaderListenerrn rn rn index.htmlrn rn
Spring 的配置文件浅析之Bean配置文件的整合
-
spring与mybatis整合配置文件详解
一 : jar包简单列举 : 1, mybatis官方提供与mybatis与spring整合jar包 2, spring相关jar包    3,mybatis相关包    4,c3p0连接池     5, mysql数据库驱动 二 : mybatis配置文件 在classpath下创建mybatis-config.xml 在与spring整合前, mybati
Mybatis整合Spring的配置文件样例
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xmlns:context="http://www.springframework.org/schema/context"        xsi:schemaLocation="http://www.springframework.org/schema/beans
spring和struts整合的web配置文件
spring和struts整合的web配置文件
shiro整合spring之spring-shiro的配置文件
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xsi:schemaLocation="
spring和myBatis整合,springIOC.xml的配置文件
spring和myBatis整合,springIOC.xml的配置文件
整合struts、Hibernate和Spring之配置文件
转载:http://www.gold98.net/blog/article.asp?id=492 struts-config.xml 程序代码 ...
spring和mybatis整合,简单配置文件
Mybatis支持自动扫描、探寻与注入,不需要我们手动去操作,这在节省我们劳动力的同时,也可以大大的节省我们的配置文件。 下面列出比较省时省力简单的配置文件示例: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" ...
spring 整合hibernate项目配置文件
1、首先在资源包下创建db.properties文件 添加内容如下:记得修改成你自己的数据库的用户名、密码和你的数据库名字 jdbc.user=username jdbc.password=password jdbc.driverClass=com.mysql.jdbc.Driver jdbc.jdbcUrl=jdbc:mysql://localhost:3306/xxx
工作流activiti整合spring的配置文件
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xmlns:context="http://www.springf
struts2、Spring、Hibernate的整合-配置文件
最近又重新看了下ssh框架的配置,做个笔记。 1.首先在web.xml文件中注册Struts2和Spring。 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee      http://java.sun.com/x
相关热词 c# 线程结束时执行 c# kb mb 图片 c# 替换第几位字符 c#项目决定成败 c# 与matlab c# xml缩进 c#传感器基础 c#操作wps c# md5使用方法 c# 引用父窗口的组件