Announcement Announcement Module
Collapse
No announcement yet.
Adding neo4j xml config to simple spring web app generates 'Validator not found error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding neo4j xml config to simple spring web app generates 'Validator not found error

    I'm trying out Neo4j for the first time. I've created a separate 'neo4jContext.xml' file, and add this as an 'include' to the main applicationContext.xml file

    neo4jContext.xml:
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
    	xmlns:util="http://www.springframework.org/schema/util"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
    		http://www.springframework.org/schema/data/neo4j http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd
    		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
    	<neo4j:repositories base-package="com.eis" />
    	<neo4j:config storeDirectory="c:/data/neo4j/jourdan" />
    
    </beans>
    However, when I add this I get the following error ...
    Code:
    org.springframework.beans.factory.BeanCreationException: 
    Error creating bean with name 'neo4jRelationshipBacking' defined in class path resource [org/springframework/data/neo4j/aspects/config/Neo4jAspectConfiguration.class]: 
    Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.neo4j.aspects.support.relationship.Neo4jRelationshipBacking org.springframework.data.neo4j.aspects.config.Neo4jAspectConfiguration.neo4jRelationshipBacking() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'neo4jTemplate' defined in class path resource [org/springframework/data/neo4j/aspects/config/Neo4jAspectConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.neo4j.support.Neo4jTemplate org.springframework.data.neo4j.config.Neo4jConfiguration.neo4jTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingInfrastructure' defined in class path resource [org/springframework/data/neo4j/aspects/config/Neo4jAspectConfiguration.class]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
     Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: javax/validation/Validator
    Any ideas?

  • #2
    I've changed my neo4jContext.xml file to...

    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
            xmlns:context="http://www.springframework.org/schema/context"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:neo4j="http://www.springframework.org/schema/data/neo4j"
            xsi:schemaLocation="
                http://www.springframework.org/schema/beans
                http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                http://www.springframework.org/schema/context
                http://www.springframework.org/schema/context/spring-context-3.0.xsd
                http://www.springframework.org/schema/data/neo4j
                http://www.springframework.org/schema/data/neo4j/spring-neo4j-2.0.xsd">
    
        <context:annotation-config/>
         <context:spring-configured/>
        <neo4j:config storeDirectory="c:/data/neo4j/jourdan"/>
    
    </beans>
    ... and now I get error...

    Code:
    SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.NoClassDefFoundError: Ljavax/validation/Validator;
    	at java.lang.Class.getDeclaredFields0(Native Method)
    	at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
    	at java.lang.Class.getDeclaredFields(Class.java:1743)
    	at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:372)
    	at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor.java:320)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyMergedBeanDefinitionPostProcessors(AbstractAutowireCapableBeanFactory.java:798)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:493)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
    	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: java.lang.ClassNotFoundException: javax.validation.Validator
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
    	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    	... 42 more
    19-Mar-2012 09:04:03 org.apache.catalina.core.StandardContext start
    SEVERE: Error listenerStart
    19-Mar-2012 09:04:03 org.apache.catalina.core.StandardContext start
    SEVERE: Context [/jourdan] startup failed due to previous errors
    19-Mar-2012 09:04:03 org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext
    19-Mar-2012 09:04:04 org.zkoss.zk.ui.http.WebManager <init>:112
    INFO: Starting ZK 5.0.6 CE (build: 2011022418)
    19-Mar-2012 09:04:04 org.zkoss.zk.ui.sys.ConfigParser parseConfigXml:158
    Looks like something in the neo4j stuff is looking for a Validator bean... do I need to define something somewhere? What jar includes the Validator class?

    Comment

    Working...
    X