+ Start a Discussion
guybrushguybrush 

Attempt to execute a class that never successfully parsed

Hey,

I have an apex class that is called when i send an email in my application,
sometimes the class throw this error message:

Attempt to execute a class that never successfully parsed: Static initialization: Myclass.cls

It doesn't happen every time i call the class.
I have done some research at this forum and the apex docs but this message are not listed.

anyone knows what means ? and how to fix it?

thanks,
Best Answer chosen by Admin (Salesforce Developers) 
billjgbilljg
This was actually a bug that crept into our patch release.  It should be fixed as of last night.  Sorry for the inconvenience.

All Answers

Rob_AppirioRob_Appirio

Check to see if you have a constructor defined for the class and make sure to call the constructor before calling any methods on this class.

  This appears to be the result of some recent changes to in Spring-09.

guybrushguybrush

Thanks, but it didn't solved the problem..... Any idea what cause the error message??? Why do you mention the class contructor solution??

 

Regards.

G.

JeremyKraybillJeremyKraybill

I've had this error twice since our sandbox was upgraded to Spring '09. Both times it occurred in classes that were 100% legit and compilable, after using Eclipse to deploy from one sandbox to another. The class worked fine in the source environment, and exactly matched the code that showed up post-deployment in the target environment.

 

The target environment gave the error you mention upon trying to execute the class via VF page, and the "Is Valid" checkbox was off in the Apex screen, rendering "Run Tests" and "Generate WSDL" buttons inactive. This did not appear to be time-related; I waited for well over 10 minutes and still saw this.

 

What solved it for me was simply making a trivial edit to the class in Eclipse and saving back to the server.

 

The only theory I have is that both times, my team was testing, and may have requested the target class during deployment.

 

Jeremy Kraybill

Austin, TX

billjgbilljg
This was actually a bug that crept into our patch release.  It should be fixed as of last night.  Sorry for the inconvenience.
This was selected as the best answer
guybrushguybrush

thanks!

 

G.