Hey people!
I'm having a curious problem when trying to configure the spring-data-neo4j with the cross-store support enabled. Everything is fine, except when I add the entityManagerFactory attribute to the <neo4j:config /> element to enable the cross-store support, then I get the following error during app bootstrap:
Looks like something is wrong with the type of Bean it's been created for the Neo4J configuration. It's supposed to be a subclass of Neo4jConfiguration (where the entityManagerFactory field exists) when cross-store is needed, isn't it?Code:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'entityManagerFactory' of bean class [org.springframework.data.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$3f3c4ea8]: Bean property 'entityManagerFactory' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1396) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) 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:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
My app has the following specs:
Other dependencies were omitted, but mainly I'm using PostgreSQL9 with Postgis support, Joda Time, and a bunch of other libraries I've already used before with success (always with Spring).Code:spring-{core,aop,aspects,beans,context,context-support,expression,jdbc,orm,oxm,web,webmvc}-3.1.0.RELEASE spring-data-commons-core-1.2.0.RELEASE spring-data-{neo4j,neo4j-rest}-2.0.0.RELEASE hibernate-{core,entitymanager}-3.6.9
I'm using Maven and Eclipse. In my pom.xml I have the AspectJ (org.codehaus.mojo:aspectj-maven-plugin-1.4) and the Eclipse (org.apache.maven.plugins:maven-eclipse-plugin-2.8) plugins. My project shows in Eclipse as a Web project and as an AspectJ project too (that means the maven Eclipse plugin is working as expected, I guess). In my AspectJ plugin I have the spring-aspects library configured.
I'm using Tomcat 6.0.32 and the spring-agent is configured at startup time as a jvm argument.
On other spring file (loaded before the neo4j one) I have:Code:<neo4j:config graphDatabaseService="graphDatabaseService" entityManagerFactory="entityManagerFactory" /> <bean id="graphDatabaseService" class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase"> <constructor-arg index="0" value="http://server-ip:7474/db/data" /> <constructor-arg index="1" value="******" /> <constructor-arg index="2" value="******" /> </bean>
If anyone need more details, just ask me.Code:<context:annotation-config /> and <context:load-time-weaver />
Is there anyone to help me out on this one? I have experience with Spring since 1.2 but I'm having a hard time on this one!!!
Kind regards,
Daniel


Reply With Quote
