on 05-13-2011 7:13 AM
Hi Folks,
I have a java class(assume, ClassA) in a DC. This class has a method to call a Web Service.
I have to create one more DC, which contains my Java application.
This application should make calls to ClassA's method after every 15 minutes.
I guess I will have to create a servlet for this. Also, I think I can use java.util.Timer for making the regular calls.
Can you please suggest me the ways to proceed on this?
Thanks.
Checkout Quartz Scheduler. It is open source and widely used.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Swapnil,
First of all Quartz works very well on Netweaver and offers you a very stable scheduling environment.
It is also very easy to monitor planned jobs and schedules during runtime.
What you really have to care about in my eyes is, how you schedule jobs in a cluster environment.
I think most productive Netweaver Installations are clusters.
You may have situations, vere a job may run on all cluster nodes whereas other jobs should run only once probably on a special node.
This can become a bit tricky. Hovever this issue is not Quartz related. Yuo might have considered this allready for your existing solution.
Cheers
Frank
Thanks, Frank.
Yes, we too have a cluster environment. In our case, this scheduler has to run only on one server node.
As per the technical requirements, I went ahead with a Servlet application.
The scheduler is running fine, except one problem.
I need to call an EJB method deployed on the same server.
Below is the code snippet.
InitialContext ctx = new InitialContext();
MyEjbLocalHome objLocalHome = (MyEjbLocalHome) ctx.lookup("localejbs/my.com/abc~myearDC/MyEjbBean");
I am getting ClassCastException at the above line.
I am sure that the local home interface is correct and belongs to the same EJB.
Can you please help me with this?
Hi,
This issue is mostly deployment related. I would need to know some more details about how you structured your application in terms of deployment packages.
Is your servlet packaged in an EAR or just in a WAR ?
I would expect that you are using an EAR for your servlet and that you have defined a refrerence to another EAR holding your EJBs ?
If this is true the servlet EAR should contain a jar that contains the EJB local interfaces. (please check)
Now here is the issue:
If you have deployed your servlet EAR and just have called it, the class loader would have loaded the version of the EJB classes that are contained in your servlet EAR (!).
If you now change the EJB and deploy it. The class loader still holds the older version. That causes a class cast exception.
The solution for this is to just redeploy the servlet EAR.
I hope this helps.
As was mentioned [here|/thread/1972726 [original link is broken];, depending on the version of your Netweaver installation, you could use this functionality: [Scheduler Article|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90a95132-8785-2b10-bda5-90d82a76431e].
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.