[opencms-dev] CmsScheduledJob and writeExportPoint

Roman Uhlig roman.uhlig at knve.de
Fri Oct 13 11:13:15 CEST 2006


Note: Looks like this is caused by the 6.2.2 bug addressed here:

http://www.opencms.org/bugzilla/show_bug.cgi?id=1201



Roman Uhlig wrote:
> 
> Hi,
> 
> I'm currently trying on my first CmsScheduledJob class to be executed
> within the OpenCms job schedule. Basically everything is quite
> straightforward and easy to use. 
> Now I have to change and publish a resource within the launch() method of
> my CmsScheduledJob class, which is working very well when executed
> manually within a jsp page. When getting executed inside the class at it's
> scheduled execution time, the following exception is noted inside the log
> file:
> 
> 11 Oct 2006 14:58:22,091 ERROR [rg.opencms.db.CmsDriverManager:7243] Error
> writing export points.
> org.opencms.db.CmsDbSqlException: An SQL error occurred when executing the
> following query: . 
>         at
> org.opencms.db.generic.CmsProjectDriver.readPublishedResources(CmsProjectDriver.java:2174)
>         at
> org.opencms.db.CmsDriverManager.writeExportPoints(CmsDriverManager.java:7146)
>         at
> org.opencms.db.CmsDriverManager.cmsEvent(CmsDriverManager.java:999)
>         at
> org.opencms.main.CmsEventManager.fireEventHandler(CmsEventManager.java:203)
>         at
> org.opencms.main.CmsEventManager.fireEvent(CmsEventManager.java:126)
>         at org.opencms.main.OpenCms.fireCmsEvent(OpenCms.java:152)
>         at
> org.opencms.db.CmsDriverManager.publishProject(CmsDriverManager.java:4535)
>         at
> org.opencms.db.CmsSecurityManager.publishProject(CmsSecurityManager.java:2893)
>         at org.opencms.file.CmsObject.publishProject(CmsObject.java:1975)
>         at org.opencms.file.CmsObject.publishProject(CmsObject.java:1998)
>         at org.opencms.file.CmsObject.publishResource(CmsObject.java:2033)
>         at org.opencms.file.CmsObject.publishResource(CmsObject.java:2016)
>         at
> com.idaba.common.IdabaGoogleSitemap.launch(IdabaGoogleSitemap.java:75)
>         at
> org.opencms.scheduler.CmsScheduleManager.execute(CmsScheduleManager.java:171)
>         at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
>         at
> org.opencms.scheduler.CmsSchedulerThread.run(CmsSchedulerThread.java:123)
> Caused by: java.sql.SQLException: Unsupported project ID "-1" to return a
> JDBC connection.
>         at
> org.opencms.db.generic.CmsSqlManager.getConnection(CmsSqlManager.java:502)
>         at
> org.opencms.db.generic.CmsSqlManager.getConnection(CmsSqlManager.java:247)
>         at
> org.opencms.db.generic.CmsProjectDriver.readPublishedResources(CmsProjectDriver.java:2149)
>         ... 15 more
> 
> Note: com.idaba.common.IdabaGoogleSitemap is the custom class mentioned
> above.
> 
> I can't really see a conection to my code inside the launch method, thats
> why I'm asking this here. Anything is working well, the resource gets
> published. Just writing export points seems to fail. Any ideas or
> experience on this?
> 
> Here's the relevant code of my implementation of
> I_CmsScheduledJob.launch():
> 
> public class IdabaGoogleSitemap implements I_CmsScheduledJob {
>     ...
>     public String launch(CmsObject arg0, Map arg1) throws Exception {
>         ....
>         cmso.createResource(portal_prefix + "/" + sitemap_filename,
> i_restype_plain_id, s_content.getBytes(), list_props);
>         cmso.unlockResource(portal_prefix + "/" + sitemap_filename);
>         cmso.publishResource(portal_prefix + "/" + sitemap_filename);
>         ...
>     }
> }
> 
> Thanks in advance,
> Roman
> 

-- 
View this message in context: http://www.nabble.com/CmsScheduledJob-and-writeExportPoint-tf2424139.html#a6792396
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list