On 12/09/13 04:08, Thomas Mueller wrote:
Hi,
Which version of H2 did you try?
1.3.173
> It bombs out
Well, is there a stack trace? Could you post it?
No error or stack trace... it just stops..
As far as I know, H2 works in an OSGi environment. The regular database also
uses FilePath...
I think i had H2 DB running in osgi a few years ago. How long has FilePath been
used?
The ClassForName problem is covered here
http://njbartlett.name/2010/08/30/osgi-readiness-loading-classes.html
The h2 code where it stops :-
void open() {
meta = new MVMapConcurrent<String, String>(StringDataType.INSTANCE,
StringDataType.INSTANCE);
HashMap<String, String> c = New.hashMap();
c.put("id", "0");
c.put("createVersion", Long.toString(currentVersion));
meta.init(this, c);
if (fileName == null) {
return;
}
FilePath parent = FilePath.get(fileName).getParent(); <<<< stops here
if (!parent.exists()) {
throw DataUtils.newIllegalArgumentException("Directory does not exist:
{0}", parent);
}
private static void registerDefaultProviders() {
if (providers == null || defaultProvider == null) {
Map<String, FilePath> map = Collections.synchronizedMap(New.<String,
FilePath>hashMap());
for (String c : new String[] {
"org.h2.store.fs.FilePathDisk",
"org.h2.store.fs.FilePathMem",
"org.h2.store.fs.FilePathMemLZF",
"org.h2.store.fs.FilePathNioMem",
"org.h2.store.fs.FilePathNioMemLZF",
"org.h2.store.fs.FilePathSplit",
"org.h2.store.fs.FilePathNio",
"org.h2.store.fs.FilePathNioMapped",
"org.h2.store.fs.FilePathZip"
}) {
try {
FilePath p = (FilePath) Class.forName(c).newInstance(); <<<<<probably because
of this
map.put(p.getScheme(), p);
if (defaultProvider == null) {
defaultProvider = p;
}
} catch (Exception e) {
// ignore - the files may be excluded in purpose
}
}
providers = map;
Regards
Paul
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.