Which is line 40?
Please confirm that the "temp" directory exists in your context
directory and that the servlet container has write access to it.
Debugging info may help - should be something like:
log4j.category.org.apache.turbine.services.upload.TurbineUploadService =
DEBUG, default
log4j.category.org.apache.commons.fileupload = DEBUG, default
The only documentation is
http://jakarta.apache.org/turbine/turbine/turbine-2.3.2/services/upload-service.html
at present.
Scott
Mark Wassermann wrote:
Hi Scott
Here is the stacktrace, but I dont know why this error is thrown.
It happens when I access the properties of the FileItem Object
thx
Mark
-- code --
ParameterParser params = data.getParameters();
FileItem fi = params.getFileItem("FD_File");
data.setMessage(fi.getContentType());
-- code --
-- turbine.log --
2007-05-03 07:31:50,781 [http-8080-1] ERROR org.apache.turbine.Turbine -
Turbine.handleException:
java.lang.NullPointerException
at
mwapp.modules.actions.system.document.ImageRelationAction.doAdd(ImageRelationAction.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:135)
at
org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:78)
at
org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction.java:72)
at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:99)
at
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:113)
at org.apache.turbine.modules.Page.build(Page.java:53)
at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:101)
at org.apache.turbine.Turbine.doGet(Turbine.java:789)
at org.apache.turbine.Turbine.doPost(Turbine.java:884)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:833)
at
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:639)
at
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1285)
at java.lang.Thread.run(Unknown Source)
-- turbine.log --
Scott Eade schrieb:
The stack trace will most likely point to the cause of the problem.
Scott
Mark Wassermann wrote:
Hi List
I am in the process of implementing a fileupload, but I have run into
some problems.
I am using T2.3.2.
I have implemented the upöoad action like the exsample in the services
section on the turbine homepage, but when I try to use the FileItem
Object I get an NullPointerExeption. I have allready increased the
maxfilesize in the config file and played along with some other values
without any efect to the problem I have.
Is there a more detailed Howto for the upload service?
-- TurbineResources.properties --
...
services.UploadService.classname=org.apache.turbine.services.upload.TurbineUploadService
...
# -------------------------------------------------------------------
#
# U P L O A D S E R V I C E
#
# -------------------------------------------------------------------
# Must be run early to allow the parser to know about the upload
# service facility
services.UploadService.earlyinit=true
# Whether the files should be automatically picked up by
# ParameterParser.
services.UploadService.automatic=true
#
# The directory where files will be temporarily stored.
#
services.UploadService.repository=./temp
#
# The maximum size of a request that will be processed.
#
services.UploadService.size.max=33554432
#
# The maximum size of a request that will have it's elements cached in
# memory by TurbineUploadService class.
#
services.UploadService.size.threshold=10240
-- TurbineResources.properties --
thx
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]