on 12-04-2008 2:39 PM
A JNDI context look up of scheduler (as shown below) gives a class cast exception at runtime.
try {
InitialContext ctx = new InitialContext();
scheduler = (com.sap.scheduler.api.Scheduler) ctx.lookup("scheduler");
} catch (NamingException ne) {
return;
}
Runtime gives back com.sap.engine.services.scheduler.impl.Scheduler instead of com.sap.scheduler.api.Scheduler. I followed the same steps as detailed out [here|http://help.sap.com/saphelp_nwce10/helpdata/en/44/3e1ed10610376ee10000000a114a6b/content.htm].
Any pointer will be highly appreciated.
Hi,
can you provide some more information on this? I have never seen this problem, in fact the implementation class that you mention below should not be registered in JNDI.
It would be ideal if you could provide a small test case together with precise version information.
Thanks and best regards,
Dirk Marwinski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the follow up. I was trying to execute the Hello Job example. I have followed the steps mentioned in the example and have used the code piece listed [here|http://help.sap.com/saphelp_nwce10/helpdata/en/44/3e1ed10610376ee10000000a114a6b/content.htm] in a Stateless Session Bean. As a result I got the aforementioned output..
KR.
Solved as per my comments
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
assumed answered as per the last post
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
sorry, I don't have a definite answer, however I have some thoughts, ideas, insights, and pointers. Could you please file a bug report in case this does not help.
As it is visible from the Log.txt, the problem is caused by a ClassCastException:
Caused by: java.lang.ClassCastException: class com.sap.engine.services.scheduler.impl.ServiceInterfaceDelegate:service:scheduler_com.sap.engine.boot.loader.ResourceMultiParentClassLoader_1afe17b@alive incompatible with interface com.sap.scheduler.api.Scheduler:bala.test/job-scheduler-app_com.sap.engine.boot.loader.ResourceMultiParentClassLoader_1154471_alive
(sorry, had to replace "at" with underscores)
This should not happen as ServiceInterfaceDelegate is an implementation of the interface. The Scheduler interface is normally loaded by the scheduler~runtime class loader (as it is part of it) and the ServiceInterfaceDelegate is loaded by the scheduler class loader. Looking at the trace above you can see that the interface is loaded by the application (bala.test/job-scheduler-app) and the ServiceInterfaceDelegate is loaded by the scheduler service. This would perfectly explain the exception as the interface loaded by another class loader is not considered "compatible".
Did you include the scheduler interface jar into your application and not set a reference to the scheduler~runtime service? This would perfectly explain the exception above.
If that is not the case please have a look at the class loader hierarchy. Make sure one of the parent class loaders of your application is the schedulerruntime class loader. Make sure you don't include the scheduler api jar within any application, library, or service that you reference. You can check the class loader dependencies with the llr telnet command, e.g. llr service:schedulerruntime.
Hope this helps,
Dirk Marwinski
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks again Dirk for the details.
I was able to solve the problem.Here is what I did after un-deploying all the DCs from the server.
For the job-definition and job-scheduler EJB DCs and the job-definition-app and job-scheduler-app Application DC,
I've established a Run time, Desing time and Deploy time dependency to the SAP
delivered DC tc/je/scheudler/api.
Then on redeployment and testing, I found that the context look-up loads up the proper class implementation
of the Scheduler interface and scheduling happens successfully.
BR,
Bala
Thanks for the note.
I'm sorry. By mistake I closed the thread. The problem has not been resolved. I get the same ClassCastException. The details remain same as explained above.
Here are my DCs:
1. [job-definition|http://www.4shared.com/file/90671863/533066b2/_2__job-definition.html] (EJB DC- Containing the implementation of MDBJobImplementation)
2. [job-definition-app|http://www.4shared.com/file/90671925/dffd6cb4/job-definition-app.html] (Application DC corresponding to the job-definition EJB DC)
3. [job-scheduler|http://www.4shared.com/file/90671968/c520d50d/job-scheduler.html] (EJB DC- Containing the scheduling relevant implementation)
4. [job-scheduler-app|http://www.4shared.com/file/90672013/d70e23/job-scheduler-app.html] (Application DC corresponding to the job-scheduler EJB DC)
5. [wd-job-scheduler|http://www.4shared.com/file/90672071/b883c889/wd-job-scheduler.html] (WD DC that calls a session bean from job-scheduler EJB DC to start the scheduling activity).
6. [Error log|http://www.4shared.com/file/90672207/1d252f15/Log.html] (Log showing the ClassCastException)
Would be great if some one can shed light on this.
Best regards,
Bala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
assumed answered due to non action
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I haven't seen such a problem. Could you send me your example application via email?
Thanks,
Dirk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.