草庐IT

BOOT_PATH

全部标签

java - Spring Boot : How do you specify an environment variable that has dashes in the application. 属性?

我有一个如下所示的application.properties文件:mcl.sso.frontend-url=http://blah.com:9001mcl.sso.mocking-agent=false我试图从命令行覆盖这两个变量。这应该可以通过设置环境变量来实现。这是我运行命令的方式:MCL_SSO_FRONTEND_URL='foobar'MCL_SSO_MOCKING_AGENT='true'./gradlewrun但是,当我打印出这些变量的值时,mcl.sso.mocking-agent等于“true”(正如预期的那样),但是mcl.sso.frontend-url仍然等于“

java - 在 Spring Boot Data REST 中进行实体验证后运行 @HandleBeforeCreate

我正在使用SpringBootDataREST来保存我的User实体@EntitypublicclassUser{@Id@GeneratedValueprivatelongid;@NotEmptyprivateStringfirstName;@NotEmptyprivateStringlastName;@NotEmptyprivateStringemail;@Size(min=5,max=20)privateStringpassword;//gettersandsetters}使用存储库:publicinterfaceUserRepositoryextendsCrudRepositor

java - 从 bash 脚本中将 Spring Boot 作为前台进程启动

我用嵌入式Tomcatservlet容器打包我的SpringBootwar。并使用java-jarserver.war将其部署为常规Java应用程序.我写了一个bash脚本,负责将服务器部署为后台/前台进程:start_foreground(){cmd="$JAVACMD${JVM_OPTS}-jar${WAR_FILE}${SPRING_OPTS}"echo"\"${cmd}\""eval${cmd}print_log"Serverisstopped."}start_background(){SPRING_OPTS="--spring.pid.file=${PID_FILE}${SP

Spring Boot中的max-http-header-size配置

概述默认情况下,SpringBootWeb应用程序包括一个预配置的嵌入式Web服务器。但是,在某些情况下,我们希望修改默认配置以满足自定义要求。在本教程中,讲解如何在SpringBoot2.x应用程序的application.properties文件中对请求标头进行设置和使用max-http-header-size属性。Max-HTTP-Header-SizeSpringBoot支持Tomcat、Undertow和Jetty作为嵌入式服务器。通常,我们在SpringBoot应用程序中的application.properties文件或application.yaml文件中进行服务器配置。大多数

BroadLeafteComerce(https://www.broadleafcommerce.com)运行项目:当前项目中未找到前缀“ Spring-Boot”的插件

环境Maven3.5JDK1.8OS-Windows7下载后的演示项目和MVN安装后,尝试使用CMDMVNSpring-Boot:Run运行管理应用程序。但是最终出现错误如下D:\giri-store\DemoSite-broadleaf-5.0.5-GA\admin>mvn-espring-boot:run[INFO]Errorstacktracesareturnedon.[INFO]Scanningforprojects...Downloading:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-met

java - 在 Java 中 : "Too many open files" error when reading from a network path

我有下面的代码,它只是从一个文件夹中读取所有文件。此文件夹中有20,000个文件。该代码在本地文件夹(d:/files)上运行良好,但在读取大约1,000-2,000个文件后在网络路径(//robot/files)上运行失败。更新:文件夹是彼此的副本。导致此问题的原因以及如何解决?packagecef_debug;importjava.io.*;publicclassMain{publicstaticvoidmain(String[]args)throwsThrowable{Stringfolder=args[0];File[]files=(newFile(folder)).listF

java - 如何将 Spring Boot JMS 从 ActiveMQ 迁移到 Oracle Advanced Queuing

我正在研究SpringBoot和JMS示例,是的,我对此很陌生由于我们使用Oracle,我想将SpringBoot和JMS示例从ActiveMQ迁移到OracleAdvancedQueueing。但是,我真的找不到这方面的信息。据我所知,我需要为Oracle版本替换下面的代码,但我没有找到如何替换的方法。@BeanpublicJmsListenerContainerFactorymyFactory(ConnectionFactoryconnectionFactory,DefaultJmsListenerContainerFactoryConfigurerconfigurer){Defa

java - java.library.path 中没有 ocijdbc10

所以我一直被这个问题困扰,每当我尝试在eclipse中运行我的应用程序时,我都会收到此错误。2011-02-2309:55:08,388ERROR(com.xxxxx.services.factory.ServiceInvokerLocal:21)-java.lang.UnsatisfiedLinkError:noocijdbc10injava.library.path我已尝试按照我找到的步骤进行操作here没有运气。我已经在XPVM和Windows7上尝试过这个(尽管在win7中我得到了不同的错误,如下所示)java.lang.UnsatisfiedLinkError:noocijd

java - JAX-RS - 两个类是否可以具有相同的@Path 标识符?

我有一个重定向到特定URI的网络应用程序:比方说/service/library。在另一个包中,我有一个jaxrs服务器,它在URI中监听/service,并定义了一些bean来处理请求。那里已经有很多bean,并且已经实现了其中一个类来处理对/service/library的请求。我正在尝试创建一个新类,它也处理对/service/library的请求,但具有不同的绝对URI路径,例如:/service/library/mynewlibrary。我的问题是,是否可以在两个类中定义相同的@Path标识符,或者它们必须是唯一的,换句话说,我是否需要为我的新类使用像/service/myl

java - 用 thymeleaf 测试 spring-boot web-app

我正在尝试编写测试以确保我的Controller加载我的View。这样做时,我得到一个“循环View路径异常”。这是由于thymeleaf-view-resolver不存在。一个简单的Controller方法如下所示:@Cacheable("Customers")@RequestMapping(value="/customer",method=RequestMethod.GET)publicStringcustomer(Modelmodel){model.addAttribute("customer","customer");return"customer";}我的View位于src/