• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

problem of indexing and storing the attachment

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hihi,

I'm new in Jforum and recently try to use jforum in my project and faced to a problem. I have configured database, admin setting and other setting via the install.jsp. The working environment is tomcat6.0, JDK1.6, Jforum2.1.8 and liferay 5. folder temp and wepapp is under the directroy of tomcat6.

When I started the jforum at the first time, it worked very well, i could connect to the database, post a message and upload an attachnment. However, when i restarted the server again, the attachment was lost, i can't download the attachment which i uploaded last time. I check the SystemGlobals.properties and find out those attachment goes to a folder with the path attachments.upload.dir = upload
attachments.store.dir = ${application.path}/${attachments.upload.dir}
which suppose to be stored in the folder jforum-2.1.8 under webapps in my case,
e.g. C:\liferay-portal-tomcat-6.0-5.1.1\webapps\jforum-2.1.8\upload
and index should be stored in
C:\liferay-portal-tomcat-6.0-5.1.1\webapps\jforum-2.1.8\WEB-INF\jforumLuceneIndex

but those attachment doesn't go to the right directory, all the things i upload goes to another folder also called jforum-2.1.8 under temp directory.
e.g. C:\liferay-portal-tomcat-6.0-5.1.1\temp\0-jforum-2.1.8\upload and the index's pages located at
C:\liferay-portal-tomcat-6.0-5.1.1\temp\0-jforum-2.1.8\WEB-INF\jforumLuceneIndex

as my observation, tomcat first copy all the service under webapps to temp and run the services inside temp after the server is started. When i stopped the server, all services inside the folder temp will automatically erase. Since all the attachment and index is store in the temp folder, these things also lost automatically. I could not suppose the server don't stop and working 24 hours, coz if any crash happen, all information in my forum will lose!!

I hope i describe clear enough, is there any way to deal with it?? could anyone please give me some hints? thanks a lot~~

Emmy


[originally posted on jforum.net by emmy865]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you deploying jforum via a war file? I think there is an option in TC that will cause the code to run from the war file and not unpack it. This might force the working directory to be the temp directory.

You might also check that jforum can write to it's directory. This might be force it to the temp directory (but I doubt that).

The directory used is based on a request.getRealPath() call. I wonder if Liferay or some filter is changing this before JForum gets it. You might try just creating a simple jsp file in the jforum directory that displays the result to test for this.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Monroe, thanks for your quick reply!! yes, you are right, i used the war file instead of unpacked the zip file. i try to download the zip file and unpacked to my webapps folder under tomcat6, those problems sloved perfectly. Thanks a lot!!
[originally posted on jforum.net by emmy865]
 
Look! I laid an egg! Why does it smell like that? Tiny ad, does this smell weird to you?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic