spring-integration-http 相关问题


Spring Integration SMB 在 Linux(CentOS 7) 上无效

我使用Spring Integration SMB将本地文件上传到Windows共享文件夹,在本地windows环境和idea中可以正常运行,但是当我将应用程序打成jar包时......


Dispatcher 在使用 spring-integation-mail 时没有订阅者

我们有一个多租户应用程序,它允许用户按需创建 IMAP 邮件获取器(也称为邮件接收器)并单独处理它们。为此,我们决定使用:spring-integration-mail (v ...


Spring 集成 JMS 轮询器以在轮询之间保留会话

我在 IBM MQ 系列队列上有一个 Spring Integration JMS 轮询器。当使用 IBM MQ Explorer(IBM 的基于 Eclipse 的队列浏览器应用程序)并查看队列的状态时,我看到了我的应用程序...


将 Spring Security 5 迁移到 Spring Security 6 HttpSecurity 问题

Spring Security 6 中以下代码应该替代什么? http .authorizeRequests() .requestMatchers("/hub/**").access("hasPermission('SOME_LAYER', '')")...


错误:cvc-elt.1.a:找不到元素“beans”的声明

添加此代码时,出现此错误,我尝试将 beans:beans 添加到标记中,但随后出现相同的错误,请帮我解决此问题 添加此代码时,出现此错误,我尝试将 beans:beans 添加到标签中,但随后出现相同的错误,请帮我解决这个问题 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:beans="http://www.springframework.org/schema/beans" 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 http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <bean id="testBean" class="alishev.spring.demo.TestBean"> <constructor-arg value="Neil"/> </bean> </beans> 您拥有 xmlns:beans="http://www.springframework.org/schema/beans",这意味着您需要为该命名空间中的所有标签添加前缀 beans:。 从 :beans 中删除 xmlns:beans="http://www.springframework.org/schema/beans",这样您的 XML 应如下所示 <?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.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <bean id="testBean" class="alishev.spring.demo.TestBean"> <constructor-arg value="Neil"/> </bean> </beans>


安装Spring Boot执行器

我有一个 SpringBoot 应用程序,其配置在端口 8081 上运行: @豆 public SecurityFilterChain filterChain(HttpSecurity http) 抛出异常 { http.csrf(AbstractHttpConf...


如何使用 RestClient 进行可重试的调用

我想强制 Spring 6.1 RestClient 使用重试机制执行所有 http 调用。 理想情况下,我想复制使用 RestTemplate 和 spring-retry 可以实现的这种行为


为什么springinitializr让项目继承spring-boot-starter-parent而不是使用spring-boot-dependency

当使用 spring initalizr 创建项目时,pom.xml 继承自 spring-boot-starter-parent: 当使用 spring initalizr 创建项目时,pom.xml继承自spring-boot-starter-parent: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.1.3</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>demo</artifactId> <version>0.0.1-SNAPSHOT</version> <name>demo</name> 与在spring-boot-dependencies中指定<dependencyManagement/>相比,这似乎不太灵活,因为如果我们需要使用生成的结构作为多模块项目的子模块,或者使用公司范围的父模块,我们需要将BOM移动到提到的部分: <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> 使用 spring-boot-starter-parent 作为父级而不是在创建时立即声明 <dependencyManagement/> 部分是否有任何具体原因? 有人投票决定关闭问题,坚称这是基于意见的,但事实并非如此。 插件配置的存在(顺便说一句,乍一看这些配置的目的是为了修复maven插件的一些“小故障”,但是,其中一些配置不再需要了,例如:https://github.com/maven-plugin)。 com/JetBrains/kotlin/pull/1501)并不是以下之间的唯一区别: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>3.1.3</version> <relativePath/> <!-- lookup parent from repository --> </parent> 和 <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> 在第一种情况下,maven 项目通过父子关系继承 dependencyManagement,因此,由于 spring-boot 团队通过 properties 部分定义依赖项版本,子项目也可以通过 properties 部分覆盖依赖项版本,例如如果我们的目标是更改 spring-framework 的版本而不更改 spring-boot 的版本,我们可以定义如下内容: <properties> <spring-framework.version>6.0.15</spring-framework.version> </properties> 这显然在第二个配置的情况下不起作用 - maven 只是从 independentBoM 导入 dependencyManagement 部分。 尚不清楚哪种方法“更灵活”(我们更愿意同时避开这两种方法),但是它们与依赖管理的角度也不同。


尝试在同一个项目中拥有 REST API 和前端应用程序

我有一个带有 REST 端点的 Spring Boot 应用程序,还有一个 VueJS 应用程序(以及一些 Vue 路由器逻辑)。问题是,每当我点击 http://localhost:8080/information 时,我...


Struts 2 与 Apache Shiro 集成时如何显示结果页面

使用: struts2 2.5.10, 春天 4.x, struts2-spring-插件2.5.10, 希罗1.4.0, Shiro-Spring 1.4.0。 网络.xml: 使用: struts2 2.5.10, 春季 4.x, struts2-spring-插件2.5.10, 四郎1.4.0, shiro-spring 1.4.0. web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <display-name>Archetype Created Web Application</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> </context-param> <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <init-param> <param-name>targetFilterLifecycle</param-name> <param-value>true</param-value> </init-param> </filter> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <!-- shiro filter mapping has to be first --> <filter-mapping> <filter-name>shiroFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> beanx.xml: <?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="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd "> <bean name="loginAction" class="example.shiro.action.LoginAction" > </bean> <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager" /> <property name="loginUrl" value="/login.jsp" /> <property name="filterChainDefinitions"> <value> /login.jsp = authc /logout = logout /* = authc </value> </property> </bean> <bean id="iniRealm" class="org.apache.shiro.realm.text.IniRealm"> <property name="resourcePath" value="classpath:shiro.ini" /> </bean> <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> <property name="realm" ref="iniRealm" /> </bean> <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/> </beans> struts.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> <package name="default" extends="struts-default"> <action name="list" class="loginAction" method="list"> <result name="success">/success.jsp</result> <result name="error">error.jsp</result> </action> </package> </struts> index.jsp: <body> <s:action name="list" /> </body> login.jsp 看起来像: <form name="loginform" action="" method="post"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr> <td>Username:</td> <td><input type="text" name="username" maxlength="30"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" maxlength="30"></td> </tr> <tr> <td colspan="2" align="left"><input type="checkbox" name="rememberMe"><font size="2">Remember Me</font></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="Login"></td> </tr> </table> </form> LoginAction.list(): public String list() { Subject currentUser = SecurityUtils.getSubject(); if(currentUser.isAuthenticated()) {System.out.println("user : "+currentUser.getPrincipal()); System.out.println("You are authenticated!"); } else { System.out.println("Hey hacker, hands up!"); } return "success"; } shiro.ini: [users] root=123,admin guest=456,guest frank=789,roleA,roleB # role name=permission1,permission2,..,permissionN [roles] admin=* roleA=lightsaber:* roleB=winnebago:drive:eagle5 index.jsp、login.jsp、success.jsp放在webapp下 我想要的是:输入LoginAction.list()需要进行身份验证,如果登录成功,则运行LoginAction.list()并返回"success"然后显示定义为Struts操作结果的success.jsp。 现在登录成功后可以执行LoginAction.list(),但是success.jsp不显示,浏览器是空白页面。 为什么? 我找到了原因:我在index.jsp中使用了<s:action name="list" />,但是struts文档说如果我们想用<s:action>看到结果页面,那么我们必须将其属性executeResult设置为true,即就像<s:action name="list" executeResult="true"/>。 在我看来,这有点奇怪,这个属性默认应该是 true。 有一个示例,您应该如何使用 Shiro applicationContext.xml 进行配置: <property name="filterChainDefinitions"> <value> # some example chain definitions: /admin/** = authc, roles[admin] /** = authc # more URL-to-FilterChain definitions here </value> </property> 以 /admin/ 开头的 URL 通过角色 admin 进行保护,任何其他 URL 均不受保护。如果 Struts 操作和结果 JSP 不在受保护区域中,则会显示它们。


Spring boot + slf4j + log4j + 类 org.apache.logging.slf4j.SLF4JLoggerContext 无法转换为类

我有Spring boot 2.3.1 pom.xml 我有Spring boot 2.3.1 pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>logger</groupId> <artifactId>logger</artifactId> <version>0.0.1-SNAPSHOT</version> <name>logger</name> <description>Demo project for Spring Boot</description> <properties> <java.version>11</java.version> <lombok.version>1.18.12</lombok.version> <log4j.version>1.2.17</log4j.version> <slf4j.version>1.7.30</slf4j.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project> 班级 @Slf4j @SpringBootApplication public class LoggerApplication { public static void main(String[] args) { log.info("++++++++++++++++++++++++TEST+++++++++++++++++++++++++++++"); SpringApplication.run(LoggerApplication.class, args); } } 应用程序.属性 logging.config=classpath:log4j.properties log4j.properties log4j.rootLogger=INFO, console log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Target=System.out log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.conversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p - %m%n 我尝试寻找解决方案,查看论坛上的类似主题,尝试各种排除依赖项的选项。 线程“main”中的异常 java.lang.ClassCastException:类 org.apache.logging.slf4j.SLF4JLoggerContext 无法转换为类 org.apache.logging.log4j.core.LoggerContext (org.apache.logging.slf4j.SLF4JLoggerContext 和 org.apache.logging.log4j.core.LoggerContext 位于未命名模块中 加载器“应用程序”)位于 我还尝试排除一些依赖项 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>*</artifactId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> </exclusion> <exclusion> <groupId>org.apache.logging.log4j</groupId> <artifactId>*</artifactId> </exclusion> </exclusions> </dependency> 但又出现错误,但现在无法再格式化日志了。 2021-01-13 19:12:15,881 信息 - ++++++++++++++++++++++++测试+++++++++++++++++++++++++++++++ 错误 StatusLogger 无法识别的格式说明符 [d] 错误 StatusLogger 无法识别的转换说明符 [d] 从转换模式中的位置 16 开始。 错误 StatusLogger 无法识别的格式说明符 [线程] 错误 StatusLogger 无法识别的转换说明符 [线程] 从转换模式中的位置 25 开始。 错误 StatusLogger 无法识别的格式说明符 [级别] 错误 StatusLogger 无法识别的转换说明符 [level] 从转换模式中的位置 35 开始。 ... 错误 StatusLogger 无法识别的格式说明符 [n] 错误 StatusLogger 无法识别的转换说明符 [n] 从转换模式中的位置 56 开始。 警告:不支持 sun.reflect.Reflection.getCallerClass。这会影响性能。 任何人都可以有任何想法如何解决它吗? 我找到了解决这个问题的方法。事实证明,问题出在其中一个私有库(elastik 的附加程序)的冲突上。 我执行了命令: mvn dependency:tree 然后找到传递依赖项,并将它们排除在所有类的路径上,以排除日志记录所需的库冲突。 pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <artifactId>logback-classic</artifactId> <groupId>ch.qos.logback</groupId> </exclusion> <exclusion> <artifactId>log4j-to-slf4j</artifactId> <groupId>org.apache.logging.log4j</groupId> </exclusion> </exclusions> </dependency> <dependency> <artifactId>springfox-boot-starter</artifactId> <groupId>io.springfox</groupId> <version>3.0.0</version> <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>${version.log4j.core}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency>


Spring Boot 版本与 Java 11 兼容

大家好,目前我正计划将具有 spring 版本 4.0.6 和 java 8 的独立 spring 应用程序迁移到具有 java 11 的 Spring boot 应用程序。所以,继续使用 spring boot


grpc-spring-boot-starter - 如果我将 spring-boot-starter-jdbc 添加到依赖项中,netty 服务器不会启动

我开始用spring boot测试grpc,我使用net.devh中提供的GrpcService:grpc-spring-boot-starter(https://yidongnan.github.io/grpc-spring-boot-起动器/en/)。 它隔离效果很好...


如何在Spring Boot 3和Spring Framework 6中注册拦截器

我正在使用 Spring Boot 3.1.0-SNAPSHOT 构建后端,它使用 Spring Framework 6x。 拦截器: @Slf4j 公共类 MyInterceptor 实现 HandlerInterceptor { @覆盖 公众嘘声...


SAS/WPS HTTP PROC 基本身份验证

我尝试使用 WPS 从 JIRA REST API 获取数据。我使用 HTTP PROC 调用 JIRA Rest api。 过程http 方法=“获取” url =“http://服务器名称:8080/rest/api/2/search?%str(&)fields=pro...


Jaxb2Marshaller 与 Spring boot 3+ 和 Jaxb 4 兼容吗?

我正在将我的项目从 Spring Boot 2.7 升级到 Spring Boot 3.1。在这个项目中仍然使用 SOAP,因此我们依赖 Jaxb 和 spring WS。 我正在使用 com.helger.maven 生成 Java 类:


Spring @Transactional 迁移到 Spring 5 后不起作用

我最近将应用程序从带有 AspectJ 1.8.10 的 Spring 4.3.x 和 JDK 8 升级到带有 Spring 5.3.x 和 AspectJ 1.9.20.1 的 JDK 17,并且事务注释似乎不起作用 在应用中...


bean“mvcHandlerMappingIntrospectorRequestTransformer”无法注册。具有该名称的 bean 已被定义并覆盖 i

环境:Spring Boot 3.2.1、JDK 21、GraalVM、Spring Native、Spring Security。错误 微软Windows [版本10.0.22631.2861] (c) 微软公司。版权所有。 。 ____ ...


Spring Boot api 在多次成功的 200 响应后给出 403

我有一个 Spring Boot 应用程序,它使用 spring security 作为依赖项。我正在将 Spring boot 版本从 2.7.16 迁移到 3.2.1。在 2.7.16 版本中一切正常。但在 3.2.1 中,其余 API 都...


如何在Spring 3.0中实现Scaffolding

“我正在使用 spring maven 项目,想要在其中实现脚手架,以便我可以根据模型动态生成 DAO、服务和 spring 表单。如何实现?”


Vite-Vue 应用 HTTP 请求重定向 - DEV 模式

我想在开发模式(npm)上将 HTTP 请求的基本 URL 从 Vite 应用程序的主机地址(http://localhost:5173)更改为我的 ASP .NET API 的主机地址(http://localhost:5815)运行开发)。 但我有这样的


Spring Boot 集成测试抛出错误“java.lang.IllegalStateException:阻塞读取超时 5000 毫秒”

问题发生在我通过 Spring boot 2.0.0.M3 使用 Spring webflux 的项目上。以下是项目的依赖项, 依赖项{ 编译 'org.springframework.boot:spring-boot-starter-


React 应用程序如何连接到 OAuth 2 Spring 授权服务器/资源服务器/oauth 客户端后端

我已经实现了一个生成令牌的 OAuth 2 spring 授权服务器。端口4002 用于 api 调用的 spring 资源服务器。端口4003 一个 spring oauth 客户端,用于处理与


Spring Boot JSP 404.Whitelabel 错误页面

无法使用 spring-boot 加载非常简单的 JSP 页面,出现 404 Not Found HmisApplication.class @SpringBootApplication 公共类 HmisApplication 扩展 SpringBootServletInitializer { @覆盖


通过 Maven Spring Boot 插件运行应用程序时如何设置 Java Xmx 标志?

我正在使用 mvn spring-boot:run 运行应用程序。我正在尝试按照此处所述设置 Xmx 标志: mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xmx512m" 但它不...


如何使用 Java 17、Spring 6、Jakarta Server Faces 4.x 和 PrimeFaces 12 检索 FacesContext?

我正在尝试将我的 JSF + PrimeFaces (UI) + Spring 应用程序从 Java 8 迁移到 Java 17,同时还将 Spring 版本迁移到 6。 为此,需要从 javax 库移出...


Java Spring Boot:异常处理

Java Spring Boot 风格的 Web 服务有点新鲜——所以请保持温柔。为什么大多数 Spring Boot 控制器示例没有显示捕获任何异常?我看到我的一些同伴正在开发...


为什么我的 React 应用程序在 http://localhost:3000/static/js/bundle.js 处显示错误

启动我的 React 应用程序时收到以下消息: 错误[对象对象]在handleError(http://localhost:3000/static/js/bundle.js:56279:58)在http://localhost:3000/static/js/bundl...


Springboot 3.2.1(使用 Jetty)和 graphql-spqr-spring-boot-starter 1.0.0 出现错误

刚刚将 Spring Boot 升级到版本 3.2.1(使用 Jetty)并开始出现以下错误。知道如何解决这个问题吗?或者 graphql-spqr-spring-boot-starter:1.0.0 仅与旧版本兼容...


Spring找不到指定的Bean

我有一个 Spring 应用程序,它使用 JpaRepository 连接到 h2,但出现以下错误: com.julio.demo.DemoApplication 中的字段 usuarioRepository 需要类型为 'com....


本地运行测试时如何禁用 Spring Cloud Google Secret Manager 4.x+?

我们使用的是 spring boot 3.2,我们正在尝试将 spring-cloud-gcp-starter-secretmanager 从版本 3.2.1 升级到 4.9.0。当我们这样做时,我们的集成测试会失败,并显示: java.lang.


Spring Security 6 POST 请求未经permitAll()授权

我正在使用 Spring Boot 3、Spring Security 6。我的安全配置无法正常工作。我有 2 条路径,任何请求都应该被允许,而对于其他所有请求,都需要进行身份验证...


Apache Tiles 3.x 不再在 Spring 6.x 中编译,因为 javax.* 重命名为 jakarta。*

我的应用程序使用Spring 5.x,Apache Tiles 3.0.x。现在我想迁移到 Spring 6.x,但问题出在 Apache Tiles 3.0.x 上,因为它有 javax.servlet.* 而不是 jakarta.* 。所有春天...


Spring security 6.2 JSESSIONID 未返回

我正在使用 Kotlin 创建一个 Spring Boot 应用程序。我已经将 WebSecurity 配置为: @配置 类安全配置{ @Autowired Lateinit var dataSource: 数据源 @值(...


在 Spring Boot 3.2.0 中使用 JdbcTemplate 将 Java LocalDate 持久化到 Oracle DATE 列时出现意外的时间组件插入

在 Spring Boot 3.2.0 中使用 JdbcTemplate 将 Java LocalDate 值保留在 Oracle DATE 列中时,我们遇到了意外行为。 在升级到 Spring Boot 3.2.0 之前,时间


使用 Hibernate - Oracle DB 在 Spring Boot 2.3.5 版本中设置 JPA 方法的超时

我正在使用 Spring Boot 2.3.5 版本和 Oracle 12c DB,并使用 Spring Boot 数据 jpa/hibernate 执行数据库操作。 有时数据库操作需要更多时间,我需要设置时间...


如何使 yfinance 通过 HTTP(S) 或ocks5 代理工作?

雅虎网站可以通过浏览器中的2081端口打开(在Firefox中为HTTP和HTTPS设置代理端口2081)。端口 2081 提供 HTTP(S) 代理。 2080端口提供SOCKS5代理服务: 网址=“...


如何限制Spring Batch作业的多个实例运行?

我的 Spring 批处理由 Rest 端点触发。我正在寻找一次仅运行一个作业实例的解决方案。


Kotlin maven 插件忽略 jvmTarget

Spring Boot:3.2.0,Kotlin:1.9.21,构建映像:maven:3.9.5-amazoncorretto-21,运行映像:amazoncorretto:17 我有一个非常简单的 Spring Boot 项目 @SpringBootApplication 类演示应用程序 有趣


如何使用spring security 6为AuthenticationManager的参数2定义bean?

我是 Spring Security 6 的新手。当我尝试配置安全性时,出现此错误: ************************** 应用程序无法启动 ************************** 描述:


将数字转换为英文字符串

像http://www.easysurf.cc/cnvert18.htm和http://www.calculatorsoup.com/calculators/conversions/numberstowords.php这样的网站尝试将数字字符串转换为英文字符串,但是它们。 ..


将 localstack 与 Spring Cloud AWS 2.3 一起使用时出现未知主机

“ResourceLoader”与 AWS S3 可以很好地处理这些属性: 云: 亚马逊: s3: 端点:s3.amazonaws.com <-- custom endpoint added in spring cloud aws 2.3 creden...


耶拿有没有办法看到OntClass来自导入的本体?

我有一个导入 bfo 的本体。在我的测试用例中,我只有一个类,它是实体的子类: 我有一个导入bfo的本体。在我的测试用例中,我只有一个类,它是 entity: 的子类 <rdf:RDF xmlns="http://my.ontology/ontologyTest#" xml:base="http://my.ontology/ontologyTest" xmlns:da="http://my.ontology/ontologyTest#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:obo="http://purl.obolibrary.org/obo/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:terms="http://purl.org/dc/terms/"> <owl:Ontology rdf:about="http://my.ontology/ontologyTest"> <owl:imports rdf:resource="http://purl.obolibrary.org/obo/bfo/2019-08-26/bfo.owl"/> </owl:Ontology> <owl:Class rdf:about="http://my.ontology/ontologyTest#Event"> <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/BFO_0000001"/> </owl:Class> </rdf:RDF> 当我打开本体时,我正在做: OntModel model = createModel("OWL_MEM"); FileManager.get().readModel(model, uri.toString()); Model _model = model.getRawModel(); model = new OntModelImpl(OntModelSpec.OWL_MEM, _model); ExtendedIterator classes = model.listClasses(); while (classes.hasNext()) { OntClass theOwlClass = (OntClass) classes.next(); if (thisClass.getNameSpace() == null && thisClass.getLocalName() == null) { continue; } ... } 我从我的本体中获取所有类(这里是Event),也从导入的本体中获取。 Jena 有没有办法知道 OntClass 是来自导入的本体并且未在我当前的本体中声明? 正如 UninformedUser 的评论中所说,感谢他,您可以执行以下操作: 列出所有导入本体的URI model.listImportedOntologyURIs() 列出导入本体的所有类model.getImportedModel(uri).listClasses() 在模型的所有类上创建一个迭代器,删除所有导入的类model.listClasses().filterDrop(importedClasses::contains) 因此,要打印模型的所有类而无需导入类: import java.util.HashSet; import java.util.Set; import org.apache.jena.ontology.OntClass; import org.apache.jena.ontology.OntModel; import org.apache.jena.ontology.OntModelSpec; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.util.iterator.ExtendedIterator; OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM); model.read("file:///Users/von/tools/data.owl", "RDF/XML"); Set<OntClass> importedClasses = new HashSet<>(); for (String uri : model.listImportedOntologyURIs()) { importedClasses.addAll(model.getImportedModel(uri).listClasses().toSet()); } ExtendedIterator<OntClass> it = model.listClasses().filterDrop(importedClasses::contains); while (it.hasNext()) { OntClass cls = it.next(); System.out.println(cls); }


我的控制器中所有 @FXML 属性均为 NULL(SPRING BOOT - JAVA-FX 集成)

我正在开发一个会员管理软件,我使用的是spring boot,spring data与JAVA-FX集成。 一切都很好,直到我创建了一个视图,其中有一张包含所有拥护成员的表格


使用 docker-compose 从其他容器通过 RPC over HTTP 连接到 geth docker 服务器:403 客户端错误:禁止 url

我正在尝试通过 RPC over HTTP 连接到 docker 容器中的 geth 节点。当我从主机连接并使用 URL http://localhost:8545 和 Web3.HTTPProvider 实例时,它工作正常......


Spring 5 中机密客户的 PKCE(非反应式)

我正在尝试在 Spring Boot 5 中的 oAuth 客户端上启用 PKCE。我能找到的示例适用于反应式客户端,如下所示: SecurityWebFilterChain springSecurityFilterChain(


Ngrok“HTTP 错误 404”。找不到所请求的资源

错误图片 我尝试使用“ngrok”执行我的 django-app。添加了 url 到“ALLOWED_HOSTS”和其他需要的变量。我做了“py manage.py runserver”和“ngrok http ...


讲解spring boot hibernate sql查询

我正在使用 Spring Boot 实现基本的员工管理 CRUD API。 以下是我希望您关注的实体和服务。 我正在尝试创建这种双向关系:员工


Spring MockRestServiceServer 处理多个异步请求

我有一个协调器 Spring Boot 服务,它向外部服务发出几个异步休息请求,我想模拟这些服务的响应。 我的代码是: mockServer.expect(要求...


Spring 集成延迟以及线程 MDC 上下文

我有一个 Spring 集成流程,其中我目前通过使用 Thread.sleep() 引入了手动条件延迟 我知道这是低效的,现在想重构整个......


© www.soinside.com 2019 - 2024. All rights reserved.