• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Problems Attaching File

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys!

I was testing some JForum features suggested in other topics, when I crossed with another one!

The scenario is the following:
JForum CVS 2.1.7 running on Tomcat and Linux.
I start a new topic, add one file, write some text on the message and press the send button.
The next screen shows the following message:

----------
Informa??o

An error has occurred.

For detailed error information, please see the HTML source code, and contact the forum Administrator.

/home/restricted/home/forums/public_html/teste/upload/2006/7/27/64439e4af3a5a3d29bf04f8c42c86e77_2.jpg_ (No such file or directory)
----------

For what is this file 64439e4af3a5a3d29bf04f8c42c86e77_2.jpg_ used for? And what should be the function of this non sense directory /teste/upload/2006/7/27/???

Just trying to understand JForum engine! Maybe I could to help fixing it... but I need help to understand a lot of things here!

TKS since now for all and any help!

[ ]'s

----------

<!-- BEGIN ERROR STACK TRACE <br /> java.lang.reflect.InvocationTargetException <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at net.jforum.Command.process(Command.java:116) <br /> at net.jforum.JForum.service(JForum.java:183) <br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) <br /> at sun.reflect.GeneratedMethodAccessor276.invoke(Unknown Source) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243) <br /> at java.security.AccessController.doPrivileged(Native Method) <br /> at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) <br /> at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275) <br /> at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:161) <br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:245) <br /> at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50) <br /> at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156) <br /> at java.security.AccessController.doPrivileged(Native Method) <br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152) <br /> at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59) <br /> at sun.reflect.GeneratedMethodAccessor283.invoke(Unknown Source) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243) <br /> at java.security.AccessController.doPrivileged(Native Method) <br /> at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) <br /> at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275) <br /> at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217) <br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197) <br /> at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:50) <br /> at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156) <br /> at java.security.AccessController.doPrivileged(Native Method) <br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152) <br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:204) <br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) <br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) <br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) <br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) <br /> at br.com.locaweb.tomcat.LocaWebValve.invoke(LocaWebValve.java:101) <br /> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) <br /> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199) <br /> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282) <br /> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754) <br /> at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684) <br /> at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876) <br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) <br /> at java.lang.Thread.run(Thread.java:595) <br /> Caused by: java.io.FileNotFoundException: /home/restricted/home/forums/public_html/teste/upload/2006/7/27/64439e4af3a5a3d29bf04f8c42c86e77_2.jpg_ (No such file or directory) <br /> at java.io.FileOutputStream.open(Native Method) <br /> at java.io.FileOutputStream.init(FileOutputStream.java:179) <br /> at java.io.FileOutputStream.init(FileOutputStream.java:70) <br /> at net.jforum.view.forum.common.UploadUtils.saveUploadedFile(UploadUtils.java:80) <br /> at net.jforum.view.forum.common.AttachmentCommon.insertAttachments(AttachmentCommon.java:242) <br /> at net.jforum.view.forum.PostAction.insertSave(PostAction.java:1101) <br /> ... 48 more <br /> <br /> END ERROR STACK TRACE-->
[originally posted on jforum.net by leandro_salvador]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The 64439e4af3a5a3d29bf04f8c42c86e77_2.jpg_ is the file you just uploaded, and the directory structure is not non-sense - it is the date/time of when you uploaded the file ;)

Check if the "upload" directory exists and if it has full write rights.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rafael Steil wrote:The 64439e4af3a5a3d29bf04f8c42c86e77_2.jpg_ is the file you just uploaded, and the directory structure is not non-sense - it is the date/time of when you uploaded the file ;)

Check if the "upload" directory exists and if it has full write rights.

Rafael



Hmmm... now I see what you say! ;)

Originally I don't have chmod 777 or 666 to all directories or files. It have to be done manually, it's not automatic. Of course: it's LocaWeb

What do you suggest: there is some way to make these chmod authorizations happens automatically? It's not practice to change the permissions of all uploaded files and new folders created everytime, don't you agree?

One more idea: wouldn't be better to let all the uploaded files in the same directory? Because of the MD5 filename we would have the sure that JForum wouldn't ever store the same file 2 times... as it does with Avatars and Smilies (I think so)... don't you agree?

[ ]'s
[originally posted on jforum.net by leandro_salvador]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, all files in the same dir will make the filesystem slow.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,
here is stack trace from the log file

10:33:01,455 ERROR [ExceptionWriter ] net.jforum.exceptions.MultipartHandlingException: Err
or while processing multipart content: net.jforum.util.legacy.commons.fileupload.FileUploadExce
ption: Processing of multipart/form-data request failed. /<path to webapps>/forum/t
mp/upload_00000020.tmp (No such file or directory)
at net.jforum.ActionServletRequest.handleMultipart(ActionServletRequest.java:356)
at net.jforum.ActionServletRequest.<init>(ActionServletRequest.java:283)
at net.jforum.JForum.service(JForum.java:135)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
ain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
:146)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java
:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
ain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:199)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118
)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)

10:33:01,473 ERROR [runtime ]
Expression templateName is undefined on line 5, column 14 in exception.html.
The problematic instruction:
----------
==> ${templateName} [on line 5, column 12 in exception.html]
in include "${templateName}/message.htm" [on line 5, column 1 in exception.html]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression templateName is undefined on line 5, colu
mn 14 in exception.html.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.Expression.getStringValue(Expression.java:118)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.renderElementToString(Environment.java:1461)
at freemarker.core.StringLiteral.getStringValue(StringLiteral.java:95)
at freemarker.core.Include.accept(Include.java:110)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:231)
at net.jforum.exceptions.ExceptionWriter.handleExceptionData(ExceptionWriter.java:108)
at net.jforum.JForum.service(JForum.java:218)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
ain.java:200)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
:146)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java
:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterCh
ain.java:166)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java
:146)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:209)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:144)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:199)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2358)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:133)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:118
)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:594)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:116)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:594)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:127)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(St
andardPipeline.java:596)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)
10:33:01,481 ERROR [runtime ]
Expression templateName is undefined on line 5, column 14 in exception.html.
The problematic instruction:
----------
==> ${templateName} [on line 5, column 12 in exception.html]
in include "${templateName}/message.htm" [on line 5, column 1 in exception.html]
----------

[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Evgeny, the "tmp" directory exists and is writable by Tomcat?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes
[originally posted on jforum.net by Evgeny]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mkdir a directory named "upload" file in your SystemGolbal.properties ?
And chmod the 775 for upload access ..


Best Regards
Anson Tai

[originally posted on jforum.net by javatai]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!