2

I'm deploying an app which uses Vaadin and Apache Cayenne. It is causing a problem as I deploy it on Tomcat running as user "www". (If I run Tomcat as "root' there is no problem.)

It complains that there is a no permission to access/write a file called "velocity.log". Does anyone know where is the location Cayenne/Tomcat is accessing the file?

I tried to find out by:

File file = new File("test");
String testPath = file.getAbsolutePath();
System.out.println(testPath );

and I saw that it prints out "/config". I therefore tried to create a directory and setting the right permissions from root "/config" and I've also tried doing the same at several locations within the Tomcat directory. None worked.

It is running now within Tomcat because I set the user to "root". I'd like to set it back to "www" but I need to resolve this problem first. Does anyone know where is location for the supposedly "velocity.log" file in a Tomcat deployment?

ikevin8me
  • 4,253
  • 5
  • 44
  • 84
  • What folder you start the tomcat ? – Ori Marko Aug 27 '17 at 13:11
  • While Cayenne up till and including 4.0 has a hard dependency on Velocity library, it also suppresses velocity.log file generation: https://github.com/apache/cayenne/blob/STABLE-4.0/cayenne-server/src/main/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessor.java#L104 Are you using / reconfiguring Velocity outside Cayenne? Also which version of Cayenne are you using? – andrus_a Aug 27 '17 at 13:32
  • Did you find your log file ? tomcat/bin folder ? – Ori Marko Aug 31 '17 at 04:42

1 Answers1

0

Notice Apache Cayenne is using Velocity 1.6 which is not 2.0 (different logging settings),

Velocity Logging will create the file on your folder where to "started" it, in your case in the folder you execute Tomcat (check your script you are running)

Velocity will setup a file-based logger that will output all logging messages to a file called velocity.log in the 'current directory' where Velocity was initialized.

Ori Marko
  • 56,308
  • 23
  • 131
  • 233