locked
Deploying timer job solution (.wsp) to SharePoint site RRS feed

  • Question

  •  

    I have a .wsp file which I want to deploy to production sharepoint site. The solution is for a particular list so I want to deploy it to the particular site.

    The deply works ok when I deploy the solution using stsadm.exe -o deploysolution solutionname. However it deploys it to the SharePoint Central Administration Site Url.

    Meaning when I activate the solution using site features in Central Admin, it creates a Timer Job (which is right) and the Timer Job definition contains URL = SharePoint Central Admin. I want it to be the actual SharePoint site. This way the job will fail as it will not find the particular list...

    Is there any way to change the URL once the feature is deployed and activated...

    I also tried to delpoy the solution using -url parameter but I guess it will not work for this type of solutions??

    Thanks.

    Tuesday, June 21, 2011 2:23 PM

Answers

  •  

    Yes I was activating the feature from the Central Admin. So I tried to activate the feature from the site collection instead of Central Admin I was getting the SP Error message with the correlation id. When I checked the log it gave the 'Access denied' error for activating the feature from the site. I logged in as a Farm Administrator when I activated the feature but still it gave the Access denied error.

    On searching more I found 2 solutions:

    1. Stopping/Changing the app pool and then activating feature (which I will have to do in different hours)

    2. Activating the feature using shell command - I tried this but ran into different issues like the '.wsp' file was not found; then parsing the '.wsp' throw errors etc.

    I will try the first option and see if that works.

    But Thanks for the help.

     

    • Marked as answer by Lily Wu Sunday, July 3, 2011 1:36 PM
    Wednesday, June 29, 2011 2:19 PM

All replies

  • As I can judge, you activated the feature with timer job at CentralAdmin site collection. It is not good idea for you.

    If you want to work with custom list in some site collection - go to that site collection and activate the feature there.

    After that, use following code in SPTimerJobDefenition Execute method to access your list:

    SPSite site = this.Parent as SPSite;

    SPList list = site.Webs[...].Lists[...];

     

    However i recommend to use timer jobs in web application scoped features and access to current web application through this.WebApplication. This will guarantee you to avoid some permission problems. Here is HowTo.

    Ivan Gorbadey. Sharepoint 2010 MCPD & MCITP.
    • Proposed as answer by Ivan Gorbadei Sunday, June 26, 2011 6:44 PM
    Sunday, June 26, 2011 6:44 PM
  •  

    Yes I was activating the feature from the Central Admin. So I tried to activate the feature from the site collection instead of Central Admin I was getting the SP Error message with the correlation id. When I checked the log it gave the 'Access denied' error for activating the feature from the site. I logged in as a Farm Administrator when I activated the feature but still it gave the Access denied error.

    On searching more I found 2 solutions:

    1. Stopping/Changing the app pool and then activating feature (which I will have to do in different hours)

    2. Activating the feature using shell command - I tried this but ran into different issues like the '.wsp' file was not found; then parsing the '.wsp' throw errors etc.

    I will try the first option and see if that works.

    But Thanks for the help.

     

    • Marked as answer by Lily Wu Sunday, July 3, 2011 1:36 PM
    Wednesday, June 29, 2011 2:19 PM