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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to