Ticket #1005 (closed defect: fixed)

Opened 4 months ago

Last modified 3 months ago

prepare-sip groovy.lang.MissingMethodException with issue image article

Reported by: russ Assigned to: russ
Priority: critical Milestone: 0.9.0
Component: ambra Version: 0.9-rc1
Keywords: Cc:
Blocking: Blocked By:

Description

howdy

the current proposed processs for the issue image articles is:

  • plos uses absolute URIs in the xml so no transforms are required
  • plos provides correct MANIFEST.xml so that prepare-sip doesn't append hard-coded "journal" to dois

however, we're still getting an error on prepare-sip for these articles.

will attach the absolute URI/custom MANIFEST.xml version of this for testing

we also get the same error with relative URIs and no MANIFEXT.xml

[root@sfweb02 tmp]# /usr/local/topaz/bin/prepare-sip -v image.pgen.v01.i01.zip
SIP for image.pgen.v01.i01.zip
  manifest added
  article links fixed
Processing file: image.pgen.v01.i01.zip
article-type: Issue Image
img-set-name: issueImage
img-set:      found
Created temp file: /tmp/tmp_54351image.pgen.v01.i01.g001.tif
Creating /tmp/image.pgen.v01.i01.g001.PNG_S
exe:          /usr/bin/convert "/tmp/tmp_54351image.pgen.v01.i01.g001.tif" -resize 120x> -quality 70 "png:/tmp/image.pgen.v01.i01.g001.PNG_S"
return code:  0
stderr:
stdout:
  error: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.toInteger() is applicable for argument types: () values: {}
groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.toInteger() is applicable for argument types: () values: {}
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:169)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodNSafe(ScriptBytecodeAdapter.java:175)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0Safe(ScriptBytecodeAdapter.java:200)
        at org.topazproject.ambra.article.util.ProcessImages$_processImage_closure2.doCall(ProcessImages.groovy:179)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:250)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
        at org.topazproject.ambra.article.util.ProcessImages$_processImage_closure2.doCall(ProcessImages.groovy)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:250)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
        at groovy.lang.Closure.call(Closure.java:292)
        at groovy.lang.Closure.call(Closure.java:287)
        at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:147)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.use(DefaultGroovyMethods.java:271)
        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.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:51)
        at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:54)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
        at org.topazproject.ambra.article.util.ProcessImages.processImage(ProcessImages.groovy:171)
        at org.topazproject.ambra.article.util.ProcessImages.this$2$processImage(ProcessImages.groovy)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:335)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
        at org.topazproject.ambra.article.util.ProcessImages$_processImages_closure1.doCall(ProcessImages.groovy:105)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:250)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeClosure(ScriptBytecodeAdapter.java:598)
        at org.topazproject.ambra.article.util.SipUtil$_updateZip_closure1.doCall(SipUtil.groovy:80)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:250)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:77)
        at org.topazproject.ambra.article.util.SipUtil$_updateZip_closure1.doCall(SipUtil.groovy)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:250)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
        at groovy.lang.Closure.call(Closure.java:292)
        at groovy.lang.Closure.call(Closure.java:287)
        at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:147)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.use(DefaultGroovyMethods.java:271)
        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.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:51)
        at org.codehaus.groovy.runtime.metaclass.NewInstanceMetaMethod.invoke(NewInstanceMetaMethod.java:54)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1094)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeStaticMethod(InvokerHelper.java:800)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeStaticMethodN(ScriptBytecodeAdapter.java:212)
        at org.topazproject.ambra.article.util.SipUtil.updateZip(SipUtil.groovy:79)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1094)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:748)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
        at org.topazproject.ambra.article.util.ProcessImages.processImages(ProcessImages.groovy:75)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
        at org.topazproject.ambra.article.util.PrepareSIP.run(PrepareSIP.groovy:74)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:899)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:740)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:777)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:757)
        at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:402)
        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.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:226)
        at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1094)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:748)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:167)
        at org.topazproject.ambra.article.util.PrepareSIP.main(PrepareSIP.groovy)

Dependency Graph

Attachments

image.pgen.v01.i01.zip (9.3 MB) - added by russ on 08/01/08 14:10:43.
zip with absolute URIs in article xml and custom MANIFEST.xml

