I have some VF pages with a custom component that are working fine in my dev environment. However, when I try to deploy this to production, the deployment fails and each page that I am trying to deploy, which all have the same component, have the following error message:
Type mismatch for
<apex:attribute assignTo>
. Value binding to a property of type String is required, property specified (sessionId) is of type null.
This is the attribute element from the custom component:
<apex:attribute name="websession" description="Website Session"
type="String" required="required" assignTo="{!sessionId}"/>
This is the sessionId variable from the custom component controller:
public String sessionId {get; set;}
and this is how the component is being used in each of the VF pages:
<c:MyCustomComponent websession="{!sessionId}" />
I know that the session id being assigned to the custom component is not null. As I said, this is working fine in dev. Just a deployment issue I think. I'm not really sure from the error message exactly what is wrong either. Is it saying that the value being passed into the component is null?
I have run the tests for these pages' controllers and they run fine.
Any ideas what could be up here?
Thanks
Best Answer
You say you are having issues when deploying correct? Any chance the controller already exists in the org you are deploying to? Any chance you missed the controller in the new deploy?
One scenario I have run into in the past is that the validation Salesforce runs can be a bit tricky when dealing with controllers and Visualforce. For instance:
To workaround this issue, if you can, you need to either delete the production instance of the code or comment out the Visualforce as part of the deploy and then uncomment it in production. There is no exact science to it, and this may not even be the real reason behind my issues in the past, but I have experienced some very strange things during deploys in the past. Good luck!