[Building Sakai] Quartz

Antonio muñoz alonso antoniovalenciaspain at hotmail.com
Tue Apr 9 11:06:37 PDT 2013


modified
This is the project structure:

-API->SakaiProxy,ProjectLogic...
-IMPL->SakaiProxyImpl,ProjectLogicImpl
-PACK-->Compoments.xml
-TOOL->BAsePAge,FirtsPAge,....
-QUARTZ->ArchiveSites.

>From BasePage if accessible to sakai Proxy and Project Logic.
>From ArchivesSite, all methods of sakaiPRoxy me back NPE.

In TOOL/POM and QUARTZ/POM, included:
    <dependency>
              <groupId>org.sakaiproject</groupId>
              <artifactId>app-api</artifactId>
     </dependency>

I see nothing different in the POM and componentes.xml

Any ideas?

From: antoniovalenciaspain at hotmail.com
To: steve.swinsburg at gmail.com
Date: Tue, 9 Apr 2013 12:38:33 +0200
CC: sakai-dev at collab.sakaiproject.org
Subject: Re: [Building Sakai] Quartz




My project:

-API
-IMPL
-PACK
-TOOL-->ArchivesSite,BasePage,FirstPage,......

>From BasePage if accessible to sakai Proxy and Project Logic.
>From ArchivesSite, all methods of sakaiPRoxy me back NPE.
It has the same POM, and okay componentes.xml

CC: sakai-dev at collab.sakaiproject.org
From: steve.swinsburg at gmail.com
Subject: Re: Quartz
Date: Tue, 9 Apr 2013 18:58:38 +1000
To: antoniovalenciaspain at hotmail.com

I'm telling you how to fix it :)
Sakai proxy and the dao is in the API and impl folders. You need those. You mentioned offline that you don't need a tool so you can delete that folder. Now add in the quartz parts and combine them. Note there is spring wiring required for both modules, so you need to combine them into one components.xml file. 
But in order to understand how to do it, you really need to read those pages I sent. Stick them into google and you'll find the pages. 
CheersSteve

Sent from my iPhone
On 09/04/2013, at 18:42, Antonio muñoz alonso <antoniovalenciaspain at hotmail.com> wrote:




Well I need to access functions that I have implemented in sakai proxy and then insert data into the database.

No need to delete anything, I use it all.

not how to fix
CC: sakai-dev at collab.sakaiproject.org
From: steve.swinsburg at gmail.com
Subject: Re: Quartz
Date: Tue, 9 Apr 2013 09:00:38 +1000
To: antoniovalenciaspain at hotmail.com

Archive sites iS the quartz job class that I wrote, which you have now incorporated into your tool. I'm pretty sure it's not what you want, so delete just that one class, and write your own and adjust the components.xml to point to that one. 
Also, if you don't want the tool portion, delete that entire directory from the archetype. You said earlier you don't need the tool part b
Basepage etc is from the tool. You aremixing up completely different things here. 
I suggest you read the following things, separately:
Sakai programmers manualHow to do quartz in Sakai
ThanksSteve
Sent from my iPhone
On 09/04/2013, at 8:15, Antonio muñoz alonso <antoniovalenciaspain at hotmail.com> wrote:




Delete what class??
Do not understand why it does not work sakaiProxy in ArchiveSites.
any ideas??
Could it be because BasePage implements IHeaderContributor and extends webpage?.

thanks

CC: sakai-dev at collab.sakaiproject.org
From: steve.swinsburg at gmail.com
Subject: Re: Quartz
Date: Sat, 6 Apr 2013 23:00:58 +1100
To: antoniovalenciaspain at hotmail.com

Delete that class, write your own. Change packages to suit yourself.
Cheers 

Sent from my iPad
On 05/04/2013, at 21:53, Antonio muñoz alonso <antoniovalenciaspain at hotmail.com> wrote:




OK.

Error SakaiProxy in ArchiveSites.

@SpringBean(name="org.sakaiproject.logic.SakaiProxy")
    protected SakaiProxy sakaiProxy;

--Public void Excute----------
//get admin session
        establishSession();
        System.out.println(sakaiProxy.getCurrentUserId());


Trace:

java.lang.NullPointerExceptio
    at org.sakaiproject.msub.alliance.jobs.ArchiveSites.execute(ArchiveSites.java:120)
    at org.sakaiproject.component.app.scheduler.jobs.SpringJobBeanWrapper.execute(SpringJobBeanWrapper.java:70)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:534)
