crash on automated script step parameter replacement

Bug #1040672 reported by Ralf Claussnitzer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Goobi.Production
Status tracked in 1.10
1.10
New
Undecided
Unassigned
1.8
Fix Released
High
Henning Gerhardt

Bug Description

When using automated script steps one can use a set of dynamic parameters to pass process parameters to external programs. An automated script call can look like this: /usr/local/bin/somescript.sh {<selector>.<property>}. Three variable sources can be selected by a <selector>. Within this variable source any property named <property> will be resolved. After resolving all variable templates the script /usr/local/bin/somescript.sh is finally called.

By looking at the source code, three selectors are available:
1- template Referring to a processes template
2- process Referring to the process itself
3- product Referring to product description

Unfortunately, the variable resolving mechanism is bound to a hibernate session which seem to have disappeared at time of the resolving. The application crashes on execution of the defined step:

ERROR 2012-08-22 14:54:20,413 (LazyInitializationException.java:<init>:42)
        failed to lazily initialize a collection of role: de.sub.goobi.beans.Prozess.vorlagen, no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: de.sub.goobi.beans.Prozess.vorlagen, no session or session was closed
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380)
        at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372)
        at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365)
        at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
        at org.hibernate.collection.PersistentSet.toArray(PersistentSet.java:194)
        at java.util.ArrayList.<init>(ArrayList.java:131)
        at de.sub.goobi.beans.Prozess.getVorlagenList(Prozess.java:464)
        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:597)
        at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:197)
        at de.sub.goobi.beans.Prozess_$$_javassist_7.getVorlagenList(Prozess_$$_javassist_7.java)
        at de.sub.goobi.helper.VariableReplacer.replace(VariableReplacer.java:200)
        at de.sub.goobi.helper.HelperSchritte.executeScript(HelperSchritte.java:205)
        at de.sub.goobi.helper.HelperSchritte.executeAllScripts(HelperSchritte.java:158)
        at de.sub.goobi.helper.ScriptThread.run(ScriptThread.java:48)

Related branches

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.