db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anarres <jg...@web.de>
Subject Re: permission denied on derby.log
Date Sat, 19 Sep 2009 07:41:40 GMT

Hi Sylvain,

thanks again for your answer. (I hit the wrong reply button by accident,
this is why I copy my and your next answer inside here.)

The problem got resolved.
The tomcat administrator at my provider's did add this start parameter for
tomcat:
-Dderby.system.home=/var/www/web4838/files/tomcat/webapps/webuebung/db_books

This is almost the path which I had tried to set via Java, only the last
directory, db_books, was missing:
System.setProperty("derby.system.home",
"/war/www/web4838/files/tomcat/webapps/webuebung");

Unfortunately I do not know now if setting the Property via Java would have
been working as well if I would have written the full path...

But still, I am glad to have this error solved.





Hi Juliane,

> 2009-09-17 14:06:22.907 GMT Thread[TP-Processor3,5,main] Cleanup action
> starting
> ERROR XBM0H: Directory
> /war/www/web4838/files/tomcat/webapps/webuebung/db_books cannot be
> created.

I still suspect a problem with permissions. You, as the /deployer/, may have
the 
right to write to "/war/www/web4838/files/tomcat/webapps/webuebung". But the 
/application/ might not have the same permissions as you.

Isn't there a directory upon which you know for sure that your app has write 
permission? For testing purpose (only!) you might use the /tmp directory:

 > 	static{
 > 		System.setProperty("derby.system.home", "/tmp");
 > 	}

If this works, you would set up with you administrator a location for your
DB 
directory.


 > Is there a need to edit the server.xml? (there is no, but I probably
could 
add a xml file with context fragment)
 > Or do I need to add a <resource-ref> to WEB-INF/web.xml?
I'm never used Tomcat directly - always through JBoss AS which use it as a 
servlet container. However, by googling a little, I found:
http://onjava.com/pub/a/onjava/2002/07/31/tomcat.html?page=2
> *The <Context> Element*
> =======================
> The <Context> element is the most commonly used element in the server.xml
> file. It represents an individual Web application that is running within a
> defined <Host>.
> [...]
> *workDir:* Defines the pathname to a scratch directory that will be used
> by
> this <Context> for temporary read and write access. The directory will be
> made visible as a servlet context attribute of type java.io.File, with the
> standard key of java.servlet.context.tempdir. If this value is not
> specified,
> Tomcat will use the work directory.

Instead of hard coding the path to your DB directory, you might be able to
use 
the workDir attribute of the Context element to set the working directory
for 
your app. If think the directory defined here will become the "default" 
directory when the application starts (whereas, up to now, your default 
directory is certainly /root).
Beware of the sentence "a scratch directory that will be used [...] for 
*temporary* read and write access". I'm not quite sure of what we should 
understood by "temporary"? Will Tomcat erase the content of this directory
at 
some point? I don't no...

 > every hint is so welcome!
;) Like the first time, all of this is highly hypothetical.


Anyway, I hope this will give you a little help,
Sylvain.

jg433@web.de a écrit :
> Bonjour Sylvain,
> 
> merci pour votre reponse.
> 
> I could solve the "ERROR XBM0H: Directory /root/db_books" in adding the
> derby-home Property to my Java code:
> 
> 	static{
> 		System.setProperty("derby.system.home",
> "/war/www/web4838/files/tomcat/webapps/webuebung");


> 	}
> 
> The call to setProperty must be static because it needs to be known to the
> application before any try to connect to the database.
> 
> But there is still a problem with file writing/reading permissions:
> catalina.log says now:
> 
> java.io.FileNotFoundException:
> /war/www/web4838/files/tomcat/webapps/webuebung/derby.log (No such file or
> directory)
> 2009-09-17 14:06:22.907 GMT Thread[TP-Processor3,5,main] Cleanup action
> starting
> ERROR XBM0H: Directory
> /war/www/web4838/files/tomcat/webapps/webuebung/db_books cannot be
> created.
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown
> Source)
> 	at
> org.apache.derby.impl.services.monitor.StorageFactoryService$9.run(Unknown
> Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at
> org.apache.derby.impl.services.monitor.StorageFactoryService.createServiceRoot(Unknown
> Source)
> 	at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown
> Source)
> 	at
> org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(Unknown
> Source)
> 	at
> org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Unknown
> Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(Unknown
> Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
> 	at org.apache.derby.jdbc.Driver40.getNewEmbedConnection(Unknown Source)
> ...
> 
> Is there a need to edit the server.xml? (there is no, but I probably could
> add a xml file with context fragment)
> Or do I need to add a <resource-ref> to WEB-INF/web.xml?
> 
> I read tried different approaches but no success...
> every hint is so welcome!
> thank you so much
> juliane



Sylvain Leroux wrote:
> 
> Hi,
> 
>> Also, I do not understand, why "ERROR XBM0H: Directory /root/db_books
>> cannot 
>> be created" has path "root" as prefix. There is no single directory named 
>> "root" anywhere.
> Since there is no answer yet, let me try a totally hypothetical guess: are
> you, 
> by any chance, working as root under Linux/Unix?
> 
> In that case, it might be possible that at some point during the
> development 
> process, some path relative to your home directory was turned into an
> absolute 
> path. That would explain that unexpected /root/db_books path...
> 
> 
> /Or/, was your deployment on your provider's space done under the root
> identity? 
> It could have lead to set at some point the starting directory for your 
> application as /root. And if as I imagine (hope?) Tomcat does not have
> root 
> privileges, it cannot write to that directory...
> 
> 
> As I stated first, all of this is highly speculative!
> Sylvain
> 
> 
> anarres a écrit :
>> 
>> Hi, I am trying to deploy a little test application on tomcat. It uses
>> GWT 
>> servlet technology and embedded derby as database. On my local system 
>> everything works fine.
>> 
>> But if I deploy the application at my provider's space, tomcats
>> catalina.out 
>> log file says: ------------- java.io.FileNotFoundException: derby.log
>> (Permission denied) 2009-09-14 16:52:28.065 GMT
>> Thread[TP-Processor3,5,main]
>> Cleanup action starting ERROR XBM0H: Directory /root/db_books cannot be
>> created. -------------- The file derby.log has read- and write
>> permissions
>> and is situated inside tomcat/webapps/testapplication/
>> 
>> Also, I do not understand, why "ERROR XBM0H: Directory /root/db_books
>> cannot 
>> be created" has path "root" as prefix. There is no single directory named 
>> "root" anywhere.
>> 
>> I searched for 2 days for a solution, every hint or tip from you is
>> highly 
>> appreciated.
>> 
>> thanks you.
>> 
>> 
>> 
>> 
>> 
> 
> 
> -- 
> Website: http://www.chicoree.fr
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/permission-denied-on-derby.log-tp25439912p25519390.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message