I have huge problems with file paths for jcrontab.properties, log4j.properties and crontab file.
You see, I'm running Tomcat 5.0 and the default/current directory is always pointing to C:\tomcat\bin, where C:\tomcat is my tomcat directory. And I can't store my files there because my app will be virtually hosted by some hosting company. I tried to use the ClassLoader.getResourceStream() thing as mentioned in the HOW-TO....but can't seem to get it working.
I can't seem to understand how I can find all the right paths for my jcrontab to work. I need to store all my properties files under ....../webapps/crontab/WEB-INF/.
BTW, I'm developing my app under Win XP, but the hosting platform will be Linux.
Please help, cos I've cracked my Java-less brain already.....
Mel.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dont know the inner parts of Crontab whether you can pass in the any arbitraty Properties instance "Crontab ct = new Crontab(myProp);". If not, then hack the sourcecode as its an opensource ;-)
In startupservlet you could use "getServletContext().getRealPath("/")" to identify a fullpath of the webapp. It should give you "c:/tomcat/webapps/crontab" name. Then just load your properties and instantiate Crontab.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just downloaded the source and cheched Crontab.java source. Instantiate it and call "ct.init(pathToMyPropWithinWebapp);" method and it should take care of the everything.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Perhaps a bit on the late side, but here goes...<br>
If you deploy jcrontab within a webserver, for instance Tomcat, do NOT use the jcrontab.jar file. Rather simply copy/paste the class file hierarchy to the relevant webapps/x/WEB-INF/classes folder. Jcrontab will then be able to access other classes deployed in the webapp. <br>
However, I am not able to run NativeExec, for instance org.jcrontab.NativeExec dir.exe without getting an "java.io.IOException: CreateProcess: dir.exe error=2" exception....
Hope this helps
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have huge problems with file paths for jcrontab.properties, log4j.properties and crontab file.
You see, I'm running Tomcat 5.0 and the default/current directory is always pointing to C:\tomcat\bin, where C:\tomcat is my tomcat directory. And I can't store my files there because my app will be virtually hosted by some hosting company. I tried to use the ClassLoader.getResourceStream() thing as mentioned in the HOW-TO....but can't seem to get it working.
I can't seem to understand how I can find all the right paths for my jcrontab to work. I need to store all my properties files under ....../webapps/crontab/WEB-INF/.
BTW, I'm developing my app under Win XP, but the hosting platform will be Linux.
Please help, cos I've cracked my Java-less brain already.....
Mel.
Dont know the inner parts of Crontab whether you can pass in the any arbitraty Properties instance "Crontab ct = new Crontab(myProp);". If not, then hack the sourcecode as its an opensource ;-)
In startupservlet you could use "getServletContext().getRealPath("/")" to identify a fullpath of the webapp. It should give you "c:/tomcat/webapps/crontab" name. Then just load your properties and instantiate Crontab.
Just downloaded the source and cheched Crontab.java source. Instantiate it and call "ct.init(pathToMyPropWithinWebapp);" method and it should take care of the everything.
Perhaps a bit on the late side, but here goes...<br>
If you deploy jcrontab within a webserver, for instance Tomcat, do NOT use the jcrontab.jar file. Rather simply copy/paste the class file hierarchy to the relevant webapps/x/WEB-INF/classes folder. Jcrontab will then be able to access other classes deployed in the webapp. <br>
However, I am not able to run NativeExec, for instance org.jcrontab.NativeExec dir.exe without getting an "java.io.IOException: CreateProcess: dir.exe error=2" exception....
Hope this helps