草庐IT

connection_properties

全部标签

java - 未从 jar 中获取 log4j.properties

我的服务器的类路径中有一个jar,它包含位于jar根目录的log4j.properties文件,用于记录代码。当jar中的代码运行时,代码的日志记录不会发生。当我使用java-Dlog4j.debug选项分析问题时,我知道log4j正在加载axis-ant.jar的log4j.properties文件(这也是在我的类路径上)并使用它代替我的jar的属性文件。当我随后从类路径中删除axis-ant.jar时,我的jarslog4j.properties文件被立即选中并记录了我的代码。有人能解释一下为什么我的log4j.properties文件没有加载而axis-ant.jar存在吗?令人

java - Spring Boot - 无法在 application.properties 的 xml 中解析属性

我有一个springboot应用程序我的@Configuration类使用@ImportResource("path/to/xml")加载xml配置,其中包含以下行在src/main/resources下,我有包含以下内容的application.properties文件:log.directory=C:/path/I/Need但是,当我运行它时,它无法按如下方式加载属性:原因:java.lang.IllegalArgumentException:无法解析字符串值“${log.directory}/file.ext”中的占位符“log.directory”

java - Hibernate 4 中的 SessionFactory.openSession(Connection)

我正在使用SessionFactory.openSession(Connection)获取现有的JDBC连接。现在在4.0中此方法不可用。我应该使用哪种方法? 最佳答案 您可以使用SessionFactory.withOptions()和SessionBuilder.connection(Connectionconnection).SessionBuilder连接(Connection连接)AddsaspecificconnectiontothesessionoptionsParameters:connection-Theconne

java - 使用spring boot和spring-boot-maven-plugin生成war时排除application.properties

我正在使用SpringBoot开发Web应用程序,并希望生成war而不是jar。使用这里描述的从jar到war的转换工作得很好:http://spring.io/guides/gs/convert-jar-to-war/但我想从war中排除application.properties,因为我使用@PropertySource(value="file:${OPENSHIFT_DATA_DIR}/application.properties")获取文件路径生产环境。此方法在生成我的war时有效,但在eclipse中我无法运行我的应用程序,因为application.properties根本

java - 远程调试 : Failed to connect to remote VM. 连接超时

我在我的UbuntuVM上使用Eclipse远程调试远程WebLogic应用程序,然后它停止工作。我在远程服务器上打开了调试。从我的VM,我可以远程登录到远程调试端口。我试过重新启动Eclipse并将网络连接设置为Direct。它只是一直超时。FailedtoconnecttoremoteVM.Connectiontimedout.org.eclipse.jdi.TimeoutException在.log中:!MESSAGEFailedtoconnecttoremoteVM.Connectiontimedout.!STACK0org.eclipse.jdi.TimeoutExcepti

java - 如何在调试/运行 Spring Boot 项目时在 IntelliJ "out"目录中生成 build-info.properties?

在我的build.gradle中,我添加了spring构建信息:springBoot{mainClass="${springBootMainClass}"buildInfo(){additionalProperties=[name:"${appName}",version:"${version}-${buildNumber}",time:buildTime()]}}defbuildTime(){finaldateFormat=newjava.text.SimpleDateFormat("yyyy-MM-ddHH:mm:ssZ")dateFormat.timeZone=TimeZone.

前端错误 “TypeError Cannot read properties of undefined (reading ‘xxx‘)

前端错误“TypeError:Cannotreadpropertiesofundefined(reading‘xxx‘)原因分析及解决情况一:出现该错误的原因是因为你花括号中的某些属性未定义。极大可能是因为你写错了属性名称情况二:异步请求获取数据时,语句可能写错,如{KaTeXparseerror:Expected'EOF',got'}'atposition19:…n).prev().val()}̲错写成{(btn).prev().val}情况三:异步请求获取数据时,由于数据时异步获取的,所以一开始是没有该数据属性,这种情况下也会报这种错误。比如说我这里有一个数据tableData,初始值为一

java - 我得到 java.net.SocketException : Permission denied: connect when sending an email in Jenkins

我的配置:Windows7机器Java7Jenkins1.511在本地帐户上作为服务运行我的jenkins.xml文件jenkinsJenkinsC:\ProgramFiles\IBM\SDP8.5\jdk\bin\java.exe-Xrs-Xmx256m-Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle-jar"%BASE%\jenkins.war"--httpPort=8080-Djava.net.preferIPv4Stack=true我的hudson.tasks.Mailer.xml文件@example.com

java - hibernate : closing the session factory does not close the c3p0 connection pool

我最近开始在我的应用程序中使用hibernate和c3p0作为ORM。但是,当我关闭session工厂时,连接池并没有自行关闭!这是我的应用程序中也是唯一的地方,我可以在其中对session执行任何操作。StatelessSessionsession=null;Transactiontransaction=null;try{session=sessionFactory.openStatelessSession();transaction=session.beginTransaction();Listlist=session.getNamedQuery("getAvailableThin

java - JavaFX 中的 "automatic injection of location and resources properties into the controller"是什么?

在Initializable的描述中据说界面:NOTEThisinterfacehasbeensupersededbyautomaticinjectionoflocationandresourcespropertiesintothecontroller.FXMLLoaderwillnowautomaticallycallanysuitablyannotatedno-arginitialize()methoddefinedbythecontroller.Itisrecommendedthattheinjectionapproachbeusedwheneverpossible.问题是:如何