[Ala-portal] Issue to view occurrence images on the Hubs.

David.Martin at csiro.au David.Martin at csiro.au
Fri Jun 27 07:31:39 CEST 2014


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 at gmail.com]
Sent: 27 June 2014 15:08
To: Martin, Dave (CES, Black Mountain); ala-portal at 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.

http://biocache.ala.org.au/biocache-media/dr0/20750/8fe44933-7970-4b3e-a2d8-da0350dca3bb/Chrysocyon.brachyurus__large.jpg

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<tel:55%2011%2096144-4050>
Research Center on Biodiversity and Computing (Biocomp)
University of Sao Paulo, Brazil
daniellins at usp.br<mailto:daniellins at usp.br>
daniel.lins at gmail.com<mailto:daniel.lins at gmail.com>






-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.gbif.org/pipermail/ala-portal/attachments/20140627/9351fe5c/attachment-0001.html 


More information about the Ala-portal mailing list