我們正在使用Google App Engine以csv格式從我們的應用程序發佈一些平面數據。 Google的DataTable和CsvRenderer from visualization-datasource庫使我們的數據轉換變得簡單,並在本地appengine開發服務器上成功完成了測試。Google App Engine不支持java.util.logging.Logger的子類:com/ibm/icu/impl/ICULogger
部署到我們的Appspot上例如暴露了App Engine不喜歡IBM的ICU庫記錄的方式:
谷歌App Engine不支持java.util.logging.Logger中的子類:COM/IBM/ICU/IMPL/ICULogger
堆棧跟蹤顯示原點:時區的
Caused by: java.lang.SecurityException: Google App Engine does not support subclasses of java.util.logging.Logger: com/ibm/icu/impl/ICULogger
at com.google.appengine.runtime.Request.process-0b3cd097cad783e6(Request.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:360)
at com.ibm.icu.util.TimeZone.<clinit>(TimeZone.java:114)
線114:
/**
* {@icu} A logger for TimeZone. Will be null if logging is not on by way of system
* property: "icu4j.debug.logging"
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public static ICULogger TimeZoneLogger = ICULogger.getICULogger(TimeZone.class.getName());
我把一個斷點在Eclipse中,並運行單元測試在調試器和TimeZoneLogger被賦值爲null,因爲沒有系統屬性打開記錄爲進一步看到:
/**
* Instantiates a new ICULogger object with logging turned off by default
* unless the system property "icu4j.debug.logging" is set to "all"
*
* @param name to be use by the logger (usually is the class name)
* @param resourceBundleName name to localize messages (can be null)
* @return a new ICULogger object
* @draft ICU 4.4
* @provisional This API might change or be removed in a future release.
*/
public static ICULogger getICULogger(String name, String resourceBundleName) {
LOGGER_STATUS flag = checkGlobalLoggingFlag();
if (flag != LOGGER_STATUS.NULL) {
ICULogger logger = new ICULogger(name, resourceBundleName);
/* Add a default handler to logger*/
logger.addHandler(new ConsoleHandler());
/* Turn off logging by default unless SYSTEM_PROP_LOGGER property is set to "all" */
if (flag == LOGGER_STATUS.ON) {
logger.turnOnLogging();
} else {
logger.turnOffLogging();
}
return logger;
}
return null;
}
我把在一些日誌語句中查看是否正在實例化TimeZoneLogger,並顯示它不是。
[INFO] Oct 29, 2013 8:45:39 AM com.example.SomeClass
[INFO] WARNING: icu4j.debug.logging = null
[INFO] Oct 29, 2013 8:45:39 AM com.example.SomeClass
[INFO] WARNING: Time Zone Logger = null
這表明它不是App Engine不喜歡的實例,而只是對導致問題的類的引用。
在這一點上我能想到的是寫我自己的CSV渲染器,這是使用違規代碼的類。這種努力不會很重要,但我更願意使用現有的庫......尤其是當圖書館和平臺都來自Google時。
其他建議?
好主意。我在過去曾經成功地攻擊過類似這樣的課程。 –