草庐IT

spring-boot-starter-data-redis

全部标签

java - 如何使用 Spring Data Repositories 作为 Vaadin JPAContainer

是否可以将org.springframework.data.jpa.repository.JpaRepository存储库用作Vaadin的JPAContainer?我们正在使用Spring3.2从头开始​​建立一个新的Vaadin7项目。Spring集成是通过SpringVaadinIntegrationAddon完成的. 最佳答案 就您可以从JPARepository或其他地方获取EntityProvider而言,您可以像这样使用JPAContainer:EntityManagerentityManager=getEntityM

java - Spring-WebSockets 上的 STOMP 与 WAMP

我目前正在从事一个需要使用WebSockets的项目。客户端将只是浏览器,因此对这两者的任何消息代理功能不感兴趣。虽然我认为这不会有太大区别,但如果我能在STOMP上得到一些评论,我会很感兴趣。对比WAMP作为使用Spring-WebSockets的子协议(protocol)。我可能会得到一些提示,这些提示可能有助于做出选择。干杯,编辑(27-02-2014):由于直接使用webSockets进行编程是低级的,因此在很多地方(一个spring文档)建议使用一些子协议(protocol)。此外,在websocket上使用子协议(protocol)是一种原生webSocket安全性;就像您

java - Spring JPA/hibernate : Failed to import bean definitions

将我的头撞在墙上几个小时也无法解决这个问题,这似乎是我的配置设置错误,或者可能是依赖冲突或缺少依赖。有什么想法吗?相关依赖:SpringDataCommonsCore1.2.0SpringDataJPA1.8.0HibernateCore5.0HibernateJPA2.1Eclipse中的错误信息:Configurationproblem:Failedtoimportbeandefinitionsfromrelativelocation[SpringDbContext.xml]Offendingresource:classpathresource[SpringAppContext.x

java - Spring Boot,禁用测试安全性

我使用springboot版本“1.3.0.M5”(我也尝试过版本“1.2.5.RELEASE”)。我添加了spring安全性:org.springframework.bootspring-boot-starter-weborg.springframework.securityspring-security-testtest和代码:@SpringBootApplicationpublicclassSpringBootMainApplication{publicstaticvoidmain(String[]args){SpringApplication.run(SpringBootMai

java - Spring Batch Reader 的游标在 JTA 事务管理步骤中提前关闭

相关步骤的工作配置如下:Step、SpringBatchJobRepository和业务存储库(使用各种数据源)都使用JTA事务管理器。步骤“myStep”使用JdbcPagingItemReader。WebLogic、OracleXE和/或EE我想分析“myStep”中JdbcCursorItemReader的性能,但是在第一次提交后,第二个block的第一次读取将失败并出现java.sql.SQLException:结果集已关闭。我怀疑可能是JTA/XA驱动程序出于某种原因关闭了游标,因此我为“myStep”提供了一个简单的数据源事务管理器(在读者正在使用的数据源上),并且该步骤能

java - 如何在 Spring Boot 应用程序中配置 DispatcherServlet?

在传统的SpringWeb应用程序中,是否可以覆盖AbstractDispatcherServletInitializer.createDispatcherServlet,调用super.createDispatcherServlet,然后在返回的实例上设置以下初始化参数?setThreadContextInheritablesetThrowExceptionIfNoHandlerFound如何在SpringBoot应用中实现这一点? 最佳答案 您可以定义自己的配置并实现它,如下所示:@Configurationpublicclas

java - Spring Boot 不加载 application.yml 配置

我有一个简单的主应用程序:@Configuration@EnableAutoConfiguration@ComponentScan(basePackages="dreamteam.eho")@Import({EhoConfig.class})publicclassMainAppimplementsCommandLineRunner,ApplicationContextAware{配置:@Configuration@EnableConfigurationProperties({RootProperties.class})publicclassEhoConfig{}和属性:@Configu

java - Spring Cache 不适用于抽象类

我正在尝试在抽象类中使用SpringCache,但它不起作用,因为据我所知,Spring正在抽象类中搜索CacheNames。我有一个使用服务层和Dao层的RESTAPI。这个想法是为每个子类使用不同的缓存名称。我的抽象服务类如下所示:@Service@TransactionalpublicabstractclassAbstractService{...@CacheablepublicListfindAll(){returngetDao().findAll();}}抽象类的扩展如下所示:@Service@CacheConfig(cacheNames="textdocuments")pu

java - Spring websockets Broken pipe & client 没有收到消息

我在使用websockets时遇到了一些问题:java.io.IOException:BrokenPipe客户端没有收到消息长话短说我想知道的主要事情:请列出客户端关闭连接的所有可能情况(刷新或关闭选项卡除外)。除了服务器通过断开的连接向客户端发送消息之外,是否会发生断开的管道异常?如果是,那么如何?尽管服务器确实发送心跳,但服务器不发送消息的可能情况有哪些?(发生这种情况时,我需要重新启动应用程序才能使其再次工作。这是一个糟糕的解决方案,因为它已经投入生产。)我有一个使用websockets的SpringMVC项目;SockJS客户端和org.springframework.web.

java - 在 Spring Boot 中将 Oauth2 与 formlogin 和执行器安全性相结合

我正在使用SpringBoot1.5.9并且有一个应用程序具有使用OAuth2客户端凭据的API,以及在同一个SpringBoot应用程序中使用Thymeleaf的CMS的formlogin。为此,我使用以下bean来配置表单登录:@ConfigurationpublicclassWebSecurityGlobalConfigextendsWebSecurityConfigurerAdapter{@AutowiredprivateUserDetailsServiceuserDetailsService;@AutowiredprivatePasswordEncoderpasswordEn