Cloudbees Tomcat Application IOException

184 views Asked by At

I'm using Cloudbees as my Java PaaS, I have created to Tomcat 8 Applications and uploaded two WAR files:

  • OpenRDF Workbench
  • OpenRDF Sesame

[source: http://www.openrdf.org ]

I uploaded Workbench and after the supposed waiting period, my instance of OpenRDF Workbench was working, I was able to access to web interface. After, I uploaded Sesame and after the supposed waiting period, I tried to access the URL for sesame, and this appeared:

HTTP Status 500 - Servlet.init() for servlet openrdf-http-server threw exception

(...)

root cause 
java.io.IOException: Unable to create logging directory /var/genapp/apps/8ec10836/.aduna/openrdf-sesame/logs
    info.aduna.app.logging.base.LogConfigurationBase.setBaseDir(LogConfigurationBase.java:70)
    info.aduna.app.AppConfiguration.init(AppConfiguration.java:155)
    info.aduna.app.AppConfiguration.init(AppConfiguration.java:140)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)

How can I fix it?

2

There are 2 answers

2
Jeen Broekstra On

Sesame tries to create a log directory in the given dir, but fails. The most likely cause is a permission issue. Make sure that the user under which tomcat runs has permission to write in that directory, and of course that there is sufficient space - Sesame will want to use the same directory for data persistence.

edit If the default location that Sesame uses can not be made writable, you can change the location by setting a system property info.aduna.platform.appdata.basedir. See section 2.5 of the Sesame user docs for details.

1
felix On

When you deploy this kind of applications on a PaaS, you should be aware that the file system is not persistent, so in case that application uses any kind of configuration file, every time you restart/deploy the application you will lose that information.

The way the file system works on CloudBees is explained here. As you can see you cannot write files where you want.

Temporary/ephemeral filesystem access is available to your application. In a java app this is injected as the "java.io.tmpdir" system property - you can store files there as needed. Please note the following: