Jump to content
We've recently updated our Privacy Statement, available here ×
  • Executing js-upgrade-newdb.sh under a non-root user account fails with 'Permission denied ' errors


    vchiem
    • Features: JasperReports Server Version: v6.4.2 Product: JasperReports® Server

    Issue:

    The following errors were thrown in the js-upgrade-pro_<datetime>.log when trying to upgrade 6.1 to 6.4.2 using js-upgrade-newdb.sh as a non-root user:

    [toc]
    [java] Caused by: org.springframework.beans.factory.BeanCreationException: 
           Error creating bean with name 'systemLoggedInUserStorage' 
           defined in file [/opt/userhome/jasperreports-install/buildomatic/conf_source/iePro/applicationContext.xml]: 
                   Cannot resolve reference to bean 'systemUserStorageCache' while setting bean property 'cache';
    ...
    [java] Caused by: net.sf.ehcache.CacheException: java.io.IOException: Permission denied 
    [java]     at net.sf.ehcache.DiskStorePathManager$DiskStorePath.<init>(DiskStorePathManager.java:331)
    

    Solution:

    In the file ../buildomatic/conf_source/iePro/applicationContext.xml, there exists the following property:

    <prop key="ehcache.disk.store.dir">#{ systemProperties['java.io.tmpdir'] }</prop>
    

    The user needs to have full permissions to the path referenced by java.io.tmpdir. This temp directory should not have any subdirectories: main, buffer, adhocCache. If they exist then they should first be deleted.

    In order to determine what path this system variable is pointing to, you can first set the debug component for class DiskStorePathManager. Please refer to 'Debugging options' below.

    There are two ways to override the path of 'java.io.tmpdir'.

    1. Including -Djava.io.tmpdir for ANT_OPTS in file ..buildomaticbindo-js-setup.sh since running js-upgrade-newdb.sh will execute this script.

      Example:

      export ANT_OPTS="$ANT_OPTS -Dnet.sf.ehcache.disabled=true -Xms512m -Xmx2048m -XX:PermSize=128m -Djava.io.tmpdir=/opt/userhome/tmp"
      
    2. Edit ../buildomatic/conf_source/iePro/applicationContext.xml and change to user.home system property. This is usually the path to the users home dir. Eg /opt/userhome

      <prop key="ehcache.disk.store.dir">#{ systemProperties['user.home'] }</prop>
      

    When running the upgrade script, watch for temp files and the following 3 directories that will be created:

    • /opt/userhome/main

    • /opt/userhome/buffer

    • /opt/userhome/adhocCache

    Note: If you are able to run a Diagnostic report on the JR Server, the Diagnostic report will show the paths for the system properties, java.io.tmpdir and user.home.

    Debugging options:

    In order to determine what the disk store path is, you can add the following logging component to the file ..buildomaticconf_sourceieProlog4j.properties :

    log4j.logger.net.sf.ehcache.DiskStorePathManager=debug
    

    and search for "Using diskstore path" in the log file. This is the path that requires the appropriate permissions set for the user. Example log entries:

         [java] Using diskstore path /opt/userhome/main

         [java] Holding exclusive lock on /opt/userhome/main/.ehcache-diskstore.lock

    Related Articles:


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...