2010-04-02 66 views
1

當我將應用程序部署到GoogleAppEngine我不斷收到以下錯誤GoogleAppEngine:可能禁用FileUpload?

Uncaught exception from servlet 
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.apphosting.runtime.security.shared.stub.java.io.FileOutputStream.<clinit>(FileOutputStream.java) 
    at org.apache.log4j.FileAppender.setFile(FileAppender.java:289) 
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163) 
    at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256) 
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132) 
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96) 
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654) 
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612) 
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509) 
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415) 
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:441) 
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468) 
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:122) 
    at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73) 
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:88) 
    at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) 
    at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131) 
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685) 
    at org.springframework.web.context.ContextLoader.<clinit>(ContextLoader.java:146) 
    at org.springframework.web.context.ContextLoaderListener.createContextLoader(ContextLoaderListener.java:53) 
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:44) 
    at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) 
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) 
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250) 
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) 
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467) 
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) 
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:191) 
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:168) 
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:123) 
    at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:243) 
    at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5485) 
    at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5483) 
    at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24) 
    at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:398) 
    at com.google.net.rpc.impl.Server$2.run(Server.java:852) 
    at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56) 
    at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:536) 
    at com.google.net.rpc.impl.Server.startRpc(Server.java:807) 
    at com.google.net.rpc.impl.Server.processRequest(Server.java:369) 
    at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:442) 
    at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319) 
    at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290) 
    at com.google.net.async.Connection.handleReadEvent(Connection.java:474) 
    at com.google.net.async.EventDispatcher.processNetworkEvents(EventDispatcher.java:831) 
    at com.google.net.async.EventDispatcher.internalLoop(EventDispatcher.java:207) 
    at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:103) 
    at com.google.net.rpc.RpcService.runUntilServerShutdown(RpcService.java:251) 
    at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run(JavaRuntime.java:404) 
    at java.lang.Thread.run(Unknown Source) 

我檢查了documentation和它建議建立一個FileUpload類,因爲我不會從上傳的文件/文件等我應用程序,這是必要的嗎?

有沒有辦法禁用此功能,或者至少繞過此錯誤?

我已經爲一個MultipartWrapperFactory.Class作爲提供實現已經從尋找這個錯誤

感謝

回答

2

看來不允許你運行你的代碼在服務器上創建本地文件的建議,但你的記錄器正在嘗試這麼做。將日誌記錄機制切換到文件以外的其他位置。

+0

呀完蛋了,謝謝。檢查了我的log4j屬性文件並禁用了文件記錄;) – Jimmy 2010-04-02 23:19:57

1

我允許創建控制檯處理程序記錄器...在logging.properties

# A default java.util.logging configuration. 
# (All App Engine logging is through java.util.logging by default). 
# 
# To use this configuration, copy it into your application's WEB-INF 
# folder and add the following to your appengine-web.xml: 
# 
# <system-properties> 
# <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> 
# </system-properties> 
# 

# Set the default logging level for all loggers to WARNING 
.level = ALL 
handlers = java.util.logging.ConsoleHandler 
java.util.logging.ConsoleHandler.level=ALL 
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 

# Set the default logging level for ORM, specifically, to WARNING 
DataNucleus.JDO.level=WARNING 
DataNucleus.Persistence.level=WARNING 
DataNucleus.Cache.level=WARNING 
DataNucleus.MetaData.level=WARNING 
DataNucleus.General.level=WARNING 
DataNucleus.Utility.level=WARNING 
DataNucleus.Transaction.level=WARNING 
DataNucleus.Datastore.level=WARNING 
DataNucleus.ClassLoading.level=WARNING 
DataNucleus.Plugin.level=WARNING 
DataNucleus.ValueGeneration.level=WARNING 
DataNucleus.Enhancer.level=WARNING 
DataNucleus.SchemaTool.level=WARNING 
java.sql.level=INFO