ORA-04068: existing state of packages has been discarded
Dear experts,
I've created an application server task to send a quick report via e-mail.
But I get the following error message in “Application Message”:
ORA-04068: existing state of packages has been discarded Caused by: ifs.fnd.base.SystemException: Failed executing statement (ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "IFSAPP.APP_MESSAGE_PROCESSING_API" has been invalidated ORA-04065: not executed, altered or dropped package body "IFSAPP.APP_MESSAGE_PROCESSING_API" ORA-06508: PL/SQL: could not find program unit being called: "IFSAPP.APP_MESSAGE_PROCESSING_API" ORA-06512: at line 1) Caused by: java.sql.SQLException: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "IFSAPP.APP_MESSAGE_PROCESSING_API" has been invalidated ORA-04065: not executed, altered or dropped package body "IFSAPP.APP_MESSAGE_PROCESSING_API" ORA-06508: PL/SQL: could not find program unit being called: "IFSAPP.APP_MESSAGE_PROCESSING_API" ORA-06512: at line 1
Caused by: oracle.jdbc.OracleDatabaseException: ORA-04068: existing state of packages has been discarded ORA-04061: existing state of package body "IFSAPP.APP_MESSAGE_PROCESSING_API" has been invalidated ORA-04065: not executed, altered or dropped package body "IFSAPP.APP_MESSAGE_PROCESSING_API" ORA-06508: PL/SQL: could not find program unit being called: "IFSAPP.APP_MESSAGE_PROCESSING_API" ORA-06512: at line 1
So I’ve checed the API APP_MESSAGE_PROCESSING_API on our environment and it isn’t available.
How can that happen?
Page 1 / 1
Did you goto Solution Manager>System Information and Utilities>Oracle Objects>Compile Invalid Objects? Do you see any? Can you recompile them?
Dear @mwilson
there were some views and packages which I have recompiled.
But the API I’ve been mentioned isn’t there.
Have you tried it again since recompiling? The first time a session encounters an invalid object, oracle will throw an error and recompile the object. I have also noticed that if the IFS database session was created before the recompile it does not always see the new version, forcing you to logout and log back in.
Worst case you might have to restart the integration server.
Hi @mwilson
Why doesn't the PL/SQL developer show me these invalid components?
Dear @mwilson
I’ve recompiled all components and it seems to work for now.
Maybe the error message will appear again because the API APP_MESSAGE_PROCESSING_API isn’t available.
Let me monitor it for a few days.
PL/SQL Developer will show you invalids, when they are actually invalid. It is active sessions that if they already have a reference to the object that was invalid that do not always recognize the change. You could also try flushing the shared pool. That will remove alot of old references. It may also clear alot of caches.
Recently, I encountered the same issue. Each time I entered the 'Application Messages' window and restarted the failed line, the task status would return to 'waiting’ but I still don’t know why this is happening and why this error happens so often.
I've checked my objects in the "Oracle Object" window, and all the status of the objects are valid
Sometimes it helps if you compile imvalid objects:
Then you need to restart the application message with rmb.
PL/SQL Developer will show you invalids, when they are actually invalid. It is active sessions that if they already have a reference to the object that was invalid that do not always recognize the change. You could also try flushing the shared pool. That will remove alot of old references. It may also clear alot of caches.
I agree, but it doesn’t help every time.
Hi @Link, Did you find the cause for such errors?
Hi @AshenR
I think for this error message it should work if you just compile all invalid objects like showed.
If you have another error message maybe you can post it here or create a case.
There can be several reasons why an object goes invalid. You may have changed the object or something the object references has changed. So, if you change an event and the trigger is invalid that can invalidate things relying on or referencing the trigger. If you make a change to a custom object other than a menu you are essentially changing a database object. If you add a custom archiving job you have the potential for invalid objects. Materialized views go invalid all the time when the source of the view changes and it needs to be updated. If you install a patch that potentially will change database objects (this invalid objects error is the reason they recommend shutting down all application server processes during a patch install).
All of that can cause cascading objects to go invalid. Even if recompiling fixes the problem a session can attempt to use one of these objects before it has been recompiled. When that happens you will get that error.
The fix is to first recompile all invalid objects. Next, you can flush the shared pool to try and clear stale references. Last, if that does not work close the session, wait five minutes and log back on.
Recently, I got this error message again.
I compiled the invalid objects and restarted the application message.
It worked.
Hi @Link , will you recompile all the invalid objects when you receive this error message?
Since I'm not fully aware of what these objects do,
I'm concerned that compiling them might cause errors.
Hi @StevenHsu,
yes, that is the way.
Even if you don’t use the application server tasks you need to compile these invalid objects.
I got this reccommendation directly from IFS.
@Link Were you able to resolve this issue? Could you please share the solution? Although the compilation works, the issue keeps reoccurring.
Sometimes it helps if you compile imvalid objects:
Then you need to restart the application message with rmb.
Dear @AshenR
this was my solution.
I hope it will help you.
@Link Thanks for the update. I have started a new thread for my concern. In my case, a set of print jobs related to BR are failing, and these failures only occur on Mondays. I suspect this might be caused by a background job running over the weekend.