"Unable to write log file" error running JUnit batch files with Ant "Unable to write log file" error running JUnit batch files with Ant selenium selenium

"Unable to write log file" error running JUnit batch files with Ant


It looks like not much information is printed on exception. On browsing i came to now this which helps you get more details on exception.

One more thing is did you using log4j or any reference to it. you can check this to get out off reference to log4j

Thank You,Murali


I have resolved the above error with some trial and error but not sure whether this will work 100% for others or not, but what I did I am sharing my experience.

Steps

  1. service jenkins stop or sudo /etc/init.d/jenkins stop
  2. Make sure all services are stopped. Even u should not be able toaccess the jenkins url from browser.
  3. check the rpm -qa|grep jenkins. It will show your jenkins rpmpackage.
  4. Run the find / -name jenkins to check where and all jenkins is used.

    [root@localhost]# find / -name "jenkins"

    /etc/rc.d/init.d/jenkins

    /etc/logrotate.d/jenkins

    /etc/sysconfig/jenkins

    /usr/lib/jenkins

    /var/lib/jenkins

    /var/cache/jenkins

    /var/cache/yum/jenkins

    /var/log/jenkins

    [root@localhost]#

  5. Take backup of /var/lib/jenkins/ folders to /var/lib/jenkins.old

  6. Now run the "rpm -e --nodeps jenkins-1.651.3-1.1" to remove thepackage.

  7. Repeat Step 4 again and make sure /var/cache/jenkins and/var/cache/yum/jenkins are the two directories which remains

  8. Now run "rpm -ivh /etc/yum.repos.d/jenkins-1.651.3-1.1.noarch.rpm"to install the jenkins package

  9. Run "service jenkins start" so that it will listen on port 8080

  10. Open the jenkins url with IP and Port.

  11. Create a free-style project with some name and make sure the project should be created in /var/lib/jenkins/jobs/project_name

  12. Configure the necessary steps such as JDK Installation, Ant installations etc., in manage jenkins options.

  13. Now run the build for your project without configuring build.xml path, so that it will create a workspace folder in /var/lib/jenkins/workspace/project_name

  14. Now copy the build.xml file from existing project and put the file in /var/lib/jenkins/workspace/project_name

  15. Build project from Jenkins.

  16. Try to resolve script label errors such as it will complain for lib, src folders not found and copy/create those folders to resolve the compilation errors.

  17. Once done with all errors try to run the build again so that you will get Build Successful.

  18. Make sure you copy/create src and lib folder and don't copy/create the target folder.

  19. Make sure target folder must be created automatically by Jenkins with jenkins ownership and jenkins file permission. Rest all may be root owner and root file permission.

  20. Now configure the junit report and email notifications to get the build reports in email.