Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2844

Fail to Importing mindmap activites

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: Tool Mind Maps
    • Labels:
      None

      Description

      When importing a mindmap activity, there's an exception thrown:


      2012-03-22 08:36:33,795 ERROR [ExportToolContentService] Unable to import tool content for tool Mindmap. Caused by java.lang.NullPointerException.
      java.lang.NullPointerException
              at java.io.StringReader.<init>(StringReader.java:33)
              at com.thoughtworks.xstream.XStream.fromXML(XStream.java:483)
              at org.lamsfoundation.lams.tool.mindmap.service.MindmapService.importToolContent(MindmapService.java:500)
              at sun.reflect.GeneratedMethodAccessor1400.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
              at $Proxy174.importToolContent(Unknown Source)
              at org.lamsfoundation.lams.learningdesign.service.ExportToolContentService.importLearningDesignV2(ExportToolContentService.java:1434)
              at org.lamsfoundation.lams.learningdesign.service.ExportToolContentService.importLearningDesign(ExportToolContentService.java:1315)
              at org.lamsfoundation.lams.learningdesign.service.ExportToolContentService$$FastClassByCGLIB$$d05ed216.invoke(<generated>)
              at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
              at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
              at org.lamsfoundation.lams.learningdesign.service.ExportToolContentService$$EnhancerByCGLIB$$b5f31f6e.importLearningDesign(<generated>)
              at org.lamsfoundation.lams.authoring.web.ImportToolContentAction.importLD(ImportToolContentAction.java:196)
              at org.lamsfoundation.lams.authoring.web.ImportToolContentAction.execute(ImportToolContentAction.java:132)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.lamsfoundation.lams.web.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:142)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.lamsfoundation.lams.web.session.SystemSessionFilter.doFilter(SystemSessionFilter.java:69)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.lamsfoundation.lams.integration.security.SingleSignOn.invoke(SingleSignOn.java:118)
              at org.lamsfoundation.lams.integration.security.LoginRequestValve.invoke(LoginRequestValve.java:71)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:662)
      2012-03-22 08:36:33,800 ERROR [ImportToolContentAction] Error occured during import
      org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
              at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:695)
              at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
              at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
              at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
              at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
              at org.lamsfoundation.lams.learningdesign.service.ExportToolContentService$$EnhancerByCGLIB$$b5f31f6e.importLearningDesign(<generated>)
              at org.lamsfoundation.lams.authoring.web.ImportToolContentAction.importLD(ImportToolContentAction.java:196)
              at org.lamsfoundation.lams.authoring.web.ImportToolContentAction.execute(ImportToolContentAction.java:132)
              at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
              at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
              at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
              at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.lamsfoundation.lams.web.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:142)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.lamsfoundation.lams.web.session.SystemSessionFilter.doFilter(SystemSessionFilter.java:69)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.lamsfoundation.lams.integration.security.SingleSignOn.invoke(SingleSignOn.java:118)
              at org.lamsfoundation.lams.integration.security.LoginRequestValve.invoke(LoginRequestValve.java:71)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
              at java.lang.Thread.run(Thread.java:662)

        Activity

        Hide
        ernieg Ernie Ghiglione added a comment -
        Attached there's an example.

        I believe this is related to LDEV-2841
        Show
        ernieg Ernie Ghiglione added a comment - Attached there's an example. I believe this is related to LDEV-2841
        Hide
        ernieg Ernie Ghiglione added a comment -
        Yo Andrey, this is related to the one you raised yesterday LDEV-2841.

        Can you take a look at this please?
        Show
        ernieg Ernie Ghiglione added a comment - Yo Andrey, this is related to the one you raised yesterday LDEV-2841 . Can you take a look at this please?
        Hide
        ernieg Ernie Ghiglione added a comment -
        I figured this out..

        The issue occurs here (MindmapService.java):
        ...
        NodeModel rootNodeModel = (NodeModel) xstream.fromXML(mindmapContent);
        ...

        It's trying to get the content of the mindmap xml, but not the content of the tool.xml specifically but rather one of its attributes that describe the actual content of the mindmaps <mindmapExportContent>.

        In this example (as well as all_tools.zip LDEV-2841), when I create the mindmap activity, I've just dropped the activity in the canvas and save the designed. But didn't get into the activity and or modify its content... so when the tool get export, there's nothing in the <mindmapExportContent> tag... because there was nothing to begin with.

        So I guess the best way to fix this is to include a minimal mindmap content on tool export if there's nothing on the export_content field.
        Show
        ernieg Ernie Ghiglione added a comment - I figured this out.. The issue occurs here (MindmapService.java): ... NodeModel rootNodeModel = (NodeModel) xstream.fromXML(mindmapContent); ... It's trying to get the content of the mindmap xml, but not the content of the tool.xml specifically but rather one of its attributes that describe the actual content of the mindmaps <mindmapExportContent>. In this example (as well as all_tools.zip LDEV-2841 ), when I create the mindmap activity, I've just dropped the activity in the canvas and save the designed. But didn't get into the activity and or modify its content... so when the tool get export, there's nothing in the <mindmapExportContent> tag... because there was nothing to begin with. So I guess the best way to fix this is to include a minimal mindmap content on tool export if there's nothing on the export_content field.
        Hide
        ernieg Ernie Ghiglione added a comment -
        > So I guess the best way to fix this is to include a minimal mindmap content on tool export if there's nothing on the export_content field.


        This can be done on export (before you do the export append an empty xml string that contains the basic example) or on import, if this is empty just generate one of the fly. Whatever it's easier
        Show
        ernieg Ernie Ghiglione added a comment - > So I guess the best way to fix this is to include a minimal mindmap content on tool export if there's nothing on the export_content field. This can be done on export (before you do the export append an empty xml string that contains the basic example) or on import, if this is empty just generate one of the fly. Whatever it's easier
        Hide
        ernieg Ernie Ghiglione added a comment -
        That fixed it.
        Thanks Andrey
        Show
        ernieg Ernie Ghiglione added a comment - That fixed it. Thanks Andrey
        Hide
        ernieg Ernie Ghiglione added a comment -
        Done
        Show
        ernieg Ernie Ghiglione added a comment - Done

          People

          • Assignee:
            dronych Andrey Balan
            Reporter:
            ernieg Ernie Ghiglione
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development