[Building Sakai] Problem converting BLOBs to files

Jim Eng jimeng at umich.edu
Fri May 14 19:22:06 PDT 2010


I'm posting this message back to sakai-dev in homes that someone might have suggestions for John if I provide a little more info about what might be going on.  In particular, I wonder if there's anything special about configuring sakai to save file bodies to the filesystem in Windows.

Now here's some additional info.
 
The kernel version is 1.0.13, and the problem is occurring in DBContentService in this part of the code:

			try
			{
				// make sure all directories are there
				File container = file.getParentFile();
				if (container != null)
				{
					container.mkdirs();
				}

				// write the file
				FileOutputStream out = new FileOutputStream(file);
				out.write(body);
				out.close();
			}
			catch (Throwable t)
			{
				M_log.warn(": failed to write resource: " + resource.getId() + " : " + t);
				return false;
			}

The throwable caught in this code fragment is a java.io.FileNotFoundException.  I believe that is thrown by the FileOutputStream constructor  [1].  Any suggestions?

John says the first three files are actually created in the filesystem in the same folder where this one would be created.  And then this one fails with an error message that says access is denied.

John: are all of the volumes specified in your sakai.properties created?  Maybe you can manually create the volumes within the bodyContent folder and make them readable/writable by all users.  And then try again?

Before running it again, delete the contents of the file path column of the content_resource table, as Steve Swinsburg mentioned.


[1] http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileOutputStream.html#FileOutputStream(java.io.File)




On May 14, 2010, at 9:47 PM, Jim Eng wrote:

> Sorry. I skipped over this sentence:
> 
>>> The Access is denied error doesn't make sense because Sakai just wrote the 3 converted files to that directory.
> 
> Do you know what version of the kernel is in that build?
> 
> Jim
> 
> 
> 
> On May 14, 2010, at 9:33 PM, Jim Eng wrote:
> 
>> Hi John,
>> 
>> It looks like the problem may be in the way your access to the file system is configured.  The root folder (it looks like "C:\Tomcat 5.5\sakai\bodycontent") must exist and the sakai process must have rights to write new files to it (as well as read, revise and delete files there). The error messages imply that the problem might be in the permissions for the sakai process.  
>> 
>> But I have not worked with Sakai running on Windows, so if that is not the problem, I will defer to someone who has experience with that.
>> 
>> HTH.
>> 
>> Jim
>> 
>> 
>> On May 14, 2010, at 5:18 PM, Grossman,John E wrote:
>> 
>>> We are testing the conversion from database content storage to file-based storage and are running into strange errors.
>>> 
>>> Details:
>>> Sakai 2.6.2 binary release (uses the 1.0.13 kernel which has the required conversion fix according to Steve Swinsburg's May 13, 2010 comment in KNL-164).
>>> 
>>> Oracle 10g database
>>> 
>>> When we run the conversion it converts 3 files, then fails with the error below. The Access is denied error doesn't make sense because Sakai just wrote the 3 converted files to that directory.
>>> 
>>> 2010-05-14 15:52:21,302  WARN main org.sakaiproject.content.impl.DbContentService - : failed to write resource: /group/PortfolioAdmin/system/freeFormRenderer.xml : java.io.FileNotFoundException: C:\Tomcat 5.5\sakai\bodycontent (Access is denied)
>>> 2010-05-14 15:52:21,302  WARN main org.sakaiproject.content.impl.DbContentService - failed to write file from byte-array to file
>>> org.sakaiproject.exception.ServerOverloadException id=failed to write file from byte-array to file
>>>         at org.sakaiproject.content.impl.DbContentService$DbStorage.commitResource(DbContentService.java:1705)
>>>         at org.sakaiproject.content.impl.BaseContentService.commitResourceEdit(BaseContentService.java:5563)
>>>         at org.sakaiproject.content.impl.BaseContentService.commitResource(BaseContentService.java:5526)
>>>         at org.theospi.portfolio.presentation.model.impl.PresentationManagerImpl.updateResource(PresentationManagerImpl.java:2930)
>>>         at org.theospi.portfolio.presentation.model.impl.PresentationManagerImpl.initFreeFormTemplate(PresentationManagerImpl.java:2887)
>>>         at org.theospi.portfolio.presentation.model.impl.PresentationManagerImpl.init(PresentationManagerImpl.java:2758)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
>>> 
>>> Appreciate any suggestions.
>>> 
>>> John
>>> 
>>> 
>>> -- 
>>> John Grossman
>>> Director, Academic Technology Services
>>> The University of Texas M. D. Anderson Cancer Center
>>> john.grossman at mdanderson.org
>>> 713-745-0305 (w)
>>> 832-771-8222 (m)
>>> _______________________________________________
>>> sakai-dev mailing list
>>> sakai-dev at collab.sakaiproject.org
>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>> 
>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>> 
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>> 
>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20100514/da49f03a/attachment.html 


More information about the sakai-dev mailing list