Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 45285 invoked from network); 24 Feb 2005 08:25:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 24 Feb 2005 08:25:26 -0000 Received: (qmail 41085 invoked by uid 500); 24 Feb 2005 08:25:21 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 41062 invoked by uid 500); 24 Feb 2005 08:25:20 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 41047 invoked by uid 99); 24 Feb 2005 08:25:20 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from v07274.home.net.pl (HELO v07274.home.net.pl) (212.85.125.162) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 24 Feb 2005 00:25:18 -0800 Received: from sj162.internetdsl.tpnet.pl (HELO ?192.168.1.62?) (lgawron.mobilebox@home@80.55.87.162) by matrix15.home.net.pl with SMTP; 24 Feb 2005 08:25:15 -0000 Message-ID: <421D8F6F.7060304@mobilebox.pl> Date: Thu, 24 Feb 2005 09:25:19 +0100 From: Leszek Gawron User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Is it a bug in the cron block? References: <1109232737.15142.494.camel@pandora> In-Reply-To: <1109232737.15142.494.camel@pandora> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Frank Rennekamp wrote: > Hi, > > I tried to use the cron block and found some difficulties. Before I > forget it, I'm working with cocoon 2.1.6, java SDK 1.4.2, tomcat 5.0.28 > and linux (debian). > > Activating the cron block with standard values in the cocoon.xconf > worked fine. > But I wanted to save the cron jobs in a database, so I made one change > in the configuration and was using the JobStore 'tx': > > delegate="org.quartz.impl.jdbcjobstore.HSQLDBDelegate"> > jdbc/personnel > > > (By the way, the only documentation found here was:'tx' and 'cmt' stores > require datasource configuration. Attributes delegate and provider are > optional. Not very helpfull, and which database structure do I have to > use? In the end I found this information on the quatz-scheduler > homepage, but it would be nice to bundle this with the cron block) > > > First I hoped I could use the datasource defined in the cocoon.xconf, > but I didn't find a solution. > So I had to configure the same datasource again, this time for use as > JNDI Datasource. > > I was modifying the server.xml and the cocoon/WEB-INF/web.xml, but I > always got the same error: > > org.quartz.SchedulerConfigException: Failure occured during job > recovery. [See nested exception: org.quartz.JobPersistenceException: > Failed to obtain DB connection from data source 'jndi:jdbc/personnel': > java.sql.SQLException: Could not retrieve datasource via JNDI url > 'jdbc/personnel' javax.naming.NameNotFoundException: Name jdbc is not > bound in this Context [See nested exception: java.sql.SQLException: > Could not retrieve datasource via JNDI url 'jdbc/personnel' > javax.naming.NameNotFoundException: Name jdbc is not bound in this > Context]] > > > Then I got the sourcecode of the quartz scheduler and found where I was > running into problems: > > src/java/main/org/quartz/utils/JNDIConnectionProvider.java > > the function init(): > > private void init() { > > if (!isAlwaysLookup()) { > try { > Context ctx = null; > if (props != null) ctx = new InitialContext(props); > else > ctx = new InitialContext(); > > datasource = (DataSource) ctx.lookup(url); > } catch (Exception e) { > getLog().error( > "Error looking up datasource: " + > e.getMessage(), e); > } > } > } > > > > Changing it into: > > private void init() { > > if (!isAlwaysLookup()) { > try { > Context ctx = null; > if (props != null) ctx = new InitialContext(props); > else > ctx = new InitialContext(); > > Context envCtx = (Context) ctx.lookup("java:comp/env"); > datasource = (DataSource) envCtx.lookup(url); > } catch (Exception e) { > getLog().error( > "Error looking up datasource: " + > e.getMessage(), e); > } > } > } > > > and compiling and replacing it with the quartz jar in the cocoon package > seems to solve the problem. > > I don't know enough about JNDI to tell if this is a bug or if this is > just a house made problem. Can anyone tell me? > > By the way, using the hsqldb database which is included in cocoon with > this aproach it's not possible, I got always a JNDI/SQL Error because > the database wasn't up, and because of this (early) error, the database > wasn't coming up. I had to use a standalone database. > > And when I'm right here, the commentar to the standard values must be > fixed, too, some are wrong, e.g.: > > > -1 > > > -1 > > At least one of them isn't working with a value of 0. Please create a patch and post it into bugzilla so your work does not get lost. -- Leszek Gawron lgawron@mobilebox.pl Project Manager MobileBox sp. z o.o. +48 (61) 855 06 67 http://www.mobilebox.pl mobile: +48 (501) 720 812 fax: +48 (61) 853 29 65 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org