将 SDN-4 添加到 GF-3:加载应用程序时出现异常:IllegalStateException:ContainerBase.addChild:开始:org.apache.catalina.LifecycleException
Add SDN-4 to GF-3: Exception while loading the app: IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException
为了使用 neo4j-graphdatabase 独立服务器,我将 SDN 3.1.2 的依赖项添加到我的 pom.xml 文件中。
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-rest</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
由于 Neo4jCdiRepositoryExtension,我可以使用 spring-data-neo4j 而无需完整的 Spring-Framework(通过 CDI)。
现在我想将我的 SDN 版本更新到 4.0.0.M1。
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.0.0.M1</version>
</dependency>
我必须创建自己的 Neo4jCdiRepositoryExtension,这看起来很容易。部署过程构建我的新扩展。
要使用我的扩展,我需要这个 class 来提供所有需要的配置:
@ApplicationScoped
public class Neo4jConfigurationProvider {
@Resource(lookup = "rest/neo4j")
private String baseUriString;
private static final String PERSISTENCE_ROOT = "...";
private SessionFactory sessionFactory;
private Neo4jServer neo4jServer;
private Session session;
@PostConstruct
public void init() {
neo4jServer = new RemoteServer(baseUriString);
sessionFactory = new SessionFactory(PERSISTENCE_ROOT + ".person", PERSISTENCE_ROOT + ".relation",
PERSISTENCE_ROOT + ".relations_type");
session = sessionFactory.openSession(baseUriString);
}
@Produces
public SessionFactory sessionFactory() {
return sessionFactory;
}
@Produces
public Neo4jServer neo4jServer() {
return neo4jServer;
}
@Produces
public Neo4jTemplate neo4jTemplate() {
return new Neo4jTemplate(session);
}
}
如果我想部署它,我的 glassfish 3 服务器会给我这个错误消息:
remote failure: Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
org.apache.catalina.LifecycleException:
com.sun.jersey.spi.inject.Errors$ErrorMessagesException.
Please see server.log for more details.
我现在的问题是:我该如何解决这个错误?
首先我找不到任何 server.log,因为我的服务器没有启动。所以我复制了一个有效的版本,添加了 sdn-4 依赖项并尝试获取它的任何日志。所以这是我的 server.log:
的错误
The following errors and warnings have been detected with resource and/or provider classes:
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.LoggingProvider(org.neo4j.kernel.logging.Logging) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.transactional.TransactionFilter(org.neo4j.server.database.Database) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.repr.InputFormatProvider(org.neo4j.server.rest.repr.RepresentationFormatRepository) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.repr.OutputFormatProvider(org.neo4j.server.rest.repr.RepresentationFormatRepository) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.paging.LeaseManagerProvider(org.neo4j.server.rest.paging.LeaseManager) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.NeoServerProvider(org.neo4j.server.NeoServer) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.plugins.PluginInvocatorProvider(org.neo4j.server.AbstractNeoServer) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.ExecutionEngineProvider(org.neo4j.server.database.CypherExecutor) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.CypherExecutorProvider(org.neo4j.server.database.CypherExecutor) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.GraphDatabaseServiceProvider(org.neo4j.server.database.Database) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.DatabaseProvider(org.neo4j.server.database.Database) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rrd.RrdDbProvider(org.neo4j.server.database.RrdDbWrapper) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.web.WebServerProvider(org.neo4j.server.web.WebServer) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.web.InjectableWrapper(org.neo4j.server.plugins.Injectable) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.dbms.UserService(org.neo4j.server.security.auth.AuthManager,org.neo4j.server.rest.repr.InputFormat,org.neo4j.server.rest.repr.OutputFormat) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.management.console.ConsoleService(org.neo4j.kernel.configuration.Config,org.neo4j.server.database.Database,javax.servlet.http.HttpServletRequest,org.neo4j.server.rest.repr.OutputFormat,org.neo4j.server.database.CypherExecutor) at parameter index 0
familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.discovery.DiscoveryService(org.neo4j.kernel.configuration.Config,org.neo4j.server.rest.repr.OutputFormat) at parameter index 0
我在 spring-data-neo4j 依赖项中搜索另一个服务器实例并找到了 "neo4j-server"。
我从我的 pom 中的 sdn-4 依赖项中排除了此服务器以使用此框架:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.0.0.RC1</version>
<exclusions>
<exclusion>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
</exclusion>
</exclusions>
</dependency>
现在我可以在 JavaEE 6 下使用 spring-data-neo4j 4-RC1 版本了。
为了使用 neo4j-graphdatabase 独立服务器,我将 SDN 3.1.2 的依赖项添加到我的 pom.xml 文件中。
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-rest</artifactId>
<version>3.1.2.RELEASE</version>
</dependency>
由于 Neo4jCdiRepositoryExtension,我可以使用 spring-data-neo4j 而无需完整的 Spring-Framework(通过 CDI)。
现在我想将我的 SDN 版本更新到 4.0.0.M1。
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.0.0.M1</version>
</dependency>
我必须创建自己的 Neo4jCdiRepositoryExtension,这看起来很容易。部署过程构建我的新扩展。 要使用我的扩展,我需要这个 class 来提供所有需要的配置:
@ApplicationScoped
public class Neo4jConfigurationProvider {
@Resource(lookup = "rest/neo4j")
private String baseUriString;
private static final String PERSISTENCE_ROOT = "...";
private SessionFactory sessionFactory;
private Neo4jServer neo4jServer;
private Session session;
@PostConstruct
public void init() {
neo4jServer = new RemoteServer(baseUriString);
sessionFactory = new SessionFactory(PERSISTENCE_ROOT + ".person", PERSISTENCE_ROOT + ".relation",
PERSISTENCE_ROOT + ".relations_type");
session = sessionFactory.openSession(baseUriString);
}
@Produces
public SessionFactory sessionFactory() {
return sessionFactory;
}
@Produces
public Neo4jServer neo4jServer() {
return neo4jServer;
}
@Produces
public Neo4jTemplate neo4jTemplate() {
return new Neo4jTemplate(session);
}
}
如果我想部署它,我的 glassfish 3 服务器会给我这个错误消息:
remote failure: Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException:
org.apache.catalina.LifecycleException:
com.sun.jersey.spi.inject.Errors$ErrorMessagesException.
Please see server.log for more details.
我现在的问题是:我该如何解决这个错误?
首先我找不到任何 server.log,因为我的服务器没有启动。所以我复制了一个有效的版本,添加了 sdn-4 依赖项并尝试获取它的任何日志。所以这是我的 server.log:
的错误The following errors and warnings have been detected with resource and/or provider classes: familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.LoggingProvider(org.neo4j.kernel.logging.Logging) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.transactional.TransactionFilter(org.neo4j.server.database.Database) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.repr.InputFormatProvider(org.neo4j.server.rest.repr.RepresentationFormatRepository) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.repr.OutputFormatProvider(org.neo4j.server.rest.repr.RepresentationFormatRepository) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.paging.LeaseManagerProvider(org.neo4j.server.rest.paging.LeaseManager) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.NeoServerProvider(org.neo4j.server.NeoServer) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.plugins.PluginInvocatorProvider(org.neo4j.server.AbstractNeoServer) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.ExecutionEngineProvider(org.neo4j.server.database.CypherExecutor) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.CypherExecutorProvider(org.neo4j.server.database.CypherExecutor) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.GraphDatabaseServiceProvider(org.neo4j.server.database.Database) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.database.DatabaseProvider(org.neo4j.server.database.Database) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rrd.RrdDbProvider(org.neo4j.server.database.RrdDbWrapper) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.web.WebServerProvider(org.neo4j.server.web.WebServer) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.web.InjectableWrapper(org.neo4j.server.plugins.Injectable) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.dbms.UserService(org.neo4j.server.security.auth.AuthManager,org.neo4j.server.rest.repr.InputFormat,org.neo4j.server.rest.repr.OutputFormat) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.management.console.ConsoleService(org.neo4j.kernel.configuration.Config,org.neo4j.server.database.Database,javax.servlet.http.HttpServletRequest,org.neo4j.server.rest.repr.OutputFormat,org.neo4j.server.database.CypherExecutor) at parameter index 0 familymanager_1 | SEVERE: Missing dependency for constructor public org.neo4j.server.rest.discovery.DiscoveryService(org.neo4j.kernel.configuration.Config,org.neo4j.server.rest.repr.OutputFormat) at parameter index 0
我在 spring-data-neo4j 依赖项中搜索另一个服务器实例并找到了 "neo4j-server"。 我从我的 pom 中的 sdn-4 依赖项中排除了此服务器以使用此框架:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>4.0.0.RC1</version>
<exclusions>
<exclusion>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
</exclusion>
</exclusions>
</dependency>
现在我可以在 JavaEE 6 下使用 spring-data-neo4j 4-RC1 版本了。