cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduler service on EP 6.0 SP2

Former Member
0 Kudos

Hello All,

I try to implement custom schedule task for EP 6.0 SP 2.

I create class CleanJobTask implements ISchedulerTask with default constructor and run method...

Also I create meta config archive and put into CleanJobTask.cc.xml.

In portalapp.xml I add references to usermanagement, knowledgemanagement, com.sap.km.cm.service, com.sap.km.bs.crt, com.sap.km.bs.rf, com.sap.km.bs.rf.manager, com.sap.km.bs.util, com.sap.km.bs.rf.service, com.sap.km.bs.sf.service.

But when configuration framework try to init ScheduleEntry and exception occured:

#1.5#10.7.2.151:381960:FBF9205643:-782A#1082556828348#com.sapportals.wcm.WcmException#irj#com.sapportals.wcm.WcmException.WcmException(90)#System#0#####ConfigurationWatcher##0#0#Error##Plain###Failed to load task com.sap.caf.km.upload.CleanJobTask java.lang.ClassNotFoundException: com.sap.caf.km.upload.CleanJobTask

at java.lang.ClassLoader.findClass(ClassLoader.java:343)

at com.sapportals.wcm.crt.CrtClassLoaderRegistry$LinkedClassLoader.findClass(CrtClassLoaderRegistry.java:81)

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

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

....

at com.sapportals.wcm.service.scheduler.wcm.SchedulerEntry.init(SchedulerEntry.java:435)

at com.sapportals.wcm.service.scheduler.wcm.SchedulerEntry.<init>(SchedulerEntry.java:178)

at com.sapportals.wcm.service.scheduler.wcm.Scheduler.configure(Scheduler.java:141)

at com.sapportals.wcm.service.scheduler.wcm.SchedulerService.configEvent(SchedulerService.java:302)

at com.sapportals.config.event.ConfigEventService.dispatchEvent(ConfigEventService.java:198)

at com.sapportals.config.event.ConfigEventService.configEvent(ConfigEventService.java:92)

at com.sapportals.config.event.ConfigWatcher.callConfigListeners(ConfigWatcher.java:436)

at com.sapportals.config.event.ConfigWatcher.flushEvents(ConfigWatcher.java:348)

at com.sapportals.config.event.ConfigWatcher.run(ConfigWatcher.java:153)

#

#1.5#10.7.2.151:381960:FBF9205643:-7829#1082556828380#com.sapportals.wcm.service.scheduler.wcm.SchedulerService#irj#com.sapportals.wcm.service.scheduler.wcm.SchedulerService.configEvent(305)#System#0#####ConfigurationWatcher##0#0#Error##Plain###Exception in configuration event handler: com.sapportals.wcm.crt.configuration.ConfigurationException: com.sapportals.wcm.WcmException: Failed to load task com.sap.caf.km.upload.CleanJobTask

at com.sapportals.wcm.service.scheduler.wcm.Scheduler.configure(Scheduler.java:147)

Can anyone help me to resolve this?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello All,

how can be a meta config archive created and which data has to be inside?

The Config Framework Archiver Plugin just gives me errors like:

Missing folder local/data

after creation the message:

Invalid structure (/..../local/data folder is empty)

comes out.

Wow can help me to resolve this?

0 Kudos

Hi Sven,

currently the following rules are valid for the ConfigArchive plugins:

Plugin Version <=1.1.8 --> src.config/data/cm/ & src.config/meta/expanded/cm/

Plugin Version 1.2.0 --> src.config/local/data/cm/ &

src.config/local/meta/expanded/cm/

Plugin Version >1.2.0 --> src.config/install/data/cm/ &

src.config/install/meta/expanded/cm/

For Version >1.2.0 the SAP NetWeaver Developer Studio will deliver Plugins for automatic structure creation. In older versions you have to create the structure manually.

Best regards,

Thilo

Former Member
0 Kudos

Hi Aliaksandr,

KM's scheduler couldn't access your CleanJobTask because your portal application knows the KM, but the KM does not know your application. But it's a simple task to create a PAR that allows the KM to call your code. All you need is to register your application's class loader in the KM's class loader registry.

To register an application's class loader it is necessary to have something like a bootstrapper that performs the registration automatically during the deployment and/or start-up phase of the Portal. For this reason a Portal Service that is started at the startup of the Portal Runtime should be added to the PAR files that contains the KM application. This Portal Service could do the registration job.

Example: A PAR file that contains an application must have a deployment descriptor (portalapp.xml). This file describes the application itself and provides information required at runtime. Portal Services are declared in service elements inside the services element and must have a name attribute. className is the name of the implementation class of the Portal Service. This class must implement the com.sapportals.portal.prt.service.IService interface. startup must be set to "true" to start the service at startup of the Portal Runtime. To register a class loader to the CRT a sharing reference to the CRT PAR must be added.

<pre>

<?xml version="1.0" encoding="iso-8859-1"?>

<application name="com.acme.sap.portal.km.service" alias="com.acme.km.service">

<application-config>

<property name="releasable" value="false"/>

<property name="startup" value="true"/>

<property name="ClassLoadingPolicy" value="CoreAccessInAPI,transitive"/>

<property name="DeploymentPolicy" value="5.0"/>

<property name="SharingReference" value="<b>com.sap.netweaver.bc.crt</b>,

com.sap.netweaver.bc.util,com.sap.netweaver.bc.sf"/>

</application-config>

<services>

<service name="<b>com.acme.sap.portal.km.service</b>" alias="com.acme.km.service">

<service-config>

<property name="className" value="Bootstrap"/>

<property name="classNameFactory" value=""/>

<property name="classNameManager" value=""/>

<property name="poolFactory" value="0"/>

<property name="startup" value="true"/>

</service-config>

</service>

</services>

</application>

</pre>

The following code snippet performs the registration in a single line of code. getKey() must return the name of the Portal Service as defined in the deployment descriptor above.

<pre>

import com.sapportals.portal.prt.service.IService;

import com.sapportals.portal.prt.service.IServiceConfiguration;

import com.sapportals.portal.prt.service.IServiceContext;

import com.sap.tc.logging.Location;

import com.sapportals.wcm.crt.CrtClassLoaderRegistry;

/**

  • Registers the PAR class loader in the CrtClassLoaderRegistry

*/

public class Bootstrap implements IService {

public static final String KEY = "<b>com.acme.sap.portal.km.service</b>";

private static final Location LOC = Location.getLocation(Bootstrap.class);

private IServiceContext serviceContext;

public void init(IServiceContext serviceContext) {

this.serviceContext = serviceContext;

// register the class loader of this application to the

// class loader registry

CrtClassLoaderRegistry.addClassLoader(getKey(), getClass().getClassLoader());

LOC.debugT("init of " + getKey() + " completed.");

}

public IServiceContext getContext() { return this.serviceContext; }

public String getKey() { return KEY; }

public void afterInit() {}

public void configure(IServiceConfiguration serviceConfiguration) {}

public void destroy() {}

public void release() {}

}

</pre>

Regards, Jens

Former Member
0 Kudos

Hello Jens,

Is there any documentation available on this topic?

thanks in advance,

Jose