草庐IT

boot_completed

全部标签

java - Spring boot + Hibernate + JPA 没有可用的事务性 EntityManager

我使用SpringBoot1.2.3.RELEASE版本和JPAoverhibernate。我遇到以下异常org.springframework.dao.InvalidDataAccessApiUsageException:NotransactionalEntityManageravailable;nestedexceptionisjavax.persistence.TransactionRequiredException:NotransactionalEntityManageravailableatorg.springframework.orm.jpa.EntityManagerFa

java - Spring Boot Actuator/health 端点不显示数据库或文件系统信息

我无法获取数据库信息或文件系统信息以显示在/health端点上。我只能得到:{"status":"UP"}关于我的设置和配置的详细信息:-Spring启动1.3.3-在JBossEAP6.4上运行WAR-数据源是JNDI资源。-Oracle是数据库spring:datasource:#MustmatchthedatasourcenameinJBossstandalone.xmljndi-name:java:jboss/beautiful-dsdriver-class-name:oracle.jdbc.driver.OracleDriverjpa:properties:#escapesr

java - Spring Boot Actuator/health 端点不显示数据库或文件系统信息

我无法获取数据库信息或文件系统信息以显示在/health端点上。我只能得到:{"status":"UP"}关于我的设置和配置的详细信息:-Spring启动1.3.3-在JBossEAP6.4上运行WAR-数据源是JNDI资源。-Oracle是数据库spring:datasource:#MustmatchthedatasourcenameinJBossstandalone.xmljndi-name:java:jboss/beautiful-dsdriver-class-name:oracle.jdbc.driver.OracleDriverjpa:properties:#escapesr

spring boot 2.0 监听多个端口

我需要在嵌入式tomcat中监听2个端口-比如说8443(https)和8081(http)。使用springboot1.5.3.RELEASE我做了类似的事情:@BeanpublicEmbeddedServletContainerCustomizercontainerCustomizer(){returnnewEmbeddedServletContainerCustomizer(){@Overridepublicvoidcustomize(ConfigurableEmbeddedServletContainercontainer){if(containerinstanceofTomc

spring boot 2.0 监听多个端口

我需要在嵌入式tomcat中监听2个端口-比如说8443(https)和8081(http)。使用springboot1.5.3.RELEASE我做了类似的事情:@BeanpublicEmbeddedServletContainerCustomizercontainerCustomizer(){returnnewEmbeddedServletContainerCustomizer(){@Overridepublicvoidcustomize(ConfigurableEmbeddedServletContainercontainer){if(containerinstanceofTomc

spring - 使用带有 Spring Annotations 的 ehcache 3(不使用 Spring Boot)

我正在尝试让Ehcache3在不使用Spring启动的情况下与Spring4一起工作。HereisaworkingexampleouttherewhichusesSpringBoot,但我正在开发一个未使用SpringBoot的现有应用程序。问题在于spring-context-support(它添加了Spring的缓存注释)期望Ehcache的CacheManager在这个类路径上:net.sf.ehcache.CacheManager但是,在Ehcache3中,CacheManager类驻留在另一个类路径中:org.ehcache.CacheManager。所以,基本上spring

spring - 使用带有 Spring Annotations 的 ehcache 3(不使用 Spring Boot)

我正在尝试让Ehcache3在不使用Spring启动的情况下与Spring4一起工作。HereisaworkingexampleouttherewhichusesSpringBoot,但我正在开发一个未使用SpringBoot的现有应用程序。问题在于spring-context-support(它添加了Spring的缓存注释)期望Ehcache的CacheManager在这个类路径上:net.sf.ehcache.CacheManager但是,在Ehcache3中,CacheManager类驻留在另一个类路径中:org.ehcache.CacheManager。所以,基本上spring

java - Spring Boot MVC 多模块可执行jar

我有一个多模块项目,使用springboot1.1.7构建结构是+parent+import+web+backend我的父模块将包括某种微服务,我想从我的父级管理什么(所有使用的依赖项)等等。在import/backend中有我的批处理业务逻辑,在web中有一个mvc应用程序,我可以从那里开始批处理作业。在Eclipse中对我来说一切正常,我可以从Application.java文件启动应用程序并且应用程序正常工作。现在我想通过执行可执行jar文件来执行该应用程序,但尝试从控制台启动时收到以下错误消息。java-jarapplication.jarKeinHauptmanifestat

java - Spring Boot MVC 多模块可执行jar

我有一个多模块项目,使用springboot1.1.7构建结构是+parent+import+web+backend我的父模块将包括某种微服务,我想从我的父级管理什么(所有使用的依赖项)等等。在import/backend中有我的批处理业务逻辑,在web中有一个mvc应用程序,我可以从那里开始批处理作业。在Eclipse中对我来说一切正常,我可以从Application.java文件启动应用程序并且应用程序正常工作。现在我想通过执行可执行jar文件来执行该应用程序,但尝试从控制台启动时收到以下错误消息。java-jarapplication.jarKeinHauptmanifestat

java - 如何使用spring boot格式化json日期格式

我正在开发SpringBoot和gradle以创建休息服务。现在我需要以“yyyy-MM-dd”的形式格式化json日期,即格式应该是dateOfBirth:“16-03-2015”,但我得到的是“dateOfBirth:-751181400000”。我在Apllication.java类中添加了以下代码,但仍然无法获得所需的输出。@Bean@ConditionalOnClass({ObjectMapper.class,Jackson2ObjectMapperBuilder.class})publicJackson2ObjectMapperBuilderjacksonBuilder()