Java application to act as background job on SAP J2EE server
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?
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.