草庐IT

spring-boot-starter-data-redis

全部标签

java - SQL状态[99999];错误代码 [17004];无效的列类型 : 1111 With Spring SimpleJdbcCall

大家好,我正在使用spring简单的JDBC模板来调用oracle过程,下面是我的代码。过程createorreplacePROCEDUREget_all_system_users(pi_client_codeINVARCHAR2,po_system_usersOUTT_SYSTEM_USER_TAB,po_error_codeOUTNUMBER,po_error_descriptionOUTVARCHAR2)ISctrNUMBER;sysUserSYSTEM_USER_OBJ;BEGINctr:=0;po_system_users:=t_system_user_tab();endSp

java - Spring Security 自定义 token 过滤器

我正在尝试执行自定义过滤器以获取token并对其进行验证。我正在遵循此response中的方法.这是相关配置:安全配置:@Configuration@EnableWebSecurity@ComponentScan(basePackages={"com.company.app"})publicclassSecurityConfigextendsWebSecurityConfigurerAdapter{@InjectAuthenticationTokenFilterauthenticationTokenFilter;@InjectTokenAuthenticationProvidertok

java - 如何使用angular js spring mvc上传多部分文件

我正在尝试使用angularjs和springMVC上传文件我在application-context.xml中有一个multipartResolverbean。我的表格是这样的:QuoteIdentifier:ChoosePleaseuploadthefile:*ValidFileInvalidFileContinue$scope.continueFileUpload=function(){varuploadUrl=serverUrl+"continueFileUpload";varformData=newFormData();formData.append("file",file.

java - Spring SAML 示例应用程序返回 Could not initialize class org.apache.commons.ssl.TrustMaterial

我一直在尝试启动并运行SpringSAML示例应用程序,但已经苦苦挣扎了好几天,并且在互联网上搜索也没有成功。我已按照快速入门指南中的所有步骤操作....当我单击“开始单点登录”按钮时,我被重定向到SSOCircle,我登录,然后被重定向回示例应用程序,但它返回以下错误:Message:Couldnotinitializeclassorg.apache.commons.ssl.TrustMaterialStackTrace:java.lang.NoClassDefFoundError:Couldnotinitializeclassorg.apache.commons.ssl.Trust

java - 我怎样才能将这个使用 SpringJUnit4ClassRunner 的面向 'spring 3.1' 的 junit4 测试转换为基于 spring 的基于 junit3.8 的测试?

此代码使用Spring3.1和junit4以及spring-test3.1。我想使用和加载junit3.8.x来转换这段代码。这是由于遗留构建系统。我怎样才能做到这一点?大多数spring在线文档都围绕以下方法展开。我需要能够“加载Spring类(class)”。在这种情况下,我有一个XML文件rest-servlet.xml并且“服务”类被注释了。我希望能够在每次测试之前加载该rest-servletspring配置文件并设置spring。测试Activity日志:importorg.junit.Assert;importorg.junit.Before;importorg.juni

java - 带有嵌入式tomcat的Spring引导+带有身份验证用户的访问日志

我正在使用带有嵌入式tomcat+spring安全性的springboot。我的tomcat访问日志是这样的IP--[14/Feb/2017:08:49:50+0200]"GET/page/2HTTP/1.1"2002606那么,我怎样才能使日志文件看起来像IP--[14/Feb/2017:08:49:50+0200]用户名-"GET/page/2HTTP/1.1"2002606每个请求都必须有用户名。对于安全身份验证,我使用带有数据库用户名和密码信息的springsecurity。 最佳答案 您可能需要更改accesslogpat

java - 如何使用 spring security 为特定端点添加 HTTP 基本身份验证?

我有一个带有SpringSecurity的SpringBoot应用程序。一个新的端点/health将被配置,因此它可以通过基本的HTTP身份验证访问。当前的HttpSecurity配置如下:@Overrideprotectedvoidconfigure(HttpSecurityhttp)throwsException{http.requestMatchers().antMatchers(HttpMethod.OPTIONS,"/**").and().csrf().disable().authorizeRequests().anyRequest().permitAll().and().s

java - Spring boot 测试失败说,由于缺少 ServletWebServerFactory bean,无法启动 ServletWebServerApplicationContext

测试类:-@RunWith(SpringRunner.class)@SpringBootTest(classes={WebsocketSourceConfiguration.class,WebSocketSourceIntegrationTests.class},webEnvironment=SpringBootTest.WebEnvironment.RANDOM_PORT,properties={"websocket.path=/some_websocket_path","websocket.allowedOrigins=*","spring.cloud.stream.default

java - 如何在不重启 tomcat 服务器的情况下从属性文件更改 spring scheduler 的 cron 表达式?

我正在使用spring调度程序。这工作正常,但是当我每次需要重新启动tomcat服务器时更改application.properties中的cron.expression值。有什么方法可以使它动态化,就像自动更改会反射(reflect)出来一样?我也用谷歌搜索,但没有为我的应用找到任何解决方案。我给出的代码片段如下:应用程序属性cron.expression=05823**?@Scheduled(cron="${cron.expression}",zone="IST")publicvoidsendEmail()throwsException{} 最佳答案

java - 在 Spring Data JPA 中使用注释连接两个以上的表

我有三个实体:A、B和C,它们之间的关系如下:classA{@ManyToManyListbs;//otherattributesandgettersetters}classB{@ManyToManyListcs;//otherattributesandgettersetters}classC{//otherattributesandgettersetters}但是从我当前的实体类中,我可以使用@JoinTable在任意2个表之间建立关系。但我想要的是将所有3个实体之间的关系保存在一个单独的表中,将这些实体的主键作为列。(外键)如果我们假设实体B和C已经保存(插入)到数据库中,我将插入