Announcement Announcement Module
Collapse
No announcement yet.
Grails without Neo4j Plugin, Repositories et al, Spring Data Neo4j 2.0 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grails without Neo4j Plugin, Repositories et al, Spring Data Neo4j 2.0

    OK, I am getting closer. but when I try to run the app, I get errors.

    On a side note, I can't get the new GraphRepository to work as aspectj is probably not run by Grails run app. But I commented them out just to see if I could get to run app.

    Code:
    | Error 2011-11-20 18:28:58,698 [Thread-10] ERROR context.ContextLoader  - Context initialization failed
    Message: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' while setting bean property 'graphDatabaseService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'graphDatabaseService': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.neo4j.kernel.EmbeddedGraphDatabase]: Constructor threw exception; nested exception is org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene[lucene]
       Line | Method
    ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    
    .
    .
    
    Caused by TransactionFailureException: Could not create data source lucene[lucene]
    ->> 186 | registerDataSource in org.neo4j.kernel.impl.transaction.TxModule
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   213 | registerLuceneDataSource in org.neo4j.kernel.GraphDbInstance
    |   115 | start .  in     ''
    |   190 | <init>   in org.neo4j.kernel.EmbeddedGraphDbImpl
    |    80 | <init> . in org.neo4j.kernel.EmbeddedGraphDatabase
    |    64 | <init>   in     ''
    |   303 | innerRun in java.util.concurrent.FutureTask$Sync
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    
    Caused by InvocationTargetException: null
    ->>  77 | create   in org.neo4j.kernel.impl.transaction.XaDataSourceManager
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   180 | registerDataSource in org.neo4j.kernel.impl.transaction.TxModule
    |   213 | registerLuceneDataSource in org.neo4j.kernel.GraphDbInstance
    |   115 | start    in     ''
    |   190 | <init> . in org.neo4j.kernel.EmbeddedGraphDbImpl
    |    80 | <init>   in org.neo4j.kernel.EmbeddedGraphDatabase
    |    64 | <init> . in     ''
    |   303 | innerRun in java.util.concurrent.FutureTask$Sync
    |   138 | run . .  in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run . .  in     ''
    ^   680 | run      in java.lang.Thread
    
    Caused by NoSuchMethodError: org.neo4j.kernel.impl.transaction.xaframework.XaContainer.create(Ljava/lang/String;Lorg/neo4j/kernel/impl/transaction/xaframework/XaCommandFactory;Lorg/neo4j/kernel/impl/transaction/xaframework/XaTransactionFactory;Ljava/util/Map;)Lorg/neo4j/kernel/impl/transaction/xaframework/XaContainer;
    ->> 126 | <init>   in org.neo4j.index.lucene.LuceneDataSource
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |    77 | create   in org.neo4j.kernel.impl.transaction.XaDataSourceManager
    |   180 | registerDataSource in org.neo4j.kernel.impl.transaction.TxModule
    |   213 | registerLuceneDataSource in org.neo4j.kernel.GraphDbInstance
    |   115 | start .  in     ''
    |   190 | <init>   in org.neo4j.kernel.EmbeddedGraphDbImpl
    |    80 | <init> . in org.neo4j.kernel.EmbeddedGraphDatabase
    |    64 | <init>   in     ''
    |   303 | innerRun in java.util.concurrent.FutureTask$Sync
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    | Error 2011-11-20 18:28:58,785 [Thread-10] ERROR context.GrailsContextLoader  - Error executing bootstraps: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' . Constructor threw exception; nested exception is org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene[lucene]
    
    Message: Error creating bean with name 'org.springframework.data.neo4j.config.Neo4jConfiguration#0': Cannot resolve reference to bean 'graphDatabaseService' while setting bean property 'graphDatabaseService'; nested exception is org.springframework.beans.factory.BeanCreationException: . Constructor threw exception; nested exception is org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene[lucene]
       Line | Method
    ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    
    Caused by BeanCreationException: Error creating bean with name 'graphDatabaseService': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.neo4j.kernel.EmbeddedGraphDatabase]: Constructor threw exception; nested exception is org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene[lucene]
    ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    
    Caused by BeanInstantiationException: Could not instantiate bean class [org.neo4j.kernel.EmbeddedGraphDatabase]: Constructor threw exception; nested exception is org.neo4j.graphdb.TransactionFailureException: Could not create data source lucene[lucene]
    ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    
    Caused by TransactionFailureException: Could not create data source lucene[lucene]
    ->> 186 | registerDataSource in org.neo4j.kernel.impl.transaction.TxModule
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   213 | registerLuceneDataSource in org.neo4j.kernel.GraphDbInstance
    |   115 | start .  in     ''
    |   190 | <init>   in org.neo4j.kernel.EmbeddedGraphDbImpl
    |    80 | <init> . in org.neo4j.kernel.EmbeddedGraphDatabase
    |    64 | <init>   in     ''
    |   303 | innerRun in java.util.concurrent.FutureTask$Sync
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    
    Caused by InvocationTargetException: null
    ->>  77 | create   in org.neo4j.kernel.impl.transaction.XaDataSourceManager
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |   180 | registerDataSource in org.neo4j.kernel.impl.transaction.TxModule
    |   213 | registerLuceneDataSource in org.neo4j.kernel.GraphDbInstance
    |   115 | start    in     ''
    |   190 | <init> . in org.neo4j.kernel.EmbeddedGraphDbImpl
    |    80 | <init>   in org.neo4j.kernel.EmbeddedGraphDatabase
    |    64 | <init> . in     ''
    |   303 | innerRun in java.util.concurrent.FutureTask$Sync
    |   138 | run . .  in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run . .  in     ''
    ^   680 | run      in java.lang.Thread
    
    Caused by NoSuchMethodError: org.neo4j.kernel.impl.transaction.xaframework.XaContainer.create(Ljava/lang/String;Lorg/neo4j/kernel/impl/transaction/xaframework/XaCommandFactory;Lorg/neo4j/kernel/impl/transaction/xaframework/XaTransactionFactory;Ljava/util/Map;)Lorg/neo4j/kernel/impl/transaction/xaframework/XaContainer;
    ->> 126 | <init>   in org.neo4j.index.lucene.LuceneDataSource
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
    |    77 | create   in org.neo4j.kernel.impl.transaction.XaDataSourceManager
    |   180 | registerDataSource in org.neo4j.kernel.impl.transaction.TxModule
    |   213 | registerLuceneDataSource in org.neo4j.kernel.GraphDbInstance
    |   115 | start .  in     ''
    |   190 | <init>   in org.neo4j.kernel.EmbeddedGraphDbImpl
    |    80 | <init> . in org.neo4j.kernel.EmbeddedGraphDatabase
    |    64 | <init>   in     ''
    |   303 | innerRun in java.util.concurrent.FutureTask$Sync
    |   138 | run      in java.util.concurrent.FutureTask
    |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
    |   908 | run      in     ''
    ^   680 | run . .  in java.lang.Thread
    
    Process finished with exit code 1
    I used the applicationContext.xml to add the two <neo4j> tags

    Code:
     <context:spring-configured/>
        <neo4j:config storeDirectory="target/config"/>
        <neo4j:repositories base-package="com.perfectworldprogramming.eventgate.spring.data.repository"/>
    Thanks

    Mark

  • #2
    Hmm the namespace adds some bean-definitions to the application context (including the one for the graphDatabaseContext).

    Can you try do add this manually?

    Code:
         <neo4j:config storeDirectory="target/config" graphDatabaseService="graphDatabaseService"/>
          <neo4j:repositories base-package="com.perfectworldprogramming.eventgate.spring.data.repository" graphDatabaseService="graphDatabaseService"/>
    
        <bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase" destroy-method="shutdown">
            <constructor-arg index="0" value="target/config-test"/>
        </bean>

    Comment


    • #3
      Same error.

      Also you posted for neo4j:repositories to have an attribute called graphDatabaseService and it did not have such an attribute.

      Here is my entire applicationContext.xml just so you can see which versions I have for the xsd files. Maybe I am using a wrong version.

      What about TransactionManager, I was assumed grails did this automatically, it looks like this is the last caused by

      Code:
      Caused by NoSuchMethodError: org.neo4j.kernel.impl.transaction.xaframework.XaContainer.create(Ljava/lang/String;Lorg/neo4j/kernel/impl/transaction/xaframework/XaCommandFactory;Lorg/neo4j/kernel/impl/transaction/xaframework/XaTransactionFactory;Ljava/util/Map;)Lorg/neo4j/kernel/impl/transaction/xaframework/XaContainer;
      ->> 126 | <init>   in org.neo4j.index.lucene.LuceneDataSource
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
      |    77 | create   in org.neo4j.kernel.impl.transaction.XaDataSourceManager
      |   180 | registerDataSource in org.neo4j.kernel.impl.transaction.TxModule
      |   213 | registerLuceneDataSource in org.neo4j.kernel.GraphDbInstance
      |   115 | start .  in     ''
      |   190 | <init>   in org.neo4j.kernel.EmbeddedGraphDbImpl
      |    80 | <init> . in org.neo4j.kernel.EmbeddedGraphDatabase
      |    64 | <init>   in     ''
      |   303 | innerRun in java.util.concurrent.FutureTask$Sync
      |   138 | run      in java.util.concurrent.FutureTask
      |   886 | runTask  in java.util.concurrent.ThreadPoolExecutor$Worker
      |   908 | run      in     ''
      ^   680 | run . .  in java.lang.Thread
      
      Process finished with exit code 1
      Thanks

      Mark

      Comment


      • #4
        Oh, sorry you're right. It's already a bit late

        If you look at the XSD: http://www.springframework.org/schem...-neo4j-2.0.xsd
        you see that there is neo4j-template-ref for <neo4j:repositories neo4j-template-ref="neo4jTemplate"/>

        So you most probably don't need that as it defaults to neo4jTemplate anyway.

        Comment


        • #5
          I also forgot to post my applicationContext.xml in the post before. Here it is.

          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:neo4j="http://www.springframework.org/schema/data/neo4j"
                 xmlns:context="http://www.springframework.org/schema/context"
                 xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.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/context http://www.springframework.org/schema/context/spring-context.xsd">
          
              <context:spring-configured/>
          
              <neo4j:config storeDirectory="config" graphDatabaseService="graphDatabaseService"/>
              <neo4j:repositories base-package="com.perfectworldprogramming.eventgate.spring.data.repository"/>
          
              <bean id="graphDatabaseService" class="org.neo4j.kernel.EmbeddedGraphDatabase" destroy-method="shutdown">
                  <constructor-arg index="0" value="config"/>
              </bean>
          
          
          	<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
          		<description>Grails application factory bean</description>
          		<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
          		<property name="grailsResourceLoader" ref="grailsResourceLoader" />
          	</bean>
          
          	<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
          		<description>A bean that manages Grails plugins</description>
          		<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
          		<property name="application" ref="grailsApplication" />
          	</bean>
          
          	<bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
          		<constructor-arg>
          			<ref bean="grailsApplication" />
          		</constructor-arg>
          		<property name="pluginManager" ref="pluginManager" />
          	</bean>
          
          	<bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean" />
          
          	<bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter">
          		<property name="encoding">
          			<value>utf-8</value>
          		</property>
          	</bean>
          </beans>

          Comment

          Working...
          X