Re: [Neo4j] Does it possible to use neo4j-server with jo4neo?

2011-03-14 Thread Batistuta Gabriel
Dear Michael,

I've already integrated the source code of jo4neo in my projet. It  
means that jo4neo is using the library 1.3 api of neo4j. Did you mean  
this kind of update? because It doesn't work. I still have the same  
problem...

Maybe It's better that I wait your update. I'll try to investiagte  
more in my problem and will tell you some feedback if I find something.

Thanks for your help,

Bat

Le 13-mars-11 à 13:37, Michael Hunger a écrit :

 Batistuta,

 It is for using Neo4j-Server, but is based on the current-API  
 (1.3.x) not on the 1.0 version that jo4neo runs against.

 You can update jo4neo to use the latest neo4j api locally (or fork  
 the project). Then you can use 1. the current neo4j graph database,  
 2. the current neo4j-rest-wrapper with neo4j.

 If I find time next week, I can try to do that, but am quite  
 overloaded now.

 Michael

 Am 13.03.2011 um 10:58 schrieb Batistuta Gabriel:

 Hi,

 but I dont't understand. Why do you implement /neo4j-java-rest- 
 binding ? It's not for using neo4j-server and jo4neo together?

 Actually my code is working with jo4neo, it's the reason why I  
 don't want to change directly my code for using Spring Data...

 Have a nice w-e,

 Bat
 Le 12-mars-11 à 22:47, Michael Hunger a écrit :

 I think the main problem is, that jo4neo runs agains neo4j - 1.0,  
 so there are lots of things that have changed since then.

 Perhaps you are interested in looking into Spring Data Graph which  
 also provides object-persistence -
 http://springsource.org/spring-data
 http://github.com/springsource/spring-data-graph

 Thanks

 Michael

 Am 11.03.2011 um 16:47 schrieb Peter Neubauer:

 Any idea?

 /peter

 Send from my mobile device, please excuse typos and brevity.

 -- Forwarded message --
 From: Batistuta Gabriel batistutagabrielf...@gmail.com
 Date: Mar 11, 2011 5:29 PM
 Subject: Re: Does it possible to use neo4j-server with jo4neo?
 To: Peter Neubauer peter.neuba...@neotechnology.com

 Maybe, you could help me. with this line of code :

 GraphDatabaseService gds = new RestGraphDatabase(new 
 URI(http://localhost:7474/db/data/ 
 ));
 ObjectGraph graph = ObjectGraphFactory.instance().get(gds);  // 
 this line triggers the error


 I've this error :
 null
 org 
 .neo4j 
 .index.lucene.LuceneIndexService.init(LuceneIndexService.java:103)
 jo4neo.impl.IndexedNeo.init(IndexedNeo.java:39)
 jo4neo.impl.ObjectGraphImpl.init(ObjectGraphImpl.java:29)
 jo4neo.impl.ObjectGraphProvider.create(ObjectGraphProvider.java:10)
 jo4neo.ObjectGraphFactory.get(ObjectGraphFactory.java:37)
 connection.GraphJo4neo.connect(GraphJo4neo.java:61)


 Do you have any idea? My neo4j-server is running correctly...

 thanks

 Le 11-mars-11 à 16:39, Peter Neubauer a écrit :

 Well,
 it's not super stable, but we are working on making it into a
 supported component, so you can check on the Neo4j users list with
 Michael if you have issues?

 Cheers,

 /peter neubauer

 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer

 http://www.neo4j.org   - Your high performance graph  
 database.
 http://startupbootcamp.org/- Öresund - Innovation happens  
 HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing  
 party.



 On Fri, Mar 11, 2011 at 4:11 PM, Batistuta Gabriel
 batistutagabrielf...@gmail.com wrote:
 Thanks, I'll try.

 Is it really stable?

 thkx

 Le 11-mars-11 à 15:59, Peter Neubauer a écrit :

 Bat,
 you could try out the dropin REST replacement for the
 GraphDatabaseService done by Michael Hunger,
 https://github.com/jexp/neo4j-java-rest-binding .

 It's not superfast, but might do the trick?

 Cheers,

 /peter neubauer

 GTalk:  neubauer.peter
 Skype   peter.neubauer
 Phone   +46 704 106975
 LinkedIn   http://www.linkedin.com/in/neubauer
 Twitter  http://twitter.com/peterneubauer

 http://www.neo4j.org   - Your high performance  
 graph database.
 http://startupbootcamp.org/- Öresund - Innovation happens  
 HERE.
 http://www.thoughtmade.com - Scandinavia's coolest Bring-a- 
 Thing party.



 On Fri, Mar 11, 2011 at 3:56 PM, BGrabiel
 batistutagabrielf...@gmail.com wrote:

 Hi,

 Everything is in the subject. Do you know if it's possible to  
 use neo4-
 server with jo4neo? My 2 instances of jo4neo and neo4j-server  
 will be
 on the same server but It's easier to explore the data from the
 webamdin.

 Thank you,

 Bat







