首页 > 其他分享 >Spring常见问题解决办法汇总

Spring常见问题解决办法汇总

时间:2022-10-24 18:33:36浏览次数:95  
标签:解决办法 www 常见问题 http Spring springframework context org schema

 

解决The prefix 'context' for element 'context:component-scan' is not bound
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
​​​           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd​​​          

http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/aop
          http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">

</beans>

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework/org/schema/beans/spring-beans-3.0.xsd">

 


No grammar constraints (DTD or XML schema).....两种解决方法
方法一:常用方法   关闭XML验证
工具栏:windows => preferences => xml => xml files => validation => Indicate when no grammar is specified:选择Ignore即可。
 
方法二:(个人推荐)
添加 内容如下
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/2002/xmlspec/dtd/2.10/xmlspec.dtd">
http://blog.sina.com.cn/s/blog_6b8f1feb01010y5a.html

cvc-complex-type.2.4.a: Invalid content was found starting with element 'para-names'. One of '{"http://
 java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":param-name}' is
 expected.
解决办法:
将web.xml中

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

替换为

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee

 



标签:解决办法,www,常见问题,http,Spring,springframework,context,org,schema
From: https://blog.51cto.com/u_15147537/5790822

相关文章

  • 达内 spring cloud 笔记
    目录随堂笔记笔记乱码问题课程安排(17到18天)开发环境常用地址springcloud搭建业务案例eureka注册中心注册中心客户端订单调用商品和用户Zuul-Api网关hystrixhystrixd......
  • SpringBoot代理图片、文件等路径
    在config文件夹下新增一个配置类即可 /***@authorcyl*@time2022/10/24*/@ConfigurationpublicclassMyWebAppConfigurationextendsWebMvcConfigurerAda......
  • springcloud学习记录day06--在Java中使用elasticsearch
    RestClient查询文档发起查询请求以matchall为例代码解读:第一步,创建SearchRequest对象,指定索引库名第二步,利用request.source()构建DSL,DSL中可以包含查询、分页......
  • Spring —— 集合注入
    数组注入  List集合注入  set集合注入  Map集合注入  Properties集合注入   ......
  • springboot~redis-cluster动态感应的配置
    redis-cluster是一个高可用,可分片的分布式redis集群解决方案,建议使用springboot2.3及以上版本的脚手架,如果是<2.3版本,你需要手动添加LettuceConnectionFactory来实现因为服......
  • 【Java八股】spring中有两个id相同的bean会报错吗?
    首先,在同一个bean里面不能出现存在id相同的两个bean,否则spring容器在启动时会报错。因为id是表示bean里面的唯一标志符号,所以spring在启动的时候回去验证id的唯一性,一旦发......
  • SpringMVC 配置
    1.webinitpackagecom.cj.config;importorg.springframework.web.context.WebApplicationContext;importorg.springframework.web.filter.CharacterEncodingFilter;......
  • SpringCloud系列之网关gateway-1.概述
    gateway底层是Netty(是高性能的网络通信组件,效率非常高),并且是spring主推的服务,所以SpringBoot项目我们使用gateway就对了。那么gateway能做什么呢?1.作用##2.Gateway对比Zuu......
  • SpringCloud系列之网关gateway-2.Gateway体系架构解析
    打开Gateway的自动装配工厂GatewayAutoConfiguration来看一下,排头第一个类就是Netty。Netty是什么?在网络传输领域Netty就是身份的象征,黄金AK般的存在,它是非阻塞、高性能、高......
  • SpringCloud系列之网关gateway-3.创建默认路由规则
    我们建立一个项目,依赖如下:我们引入了actuator监控组件,eureka组件,可以看到我们没有引入spring-boot-starter-web这个依赖,是因为gateway这个项目较为特殊。图中我们引入了gat......