Neo4jデータベースを含むSpring MVC(4.2.0.RELEASE)を使用してJava Rest Serviceを開発しています。したがって、Spring Data Neo4j(4.1.1.RELEASE)が使用されます。SpringデータNeo4j複数のバージョンをtomcatにデプロイするときのNullPointerException
@Configuration
@ComponentScan(basePackages = { "com.xxx.yyy" })
@EnableNeo4jRepositories(basePackages = "com.xxx.yyy.dao.repo")
@EnableTransactionManagement
public class Neo4jConfig extends Neo4jConfiguration {
@Autowired
private ApplicationProperties properties;
@Bean
public SessionFactory getSessionFactory() {
return new SessionFactory(getConfiguration(), "com.xxx.yyy.dao.beans");
}
@Bean
public Neo4jOperations neo4jTemplate() throws Exception {
return new Neo4jTemplate(getSession());
}
@Bean
public org.neo4j.ogm.config.Configuration getConfiguration() {
org.neo4j.ogm.config.Configuration config = new org.neo4j.ogm.config.Configuration();
config.driverConfiguration().setDriverClassName(this.properties.getNeo4jDriver())
.setURI(this.properties.getNeo4jEndpoint())
.setCredentials(this.properties.getNeo4jUser(), this.properties.getNeo4jPassword());
return config;
}
@Bean
@Scope(value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Session getSession() throws Exception {
return super.getSession();
}
}
アプリケーションを本番環境にTomcat7に配備されています。
SDNの構成は次のようになります。
ゼロダウンタイムの展開では、複数のバージョンを展開するためにtomcatのバージョンフラグを使用したいと思います。私がそうするならば、アプリケーションはorg.neo4j.ogm.context.RestModelMapper
のNullPointerException
のためにもう働かない。
スタックトレース:
java.lang.NullPointerException
at org.neo4j.ogm.context.RestModelMapper.mapEntity(RestModelMapper.java:153) ~[neo4j-ogm-core-2.0.1.jar:?]
at org.neo4j.ogm.context.RestModelMapper.map(RestModelMapper.java:76) ~[neo4j-ogm-core-2.0.1.jar:?]
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:94) ~[neo4j-ogm-core-2.0.1.jar:?]
at org.neo4j.ogm.session.delegates.ExecuteQueriesDelegate.query(ExecuteQueriesDelegate.java:73) ~[neo4j-ogm-core-2.0.1.jar:?]
at org.neo4j.ogm.session.Neo4jSession.query(Neo4jSession.java:313) ~[neo4j-ogm-core-2.0.1.jar:?]
この問題は、私はTomcat上で、バージョンフラグを使用する場合にのみ発生します。 anybobyはここで何が問題なのか知っていますか?