mirror of https://github.com/apache/archiva.git
Fix for initialization problems with new spring version
This commit is contained in:
parent
7e6ad27e07
commit
2cc9dc8b4a
|
@ -57,7 +57,7 @@ public class JcrRepositorySessionFactory
|
|||
@Inject
|
||||
private Repository repository;
|
||||
|
||||
@Inject
|
||||
// Lazy evaluation to avoid problems with circular dependencies during initialization
|
||||
private MetadataResolver metadataResolver;
|
||||
|
||||
@Inject
|
||||
|
@ -75,7 +75,7 @@ public class JcrRepositorySessionFactory
|
|||
// API.
|
||||
MetadataRepository metadataRepository = new JcrMetadataRepository( metadataFacetFactories, repository );
|
||||
|
||||
return new RepositorySession( metadataRepository, metadataResolver );
|
||||
return new RepositorySession( metadataRepository, getMetadataResolver() );
|
||||
}
|
||||
catch ( RepositoryException e )
|
||||
{
|
||||
|
@ -84,6 +84,14 @@ public class JcrRepositorySessionFactory
|
|||
}
|
||||
}
|
||||
|
||||
// Lazy evaluation to avoid problems with circular dependencies during initialization
|
||||
private MetadataResolver getMetadataResolver() {
|
||||
if (this.metadataResolver==null) {
|
||||
this.metadataResolver = applicationContext.getBean( MetadataResolver.class );
|
||||
}
|
||||
return this.metadataResolver;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void initialize()
|
||||
throws Exception
|
||||
|
|
Loading…
Reference in New Issue