Hi Again -

Since i'm working with an older version of appfuse(1.8), i upgraded
httpclient which seemed to fix the problems I was having.
Thanks for the tip!

Now of course, I have a new problem.  : )

I've made some progress and managed to display bookmarks from delicious in a
jsp page.  The service from delicious/yahoo has many issues.  The biggest is
that you get throttled if  you make repeated and frequent calls to their
server .  Basically, they kick you off!  The time limit is unknown but seems
to be more than a few minutes, maybe 15 or 30.

I decided that I should create a local copy of the delicious posts and
update it on a regular scheduled basis. I configured quartz and got it
working, created a dao and service layer for a new bookmark pojo.
everything was going peachy until......

I setup a quartz job that calls a function called getAllPosts( ) in
DeliciousManagerImpl.  The getAllPosts( )  function calls a function in
bookmarkManager called deleteAllBookmarks().  This is meant to clear out
existing list before it is replaced with the new one from delicious.  Right
now, i'm only trying to delete existing bookmarks.

The problem:  If I call deleteAllBookmarks() in bookmarkManager from an
action it works fine.  If I call deleteAllBookmarks() in bookmarkManager
from within the getAllPosts( ) function in DeliciousManagerImpl it produces
an error.

My code snippets and error report are below.  Any ideas?

Best,

Dorothy



from BookmarkDAOHibernate
-------------------------------------------------------
   public void deleteAllBookmarks() {

       List bookmarks = getHibernateTemplate().find("from Bookmark");

       if ((bookmarks.size() > 0) && log.isDebugEnabled()) {
           log.debug("deleting all " + bookmarks.size() + " bookmarks " );
           getHibernateTemplate().deleteAll(bookmarks);
       }

   }



from DeliciousManagerImpl
-------------------------------------------------------
  public void getAllPosts( ) {

           bookmarkManager.deleteAllBookmarks();

   }



from applicationContext-service.xml
---------------------------------------------------------
<!--  Bookmark -->
   <bean id="bookmarkManager" parent="txProxyTemplate">
       <property name="target">
           <bean class="org.dba.service.impl.BookmarkManagerImpl">
               <property name="bookmarkDAO" ref="bookmarkDAO"/>
           </bean>
       </property>
   </bean>

<!--  Delicious -->
   <bean id="deliciousService" class="del.icio.us.Delicious">
          <constructor-arg index="0" value="username"/>
          <constructor-arg index="1" value="password"/>
   </bean>

    <bean id="deliciousManager" parent="txProxyTemplate">
       <property name="target">
           <bean class="org.dba.service.delicious.impl.DeliciousManagerImpl
">
               <property name="deliciousService" ref="deliciousService"/>
               <property name="bookmarkManager" ref="bookmarkManager"/>
           </bean>
       </property>
   </bean>


   <!--  quartz  -->

   <bean id="dummyJobDetail" class="
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
       <property name="targetObject"><ref bean="deliciousManager"/></
property>
       <property name="targetMethod"><value>getAllPosts</value></property>
   </bean>

   <bean id="dummyTrigger" class="
org.springframework.scheduling.quartz.SimpleTriggerBean">
     <property name="jobDetail">
       <ref bean="dummyJobDetail"/>
     </property>
     <property name="startDelay">
       <value>30000</value>
     </property>
     <property name="repeatInterval">
       <value>3600000</value>
     </property>
   </bean>

   <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean
">
     <property name="triggers">
       <list>

         <ref local="dummyTrigger"/>

       </list>
     </property>
   </bean>


THE ERROR
------------------------------------------------
ERROR [DefaultQuartzScheduler_Worker-1] JobRunShell.run(211) | Job
DEFAULT.dummyJobDetail threw an unhandled Exception:
java.lang.NoSuchMethodError: org.quartz.JobExecutionException
.<init>(Ljava/lang/String;Ljava/lang/Exception;Z)V
   at
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal
(MethodInvokingJobDetailFactoryBean.java:174)
   at org.springframework.scheduling.quartz.QuartzJobBean.execute(
QuartzJobBean.java:66)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(
SimpleThreadPool.java:529)
[death] ERROR [DefaultQuartzScheduler_Worker-1]
ErrorLogger.schedulerError(2156)
| Job (DEFAULT.dummyJobDetail threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested
exception: java.lang.NoSuchMethodError: org.quartz.JobExecutionException
.<init>(Ljava/lang/String;Ljava/lang/Exception;Z)V]
   at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(
SimpleThreadPool.java:529)
Caused by: java.lang.NoSuchMethodError: org.quartz.JobExecutionException
.<init>(Ljava/lang/String;Ljava/lang/Exception;Z)V
   at
org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal
(MethodInvokingJobDetailFactoryBean.java:174)
   at org.springframework.scheduling.quartz.QuartzJobBean.execute(
QuartzJobBean.java:66)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
   ... 1 more

Reply via email to