1 2 Previous Next 21 Replies Latest reply on Jul 28, 2006 10:20 AM by aron.gombas

    serviceResultUpdaterJob not traversing repository

    sstuart4

      Hi, I am currently trying to implement the scheduler functionality new to Version 0.2.0RC2. The problem I am having seems to be minor since I am not getting any errors, its just that the service is only taking a very short time to run when I know it should be 10+ mins or so... Here are the last few lines of my JBoss server log:

      2006-07-17 15:41:50,272 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)] Started in 2m:18s:405ms
      2006-07-17 15:41:53,004 DEBUG [org.quartz.simpl.SimpleJobFactory] Producing instance of Job 'DEFAULT.serviceResultUpdaterJob', class=hu.midori.kosmos.server.ServiceResultUpdaterJob
      2006-07-17 15:41:53,005 DEBUG [org.quartz.core.JobRunShell] Calling execute on job DEFAULT.serviceResultUpdaterJob
      2006-07-17 15:41:53,009 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
      2006-07-17 15:41:53,010 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Update job completed.


      As you can see, this is taking less than a second for a rather large repository.

      The portlet.xml should be hitting the trunk of my repo and the org.springframework.scheduling.quartz.SimpleTriggerBean configuration in the kosmos-services-servlet.xml is set like this:

      <bean id="serviceResultUpdateTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
       <property name="jobDetail" ref="serviceResultUpdaterJob"/>
       <property name="startDelay" value="10000"/>
       <property name="repeatInterval" value="7200000"/>
       </bean>


      BTW, I am running the jboss-portal-2.2.0-bundled install. Thanks!

        • 1. Re: serviceResultUpdaterJob not traversing repository
          aron.gombas

          Hi!

          Based on your description, I'd think this is a feature of the "L2 cache", not a bug.

          The SVN traversal is probably the most expensive process in Kosmos, so I've introduced a so-called second level cache here. This is very simple: if the revision number did not change since the last traversal, it won't be traversed again, but the previous result will be returned from the cache! (This saves tremendous amount of time in most real-world scenarios.)

          Can you check that if you commit a change to your repo the traversal will be done again?

          • 2. Re: serviceResultUpdaterJob not traversing repository
            sstuart4

            Ok, I am not that familiar with how the L2 caching works. I was under the impression that once the server was restarted that the cache would be lost and have to be traversed again.

            I went through my server log and have not seen a traveral yet eventhough I know some changes were committed. I think I may have found one error on my part though in the kosmos-portlet.war's portlet.xml:

            <init-param>
             <name>service.url</name>
             <value>http://localhost:8080/kosmos-server/kosmos-services/svn-service</value>
            </init-param>
            


            I think I should be replacing servername:port with the actual server name:port.

            • 3. Re: serviceResultUpdaterJob not traversing repository
              sstuart4

              I also just found the following in my server log as well:

              2006-07-18 09:39:13,601 INFO [hu.midori.kosmos.portlet.svn.SvnMonitoringPortlet] Viewing...
              2006-07-18 09:39:13,909 DEBUG [hu.midori.kosmos.server.MethodResultCacheInterceptor] Accessing cache "hu.midori.kosmos.server.cache" [0 items]...
              2006-07-18 09:39:13,910 INFO [hu.midori.kosmos.server.MethodResultCacheInterceptor] Cache-miss: reloading "hu.midori.kosmos.server.svn.SvnServiceImpl.getRepositories.http://maven.user:pwd4maven@source.hgdc.bscdev.net/repos/hgdcportal/trunk"...
              


              The problem is when I access the SvnMonitoringPortlet the first time it takes a while to load. This is one reason it appears the scheduler is not caching the data properly.

              • 4. Re: serviceResultUpdaterJob not traversing repository
                aron.gombas

                 

                I was under the impression that once the server was restarted that the cache would be lost and have to be traversed again.

                Kosmos is using EHCache for caching, and by-default the cache is set to be "disk-persistent", so it will save/load its content to disk and will survive the app-server restarts. (It can be easiliy turned off, of course, see ehcache.xml.)

                The problem is when I access the SvnMonitoringPortlet the first time it takes a while to load.

                Well, it is an expensive operation, so it simply blocks when running it for the first time. Using the scheduler, you can schedule it to run in the background (e.g. at midnight), which can help to achieve a reasonable performance.

                • 5. Re: serviceResultUpdaterJob not traversing repository
                  sstuart4

                  Ok, that is what I was trying to accomplish, but I must be missing something.. Where do I specify the repo location to traverse at the specified intervals? If it is in the kosmos-portlet.war portlet.xml, I have tried that under the monitored.urls, but it simply is not gathering any information at the specified times. Over a 24 hour period, it appears not be caching anything, even when changes are going into the repository.

                  • 6. Re: serviceResultUpdaterJob not traversing repository
                    sstuart4

                    One more thing I wanted to post...

                    2006-07-18 12:02:51,574 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
                    2006-07-18 12:02:51,575 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Update job completed.
                    
                    2006-07-18 14:02:51,561 DEBUG [org.quartz.core.JobRunShell] Calling execute on job DEFAULT.serviceResultUpdaterJob
                    2006-07-18 14:02:51,562 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
                    
                    2006-07-18 16:02:51,562 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
                    2006-07-18 16:02:51,562 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Update job completed.
                    
                    2006-07-18 18:02:51,559 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
                    2006-07-18 18:02:51,560 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Update job completed.
                    
                    2006-07-18 20:02:51,554 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
                    2006-07-18 20:02:51,554 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Update job completed.
                    
                    2006-07-18 22:02:51,562 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
                    2006-07-18 22:02:51,562 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Update job completed.
                    


                    This is over the course of a day when I am positive that changes where submitted to the repository and it was listed as one of the monitored urls in the portlet.xml.

                    • 7. Re: serviceResultUpdaterJob not traversing repository
                      aron.gombas

                       

                      Where do I specify the repo location to traverse at the specified intervals? If it is in the kosmos-portlet.war portlet.xml, I have tried that under the monitored.urls, but it simply is not gathering any information at the specified times.

                      Correct, you configure the URL to parse at "monitored.urls" in kosmos-portlet.war portlet.xml, and you configure the scheduler in kosmos-server.war kosmos-services-servlet.xml.

                      Over a 24 hour period, it appears not be caching anything, even when changes are going into the repository.

                      It's strange. Could you post the two files mentioned above and your ehcache.xml here?

                      • 8. Re: serviceResultUpdaterJob not traversing repository
                        sstuart4

                        Sure, no problem. Here they are...

                        portlet.xml:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0">
                        
                        <!--
                         <portlet>
                         <portlet-name>GmfCcMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.cc.CcMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>GMF Builds</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/cc-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://gmf-dev.borland.com/cruisecontrol/buildresults/checkout,
                         http://gmf-dev.borland.com/cruisecontrol/buildresults/nightly
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.cc.cc_monitoring</resource-bundle>
                         <portlet-info>
                         <title>CruiseControl Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>JBossCcMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.cc.CcMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>JBoss builds</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/cc-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://cruisecontrol.jboss.com/cc/buildresults/jboss-portal-2.0-testsuite,
                         http://cruisecontrol.jboss.com/cc/buildresults/jboss-portal-2.2-testsuite,
                         http://cruisecontrol.jboss.com/cc/buildresults/jbosslabs
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.cc.cc_monitoring</resource-bundle>
                         <portlet-info>
                         <title>CruiseControl Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>AtlassianJiraMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.jira.JiraMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>Atlassian Issues</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://jira.atlassian.com/browse/CONF,
                         http://jira.atlassian.com/browse/JRA
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle>
                         <portlet-info>
                         <title>JIRA Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>CodehausJiraMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.jira.JiraMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>Codehaus Issues</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://jira.codehaus.org/browse/SCM,
                         http://jira.codehaus.org/browse/XFIRE
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle>
                         <portlet-info>
                         <title>JIRA Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>JBossJiraMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.jira.JiraMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>JBoss Issues</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/jira-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://jira.jboss.com/jira/browse/JBLAB,
                         http://jira.jboss.com/jira/browse/JBPORTAL,
                         http://jira.jboss.com/jira/browse/KOSMOS
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle>
                         <portlet-info>
                         <title>JIRA Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>JBossJiraSoapMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.jira.JiraMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>Atlassian Issues</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/jirasoap-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://soaptester:soaptester@jira.atlassian.com/rpc/soap/jirasoapservice-v2?wsdl:Fixed for unreleased versions
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.jira.jira_monitoring</resource-bundle>
                         <portlet-info>
                         <title>JIRA Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>KosmosDependenciesSfMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.sf.SfMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>Kosmos Dependencies</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/sf-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://sourceforge.net/projects/cruisecontrol/,
                         http://sourceforge.net/projects/displaytag/,
                         http://sourceforge.net/projects/jfreechart/,
                         http://sourceforge.net/projects/jtidy/,
                         http://sourceforge.net/projects/saxon/,
                         http://www.sourceforge.net/projects/springframework
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.sf.sf_monitoring</resource-bundle>
                         <portlet-info>
                         <title>SourceForge Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>JBossProductsSfMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.sf.SfMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>JBoss Products</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/sf-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://sourceforge.net/projects/jboss/
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.sf.sf_monitoring</resource-bundle>
                         <portlet-info>
                         <title>SourceForge Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                        <!--
                         <portlet>
                         <portlet-name>KosmosToolsSfMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.sf.SfMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>Kosmos Development Tools</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://localhost:8080/kosmos-server/kosmos-services/sf-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://sourceforge.net/projects/docbook
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.sf.sf_monitoring</resource-bundle>
                         <portlet-info>
                         <title>SourceForge Monitoring</title>
                         </portlet-info>
                         </portlet>
                        -->
                        
                         <portlet>
                         <portlet-name>JBossSvnMonitoringPortlet</portlet-name>
                         <portlet-class>hu.midori.kosmos.portlet.svn.SvnMonitoringPortlet</portlet-class>
                         <init-param>
                         <name>monitored.resource</name>
                         <value>JBoss Labs Subversion</value>
                         </init-param>
                         <init-param>
                         <name>service.url</name>
                         <value>http://myserver.net:8080/kosmos-server/kosmos-services/svn-service</value>
                         </init-param>
                         <init-param>
                         <name>monitored.urls</name>
                         <value>
                         http://username:pwd@myserver.net/repos/portal/trunk
                         </value>
                         </init-param>
                         <supports>
                         <mime-type>text/html</mime-type>
                         <portlet-mode>HELP</portlet-mode>
                         <portlet-mode>VIEW</portlet-mode>
                         </supports>
                         <supported-locale>de</supported-locale>
                         <supported-locale>en</supported-locale>
                         <supported-locale>fr</supported-locale>
                         <supported-locale>hu</supported-locale>
                         <supported-locale>ja</supported-locale>
                         <supported-locale>pl</supported-locale>
                         <resource-bundle>hu.midori.kosmos.portlet.svn.svn_monitoring</resource-bundle>
                         <portlet-info>
                         <title>Subversion Monitoring</title>
                         </portlet-info>
                         </portlet>
                        
                        </portlet-app>
                        


                        kosmos-services-servlet.xml:

                        <?xml version="1.0" encoding="UTF-8"?>
                        <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
                        
                        <beans>
                         <!-- CC service -->
                         <bean id="ccService" class="hu.midori.kosmos.server.cc.CcServiceImpl">
                         <property name="store" ref="webdavStaticContentStore"/>
                         </bean>
                        
                         <bean id="ccServiceProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
                         <property name="targetName" value="ccService"/>
                         <property name="interceptorNames">
                         <list>
                         <value>serviceCachePointCutAdvisor</value>
                         </list>
                         </property>
                         </bean>
                        
                         <bean name="/cc-service" class="org.springframework.remoting.caucho.HessianServiceExporter">
                         <property name="service" ref="ccServiceProxy"/>
                         <property name="serviceInterface" value="hu.midori.kosmos.protocol.CcService"/>
                         </bean>
                        
                         <!-- JIRA service -->
                         <bean id="jiraService" class="hu.midori.kosmos.server.jira.JiraWebCrawlingServiceImpl">
                         <property name="store" ref="webdavStaticContentStore"/>
                         </bean>
                        
                         <bean id="jiraServiceProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
                         <property name="targetName" value="jiraService"/>
                         <property name="interceptorNames">
                         <list>
                         <value>serviceCachePointCutAdvisor</value>
                         </list>
                         </property>
                         </bean>
                        
                         <bean name="/jira-service" class="org.springframework.remoting.caucho.HessianServiceExporter">
                         <property name="service" ref="jiraServiceProxy"/>
                         <property name="serviceInterface" value="hu.midori.kosmos.protocol.JiraService"/>
                         </bean>
                        
                         <!-- JIRA SOAP service -->
                         <bean id="jiraSoapService" class="hu.midori.kosmos.server.jira.JiraSoapServiceImpl">
                         <property name="store" ref="webdavStaticContentStore"/>
                         </bean>
                        
                         <bean id="jiraSoapServiceProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
                         <property name="targetName" value="jiraSoapService"/>
                         <property name="interceptorNames">
                         <list>
                         <value>serviceCachePointCutAdvisor</value>
                         </list>
                         </property>
                         </bean>
                        
                         <bean name="/jirasoap-service" class="org.springframework.remoting.caucho.HessianServiceExporter">
                         <property name="service" ref="jiraSoapServiceProxy"/>
                         <property name="serviceInterface" value="hu.midori.kosmos.protocol.JiraService"/>
                         </bean>
                        
                         <!-- SF service -->
                         <bean id="sfService" class="hu.midori.kosmos.server.sf.SfServiceImpl">
                         <property name="store" ref="webdavStaticContentStore"/>
                         </bean>
                        
                         <bean id="sfServiceProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
                         <property name="targetName" value="sfService"/>
                         <property name="interceptorNames">
                         <list>
                         <value>serviceCachePointCutAdvisor</value>
                         </list>
                         </property>
                         </bean>
                        
                         <bean name="/sf-service" class="org.springframework.remoting.caucho.HessianServiceExporter">
                         <property name="service" ref="sfServiceProxy"/>
                         <property name="serviceInterface" value="hu.midori.kosmos.protocol.SfService"/>
                         </bean>
                        
                         <!-- SVN service -->
                         <bean id="svnService" class="hu.midori.kosmos.server.svn.SvnServiceImpl">
                         <property name="store" ref="webdavStaticContentStore"/>
                         </bean>
                        
                         <bean id="svnServiceProxy" class="org.springframework.aop.framework.ProxyFactoryBean">
                         <property name="targetName" value="svnService"/>
                         <property name="interceptorNames">
                         <list>
                         <value>serviceCachePointCutAdvisor</value>
                         </list>
                         </property>
                         </bean>
                        
                         <bean name="/svn-service" class="org.springframework.remoting.caucho.HessianServiceExporter">
                         <property name="service" ref="svnServiceProxy"/>
                         <property name="serviceInterface" value="hu.midori.kosmos.protocol.SvnService"/>
                         </bean>
                        
                         <!-- Service result POJO cache -->
                         <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
                         <property name="configLocation" value="classpath:ehcache.xml"/>
                         </bean>
                        
                         <bean id="serviceResultCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
                         <property name="cacheManager" ref="cacheManager"/>
                         <property name="cacheName" value="hu.midori.kosmos.server.cache"/>
                         </bean>
                        
                         <!-- Service result cache interceptor -->
                         <bean id="serviceCacheInterceptor" class="hu.midori.kosmos.server.MethodResultCacheInterceptor">
                         <property name="cache" ref="serviceResultCache" />
                         </bean>
                        
                         <bean id="serviceCachePointCutAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
                         <property name="advice">
                         <ref local="serviceCacheInterceptor"/>
                         </property>
                         <property name="patterns">
                         <list>
                         <value>hu.midori.kosmos.protocol.CcService.getProjects</value>
                         <value>hu.midori.kosmos.protocol.JiraService.getProjects</value>
                         <value>hu.midori.kosmos.protocol.SfService.getFileReleases</value>
                         <value>hu.midori.kosmos.protocol.SvnService.getRepositories</value>
                         </list>
                         </property>
                         </bean>
                        
                         <!-- Service result update scheduler -->
                         <bean name="serviceResultUpdaterJob" class="org.springframework.scheduling.quartz.JobDetailBean">
                         <property name="jobClass" value="hu.midori.kosmos.server.ServiceResultUpdaterJob"/>
                         <property name="jobDataAsMap">
                         <map>
                         <entry key="cache" value-ref="serviceResultCache"/>
                         </map>
                         </property>
                         </bean>
                        
                        
                         <bean id="serviceResultUpdateTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
                         <property name="jobDetail" ref="serviceResultUpdaterJob"/>
                         <property name="startDelay" value="10000"/>
                         <!-- Repeats every 2 hours -->
                         <property name="repeatInterval" value="7200000"/>
                         </bean>
                        
                         <!--
                         Alternatively, a cron-style trigger can be used.
                         For this, remove the previous bean definition and use this one: -->
                         <!--
                         <bean id="serviceResultUpdateTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
                         <property name="jobDetail" ref="serviceResultUpdaterJob"/>
                         <property name="cronExpression" value="0 29 15 * * ?"/>
                         </bean>
                         -->
                        
                         <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
                         <property name="triggers">
                         <list>
                         <ref bean="serviceResultUpdateTrigger"/>
                         </list>
                         </property>
                         </bean>
                        
                         <!-- WebDAV static content store -->
                         <bean id="webdavStaticContentStore" class="hu.midori.kosmos.server.store.WebdavStaticContentStore">
                         <property name="webdavUrl" value="http://myserver.net:8080/slide/files"/><!-- Both HTTP and HTTPS protocol can be used here. -->
                         <property name="webdavUser" value=""/>
                         <property name="webdavPassword" value=""/>
                         <!--
                         This URL will be used as base URL for the generated images.
                         If you don't specify anything here, the value of "webdavUrl"
                         will be used. Uncomment this, if you want to override that.
                        
                         <property name="clientUrl" value="http://myserver/my-webdav/kosmos-images"/>
                         -->
                         </bean>
                        </beans>
                        


                        ehcache.xml:

                        <ehcache>
                         <diskStore path="java.io.tmpdir"/>
                        
                         <!-- durations need to set longer than the "repeatInterval" property of the "serviceResultUpdateTrigger" bean -->
                         <defaultCache name="hu.midori.kosmos.server.defaultCache" maxElementsInMemory="1024" eternal="false"
                         timeToIdleSeconds="14400" timeToLiveSeconds="14400" overflowToDisk="true" diskPersistent="true"/>
                        
                         <cache name="hu.midori.kosmos.server.cache" maxElementsInMemory="1024" eternal="false"
                         timeToIdleSeconds="14400" timeToLiveSeconds="14400" overflowToDisk="true" diskPersistent="true"/>
                        </ehcache>
                        


                        • 9. Re: serviceResultUpdaterJob not traversing repository
                          aron.gombas

                          Based on your scheduler settings, the service should be invoked once in every 2 hours. This is exactly what's happening in the log above, so that's fine.

                          BUT! In your ''ehcache.xml'' the cache content lives for 14400 secs (that is 4 hours). So even if the service is invoked by scheduler, that will return the same cached object for 2 iterations! (However, it should happen only twice, for the third try, you should get a new result... Don't really understand.)

                          Anyway, could you try setting diskPersistent="false" and timeToLiveSeconds=''3600" (1 hour) in your ehcache.xml and restart the container?

                          • 10. Re: serviceResultUpdaterJob not traversing repository
                            sstuart4

                            I tried that, but to no avail...

                            I added a few debug lines to the ServiceResultUpdateJob inside the executeInternal() method as follows:

                             log.info("Running scheduled update job...");
                            
                             log.info("************************ Cache ************************************");
                             log.info("getSize: " + cache.getSize());
                            
                             log.info("************************ Data Store ************************************");
                             log.info("getDiskStoreSize: " + cache.getDiskStoreSize());
                            
                             // iterate through the current content of the cache
                             for(Iterator it = cache.getKeys().iterator(); it.hasNext();) {
                            


                            This was the output of the log file when I restarted the server:

                            2006-07-21 11:30:40,235 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Running scheduled update job...
                            2006-07-21 11:30:40,235 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] ************************ Cache ************************************
                            2006-07-21 11:30:40,236 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] getSize: 0
                            2006-07-21 11:30:40,236 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] ************************ Data Store ************************************
                            2006-07-21 11:30:40,236 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] getDiskStoreSize: 0
                            2006-07-21 11:30:40,236 INFO [hu.midori.kosmos.server.ServiceResultUpdaterJob] Update job completed.
                            


                            I guess my question now is why would the cache size be empty and the disk store size also? If it is due to my changes in ehcache.xml, it should be trying to traverse the repo now, right?

                            • 11. Re: serviceResultUpdaterJob not traversing repository
                              aron.gombas

                              This actually looks OK to me, this how the scheduler works:
                              - the first time an item is queried, it gets delivered by the appropriate service and then put to the cache
                              - when the scheduler invokes the job to update the content of the cache, only the items ALREADY in the cache will be reloaded

                              In your case, for some reason, there is 0 item in the cache, that's why the update job is completed in 0 seconds.

                              So, the question: how can be 0 items in your cache? What happens the first time when you display the appropriate SVN portlet? Can you see the repo processed and the result put to the cache?

                              • 12. Re: serviceResultUpdaterJob not traversing repository
                                sstuart4

                                Thanks Aron, that makes much more sense. Maybe this sort of explanation on the kosmos site would be helpful for future users. The information on setting up a job for traversing a repository does not give any indication of how/when the initial caching is supposed to work.

                                • 13. Re: serviceResultUpdaterJob not traversing repository
                                  aron.gombas

                                  Ahh, OK, good point. I'll update the documentation.

                                  Is this working for you now?

                                  • 14. Re: serviceResultUpdaterJob not traversing repository
                                    sstuart4

                                    Everything seems to be fine except that the cache does not seem to be surviving server restarts. Here is a portion of my log just after a restart:

                                    Before the restart:

                                    2006-07-25 14:44:45,045 INFO [hu.midori.kosmos.portlet.svn.SvnMonitoringPortlet] Viewing...
                                    2006-07-25 14:44:45,141 DEBUG [hu.midori.kosmos.server.MethodResultCacheInterceptor] Accessing cache "hu.midori.kosmos.server.cache" [2 items]...
                                    2006-07-25 14:44:45,142 INFO [hu.midori.kosmos.server.MethodResultCacheInterceptor] Cache-hit: "hu.midori.kosmos.server.svn.SvnServiceImpl.getRepositories.http://myserver.net/repos/project/trunk" returned from cache (11 minutes old)
                                    2006-07-25 14:44:48,321 DEBUG [hu.midori.kosmos.server.MethodResultCacheInterceptor] Accessing cache "hu.midori.kosmos.server.cache" [2 items]...
                                    2006-07-25 14:44:48,321 INFO [hu.midori.kosmos.server.MethodResultCacheInterceptor] Cache-hit: "hu.midori.kosmos.server.svn.SvnServiceImpl.getRepositories.http://myserver.net/repos/project2/trunk" returned from cache (9 minutes old)
                                    2006-07-25 14:44:48,556 DEBUG [hu.midori.kosmos.portlet.svn.SvnMonitoringPortlet] SVN repositories downloaded: 2
                                    


                                    And after...

                                    2006-07-25 15:22:06,805 INFO [hu.midori.kosmos.portlet.svn.SvnMonitoringPortlet] Viewing...
                                    2006-07-25 15:22:06,919 DEBUG [hu.midori.kosmos.server.MethodResultCacheInterceptor] Accessing cache "hu.midori.kosmos.server.cache" [0 items]...
                                    2006-07-25 15:22:06,919 INFO [hu.midori.kosmos.server.MethodResultCacheInterceptor] Cache-miss: reloading "hu.midori.kosmos.server.svn.SvnServiceImpl.getRepositories.http://myserver.net/repos/project/trunk"...
                                    2006-07-25 15:22:06,919 DEBUG [hu.midori.kosmos.server.svn.SvnServiceImpl] Returning repositories...
                                    


                                    1 2 Previous Next