Meaningless Drivel is fun!*
The moose likes JForum and the fly likes problem of indexing and storing the attachment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "problem of indexing and storing the attachment" Watch "problem of indexing and storing the attachment" New topic
Author

problem of indexing and storing the attachment

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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

Joined: Apr 22, 2012
Posts: 17424
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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem of indexing and storing the attachment