2013-04-05 12:50:49,791 ERROR QuartzScheduler_Worker-1 org.quartz.core.ErrorLogger - Job (DEFAULT.Hola threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.NullPointerException]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:534)
Caused by: java.lang.NullPointerException
    at org.sakaiproject.msub.alliance.jobs.ArchiveSites.execute(ArchiveSites.java:120)
    at org.sakaiproject.component.app.scheduler.jobs.SpringJobBeanWrapper.execute(SpringJobBeanWrapper.java:70)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

any ideas?.

Date: Wed, 3 Apr 2013 11:58:55 +1100
Subject: Re: Quartz
From: steve.swinsburg at gmail.com
To: antoniovalenciaspain at hotmail.com
CC: sakai-dev at collab.sakaiproject.org

Do it the other way around.
1. Create project using archetype. Compile and run.2. Check out the quartz example. Compile and run.3. Move quartz code into project created in 1.

This way you only need to move one class a bit of XML. The other way you need to move multiple classes, API's and spring wiring.



On Wed, Apr 3, 2013 at 10:18 AM, Antonio muñoz alonso <antoniovalenciaspain at hotmail.com> wrote:







First Create and Compile this project : svn cohttps://source.sakaiproject.org/contrib/swinsburg/quartz-example/

Run Ok in tomcat.
After copy api and impl(SakaiProxy and SakaiLogic) of a project Sakai Maven Archetype.No run in tomcat. 
CC: sakai-dev at collab.sakaiproject.org

From: steve.swinsburg at gmail.com
Subject: Re: Quartz
Date: Wed, 3 Apr 2013 09:16:57 +1100
To: antoniovalenciaspain at hotmail.com


If you do a brand new archetype project, then build and deploy, does it have the same error?
Try a fresh tomcat. 
Cheers

Sent from my iPhone

On 03/04/2013, at 8:32, Antonio muñoz alonso <antoniovalenciaspain at hotmail.com> wrote:





I still have the same error, I have the same dependencies in sakai  Maven archetype . :(

Subject: Re: Quartz
From: steve.swinsburg at gmail.com

Date: Tue, 2 Apr 2013 22:41:44 +1100
CC: sakai-dev at collab.sakaiproject.org
To: antoniovalenciaspain at hotmail.com


Yes.
java.lang.NoClassDefFoundError: org/apache/commons/configuration/ConfigurationException

IIRC you need to bundle commons configuration inside the component pack, so list that dependency as compile scope in the pom. 
It would be much easier for you if you used the archetype to generate a working app, then added the quartz class and fe lines of wiring XML to it, rather than adding multiple classes and wiring to a quartz project. Pull out the tool module if you don't need it.


On 02/04/2013, at 11:47 AM, Antonio muñoz alonso <antoniovalenciaspain at hotmail.com> wrote:


any ideas??
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.sakaiproject.msub.logic.ProjectLogic' defined in file [/opt/tomcat/components/alliance-quartz-pack/WEB-INF/components.xml]: Cannot resolve reference to bean 'org.sakaiproject.msub.dao.ProjectDao' while setting bean property 'dao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.sakaiproject.msub.dao.ProjectDao' defined in file [/opt/tomcat/components/alliance-quartz-pack/WEB-INF/components.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/configuration/ConfigurationException
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
	at java.security.AccessController.doPrivileged(Native Method)	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.sakaiproject.util.NoisierDefaultListableBeanFactory.getBean(NoisierDefaultListableBeanFactory.java:114)	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
	at org.sakaiproject.util.NoisierDefaultListableBeanFactory.preInstantiateSingletons(NoisierDefaultListableBeanFactory.java:73)	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)	at org.sakaiproject.component.impl.SpringCompMgr.init(SpringCompMgr.java:154)
	at org.sakaiproject.component.cover.ComponentManager.getInstance(ComponentManager.java:98)	at org.sakaiproject.component.impl.ContextLoader.loadParentContext(ContextLoader.java:107)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:195)	at org.sakaiproject.component.impl.ContextLoader.initWebApplicationContext(ContextLoader.java:64)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)	at org.sakaiproject.util.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:56)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3795)	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:634)
	at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:561)	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:496)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)	at org.apache.catalina.core.StandardService.start(StandardService.java:448)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)	at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java 		 	   		  
 		 	   		  

_______________________________________________
sakai-dev mailing list
sakai-dev at collab.sakaiproject.org
http://collab.sakaiproject.org/mailman/listinfo/sakai-dev

TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe" 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20130409/625a1c7e/attachment.html 


More information about the sakai-dev mailing list