我目前正在做一个非常简单的项目,使用托管在Weblogic和SQLite DB中的Java web应用程序。(作用域非常小,仅两个表)
开发进行得很好,仍然可以工作,但在部署到staging时,我遇到了一些意想不到的问题。
每当应用程序必须从DB读取(select)时,我可以读取以下堆栈跟踪:
Root cause of ServletException.java.lang.Error: in _syscall()
at org.ibex.nestedvm.Runtime.syscall(Runtime.java:1086)
at org.sqlite.SQLite.run_0x171800(target/build/SQLite.mips:???)
at org.sqlite.SQLite.trampoline(target/build/SQLite.mips:???)
at org.sqlite.SQLite._execute(target/build/SQLite.mips:???)
at org.ibex.nestedvm.Runtime.__execute(Runtime.java:506)
at org.ibex.nestedvm.Runtime.call(Runtime.java:678)
at org.ibex.nestedvm.Runtime.call(Runtime.java:647)
at org.sqlite.NestedDB.call(NestedDB.java:568)
at org.sqlite.NestedDB.call(NestedDB.java:563)
at org.sqlite.NestedDB.prepare(NestedDB.java:130)
at org.sqlite.DB.prepare(DB.java:123)
at org.sqlite.Stmt.executeQuery(Stmt.java:121)如果我错了,请告诉我,但我所理解的是,target/build/SQLite.mips引用了驱动程序的本机实现。然而,我确实指定它应该坚持纯java,使用:
Connection con;
//Load the JDBC driver class dynamically.
Driver d = (Driver)Class.forName("org.sqlite.JDBC").newInstance();
DriverManager.registerDriver(d);
//init the connection
System.setProperty("sqlite.purejava", "true");
con = DriverManager.getConnection(getConnectionString());我的理解正确吗?我如何进一步强制使用纯java实现?还有别的原因会导致这样的堆栈跟踪吗?
需要说明的是,开发环境和交错环境都是linux / bea weblogic。
感谢您的宝贵时间:)
发布于 2013-08-12 20:57:01
根据堆栈跟踪中的类名,我假设您使用的是XerialJ JDBC驱动程序(这是不是有点老了?)
根据它的wiki,您应该在加载JDBC驱动程序之前设置该属性。
System.setProperty("sqlite.purejava", "true");
Class.forName("org.sqlite.JDBC"); 您是在驱动程序加载之后(但在连接设置之前)设置的。请更改初始化顺序,如下所示,然后重试:
//Load the JDBC driver class dynamically.
System.setProperty("sqlite.purejava", "true");
Driver d = (Driver)Class.forName(driver).newInstance();
DriverManager.registerDriver(d);
//init the connection
con = DriverManager.getConnection(getConnectionString());发布于 2013-08-13 20:15:46
正如评论中所说的,这是我们想出来的。
尽管很明显,NFS和SQLite不能很好地混合在一起,但有限的写操作和从3台机器并发读取访问的需要迫使我们将两者混合在一起。
问题是缺少负责通过NFS并发访问文件共享的服务。Dev env让它运行,而staging没有。
感谢您的宝贵时间!
https://stackoverflow.com/questions/18186507
复制相似问题