___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Online Backup : wich package?

2010-06-10 Thread Batistuta Gabriel
I progress slowly...but I have a new error.
Here is my code :
//create the graph
neo = new EmbeddedGraphDatabase(CONSTANTS.GRAPH_PATH);
graph = ObjectGraphFactory.instance().get(neo);

for (String datasource : new String[]{nioneodb, lucene}) {
neo.getConfig().getTxModule().getXaDataSourceManager()
.getXaDataSource( datasource ).keepLogicalLogs( true );
  }


graph.close();
neo.shutdown();
/*
  * here, I put my code to copy the content of the graph directory to  
the backup directory
  **/

//open again the graph
neo = new EmbeddedGraphDatabase(CONSTANTS.GRAPH_PATH);
graph = ObjectGraphFactory.instance().get(neo);

/**
  * I create the backup graph
  **/
EmbeddedGraphDatabase neo = GraphJo4neo.getGraphDatabaseService();
EmbeddedGraphDatabase backupGraphDb = new  
EmbeddedGraphDatabase( CONSTANTS.GRAPH_BACKUP_PATH );
IndexService backupIndexService = new  
LuceneIndexService( backupGraphDb );
Backup backup = new Neo4jBackup( neo, backupGraphDb,
new ArrayListString()
{
  {
  add( nioneodb );
  add( lucene );
  }
} );

try {
backup.enableFileLogger();
backup.setLogLevelDebug();
backup.doBackup();  //  /!!\ : ERROR HERE
} catch (IOException e) {}
backupIndexService.shutdown();
backupGraphDb.shutdown();


But I obtain this error :
java.lang.RuntimeException: Missing log entry in backup source: [10]  
in resource [nioneodb]. Can not perform backup.
at org.neo4j.onlinebackup.Neo4jBackup 
$Neo4jBackupTask.prepare(Neo4jBackup.java:362)
at org.neo4j.onlinebackup.Neo4jBackup.runMultiBackup(Neo4jBackup.java: 
262)
at org.neo4j.onlinebackup.Neo4jBackup.doBackup(Neo4jBackup.java:196)
at util.BackupNeo4j.run(BackupNeo4j.java:53)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)


Many thanks for your attention,

Bat

