[opencms-dev] CmsScheduledJob and writeExportPoint

Andy Bicksbo schlachtzeuger at gmail.com
Fri Oct 13 15:28:34 CEST 2006


Hi
Ok, thanks for quick feedback...this is what i thought about, i know what
the createResource thing is about, but i took the other option, cause so i
have some evidence when the thing is running automatically every day, and i
thougt it was better to use the xml stuff for bigger amount of data. So may
try the publishProject stuff i wrote last time
Thanks
Andy


2006/10/13, Roman Uhlig <roman.uhlig at knve.de>:
>
>
> Writing export points and therefore the exception happens while publishing
> resources. As stated in the bug report posted earlier in this thread, this
> did not happen until OpenCms 6.2.2. In 6.2.1 everything was working fine.
>
> Using createResource is usually working fine. Especially when creating
> (custom) XMLContent resources, it does the whole work like creating the
> default XML structure inside the resource. We use it i.e. for our intranet
> knowledge management, it has some advantages over classic wiki solutions.
>
> Roman
>
>
> Andy Bicksbo wrote:
> >
> > Hi
> > Is the method "createResource you use that one, which causes OpenCms to
> > write the export points, or publishResource?
> > I'm asking cause i had some problems with the publishResource, but i
> never
> > used it with craeteResource. I write the files instead in xmlFiles and
> > import them afterwords than i use:
> > *publishProject*<
> http://www.opencms.org/export/javadoc/core/org/opencms/file/CmsObject.html#publishProject(org.opencms.report.I_CmsReport
> ,
> > org.opencms.file.CmsResource,
> > boolean)>(I_CmsReport<
> http://www.opencms.org/export/javadoc/core/org/opencms/report/I_CmsReport.html
> >
> > report,
> > CmsResource<
> http://www.opencms.org/export/javadoc/core/org/opencms/file/CmsResource.html
> >
> > directPublishResource,
> > boolean directPublishSiblings)
> > this one works fine...
> > So please give me feedback aubout that, cause i'm very interested in
> that
> > Thanks
> > Andy
> >
> >
> > 2006/10/13, Roman Uhlig <roman.uhlig at knve.de>:
> >>
> >>
> >> 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.
> >>
> >>
> >> _______________________________________________
> >> This mail is sent to you from the opencms-dev mailing list
> >> To change your list options, or to unsubscribe from the list, please
> >> visit
> >> http://lists.opencms.org/mailman/listinfo/opencms-dev
> >>
> >
> >
> > _______________________________________________
> > This mail is sent to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please
> visit
> > http://lists.opencms.org/mailman/listinfo/opencms-dev
> >
>
> --
> View this message in context:
> http://www.nabble.com/CmsScheduledJob-and-writeExportPoint-tf2424139.html#a6794018
> Sent from the OpenCMS - Dev mailing list archive at Nabble.com.
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20061013/1e342fa1/attachment.htm>


More information about the opencms-dev mailing list