Thanks Daniel

Yes this is a configuration bug for 1.1. We aim to have all configuration driven by one properties file that is external to the deployed application, but this one slipped through the net.

To get around it, include a biocache.properties file in:

$TOMCAT_HOME/biocache-service/WEB-INF/classes/biocache.properties

with the lines:

biocacheMediaUrl=<URL_TO_YOUR_APACHE_SERVER>
biocacheMediaDir=/data/biocache-media/

This will be fixed in the release of 1.2 which should happen before the workshop in Canberra.

Dave


From: Daniel Lins [daniel.lins@gmail.com]
Sent: 27 June 2014 15:08
To: Martin, Dave (CES, Black Mountain); ala-portal@lists.gbif.org; Pedro Corrêa
Subject: Issue to view occurrence images on the Hubs.

Hi Dave,

After I updated the biocache-service to the version 1.1, I stopped viewing the occurrence images in the hubs portal. All images urls were set to http://biocache.ala.org.au/biocache-media.

e.g.

Maybe it's a issue, because in the biocache-service code (tags/biocache-service-1.1/src/main/java/au/org/ala/biocache/dto/OccurrenceIndex.java) the application is not checking the external configuration file. It is looking to "/biocache.properties". This file does not exist in this folder, thus the application always uses the default media url ("http://biocache.ala.org.au/biocache-media/"), generating this error.

public class OccurrenceIndex {

    public static String biocacheMediaUrl = "http://biocache.ala.org.au/biocache-media/";
    public static String biocacheMediaDir = "/data/biocache-media/";
    protected static final Logger logger = Logger.getLogger(OccurrenceIndex.class);

    static {
        //check the properties file for an override
        try {
            Properties p = new Properties();
                    p.load(OccurrenceIndex.class.getResourceAsStream("/biocache.properties"));
            //InputStream inStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("biocache.properties");
            //p.load(inStream);
            logger.debug("Retrieved biocacheMediaUrl: " + p.getProperty("biocacheMediaUrl"));
            logger.debug("Retrieved biocacheMediaDir: " + p.getProperty("biocacheMediaDir"));
           
            if(p.getProperty("biocacheMediaUrl") != null)
                biocacheMediaUrl = p.getProperty("biocacheMediaUrl");
            if(p.getProperty("biocacheMediaDir") != null)
                biocacheMediaDir = p.getProperty("biocacheMediaDir");
 

I changed this code to check first the property of the external configuration file ("/data/biocache/config/biocache-config.properties")
 and the visualization of images worked again.

Regards,
Daniel Lins da Silva
(Mobile) 55 11 96144-4050
Research Center on Biodiversity and Computing (Biocomp)
University of Sao Paulo, Brazil