Le 09-juin-10 à 18:01, Tobias Ivarsson a écrit :

 The exception really says it all. You are trying to backup to a  
 target that
 does not have the same origin as the source.

 You need to create the target Neo4j store by either letting the
 online-backup component create it, using the
 Neo4jBackup(EmbeddedGraphDatabase, String, ...) constructors, or  
 manually
 create a copy of the store on the file system level before you do the
 initial copying.

 Cheers,
 Tobias

 On Wed, Jun 9, 2010 at 5:41 PM, Batistuta Gabriel 
 batistutagabrielf...@gmail.com wrote:

 I fixed one problem. But I still have a problem.

 My classes are starded from BlazeDS. It's a server-based Java  
 remoting
 installed on Glassfish. So, I can not see the packages of neo4j on  
 the
 classpath.
 However, I use this packages :
 lucene-core-2.9.1.jar
 neo4j-remote-graphdb-0.5.jar
 neo4j-commons-0.4.jar
 neo4j-index-1.0-b1.jar
 neo4j-kernel-1.0-rc.jar
 neo4j-shell-1.0-rc.jar
 neo4j-apoc-examples-0.5.jar
 neo4j-online-backup-0.5.jar
 neo4j-remote-graphdb-0.5.jar

 when I run my program, now I obtain this error :
 java.lang.RuntimeException: Source[1276097996318,1276097996318] is  
 not
 same as destination[1276097998894,1276097998894] for resource  
 [nioneodb]
at org.neo4j.onlinebackup.Neo4jBackup
 $Neo4jBackupTask.prepare(Neo4jBackup.java:329)
   at
 org.neo4j.onlinebackup.Neo4jBackup.runMultiBackup(Neo4jBackup.java:
 262)
   at  
 org.neo4j.onlinebackup.Neo4jBackup.doBackup(Neo4jBackup.java:196)
