我刚看到第四个候选人已经发布了Hibernate 5.与早期版本相比,5中有什么新东西?
任何人都可以建议为什么我们需要使用静态方法声明PropertySourcesPlaceholderConfigurer bean ?我刚刚发现如果我在下面使用非静态,那么url将被设置为null值而不是从属性文件中获取 -
@Value("${spring.datasource.url}")
private String url;
@Bean
public static PropertySourcesPlaceholderConfigurer propertyConfig(String profile) {
String propertyFileName = "application_"+profile+".properties";
System.out.println(propertyFileName);
PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
configurer.setLocation(new ClassPathResource(propertyFileName));
return configurer;
}
@Bean
@Profile("local")
public static String localProfile(){
return "local";
}
@Bean
@Profile("prod")
public static String prodProfile(){
return "prod";
}
Run Code Online (Sandbox Code Playgroud) 我刚刚下载了hadoop并解压缩了该文件.但是当我从命令提示符运行hadoop version命令时,我收到以下错误.我仔细检查,JAVA_HOME设置为"C:\ Program Files\Java\jdk1.8.0_45",这对我来说没问题.
C:\Users\shri-pc>hadoop version
The system cannot find the path specified.
Error: JAVA_HOME is incorrectly set.
Please update C:\JAVA\hadoop-2.6.0\conf\hadoop-env.cmd
'-Xmx512m' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
java -version命令的输出正常.请指教 .
C:\Users\shri-pc>java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) Client VM (build 25.51-b03, mixed mode)
Run Code Online (Sandbox Code Playgroud)