Spring Web Security锁定Neo4j嵌入式数据库 [英] Spring Web Security locks Neo4j embedded database

查看:77
本文介绍了Spring Web Security锁定Neo4j嵌入式数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在继续我的上一期问题 Neo4j嵌入式数据库在异常应用程序后挂起终止

In continue to my previous issue Neo4j Embedded database hangs after abnormal application termination

我注意到,如果我在终止应用程序之前使用graphDatabaseService.shutdown();方法,一切都将正常运行.否则,重新启动后,我的应用程序将挂起数据库操作.

I noticed that everything works properly if I use graphDatabaseService.shutdown(); method before terminating of my application.. Otherwise after restart my application hangs on the database operations.

经过数小时的调查,我认为我已经找到了此问题的一般来源,但现在不知道如何解决此问题.

After hours of investigation I think, I have found the general source of this issue but have no idea right now how to fix it.

这是我的Spring Boot WebSecurityConfig:

This is my Spring Boot WebSecurityConfig:

@Configuration
@EnableWebSecurity
@EnableWebMvcSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {


    @Autowired
    private SocialAuthenticationSuccessHandler socialAuthenticationSuccessHandler;

    @Autowired
    private TokenAuthenticationService tokenAuthenticationService;

    @Autowired
    private TokenAuthenticationFilter tokenAuthenticationFilter;

    @Autowired
    private DBUserDetailsService userDetailsService;

.....

}

我自动连接了内部使用Neo4j的4个字段(DAO,存储库等).当这些字段出现在我的WebSecurityConfig内部时,Neo4j会在异常关闭后重新启动时挂起.当我删除这些字段时,问题消失了.

I autowired 4 fields that internally use Neo4j(DAO, repositories and so on). Neo4j hangs on restart after unclean shutdown when these fields are present inside of my WebSecurityConfig. When I remove these fields the issue disappears.

我使用:

OS: Windows 8.1
jdk1.8.0_51
Spring 4.1.7.RELEASE
Spring Boot 1.2.5.RELEASE
Spring Security 3.2.7.RELEASE 
neo4j version 2.2.3
lucene version 3.6.2
spring-data-neo4j version 3.4.0.M1

如果WebSecurityConfig具有与Neo4j相关的东西的引用,则会出现此问题,否则一切正常.

This issue will appear if WebSecurityConfighas references on Neo4j related stuff, otherwise everything works properly..

它在事务提交时挂起:

2015-07-29 16:47:51 [main] DEBUG o.s.t.jta.JtaTransactionManager - Initiating transaction commit

有什么问题吗?

已更新

挂起时的堆栈跟踪:

Thread [main] (Suspended (breakpoint at line 229 in LuceneDataSource))  
    LuceneDataSource.getWriteLock() line: 229   
    LuceneCommandApplier.visitIndexDefineCommand(IndexDefineCommand) line: 98   
    LegacyIndexApplier.applier(IndexCommand) line: 94   
    LegacyIndexApplier.visitIndexRemoveCommand(IndexCommand$RemoveCommand) line: 153    
    CommandApplierFacade.visitIndexRemoveCommand(IndexCommand$RemoveCommand) line: 221  
    IndexCommand$RemoveCommand.handle(NeoCommandHandler) line: 253  
    CommandApplierFacade.visit(Command) line: 82    
    CommandApplierFacade.visit(Object) line: 1  
    PhysicalTransactionRepresentation.accept(Visitor<Command,IOException>) line: 72 
    TransactionRepresentationStoreApplier.apply(TransactionRepresentation, ValidatedIndexUpdates, LockGroup, long, TransactionApplicationMode) line: 108    
    TransactionRepresentationCommitProcess.applyToStore(TransactionRepresentation, LockGroup, CommitEvent, ValidatedIndexUpdates, long, TransactionApplicationMode) line: 107   
    TransactionRepresentationCommitProcess.commit(TransactionRepresentation, LockGroup, CommitEvent, TransactionApplicationMode) line: 64   
    KernelTransactionImplementation.commit() line: 502  
    KernelTransactionImplementation.close() line: 418   
    TopLevelTransaction.close() line: 112   
    Neo4jEmbeddedTransactionManager$TxState.commit() line: 39   
    Neo4jEmbeddedTransactionManager.commit() line: 77   
    UserTransactionAdapter.commit() line: 82    
    JtaTransactionManager.doCommit(DefaultTransactionStatus) line: 1021 
    JtaTransactionManager(AbstractPlatformTransactionManager).processCommit(DefaultTransactionStatus) line: 757 
    JtaTransactionManager(AbstractPlatformTransactionManager).commit(TransactionStatus) line: 726   
    TransactionInterceptor(TransactionAspectSupport).commitTransactionAfterReturning(TransactionAspectSupport$TransactionInfo) line: 521    
    TransactionInterceptor(TransactionAspectSupport).invokeWithinTransaction(Method, Class<?>, InvocationCallback) line: 291    
    TransactionInterceptor.invoke(MethodInvocation) line: 96    
    CglibAopProxy$CglibMethodInvocation(ReflectiveMethodInvocation).proceed() line: 179 
    CglibAopProxy$DynamicAdvisedInterceptor.intercept(Object, Method, Object[], MethodProxy) line: 653  
    DataGenerator$$EnhancerBySpringCGLIB$$96453c81.initialDatabaseSetup() line: not available   
    Application.lambda$0(Neo4jTemplate, DataGenerator, String[]) line: 37   
    1625413756.run(String[]) line: not available    
    SpringApplication.runCommandLineRunners(ApplicationContext, String...) line: 672    
    SpringApplication.afterRefresh(ConfigurableApplicationContext, String[]) line: 690  
    SpringApplication.run(String...) line: 321  
    SpringApplication.run(Object[], String[]) line: 957 
    SpringApplication.run(Object, String...) line: 946  
    Application.main(String[]) line: 44 

它挂在获取org.neo4j.kernel.impl.api.LegacyIndexApplier

推荐答案

我可以确认此问题与以下修复程序有关- https://github.com/neo4j/neo4j/commit/c9596af0d990d7dde9a9053799b7295985ae3c05

I can confirm that this issue related to the following fix - https://github.com/neo4j/neo4j/commit/c9596af0d990d7dde9a9053799b7295985ae3c05

我已经应用了这次提交的更改,问题就解决了.

I have applied the changes from this commit and the issue is gone.

所以,现在我正在等待Neo4j 2.2.4发行.

So, right now I'm waiting for Neo4j 2.2.4 release.

您知道Neo4j 2.2.4的计划发布日期吗?

Do you know the planned release date for Neo4j 2.2.4 ?

这篇关于Spring Web Security锁定Neo4j嵌入式数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