at util.BackupNeo4j.run(BackupNeo4j.java:49)

 Thanks

 Le 09-juin-10 à 14:21, Tobias Ivarsson a écrit :

 You could also use this code to print the classpath:

   //Get the System Classloader
   ClassLoader sysClassLoader =
 ClassLoader.getSystemClassLoader();

   //Get the URLs
   URL[] urls = ((URLClassLoader)sysClassLoader).getURLs();

   *for*(*int *i=0; i urls.length; i++)
   {
   System.out.println(urls[i].getFile());
   }

 This might give a slightly more complete view of the paths from  
 where
 classes are loaded.
 (if, for example you have added the Neo4j jar files in your Java
 extension
 library directory, they might not appear in the java.class.path
 property)

 From

 http://www.java-tips.org/java-se-tips/java.lang/how-to-print-classpath.html

 On Wed, Jun 9, 2010 at 2:09 PM, Johan Svensson jo...@neotechnology.com
 wrote:

 What was the output of
 System.out.println(System.getProperty(java.class.path)); as
 Tobias
 asked you to do?

 On Wed, Jun 9, 2010 at 1:56 PM, Batistuta Gabriel
 batistutagabrielf...@gmail.com wrote:
 However, I obtain this error :
 java.lang.NoSuchMethodError:
 org.neo4j.onlinebackup.AbstractResource.init(Lorg/neo4j/kernel/
 impl/
 transaction/x
 aframework/XaDataSource;)V
  at
 org
 .neo4j
 .onlinebackup
 .EmbeddedGraphDatabaseResource
 .init(EmbeddedGraphDatabaseResource.java:31

Re: [Neo4j] Online Backup : wich package?

2010-06-10 Thread Batistuta Gabriel

 The keepLogicalLogs( true ) parts need to be there for the part of  
 the code
 where you do the backups.
What does it means in my case? My part of code is not correct? Because  
if I understand, you mean that I need to use the code  
keepLogicalLogs( true ) in the same class where I do my backup?
Sorry for my misunderstanding,

Best,
Bat


 Cheers,
 Tobias

 On Thu, Jun 10, 2010 at 10:16 AM, Batistuta Gabriel 
 batistutagabrielf...@gmail.com wrote:

 I progress slowly...but I have a new error.
 Here is my code :
 //create the graph
 neo = new EmbeddedGraphDatabase(CONSTANTS.GRAPH_PATH);
 graph = ObjectGraphFactory.instance().get(neo);

 for (String datasource : new String[]{nioneodb, lucene}) {
   neo.getConfig().getTxModule().getXaDataSourceManager()
   .getXaDataSource( datasource ).keepLogicalLogs( true );
 }


 graph.close();
 neo.shutdown();
 /*
 * here, I put my code to copy the content of the graph directory to
 the backup directory
 **/

 //open again the graph
 neo = new EmbeddedGraphDatabase(CONSTANTS.GRAPH_PATH);
 graph = ObjectGraphFactory.instance().get(neo);

 /**
 * I create the backup graph
  **/
 EmbeddedGraphDatabase neo = GraphJo4neo.getGraphDatabaseService();
 EmbeddedGraphDatabase backupGraphDb = new
 EmbeddedGraphDatabase( CONSTANTS.GRAPH_BACKUP_PATH );
 IndexService backupIndexService = new
 LuceneIndexService( backupGraphDb );
 Backup backup = new Neo4jBackup( neo, backupGraphDb,
   new ArrayListString()
   {
 {
 add( nioneodb );
 add( lucene );
 }
   } );

 try {
   backup.enableFileLogger();
   backup.setLogLevelDebug();
backup.doBackup();  //  /!!\ : ERROR HERE
 } catch (IOException e) {}
 backupIndexService.shutdown();
 backupGraphDb.shutdown();


 But I obtain this error :
 java.lang.RuntimeException: Missing log entry in backup source: [10]
 in resource [nioneodb]. Can not perform backup.
at org.neo4j.onlinebackup.Neo4jBackup
 $Neo4jBackupTask.prepare(Neo4jBackup.java:362)
at
 org.neo4j.onlinebackup.Neo4jBackup.runMultiBackup(Neo4jBackup.java:
 262)
   at  
 org.neo4j.onlinebackup.Neo4jBackup.doBackup(Neo4jBackup.java:196)
at util.BackupNeo4j.run(BackupNeo4j.java:53)
   at java.util.TimerThread.mainLoop(Timer.java:512)
   at java.util.TimerThread.run(Timer.java:462)


 Many thanks for your attention,

 Bat

 Le 09-juin-10 à 18:01, Tobias Ivarsson a écrit :

 The exception really says it all. You are trying to backup to a
 target that
 does not have the same origin as the source.

 You need to create the target Neo4j store by either letting the
 online-backup component create it, using the
 Neo4jBackup(EmbeddedGraphDatabase, String, ...) constructors, or
 manually
 create a copy of the store on the file system level before you do  
 the
 initial copying.

 Cheers,
 Tobias

 On Wed, Jun 9, 2010 at 5:41 PM, Batistuta Gabriel 
 batistutagabrielf...@gmail.com wrote:

 I fixed one problem. But I still have a problem.

 My classes are starded from BlazeDS. It's a server-based Java
 remoting
 installed on Glassfish. So, I can not see the packages of neo4j on
 the
 classpath.
 However, I use this packages :
 lucene-core-2.9.1.jar
 neo4j-remote-graphdb-0.5.jar
 neo4j-commons-0.4.jar
 neo4j-index-1.0-b1.jar
 neo4j-kernel-1.0-rc.jar
 neo4j-shell-1.0-rc.jar
 neo4j-apoc-examples-0.5.jar
 neo4j-online-backup-0.5.jar
 neo4j-remote-graphdb-0.5.jar

 when I run my program, now I obtain this error :
 java.lang.RuntimeException: Source[1276097996318,1276097996318] is
 not
 same as destination[1276097998894,1276097998894] for resource
 [nioneodb]
   at org.neo4j.onlinebackup.Neo4jBackup
 $Neo4jBackupTask.prepare(Neo4jBackup.java:329)
  at
 org.neo4j.onlinebackup.Neo4jBackup.runMultiBackup(Neo4jBackup.java:
 262)
  at
 org.neo4j.onlinebackup.Neo4jBackup.doBackup(Neo4jBackup.java:196)
   at util.BackupNeo4j.run(BackupNeo4j.java:49)

 Thanks

 Le 09-juin-10 à 14:21, Tobias Ivarsson a écrit :

 You could also use this code to print the classpath:

  //Get the System Classloader
  ClassLoader sysClassLoader =
 ClassLoader.getSystemClassLoader();

  //Get the URLs
  URL[] urls = ((URLClassLoader)sysClassLoader).getURLs();

  *for*(*int *i=0; i urls.length; i++)
  {
  System.out.println(urls[i].getFile());
  }

 This might give a slightly more complete view of the paths from
 where
 classes are loaded.
 (if, for example you have added the Neo4j jar files in your Java
 extension
 library directory, they might not appear in the java.class.path
 property)

 From


 http://www.java-tips.org/java-se-tips/java.lang/how-to-print-classpath.html

 On Wed, Jun 9, 2010 at 2:09 PM, Johan Svensson 
 jo...@neotechnology.com
 wrote:

 What was the output of
 System.out.println(System.getProperty(java.class.path)); as
 Tobias
 asked you to do?

 On Wed, Jun 9, 2010 at 1:56 PM, Batistuta Gabriel

Re: [Neo4j] Online Backup : wich package?

2010-06-10 Thread Batistuta Gabriel
Many thanks : It's running now!

Is it possible to define the place where we want to set the backup log  
of the class Neo4jBackup?

Best,
Bat

Le 10-juin-10 à 11:17, Tobias Ivarsson a écrit :

 Here is a quick patch of your code (I haven't tried it, but it shows  
 the
 conceptual difference):


 neo = new EmbeddedGraphDatabase(CONSTANTS.GRAPH_PATH);
 for (String datasource : new String[]{nioneodb, lucene}) {
   neo.getConfig().getTxModule().getXaDataSourceManager()
   .getXaDataSource( datasource ).keepLogicalLogs( true );
 }
 graph = ObjectGraphFactory.instance().get(neo);


 graph.close();
 neo.shutdown();
 /*
 * here, I put my code to copy the content of the graph directory to
 the backup directory
 **/
 /**
 * I create the backup graph
 **/
 EmbeddedGraphDatabase neo = GraphJo4neo.getGraphDatabaseService();
 for (String datasource : new String[]{nioneodb, lucene}) {
   neo.getConfig().getTxModule().getXaDataSourceManager()
   .getXaDataSource( datasource ).keepLogicalLogs( true );
 }
 EmbeddedGraphDatabase backupGraphDb = new
 EmbeddedGraphDatabase( CONSTANTS.GRAPH_BACKUP_PATH );
 IndexService backupIndexService = new
 LuceneIndexService( backupGraphDb );
 Backup backup = new Neo4jBackup( neo, backupGraphDb,
   new ArrayListString()
   {
 {
 add( nioneodb );
 add( lucene );
 }
   } );

 try {
   backup.enableFileLogger();
   backup.setLogLevelDebug();
   backup.doBackup();  //  /!!\ : ERROR HERE
 } catch (IOException e) {}
 backupIndexService.shutdown();
 backupGraphDb.shutdown();

 On Thu, Jun 10, 2010 at 11:11 AM, Batistuta Gabriel 
 batistutagabrielf...@gmail.com wrote:


 The keepLogicalLogs( true ) parts need to be there for the part of
 the code
 where you do the backups.
 What does it means in my case? My part of code is not correct?  
 Because
 if I understand, you mean that I need to use the code
 keepLogicalLogs( true ) in the same class where I do my backup?
 Sorry for my misunderstanding,

 Best,
 Bat

 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Online Backup : wich package?

2010-06-09 Thread Batistuta Gabriel
Nobody has a solution for my problem?

Many thanks,

Bat
Le 08-juin-10 à 16:05, BatiG a écrit :


 I've tried with :
 - neo4j-kernel-1.0-rc.jar
 - neo4j-kernel-1.0.jar

 And I've the same error in the both cases.
 -- 
 View this message in context: 
 http://neo4j-user-list.438527.n3.nabble.com/Online-Backup-wich-package-tp878706p879410.html
 Sent from the Neo4J User List mailing list archive at Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Online Backup : wich package?

2010-06-09 Thread Batistuta Gabriel
Thanks.

If I understand the tutorial of neo4j and your expaination, this part  
of code is correct :

//create the original graph
neo = new EmbeddedGraphDatabase(CONSTANTS.GRAPH_PATH);
graph = ObjectGraphFactory.instance().get(neo);

for (String datasource : new String[]{nioneodb, lucene}) {
neo.getConfig().getTxModule().getXaDataSourceManager()
.getXaDataSource( datasource ).keepLogicalLogs( true );
}

//create the backup graph
EmbeddedGraphDatabase neo = GraphJo4neo.getGraphDatabaseService();
EmbeddedGraphDatabase backupGraphDb = new  
EmbeddedGraphDatabase( CONSTANTS.GRAPH_BACKUP_PATH );
IndexService backupIndexService = new  
LuceneIndexService( backupGraphDb );
Backup backup = new Neo4jBackup( neo, backupGraphDb,
new ArrayListString()
{
  {
add( nioneodb );
add( lucene );
   }
 } );


try {
backup.enableFileLogger();
backup.setLogLevelDebug();
backup.doBackup();
} catch (IOException e) {}

Basically, this part of code is right, isn'it?


Le 09-juin-10 à 12:07, Tobias Ivarsson a écrit :

 Hi Bat,

 I've tried this with the combination of
 * neo4j-kernel-1.0.jar (from neo4j-apoc-1.0)
 * neo4j-online-backup-0.5.jar
 That works fine.

 Are you sure that you don't have incompatible versions on the class  
 path as
 well?

 Try printing the classpath from your application and verify that you  
 don't
 have multiple versions of the same Neo4j library there:
System.out.println(System.getProperty(java.class.path));


 Also, don't forget that you need to tell the data sources (nioneodb  
 and
 lucene) to keep their logical logs:

