[Dspace-tech] Thumbnails created in shell/not created in cron job

4 views
Skip to first unread message

Thomas A McGee

unread,
Aug 25, 2015, 11:21:16 AM8/25/15
to dspac...@lists.sourceforge.net

Following up on my earlier post, I was getting errors when running the ./filter-media command with the flags to only run the JPEGFilter. I tried it again with no flags, and presto! thumbnails created. The librarians are very happy with them.

OK, so then I check my crontab to see what's going on. Running from a command line:
/usr/home/dspace/app/dspace/bin/filter-media -v


generates a nice page of results with a few warnings.

Setting a crontab entry according to the cookbook to:
5 2 * * * /usr/home/dspace/app/dspace/bin/filter-media -v >> /tmp/mediafilter.log 2>&1

returns this mess to the output log file:
Applying Media Filters
Warning: -Xmx256m not understood. Ignoring.
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: org.dspace.app.mediafilter.MediaFilterManager
   at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.Class.forName(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
   at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
   at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/libgcj.so.5.0.0)
   at __gcj_personality_v0 (/usr/home/dspace/java.version=1.4.2)
   at __libc_start_main (/lib/tls/libc-2.3.4.so)
   at _Jv_RegisterClasses (/usr/home/dspace/java.version=1.4.2)
Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in [file:/usr/home/dspace/app/dspace/lib/activation-1.1.jar, file:/usr/home/dspace/app/dspace/lib/bcmail-jdk14-136.jar, file:/usr/home/dspace/app/dspace/lib/bcprov-jdk14-136.jar, file:/usr/home/dspace/app/dspace/lib/commons-cli-1.0.jar, file:/usr/home/dspace/app/dspace/lib/commons-codec-1.3.jar, file:/usr/home/dspace/app/dspace/lib/commons-collections-3.2.jar, file:/usr/home/dspace/app/dspace/lib/commons-dbcp-1.2.1.jar, file:/usr/home/dspace/app/dspace/lib/commons-fileupload-1.1.1.jar, file:/usr/home/dspace/app/dspace/lib/commons-io-1.2.jar, file:/usr/home/dspace/app/dspace/lib/commons-lang-2.2.jar, file:/usr/home/dspace/app/dspace/lib/commons-logging-1.0.jar, file:/usr/home/dspace/app/dspace/lib/commons-pool-1.3.jar, file:/usr/home/dspace/app/dspace/lib/dom4j-1.6.1.jar, file:/usr/home/dspace/app/dspace/lib/dspace-api-1.5.0.jar, file:/usr/home/dspace/app/dspace/lib/dspace-api-lang-1.5.0.0.jar, file:/usr/home/dspace/app/dspace/lib/fontbox-0.1.0.jar, file:/usr/home/dspace/app/dspace/lib/handle-5.3.4.jar, file:/usr/home/dspace/app/dspace/lib/icu4j-3.4.4.jar, file:/usr/home/dspace/app/dspace/lib/jargon-1.4.25.jar, file:/usr/home/dspace/app/dspace/lib/jaxen-1.1.jar, file:/usr/home/dspace/app/dspace/lib/jdom-1.0.jar, file:/usr/home/dspace/app/dspace/lib/jempbox-0.2.0.jar, file:/usr/home/dspace/app/dspace/lib/log4j-1.2.14.jar, file:/usr/home/dspace/app/dspace/lib/lucene-core-2.3.0.jar, file:/usr/home/dspace/app/dspace/lib/mail-1.4.jar, file:/usr/home/dspace/app/dspace/lib/mets-1.5.2.jar, file:/usr/home/dspace/app/dspace/lib/ojdbc14-10.2.0.2.0.jar, file:/usr/home/dspace/app/dspace/lib/oro-2.0.8.jar, file:/usr/home/dspace/app/dspace/lib/pdfbox-0.7.3.jar, file:/usr/home/dspace/app/dspace/lib/poi-2.5.1-final-20040804.jar, file:/usr/home/dspace/app/dspace/lib/rome-0.8.jar, file:/usr/home/dspace/app/dspace/lib/tm-extractors-0.4.jar, file:/usr/home/dspace/app/dspace/lib/xalan-2.7.0.jar, file:/usr/home/dspace/app/dspace/lib/xercesImpl-2.8.1.jar, file:/usr/home/dspace/app/dspace/lib/xml-apis-1.0.b2.jar, file:/usr/home/dspace/app/dspace/lib/xmlParserAPIs-2.0.2.jar, file:/usr/home/dspace/app/dspace/config/, file:/usr/share/java/libgcj-3.4.6.jar, file:./, core:/]
   at java.net.URLClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
   at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.ClassLoader.loadClass(java.lang.String, boolean) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_BytecodeVerifier.verify_instructions_0() (/usr/lib/libgcj.so.5.0.0)
   at _Jv_VerifyMethod(_Jv_InterpMethod) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_PrepareClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
   at _Jv_WaitForState(java.lang.Class, int) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.VMClassLoader.linkClass0(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
   at java.lang.VMClassLoader.resolveClass(java.lang.Class) (/usr/lib/libgcj.so.5.0.0)
   ...9 more

Crontab was set up as user 'dspace', which is the user account used for the successful command-line execution. The log file is created and owned by user 'dspace' as well.

_____________________
Tom McGee
Seton Hall University TLTC
973.275.2992

Mark H. Wood

unread,
Aug 25, 2015, 11:21:17 AM8/25/15
to dspac...@lists.sourceforge.net
The cron job is still using gcj Java, not Sun, which may affect your
results. Cron jobs typically have a very different (much simpler)
environment than interactive sessions, which may account for the
difference between running a command in cron and running the same
command interactively.

--
Mark H. Wood, Lead System Programmer mw...@IUPUI.Edu
Friends don't let friends publish revisable-form documents.

Thomas A McGee

unread,
Aug 25, 2015, 11:21:30 AM8/25/15
to dspac...@lists.sourceforge.net

I've figured it out. You can't have the java call directly in the crontab. You need to write a shell script that brings in the proper environmental variables and sets the PATH, and then that script makes the java call. Mine looks like this:

SHELL=/bin/bash

export JAVA_HOME=/usr/home/dspace/app/java
export ANT_HOME=/usr/home/dspace/app/ant
export MAVEN_HOME=/usr/home/dspace/app/maven
export CATALINA_HOME=/usr/home/dspace/app/tomcat
export DSPACE_HOME=/usr/home/dspace/app/dspace
export LD_LIBRARY_PATH=/usr/home/dspace/app/sqlplus
export TNS_ADMIN=/usr/home/dspace/app/sqlplus
export JAVA_OPTS="-Xmx2024M -Xms2024M -Dfile.encoding=UTF-8"

PATH=.:$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$CATALINA_HOME/bin:$PATH:/usr/home/dspace/app/sqlplus
PATH=$PATH:$DSPACE_HOME/bin

/bin/date >> /tmp/mediafilter.log
/usr/home/dspace/app/dspace/bin/filter-media -v >> /tmp/mediafilter.log

It would be good to address this in the documentation (http://www.dspace.org/index.php?option=com_content&task=view&id=152 -- see "cron jobs")

Sofia Alicia Treviño Garza

unread,
Aug 25, 2015, 11:21:32 AM8/25/15
to Thomas A McGee, dspac...@lists.sourceforge.net

Hello :

 

I want to know how to install Dspace language pack for my actual installation.

Could you please send me some information about it?

 

 

Saludos cordiales y estoy para servirte.

Sofía

 

 sofia3

 

Sofía Alicia Treviño Garza

Universidad Virtual - Dirección de Informática

Tutora de Comercio Electrónico - PACSI
Tecnológico de Monterrey

TEL: (81) 8358200 Ext. 6605

Edificio CEDES - SS1

Av. Eugenio Garza Sada

Monterrey N.L.

http://www.tecvirtual.itesm.mx

http://www.itesm.mx

image001.jpg

Claudia Jürgen

unread,
Aug 25, 2015, 11:21:36 AM8/25/15
to sofia....@itesm.mx, dspac...@lists.sourceforge.net
Hola Sofia,

this largely depends on the version of DSpace you're using, 1.4.2 and
lower, 1.5 or 1.5.1?

Claudia Jürgen


Sofia Alicia Treviño Garza schrieb:
> Hello :
>
>
>
> I want to know how to install Dspace language pack for my actual
> installation.
>
> Could you please send me some information about it?
>
>
>
>
>
> Saludos cordiales y estoy para servirte.
>
> Sofía
>
>
>
> sofia3
>
>
>
> Sofía Alicia Treviño Garza
>
> Universidad Virtual - Dirección de Informática
>
> Tutora de Comercio Electrónico - PACSI
> Tecnológico de Monterrey
> TEL: (81) 8358200 Ext. 6605
>
> Edificio CEDES - SS1
>
> Av. Eugenio Garza Sada
>
> Monterrey N.L.
>
> <http://www.tecvirtual.itesm.mx/> http://www.tecvirtual.itesm.mx
>
> <http://www.itesm.mx/> http://www.itesm.mx
>
>
>
> From: Thomas A McGee [mailto:mcge...@shu.edu]
> Sent: miércoles, 05 de noviembre de 2008 08:02 a.m.
> To: dspac...@lists.sourceforge.net
> Subject: [Dspace-tech] Thumbnails created in shell/not created in cron job
>
>
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> DSpace-tech mailing list
> DSpac...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply all
Reply to author
Forward
0 new messages