SharePoint 2007 Central Administration timerjob "timer job definition" Page error

Source: Internet
Author: User
Tags definition modifier

Deployment completed its own development of the timerjob, found that "timer job definition" page error, not go, but timerjob can run normally, so, certainly not, estimated or code problems, the fragile SharePoint page was killed.

The following figure, http://URL/_admin/ServiceJobDefinitions.aspx unknown error, the most annoying, and changed the web.config also do not throw

Calm down and think for a moment, there may be a few points of problem:

1, the configuration file format problem, delete the configuration file, still error, and format has problems, basically timer service does not come.

2, read the configuration file has a problem, but the program is the console tuned, should not.

3, there is a problem, this first is not reliable, because did not mend, should not.

4, the code itself has problems.

So, view logs, SharePoint logs, and Windows application logs

To view the Windows application log, Discover:

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/sharepoint/

Obviously, the code has problems, causing problems.

Comment out the Excute function inside all things, redeploy timerjob, incredibly still error; So, a hard-hearted, all I write code, all commented out, OK; Part of the comment to see which part of the problem. Finally, I found

public static string subhttpurl = configurationmanager.appsettings["Subhttpurl"]. ToString ();

public static string WebService = configurationmanager.appsettings["WebService"]. ToString ();

These two variable declarations are problematic, put them in the method, and do not have to be public static. As follows:

String subhttpurl = configurationmanager.appsettings["Subhttpurl"]. ToString ();

String WebService = configurationmanager.appsettings["WebService"]. ToString ();

See: Use the static modifier to declare static members that belong to the type itself and not to a particular object. The static modifier can be used for classes, fields, methods, properties, operators, events, and constructors, but not for indexers, destructors, or types other than classes, and may timerjob not support such a declaration, resulting in an error, unlike a console program. Because Timerjob debugging is not very convenient, so basically all from the console debugging OK, only to change into Timerjob, OK, the problem solved, OK. Quite simple question, quite simple idea, record, also give everybody many references.

Modify OK after the screenshot.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.