Change History

08/01/08 14:10:43 changed by russ

  • attachment image.pgen.v01.i01.zip added.

zip with absolute URIs in article xml and custom MANIFEST.xml

08/01/08 15:41:46 changed by amit

  • owner changed from ronald to russ.

Problem is lack of configuration related to M and L png transformations. ProcessImages?.groovy is looking for dimensions to convert the TIF to all three and that is missing for <imageSet name="issueImage"> in configuration. I added the following to ambra.xml for issueImage and prepare_sip worked.

            <imageSet name="issueImage">
              <small width="120" />
              <medium maxDimension="600" quality="80" />
              <large quality="80" />
            </imageSet>

So now we have one of two choices:

  • Use the above configuration
  • Or modify ProcessImages?.groovy to not create M and L for issue images

08/01/08 15:50:13 changed by amit

Or you don't provide M and L in the manifest file.

08/01/08 16:28:18 changed by russ

0.8 behavior was to take the imageSet as an override - medium and large were taken from the default set in this case.

if you're going to completely ignore the previous functionality, please try and document it?

path of least resistance is to make the config still more verbose to compensate for this, so i'll make the change.

08/03/08 00:30:41 changed by ronald

  • owner changed from russ to ronald.
  • status changed from new to assigned.

A couple notes here:

  1. Do not include entries in the manifest for things that do not exist in the zip; i.e. do not include the PNG_* entries - those will be added when those images are created.
  2. Re the 2nd previous comment, not putting M and L in the manifest won't change anything. The manifest is supposed to describe what is in the zip; it doesn't drive the image scaling.

08/03/08 00:31:32 changed by ronald

  • status changed from assigned to closed.
  • resolution set to fixed.

(In [6297]) Reworked CommonsConfigCategory? to be a bit more consistent and basically always return a list even if there is only one match. Together with the appropriate adjustments in ProcessImages? this closes #1005.

08/03/08 00:34:37 changed by ronald

To clarify: this was a bug in certain cases, and it now correctly falls back to the built-in defaults if no entry is found in the config for any part.

(follow-up: ↓ 10 ) 08/11/08 11:42:46 changed by russ

  • priority changed from high to critical.
  • status changed from closed to reopened.
  • resolution deleted.

after removing the PNG representations from MANIFEST.xml, prepare-sip worked with image.pgen.v01.i01.

however, i still could not ingest the file:

Error ingesting: image.pgen.v01.i01.zip - org.topazproject.ambra.article.service.IngestException: Zip format error
javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: zip; SystemID: file:/usr/local/topaz/ambra/webapps/ROOT/WEB-INF/classes/org/topazproject/ambra/article/service/pmc2obj.xslt; Line#: 59; Column#: -1 An empty sequence is not allowed as the value of variable $manifest; SystemID: file:/usr/local/topaz/ambra/webapps/ROOT/WEB-INF/classes/org/topazproject/ambra/article/service/pmc2obj.xslt; Line#: 59; Column#: -1
net.sf.saxon.trans.DynamicError: An empty sequence is not allowed as the value of variable $manifest 

looks like if MANIFEST.xml exists, then manifest.dtd is not created.

is manifest.dtd the same in each package or does it need to be created with specific entries for each article?

could you document both the process we need to follow to ingest image articles and the rules for creating manifest.dtd if there are any?

08/11/08 11:46:23 changed by russ

  • owner changed from ronald to russ.
  • status changed from reopened to new.

looks like manifest.dtd is a constant, was able to ingest after adding it.

i'll ask rich to update our image article creation app to include this.

08/11/08 11:54:38 changed by russ

  • status changed from new to closed.
  • resolution set to fixed.

(in reply to: ↑ 7 ) 08/11/08 22:20:30 changed by ronald

Replying to russ:

is manifest.dtd the same in each package or does it need to be created with specific entries for each article?

could you document both the process we need to follow to ingest image articles and the rules for creating manifest.dtd if there are any?

MANIFEST.xml and manifest.dtd are expected to created/available in tandem, i.e. either both should be present or neither. So yes, if you create a MANIFEST.xml be sure to include the manifest.dtd too.