[Logo] Terracotta Discussion Forums
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Messages posted by: stephanj  XML
Profile for stephanj -> Messages posted by stephanj [4]
Author Message
Explicitly setting the "java.io.tmpdir" property in the java code works!

So adding the code below before the StdSchedulerFactory instance, solves the problem on my dev. machine. Thanks!

Code:
 File newTmpDir = new File(System.getProperty("user.home"), "tmp"+System.nanoTime());
 newTmpDir.mkdir();
 
 if (!newTmpDir.isDirectory() || !newTmpDir.canWrite()) {
                 throw new AssertionError(newTmpDir.getAbsolutePath());
 }
 
 System.setProperty("java.io.tmpdir", newTmpDir.getAbsolutePath());
 

A possible correction could be :

Code:
 String dir = System.getProperty("java.io.tmpdir");
 File source = new File(dir);
 File file = File.createTempFile("prefix", "suffix", source);
 


Because java.io.File.createTempFile(*) does not react on java.io.tmpdir property change :(

This is a known bug in the Java bug database @ http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4352108
I've found the issue and the solution :)

The problem is using the method File.createTempFile(...) on Mac OS X!!
See following blog post for more info @ http://codepuccino.com/metacosm/2009/09/04/beware-of-file-createtempfile/

Solution:

Using the other overloaded 'createTempFile' method where a third parameter is used to define the target temp directory solves the problem on Mac OS X.

Code:
 final File  tempDir = File.createTempFile("tmpSigarJars", Long.toString(System.nanoTime()), new File("."));
 
I'm blocked trying to run Terracotta 3.2.0 using Quartz Jobs (v1.7) on Tomcat (6.0.20).

I've followed the Terracotta Job Store for Quartz Custom Installation @ http://www.terracotta.org/documentation/ga/product-documentation-12.html

Terracotta server starts fine and Terracotta console connects and shows one server array.

However when starting Tomcat and the installed web app, I get an exception thrown during the Quartz TerracottaJobStore initialization. FYI - When I change the property org.quartz.jobStore.class to use the RAMJobStore everything works fine.

The Quartz property file is copied below. Both Terracotta server and Tomcat run for the moment on the same server.

Code:
 org.quartz.scheduler.instanceName = DefaultQuartzScheduler
 org.quartz.scheduler.instanceId = parleysQuartzSchedulerId
 org.quartz.scheduler.rmi.export = false
 org.quartz.scheduler.rmi.proxy = false
 org.quartz.scheduler.wrapJobExecutionInUserTransaction = false
 
 org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
 org.quartz.threadPool.threadCount = 10
 org.quartz.threadPool.threadPriority = 5
 org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
 
 org.quartz.jobStore.misfireThreshold = 60000
 
 org.quartz.jobStore.class =  org.terracotta.quartz.TerracottaJobStore
 org.quartz.jobStore.tcConfigUrl = localhost:9510
 


The tc-config.xml looks like this:
Code:
 ...
   <servers>
     <server host="%i" name="localhost">
         <dso-port>9510</dso-port>
         <jmx-port>9520</jmx-port>
         <data>terracotta/server-data</data>
         <logs>terracotta/server-logs</logs>
         <statistics>terracotta/cluster-statistics</statistics>
     </server>
   </servers>
 
   <clients>
         <logs>terracotta/client-logs</logs>
         <statistics>terracotta/client-statistics/%D</statistics>
         <modules>
                 <module name="tim-quartz-1.7"/>
                 <module name="tim-tomcat-6.0"/>
         </modules>
   </clients>
 ...
 


The above tims are installed using the tim-get.sh command.


...
(+) tim-quartz-1.7 1.3.0
...
(+) tim-tomcat-6.0 2.1.0
...
 


And the thrown Terracotta exception shown in Tomcat log file is pasted below.

Any suggestions or comments are very welcome!


java.lang.RuntimeException: java.io.IOException: No such file or directory
at org.terracotta.quartz.TerracottaJobStore.init(TerracottaJobStore.java:120)
at org.terracotta.quartz.TerracottaJobStore.initialize(TerracottaJobStore.java:397)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1230)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1393)
at com.parleys.QuartzSetup.setup(QuartzSetup.java:47)
at com.parleys.QuartzSetup.contextInitialized(QuartzSetup.java:25)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3934)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1704)
at java.io.File.createTempFile(File.java:1792)
at java.io.File.createTempFile(File.java:1828)
at org.terracotta.quartz.TerracottaJobStore.createTempDir(TerracottaJobStore.java:217)
at org.terracotta.quartz.TerracottaJobStore.init(TerracottaJobStore.java:93)
... 29 more
 
 
Profile for stephanj -> Messages posted by stephanj [4]
Go to:   
Powered by JForum 2.1.7 © JForum Team