jjzjj

spring-annotations

全部标签

java - 添加 spring-data-jpa 模式引用后,Spring 配置 xml 无效

启动spring上下文时出现以下异常:java.lang.Exception:java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:org.apache.catalina.LifecycleException:org.xml.sax.SAXParseException;systemId:http://www.springframework.org/schema/data/jpa/;lineNumber:1;columnNumber:55;Wh

java - 应用程序上下文 xml 文件中的 Spring util 属性

我在app-context.xml中这样描述属性文件:在任何java文件中,我都可以通过以下方式访问此文件:@Autowired@Qualifier("properties")privatePropertiesproperties;但是,当我尝试访问camel-context.xml中的属性时喜欢:beanvortalEndpoint的值字面上是${endpointUrl}-不读取来自poperties的值。我做错了什么? 最佳答案 初始化了java.util.Properties类的实例,查看Doc.这不是加载属性的正确方法,如果

xml - 我可以在 Spring Boot 应用程序中使用 xml 属性文件而不是 application.properties 吗?

在我们的SpringBoot应用程序中,我们使用application.properties,但Ops团队要求使用基于XML的属性文件。格式很简单。如果apllication.properties看起来像:com.mail.host=mail_hostdb.connection.port=1521对应的xml应该是:mail_host1521我们实现了它,但SpringBoot仍在寻找application.properties以获得其特定属性。这有点不方便。我们希望将所有属性放在一个地方,即-XML文件。覆盖SpringBoot的默认行为以使其在XML文件中查找属性的最佳方法是什么?

java - 如何在 Spring 中将两个 ApplicationContext 合并到另一个?

我的springjava模块中有两个上下文ClassPathXmlApplicationContextcontext=newClassPathXmlApplicationContext("SpringBeans.xml");和ClassPathXmlApplicationContexthelloContext=newClassPathXmlApplicationContext("HelloBeans.xml");有两个不同的xml文件。现在我必须从context获取HelloBeans.xml的bean,从helloContext获取SpringBeans.xml的bean,而不刷新上

没有 XML 的 Java Spring 拦截器

我知道可以配置Spring应用程序withouttheuseofXMLconfigfiles,并致力于此方法。但是,我不确定如何声明HTTPinterceptors以这种方式。我正在使用thistutorial,它声明了以下XML。welcomeController/WEB-INF/pages/.jsp如何在Java中执行此操作?没有@Interceptor注释。SpringApplication.java@SuppressWarnings("WeakerAccess")@SpringBootApplication@PropertySources(value={@PropertySou

java - 使用 Spring 从自定义 XML 配置创建对象网络

我有一个自定义XML配置,定义了这样一种网络S1----O1----O2----O3----T1\+---O4----O5------------T2\S2---+-O6--+-O7------------T4//S3-+//S4------+在哪里S是某种数据源,比如网络套接字O是处理数据的运算符T是目标或数据接收器这些元素用这样的xmlblock表示:依赖项是构造函数参数。我的示例运算符O6将具有如下构造函数:classThresholdOperatorextendsOperator{publicThresholdOperator(Stringname,//"O6"Listsour

java - 用于 Eclipse 的 Spring 上下文 XML validator ?

有什么方法可以在eclipse中验证springcontextxml文件吗?功能如下:验证bean的类属性验证bean引用也许使用Autowiring进行验证?不幸的是,我们没有在当前项目上使用注释。我不喜欢当前的工作流程:“部署它并为类名拼写错误获取空指针” 最佳答案 一定要看看这里的SpringIDEhttp://springide.org/project/wiki/SpringideInstall它会满足您的所有要求。(不确定Autowiring)。它甚至可以自动完成bean属性和引用。

xml - spring xml 中的默认占位符值

在我们具体的应用中db.properties文件是由3d方提供的。根据配置,此属性文件可以包含或不包含db.schema属性。因此,如果没有db.schema属性,则db.username必须用于hibernate.default_schema属性。如果db.schema不存在,占位符${db.schema:db.username}不会检索db.username的值,因此传播“db.schema”值而不是实际(即dba)值。因此,问题是:如果db.schema不存在,如何传播db.username的默认值(假设db.username始终存在)?org.hibernate.dialect

java - cvc-complex-type.2.4.c : The matching wildcard is strict, 但找不到元素 'mvc:annotation-driven' 的声明

我想这是一个xml解析问题,但我就是看不到它在哪里。我阅读了一些有关该主题的文章,但没有任何帮助:我有这个springmvc配置:-->这是tomcat所说的:org.xml.sax.SAXParseException;lineNumber:23;columnNumber:30;cvc-complex-type.2.4.c:Thematchingwildcardisstrict,butnodeclarationcanbefoundforelement'mvc:annotation-driven'.com.sun.org.apache.xerces.internal.util.Error

Spring Boot Admin2 实例状态监控详解

其他相关文章:SpringBootAdmin参考指南SpringBootAdmin服务离线、不显示健康信息的问题SpringBootAdmin2@EnableAdminServer的加载SpringBootAdmin2AdminServerAutoConfiguration详解在微服务中集成SpringBootAdmin的主要作用之一就是用来监控服务的实例状态,并且最好是当服务DOWN或者OFFLINE的时候发消息提醒,SBA2提供了很多提醒方式,并且SBA2已经集成了钉钉,只要进行少量配置即可将状态变更发送到钉钉,详见我的另外一篇文章《SpringBootAdmin参考指南》。SBA2接入飞