EmbeddedGraphDatabase neo = ...
for (String datasource : new String[]{nioneodb, lucene}) {
neo.getConfig().getTxModule().getXaDataSourceManager()
   .getXaDataSource( datasource ).keepLogicalLogs( true );
}

 Cheers,
 Tobias

 On Wed, Jun 9, 2010 at 9:56 AM, Batistuta Gabriel 
 batistutagabrielf...@gmail.com wrote:

 Nobody has a solution for my problem?

 Many thanks,

 Bat
 Le 08-juin-10 à 16:05, BatiG a écrit :


 I've tried with :
 - neo4j-kernel-1.0-rc.jar
 - neo4j-kernel-1.0.jar

 And I've the same error in the both cases.
 --
 View this message in context:
 http://neo4j-user-list.438527.n3.nabble.com/Online-Backup-wich-package-tp878706p879410.html
 Sent from the Neo4J User List mailing list archive at Nabble.com.
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




 -- 
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Online Backup : wich package?

2010-06-09 Thread Batistuta Gabriel
However, I obtain this error :
java.lang.NoSuchMethodError:  
org.neo4j.onlinebackup.AbstractResource.init(Lorg/neo4j/kernel/impl/ 
transaction/x
aframework/XaDataSource;)V
at  
org 
.neo4j 
.onlinebackup 
.EmbeddedGraphDatabaseResource 
.init(EmbeddedGraphDatabaseResource.java:31)
at org.neo4j.onlinebackup.Neo4jBackup.doBackup(Neo4jBackup.java:164)
at util.BackupNeo4j.run(BackupNeo4j.java:49)

