[Neo4j] Exception when adding a "Comment" property to a node

Paul A. Jackson Paul.Jackson at pb.com
Tue Oct 12 21:33:19 CEST 2010


All,

Sorry for the false alarm.  It turns out that the actual field name that I was using was "Comment\n" (literal newline at end of string), not "Comment".  We do not have a requirement to index properties with newlines in their name, so you can ignore this post.

Thanks for looking it to it.

-Paul


If anyone still wants the test program, here it is:

import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Transaction;
import org.neo4j.index.lucene.LuceneIndexService;
import org.neo4j.kernel.EmbeddedGraphDatabase;

public class Comment
{
  private static GraphDatabaseService graph;
  private static LuceneIndexService indexService;

  public static void main(String[] args)
  {
    graph = new EmbeddedGraphDatabase("./graph.comment");
    indexService = new LuceneIndexService(graph);
    Transaction tx = null;
    try
    {
      Node node;

      tx = graph.beginTx();
      node = graph.createNode();
      setProperty(node, "Foo", "Bar");
      tx.success();
      tx.finish();

      tx = graph.beginTx();
      node = graph.createNode();
      setProperty(node, "Comment\n", "This should be no different.");
      tx.success();
      tx.finish();
    }
    catch (Throwable e)
    {
      e.printStackTrace();
      tx.failure();
      tx.finish();
    }
    indexService.shutdown();
    graph.shutdown();
  }

  private static void setProperty(Node node, String key, String value)
  {
    node.setProperty(key, value);
    indexService.index(node, key, value);
  }
}


-----Original Message-----
From: user-bounces at lists.neo4j.org [mailto:user-bounces at lists.neo4j.org] On Behalf Of Mattias Persson
Sent: Tuesday, October 12, 2010 3:46 AM
To: Neo4j user discussions
Subject: Re: [Neo4j] Exception when adding a "Comment" property to a node

Seems like your index key contains characters illegal on your current file
system... would it be possible to see the code? or could you supply which
index keys you use to index your comments?

2010/10/12 Tobias Ivarsson <tobias.ivarsson at neotechnology.com>

> Hi Paul,
>
> Comment is not a reserved word, there are no reserved words for what
> property keys you can use.
>
> Are you also indexing that "Comment" property? It looks like the exception
> originates from the index component. If so we need to find a work around
> for
> that.
>
> I can see that you are running this on windows. I'm wondering if this could
> be the index component trying to create some file (for storing the index)
> that your file system rejects.
>
> Which versions of Neo4j-kernel and Neo4j-index are you using?
>
> Have you isolated this so that it is only a "Comment" property being
> indexed, or are there other indexes to factor in as well?
>
> Cheers,
> Tobias
>
> On Tue, Oct 12, 2010 at 12:49 AM, Paul A. Jackson <Paul.Jackson at pb.com
> >wrote:
>
> > Using Neo4j 1.1, when I create a node that has a "Comment" property, I
> get
> > the following exception when I commit the node:
> >
> > javax.transaction.xa.XAException: Unknown
> > xid[GlobalId[NEOKERNL|1286836445937|4], BranchId[ 52 49 52 49 52 49 ]]
> >            at
> >
> org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.rollback(XaResourceManager.java:416)
> >            at
> >
> org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.rollback(XaResourceHelpImpl.java:111)
> >            at
> >
> org.neo4j.kernel.impl.transaction.TransactionImpl.doRollback(TransactionImpl.java:533)
> >            at
> > org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:616)
> >            at
> > org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:561)
> >            at
> >
> org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:104)
> >            at
> >
> org.neo4j.kernel.EmbeddedGraphDbImpl$TransactionImpl.finish(EmbeddedGraphDbImpl.java:560)
> >            at
> com.g1.dcg.graph.neo4j.NeoGraph.newNeoNode(NeoGraph.java:167)
> > Oct 11, 2010 6:34:06 PM org.neo4j.kernel.impl.transaction.TxManager
> commit
> > SEVERE: Unable to rollback transaction. Some resources may be commited
> > others not. Neo4j kernel should be SHUTDOWN for resource maintance and
> > transaction recovery ---->
> > java.lang.RuntimeException: java.io.IOException: The filename, directory
> > name, or volume label syntax is incorrect
> >            at
> >
> org.neo4j.index.lucene.LuceneDataSource.getIndexWriter(LuceneDataSource.java:398)
> >            at
> >
> org.neo4j.index.lucene.LuceneTransaction.doCommit(LuceneTransaction.java:207)
> >            at
> >
> org.neo4j.kernel.impl.transaction.xaframework.XaTransaction.commit(XaTransaction.java:316)
> >            at
> >
> org.neo4j.kernel.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:399)
> >            at
> >
> org.neo4j.kernel.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64)
> >            at
> >
> org.neo4j.kernel.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:516)
> >            at
> > org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:590)
> >            at
> > org.neo4j.kernel.impl.transaction.TxManager.commit(TxManager.java:561)
> >            at
> >
> org.neo4j.kernel.impl.transaction.TransactionImpl.commit(TransactionImpl.java:104)
> >            at
> >
> org.neo4j.kernel.EmbeddedGraphDbImpl$TransactionImpl.finish(EmbeddedGraphDbImpl.java:560)
> >            at
> com.g1.dcg.graph.neo4j.NeoGraph.newNeoNode(NeoGraph.java:167)
> > Caused by: java.io.IOException: The filename, directory name, or volume
> > label syntax is incorrect
> >            at java.io.WinNTFileSystem.canonicalize0(Native Method)
> >            at
> > java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396)
> >            at java.io.File.getCanonicalPath(File.java:559)
> >            at
> >
> org.apache.lucene.store.FSDirectory.getCanonicalPath(FSDirectory.java:340)
> >            at
> > org.apache.lucene.store.FSDirectory.<init>(FSDirectory.java:381)
> >            at
> >
> org.apache.lucene.store.SimpleFSDirectory.<init>(SimpleFSDirectory.java:40)
> >            at
> > org.apache.lucene.store.FSDirectory.open(FSDirectory.java:424)
> >            at
> > org.apache.lucene.store.FSDirectory.open(FSDirectory.java:411)
> >            at
> >
> org.neo4j.index.lucene.LuceneDataSource.getDirectory(LuceneDataSource.java:326)
> >            at
> >
> org.neo4j.index.lucene.LuceneDataSource.getIndexWriter(LuceneDataSource.java:385)
> >            ... 19 more
> >
> > Is "Comment" as reserved word and are there other reserved words?
> >
> > Thanks,
> > -Paul
> > _______________________________________________
> > Neo4j mailing list
> > User at lists.neo4j.org
> > https://lists.neo4j.org/mailman/listinfo/user
> >
>
>
>
> --
> Tobias Ivarsson <tobias.ivarsson at neotechnology.com>
> Hacker, Neo Technology
> www.neotechnology.com
> Cellphone: +46 706 534857
> _______________________________________________
> Neo4j mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [mattias at neotechnology.com]
Hacker, Neo Technology
www.neotechnology.com
_______________________________________________
Neo4j mailing list
User at lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user



More information about the User mailing list