奇葩问题
1.Linux打的war包在linux上无法运行,在windows上能运行
2.windows打的war包在windows上可以运行,在linux上也可以运行.
elasticsearch的netty依赖问题
项目中使用elasticsearch(版本号:5.3.0),服务器在运行后表现形式就是:NoNodeAvailableException[None of the configured nodes are available ] ,经查是elasticsearch的netty4的版本有问题。elasticsearch当前服务器使用的版本是5.3.0是netty4 4.1.7.Final。此netty版本低一个版本号都不行。POM依赖如下:
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.1.7.Final</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-common</artifactId>
</exclusion>
</exclusions>
</dependency>
spring无法读取properties的问题
spring在location配置文件的时候,有时候图简单会采用classpath:*.properties,这种写法有时候会导致linux的编译问题。解决此问题只需要讲location的配置文件写成每个对应的配置文件名就行了。
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:component.properties</value>
</list>
</property>
</bean>