History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: DRS-98
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Tetyana Loskutova
Reporter: Roberto Portilla
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
dRS

NullPointerException in replicate method

Created: 21/May/08 06:59 PM   Updated: 02/Jun/08 04:55 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0h
Time Spent - 5h
Time Spent: 5h
Time Spent - 5h

Environment: Linux Ubuntu 8.04, 2.6.24-15-generic kernel, SDK 1.5, intel dual core, dRS 7.2, db4o 7.2

Iteration: 45
Resolution Date: 02/Jun/08 04:55 PM
First Response Date: 02/Jun/08 06:12 AM
Labels:
Participants: Roberto Portilla and Tetyana Loskutova
Number of Attachments: 0
Number of Comments: 3


 Description  « Hide
When try to made a replication form local db4o database to remote db4o database the drs crash and send:

java.lang.NullPointerException
at com.db4o.drs.db4o.FileReplicationProvider.produceReference(Unknown Source)
at com.db4o.drs.inside.InstanceReplicationPreparer.prepareObjectToBeReplicated(Unknown Source)
at com.db4o.drs.inside.InstanceReplicationPreparer.visit(Unknown Source)
at com.db4o.drs.inside.traversal.GenericTraverser.traverseObject(Unknown Source)
at com.db4o.drs.inside.traversal.GenericTraverser.traverseGraph(Unknown Source)
at com.db4o.drs.inside.GenericReplicationSession.prepareGraphToBeReplicated(Unknown Source)
at com.db4o.drs.inside.GenericReplicationSession.replicate(Unknown Source)

The code is:

Db4o.newConfiguration().generateUUIDs(ConfigScope.GLOBALLY);
Db4o.newConfiguration().generateVersionNumbers(ConfigScope.GLOBALLY);
Db4o.newConfiguration().allowVersionUpdates(true);

ObjectContainer local = Db4o.openClient("localhost", 8081, "username","userpassword");
ObjectContainer remote = Db4o.openClient("192.168.1.200", 8081, "username","userpassword");

//Class _class=A propietary class

ReplicationSession replication = Replication.begin(local, remote);
ObjectSet<?> changed = replication.providerA().objectsChangedSinceLastReplication();
if (changed!=null && changed.size()>0){
    while (changed.hasNext()){
        Object obj=changed.next();
if (_class.isInstance(obj)){
replication.replicate(_class.cast(obj)); <------- Here is the exception
}
}
replication.commit();
replication.close();
local.close();
remote.close();


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Roberto Portilla - 22/May/08 07:51 PM
Ok, thisn't a bug on the drs code nor the db4o code, actually it's more a bug of the tutorials, just need update the tutorials and references. The error was resolve this:

Change:

Db4o.newConfiguration().generateUUIDs(ConfigScope.GLOBALLY);
Db4o.newConfiguration().generateVersionNumbers(ConfigScope.GLOBALLY);
Db4o.newConfiguration().allowVersionUpdates(true);

Db4o.openServer("some location",someport);

For:

Configuration config=Db4o.newConfiguration();
config.generateUUIDs(ConfigScope.GLOBALLY);
config.generateVersionNumbers(ConfigScope.GLOBALLY);
config.allowVersionUpdates(true);

Db4o.openServer(config, "some location",someport);


Please close this issue

Thanks!

Tetyana Loskutova - 02/Jun/08 06:12 AM
Roberto, I did not find a code like this anywhere:
Db4o.newConfiguration().generateUUIDs(ConfigScope.GLOBALLY);
Db4o.newConfiguration().generateVersionNumbers(ConfigScope.GLOBALLY);
Db4o.newConfiguration().allowVersionUpdates(true);
Which tutorials/reference do you refer to?