AnsweredAssumed Answered

Clarity JOB - Java implementation

Question asked by fabricio.de.marchi on Aug 31, 2010
Latest reply on Sep 23, 2014 by nirbhay.kumar
Hi All,

I am trying to deploy a java file to use as a JOB in Clarity.

I've followed the documentation and developed the following class:
package com.dell.test;

import java.util.HashMap;

import com.niku.union.interfaces.JobSchedulerContext;
import com.niku.union.interfaces.SchedulerListener;


public class TestOutOfMemory implements SchedulerListener {


public double getPercentComplete() throws Exception {


return 0;

}


public void scheduledEventFired(JobSchedulerContext arg0) throws Exception {


System.out.println("test");

}

}
I've created a JA file that contains the following structure:
/com/dell/test/TestOutOfMemory.class
/META-INF/manifest.mf
Manifest-Version: 1.0
Created-By: 1.5.0_13 (Sun Microsystems Inc.)

I've placed the JAR file in the $NIKU_INSTALLATION/lib folder.

I've used the NSA application to repackage the niku.ear file.

In the niku.ear/webroot.war file I can see the manifect.mf file and it is pointing to my jar file: lib/zdellt.jar

I've redeployed the niku.ear on weblogic 9.2 by placing the "app" in "Admin" mode so I could use the "Update" button to select the location where the niku.ear file was created. The "Update" happens without any issues in the weblogic console.

I've also restarted the "app" just to be sure it reloads the whole application.

When I go to Clarity and create a new JOB and say it will run a Java I am using the following to identify the class "com.dell.test.TestOutOfMemory" but that JOB does not runs. If I try to run it I get the following message in the Clarity interface:
NJS-0001: Unable to process request due to server configuration or other technical problems. Contact your site administrator.

If I check the log files, inside the app-niku.log file I can see the following error:
SYS   2010-08-31 12:07:09,777 [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] niku.union (xogadmin:18045821__-51f89351:npt.overview) Using defaults for rules.xml
ERROR 2010-08-31 12:07:46,034 [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] niku.njs (xogadmin:18045821__-51f89351:nmc.addSchedulerProperties) Unable to schedule job: 5198164
com.niku.union.exceptions.SchedulerException: Job's listener is invalid

at com.niku.njs.SchedulerImpl.validate(SchedulerImpl.java:1319)

at com.niku.njs.SchedulerImpl.schedule(SchedulerImpl.java:172)

at com.niku.njs.xbl.handlers.ScheduleJob.postProcess(ScheduleJob.java:66)

at com.niku.xql2.handlers.BaseHandler.postProcess(BaseHandler.java:48)

at com.niku.xql2.XQLVisitor.postProcess(XQLVisitor.java:1355)

at com.niku.union.xml.dom.DOMWalker.postProcess(DOMWalker.java:210)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:94)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:51)

at com.niku.xql2.handlers.LockHandler.preProcess(LockHandler.java:95)

at com.niku.xql2.XQLVisitor.preProcess(XQLVisitor.java:1342)

at com.niku.union.xml.dom.DOMWalker.preProcess(DOMWalker.java:194)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:74)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92)

at com.niku.union.xml.dom.DOMWalker.traverseIntern(DOMWalker.java:92)

at com.niku.union.xml.dom.DOMWalker.traverse(DOMWalker.java:36)

at com.niku.xql2.XQLProcessor.process(XQLProcessor.java:239)

at com.niku.xql2.XQLProcessor.process(XQLProcessor.java:280)

at com.niku.xql2.binding.ServiceControlBindingXql.processFile(ServiceControlBindingXql.java:393)

at com.niku.xql2.binding.ServiceControlBindingXql.getDocument(ServiceControlBindingXql.java:258)

at com.niku.xql2.binding.ServiceControlBindingXql.processRequest(ServiceControlBindingXql.java:142)

at com.niku.union.service.ServiceControlImpl.processRequest(ServiceControlImpl.java:759)

at com.niku.union.service.ServiceControlImpl.processRequest(ServiceControlImpl.java:213)

at com.niku.union.web.WebServiceAdapter.processRequest(WebServiceAdapter.java:188)

at com.niku.union.web.PortletController.processServiceRequest(PortletController.java:1322)

at com.niku.union.web.PortletController.processProcessActionRequest(PortletController.java:229)

at com.niku.union.web.PortletController.processRequest(PortletController.java:156)

at com.niku.union.web.WebActionController.processAction(WebActionController.java:1087)

at com.niku.union.web.WebActionController.processRequest(WebActionController.java:170)

at com.niku.union.web.WebControlServlet.service(WebControlServlet.java:319)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:223)

at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)

at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at com.niku.union.web.filter.GZIPResponseFilter.doFilter(GZIPResponseFilter.java:121)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3243)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2003)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1909)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1359)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: java.lang.ClassNotFoundException: com.dell.test.TestOutOfMemory

at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:286)

at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:259)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:158)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:164)

at com.niku.njs.SchedulerImpl.validate(SchedulerImpl.java:1312)

... 44 more
I am not sure what I am doing wrong and why the Clarity application is not seeing this class.

Any help would be appreciated.

Thanks,

Fabricio

Outcomes