Title: RE: DatabasePageStore is unusable (Always throws a NullPointerException on construction)

Hi all,

Any ideas on how to get DatabasePageStore working?

At the moment, to store RTree in the database, Im first using FileSystemPageStore to store it in a file. Then I read this file as stream and store it in the database.

And to retrieve it, Im doing the reverse.

Any help on this would be appreciated.

Thanks,

Sai

_____________________________________________
From: Sai Giddu
Sent: Wednesday, September 27, 2006 11:56 AM
To: '[email protected]'
Subject: DatabasePageStore is unusable (Always throws a NullPointerException on construction)

Hi,

I'm trying to use DatabasePageStore to store RTree in a SqlServer database. This always throws an exception on construction.

My code:

        DatabasePageStore databasePageStore = new DatabasePageStore(dataSource, new SqlServerDialect(), "RTree1"); // Exception thrown at this line

        rTree = new RTree(databasePageStore);

Constructor for DatabasePageStore calls "createNew()" which in turn has the following three lines

                    this.root = new DatabaseNode(this.maxNodeEntries, this.dataSource, this.dialect, this.rtreeName);

                    this.root.setLeaf(true);

                this.root.save();

Reason for NullPointerException:

The "doSave()" method in DatabaseNode creates a null byte array (byte[] bytes = null;) and passes it to "doInsert()" method which tries to instantiate a ByteArrayInputStream object passing the "null" byte array to the constructor.

One work-around I can think of is to create my own DatabasePageStore class. But this would leave my project out of sync with future improvements in this area implemented in the GeoTools project.

Is there any other work-around to get rid of this problem?

Thanks,

Sai

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to