Le 09-juin-10 à 13:48, Johan Svensson a écrit :

 On Wed, Jun 9, 2010 at 1:37 PM, Batistuta Gabriel
 batistutagabrielf...@gmail.com wrote:
 Thanks.

 If I understand the tutorial of neo4j and your expaination, this part
 of code is correct :

 //create the original graph
 neo = new EmbeddedGraphDatabase(CONSTANTS.GRAPH_PATH);
 graph = ObjectGraphFactory.instance().get(neo);

 for (String datasource : new String[]{nioneodb, lucene}) {
neo.getConfig().getTxModule().getXaDataSourceManager()
.getXaDataSource( datasource ).keepLogicalLogs( true );
 }

 //create the backup graph
 EmbeddedGraphDatabase neo = GraphJo4neo.getGraphDatabaseService();
 EmbeddedGraphDatabase backupGraphDb = new
 EmbeddedGraphDatabase( CONSTANTS.GRAPH_BACKUP_PATH );
 IndexService backupIndexService = new
 LuceneIndexService( backupGraphDb );
 Backup backup = new Neo4jBackup( neo, backupGraphDb,
new ArrayListString()
{
  {
add( nioneodb );
add( lucene );
   }
 } );


 try {
backup.enableFileLogger();
backup.setLogLevelDebug();
backup.doBackup();
 } catch (IOException e) {}

 Basically, this part of code is right, isn'it?


 Yes that looks right.

 -Johan
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo4j] Online Backup : wich package?

