我有一个简单的spring-neo4j项目,只保存一个实体。它在Windows 7中工作,neo4j服务器在localhost中启动。但是当我尝试另外两台机器(neo4j再次在localhost中启动)时,它失败了"引起:org.neo4j.ogm.exception.CypherException:执行Cypher" Neo.ClientError.Statement.InvalidSyntax&时出错#34 ;.第一台机器是英文Windows 7 64位,其他是土耳其Windows 7 64位(一台是Windows服务器)。机器语言会导致这种情况吗?
DemoApplication:
@Configuration
@SpringBootApplication
@EnableNeo4jRepositories("com.rest.repository")
@EnableTransactionManagement
@ComponentScan("com")
public class DemoApplication extends Neo4jConfiguration implements CommandLineRunner {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@Override
public SessionFactory getSessionFactory() {
return new SessionFactory("com.rest.model");
}
@Override
@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Session getSession() throws Exception {
return super.getSession();
}
@Override
public void run(String... args) throws Exception {
}
}
...and in spring controller...
@Autowired
private Session session;
..
session.save(object);
..