uPortal-Project / uPortal-start

CLI tools for implementing uPortal, beginning with version 5.0.0
Apache License 2.0
19 stars 54 forks source link

Fix dataImport for Announcements #380

Open bjagg opened 4 years ago

bjagg commented 4 years ago

Describe the bug Currently, dataImport does not work for Announcements data files. DataInit does.

To Reproduce Steps to reproduce the behavior:

  1. Start Hsql
  2. ./gradlew dataImport -Ddir data/quickstart/announcements/
  3. Check if import succeeded

Expected behavior ./gradlew dataImport -Ddir data/quickstart/announcements/ imports files in that directory

remyjacob commented 4 years ago

Is there a workaround for it ?

jgribonvald commented 3 years ago

Is there a workaround for it ?

The workaround is to launch ./gradlew overlays:uPortal:dataImport -D..... when you don't need the announcement import

jgribonvald commented 3 years ago

To provide a trace of the error:

> Task :overlays:CalendarPortlet:dataImport
No actions have been defined for this task in this project
[ant:java] 
[ant:java] ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider com.sun.phobos.script.javascript.RhinoScriptEngineFactory could not be instantiated
[ant:java]  INFO 
[ant:java] **************************************************
[ant:java] ** Invoking ScriptRunner.run(Task, TaskRequest)
[ant:java] ** TaskRequest contains 3 elements
[ant:java] **   - $1=/opt/uPortal/uPortal-start/overlays/NewsReaderPortlet/build/export
[ant:java] **   - Attributes.CACHE={}
[ant:java] **   - Attributes.ORIGIN=classpath://org/jasig/portlet/newsreader/io/import.crn.xml
[ant:java] **************************************************
[ant:java] 
[ant:java]  INFO Loaded 'javax.script.Compilable', assuming JDK6 and compilable script support
[ant:java]  INFO Creating new lazily initialized GenericApplicationContext for the portal
[ant:java] INFO  [07:05.653] Creating new lazily initialized GenericApplicationContext for the portal
[ant:java]  INFO Loading XML bean definitions from class path resource [context/importExportContext.xml]
[ant:java]  INFO Loading XML bean definitions from class path resource [context/databaseContext.xml]
[ant:java]  INFO Refreshing org.springframework.context.support.GenericApplicationContext@1a4013: startup date [Fri Jun 04 16:07:05 CEST 2021]; root of context hierarchy
[ant:java]  INFO Jasypt support for encrypted property values DISABLED;  specify environment variable UP_JASYPT_KEY to use this feature
[ant:java]  INFO Loading properties file from class path resource [datasource.properties]
[ant:java]  INFO Loading properties file from class path resource [configuration.properties]
[ant:java]  INFO Loading properties file from URL [file:/opt/uPortal/tomcat/portal/global.properties]
[ant:java]  INFO Jasypt support for encrypted property values DISABLED;  specify environment variable UP_JASYPT_KEY to use this feature
[ant:java]  INFO Loading properties file from class path resource [datasource.properties]
[ant:java]  INFO Loading properties file from class path resource [configuration.properties]
[ant:java]  INFO Loading properties file from URL [file:/opt/uPortal/tomcat/portal/global.properties]
[ant:java]  INFO Created new lazily initialized GenericApplicationContext for the portal in 290ms
[ant:java] ERROR The specified DIR does not exist:  /opt/uPortal/uPortal-start/overlays/NewsReaderPortlet/build/export
[ant:java]  INFO Closing org.springframework.context.support.GenericApplicationContext@1a4013: startup date [Fri Jun 04 16:07:05 CEST 2021]; root of context hierarchy
[ant:java] Exception in thread "main" org.danann.cernunnos.ManagedException: The Cernunnos Runtime encountered an error:
[ant:java]              Origin Document:  classpath://org/jasig/portlet/newsreader/io/import.crn.xml
[ant:java]              Source:  /with/subtasks/with-attribute/for-each/file-iterator
[ant:java]              Entity Name:  <file-iterator>
[ant:java]      at org.danann.cernunnos.runtime.RuntimeTaskDecorator.perform(RuntimeTaskDecorator.java:93)
[ant:java]      at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:148)
[ant:java]      at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:123)
[ant:java]      at org.danann.cernunnos.flow.ForEachTask.perform(ForEachTask.java:80)
[ant:java]      at org.danann.cernunnos.runtime.RuntimeTaskDecorator.perform(RuntimeTaskDecorator.java:77)
[ant:java]      at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:148)
[ant:java]      at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:123)
[ant:java]      at org.danann.cernunnos.core.SetAttributeTask.perform(SetAttributeTask.java:66)
[ant:java]      at org.danann.cernunnos.runtime.RuntimeTaskDecorator.perform(RuntimeTaskDecorator.java:77)
[ant:java]      at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:148)
[ant:java]      at org.danann.cernunnos.AbstractContainerTask.performSubtasks(AbstractContainerTask.java:123)
[ant:java]      at org.danann.cernunnos.core.WithTask.perform(WithTask.java:90)
[ant:java]      at org.danann.cernunnos.runtime.RuntimeTaskDecorator.perform(RuntimeTaskDecorator.java:77)
[ant:java]      at org.danann.cernunnos.runtime.ScriptRunner$TaskDecorator.perform(ScriptRunner.java:436)
[ant:java]      at org.danann.cernunnos.runtime.ScriptRunner.run(ScriptRunner.java:288)
[ant:java]      at org.danann.cernunnos.runtime.ScriptRunner.run(ScriptRunner.java:225)
[ant:java]      at org.danann.cernunnos.runtime.ScriptRunner.run(ScriptRunner.java:158)
[ant:java]      at org.danann.cernunnos.runtime.Main.main(Main.java:103)
[ant:java] Caused by: java.lang.RuntimeException: The specified DIR does not exist:  /opt/uPortal/uPortal-start/overlays/NewsReaderPortlet/build/export
[ant:java]      at org.danann.cernunnos.io.FileIteratorTask.perform(FileIteratorTask.java:107)
[ant:java]      at org.danann.cernunnos.runtime.RuntimeTaskDecorator.perform(RuntimeTaskDecorator.java:77)
[ant:java]      ... 17 more

> Task :overlays:NewsReaderPortlet:dataImport FAILED

This cause .gradlew dataImport fail , we should use ./gradlew overlays:uPortal:dataImport instead and in waiting this is fixed