Skip to main content
Question

ORA-04068: existing state of packages has been discarded


Forum|alt.badge.img+23
  • Superhero (Customer)
  • 1169 replies

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?

19 replies

Forum|alt.badge.img+10
  • Hero (Customer)
  • 126 replies
  • July 9, 2024

Did you goto Solution Manager>System Information and Utilities>Oracle Objects>Compile Invalid Objects?  Do you see any?  Can you recompile them?


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • July 9, 2024

Dear @mwilson 

there were some views and packages which I have recompiled.

But the API I’ve been mentioned isn’t there.

 


Forum|alt.badge.img+10
  • Hero (Customer)
  • 126 replies
  • July 9, 2024

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.


Forum|alt.badge.img+10
  • Hero (Customer)
  • 126 replies
  • July 9, 2024

Worst case you might have to restart the integration server.


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • July 10, 2024

Hi @mwilson 

Why doesn't the PL/SQL developer show me these invalid components?


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • July 10, 2024

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. 😊


Forum|alt.badge.img+10
  • Hero (Customer)
  • 126 replies
  • July 10, 2024

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.


Forum|alt.badge.img+4
  • Sidekick (Customer)
  • 17 replies
  • November 6, 2024

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


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • November 6, 2024

Sometimes it helps if you compile imvalid objects:

Then you need to restart the application message with rmb.


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • November 6, 2024
mwilson wrote:

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. 


AshenR
Hero (Partner)
Forum|alt.badge.img+8
  • Hero (Partner)
  • 99 replies
  • November 6, 2024

Hi @Link, Did you find the cause for such errors? 


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • November 6, 2024

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.

 


Forum|alt.badge.img+10
  • Hero (Customer)
  • 126 replies
  • November 6, 2024

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.


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • November 11, 2024

Recently, I got this error message again. 

I compiled the invalid objects and restarted the application message.

It worked. 


Forum|alt.badge.img+4
  • Sidekick (Customer)
  • 17 replies
  • November 12, 2024

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.

 


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • November 12, 2024

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.

 


AshenR
Hero (Partner)
Forum|alt.badge.img+8
  • Hero (Partner)
  • 99 replies
  • December 11, 2024

@Link Were you able to resolve this issue? Could you please share the solution? Although the compilation works, the issue keeps reoccurring.


Forum|alt.badge.img+23
  • Author
  • Superhero (Customer)
  • 1169 replies
  • December 11, 2024
Link wrote:

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.


AshenR
Hero (Partner)
Forum|alt.badge.img+8
  • Hero (Partner)
  • 99 replies
  • December 11, 2024

@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.
 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings