2016-07-12 90 views
0

我正在使用Eclipse Neon,GWT和sqlite編寫Web應用程序。我的webapp在某個點連接到位於war目錄中的數據庫(爲了使db可用於服務器,這是必需的)。當我嘗試創建連接,嚴格的閱讀模式:連接到SQLite數據庫時出現GAE受限類錯誤

Properties config = new Properties(); 
config.setProperty("open_mode", "1"); 
Class.forName("org.sqlite.JDBC"); 
return DriverManager.getConnection("jdbc:sqlite:db.db"); 

以下異常堆棧出現在控制檯:

java.lang.NoClassDefFoundError: java.io.FileOutputStream is a restricted class. Please see the Google App Engine developer's guide for more details. 
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:52) 
at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:165) 
at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:290) 
at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:65) 
at org.sqlite.core.NativeDB.load(NativeDB.java:53) 
at org.sqlite.core.CoreConnection.open(CoreConnection.java:211) 
at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76) 
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:24) 
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23) 
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45) 
at org.sqlite.JDBC.createConnection(JDBC.java:114) 
at org.sqlite.JDBC.connect(JDBC.java:88) 
at java.sql.DriverManager.getConnection(Unknown Source) 
at java.sql.DriverManager.getConnection(Unknown Source) 
[...] 

實際上,我剛剛開放對數據庫的連接。日誌被轉發到控制檯,所以沒有打開文件來存儲它們,並且我不創建文件。這個錯誤來自於GAE和我無法控制的JDBC加載器。

我在做什麼錯?

回答

0

我會回答我自己的問題......答案是,我不需要GAE,所以我必須禁用它。我刪除了從戰爭/ WEB-INF/lib和殘疾人的AppEngine所有GoogleAppEngine罐子通過瀏覽基於Eclipse:

RightClick on project -> Google -> AppEngine Settings... -> detick "Use Google AppEngine" 

希望它可以幫助別人。

相關問題