Classcast exception while click on metadata against a folder in Resource Folder

11 views
Skip to first unread message

mamtay...@gmail.com

unread,
Aug 22, 2014, 3:45:36 AM8/22/14
to open...@googlegroups.com
Hi,
 
While i created a folder under Resource Folder of Learning Resources tab.
Clicking on metadata icon to edit metadata, giving following classcast exception;
Throwable: java.lang.ClassCastException

message:org.olat.core.util.vfs.LocalFolderImpl cannot be cast to org.olat.core.util.vfs.OlatRelPathImpl,java.lang.ClassCastException

at org.olat.core.commons.modules.bc.meta.MetaInfoFormController.initForm(MetaInfoFormController.java:214)
at org.olat.core.gui.components.form.flexible.impl.FormBasicController.initForm(FormBasicController.java:215)
at org.olat.core.commons.modules.bc.meta.MetaInfoFormController.(MetaInfoFormController.java:100)
at org.olat.core.commons.modules.bc.commands.CmdEditMeta.execute(CmdEditMeta.java:101)
at org.olat.core.commons.modules.bc.FolderRunController.event(FolderRunController.java:386)
at org.olat.core.gui.control.DefaultController.dispatchEvent(DefaultController.java:195)
at org.olat.core.gui.components.Component$1.run(Component.java:238)
at org.olat.core.logging.activity.ThreadLocalUserActivityLoggerInstaller.runWithUserActivityLogger(ThreadLocalUserActivityLoggerInstaller.java:108)
at org.olat.core.gui.components.Component.fireEvent(Component.java:236)
at org.olat.core.commons.modules.bc.components.FolderComponent.doDispatchRequest(FolderComponent.java:147)
 
 
To fix this i have done changes in LocalFolderImpl  by adding OlatRelPathImpl
 
public class LocalFolderImpl extends LocalImpl implements VFSContainer,OlatRelPathImpl
 
overriding following method

public String getRelPath() {
return folderRelPath;
}

In this i am not able to understand what shuld be the value of folderRelPath.

Its giving Null pointer exception while create a new folder in following block

if
 (item instanceof OlatRelPathImpl) {
// update meta data
MetaInfo meta =
meta.setAuthor(ureq.getIdentity());
meta.write();
}
fireEvent(ureq, Event.
DONE_EVENT);

Meta is returned as Null because in MetaInfoFactory.java originFile.exists() condition gets false and it returns canonicalMetaPath  null

if(originFile == null || !originFile.exists()) {
canonicalMetaPath =null;
}

Please let me know how can i fix this classcast exception without impacting other functionality.

Please revert asap.

 

Thanks,

Mamta.

 

 

Florian Gnägi

unread,
Aug 26, 2014, 10:19:21 AM8/26/14
to open...@googlegroups.com
Hi Mamta

On what OpenOLAT version did you get this error? I guess we refactored quite a bit there, I don’t get this error on the latest OpenOLAT build. 

I can not say if your changes are ok, this needs a deep look into the issue. The VFS code is complex and unfortunately has many casts that should not be done. So, it is too risky for me to give you any advice here without taking some serious time. Please compare the code with the lastest from the OpenOLAT repository, maybe you can merge some things back to your code base. 

Cheers
Florian



--
--
Sie erhalten diese Nachricht, weil Sie Mitglied sind von Google
Groups-Gruppe "OpenOLAT".
Für das Erstellen von Beiträgen in dieser Gruppe senden Sie eine E-Mail
an open...@googlegroups.com
Um sich von dieser Gruppe abzumelden, senden Sie eine E-Mail an
openolat+u...@googlegroups.com
Weitere Optionen finden Sie in dieser Gruppe unter
http://groups.google.com/group/openolat?hl=de
-------------------------------------------------------------------------------------------------------------------
OpenOLAT - infinite learning - http://www.openolat.org

---
You received this message because you are subscribed to the Google Groups "OpenOLAT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openolat+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--------------------------------------------------------------------
professional services for the e-learning system OpenOLAT and OLATpro
 hosting - operating - support - development - mobile - consulting
--------------------------------------------------------------------

frentix  GmbH
Florian Gnägi, Geschäftsführer
Hardturmstrasse 76
CH-8005 Zürich, Switzerland

skype:gnaegi  twitter:gnaegi  xing:Florian_Gnaegi 
--------------------------------------------------------------------















Reply all
Reply to author
Forward
0 new messages