2010-06-09 Thread Batistuta Gabriel
I fixed one problem. But I still have a problem.

My classes are starded from BlazeDS. It's a server-based Java remoting  
installed on Glassfish. So, I can not see the packages of neo4j on the  
classpath.
However, I use this packages :
lucene-core-2.9.1.jar
neo4j-remote-graphdb-0.5.jar
neo4j-commons-0.4.jar
neo4j-index-1.0-b1.jar
neo4j-kernel-1.0-rc.jar
neo4j-shell-1.0-rc.jar
neo4j-apoc-examples-0.5.jar
neo4j-online-backup-0.5.jar
neo4j-remote-graphdb-0.5.jar

when I run my program, now I obtain this error :
java.lang.RuntimeException: Source[1276097996318,1276097996318] is not  
same as destination[1276097998894,1276097998894] for resource [nioneodb]
at org.neo4j.onlinebackup.Neo4jBackup 
$Neo4jBackupTask.prepare(Neo4jBackup.java:329)
at org.neo4j.onlinebackup.Neo4jBackup.runMultiBackup(Neo4jBackup.java: 
262)
at org.neo4j.onlinebackup.Neo4jBackup.doBackup(Neo4jBackup.java:196)
at util.BackupNeo4j.run(BackupNeo4j.java:49)

Thanks

Le 09-juin-10 à 14:21, Tobias Ivarsson a écrit :

 You could also use this code to print the classpath:

//Get the System Classloader
ClassLoader sysClassLoader =  
 ClassLoader.getSystemClassLoader();

//Get the URLs
URL[] urls = ((URLClassLoader)sysClassLoader).getURLs();

*for*(*int *i=0; i urls.length; i++)
{
System.out.println(urls[i].getFile());
}

 This might give a slightly more complete view of the paths from where
 classes are loaded.
 (if, for example you have added the Neo4j jar files in your Java  
 extension
 library directory, they might not appear in the java.class.path  
 property)

 From
 http://www.java-tips.org/java-se-tips/java.lang/how-to-print-classpath.html

 On Wed, Jun 9, 2010 at 2:09 PM, Johan Svensson jo...@neotechnology.com 
 wrote:

 What was the output of
 System.out.println(System.getProperty(java.class.path)); as  
 Tobias
 asked you to do?

 On Wed, Jun 9, 2010 at 1:56 PM, Batistuta Gabriel
 batistutagabrielf...@gmail.com wrote:
 However, I obtain this error :
 java.lang.NoSuchMethodError:
 org.neo4j.onlinebackup.AbstractResource.init(Lorg/neo4j/kernel/ 
 impl/
 transaction/x
 aframework/XaDataSource;)V
   at
 org
 .neo4j
 .onlinebackup
 .EmbeddedGraphDatabaseResource
 .init(EmbeddedGraphDatabaseResource.java:31)
   at
 org.neo4j.onlinebackup.Neo4jBackup.doBackup(Neo4jBackup.java:164)
   at util.BackupNeo4j.run(BackupNeo4j.java:49)

 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




 -- 
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

___
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user