+ Start a Discussion
Terence VibanTerence Viban 

Integration wookbook error: invalid application.xml, no declaration can be found for element 'fss:oauth'

Hi all,

I am working my way through the integration wookbook. The basic scenerio is, the application is written using spring mvc and hosted in heroku. One way integration from salesforce via REST API works fine. Now we want the app on heroku to integrate with salesforce an be able to update our data model. For this we need to enable OAuth so the heroku app can authenticate remotely before accessing data on Salesforce (Tutorial 3 in the wookbook).

At this step, I get the following error


org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 30 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 16; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'fss:oauth'.

I have found a couple of resources online which try to explain this scenario and offer possible solutions 

http://stackoverflow.com/questions/8711186/the-matching-wildcard-is-strict-but-no-declaration-can-be-found-for-element-fs

There is this explaination and solution that makes absolute sense

https://github.com/forcedotcom/java-sdk/issues/31

Basically that the xsd file in which "fss:oauth" should be defined is missing which is true, because the xsi:schemaLocation in the application.xml http://media.developerforce.com/schema/force-springsecurity-1.3.xsd gives me this error.

<Error>
<Code>AccessDenied</Code>
<Message>Access Denied</Message>
<RequestId>CD73BCF1560A19F3</RequestId>
<HostId>
4m6ilf2nj4XemWlWJBH5ZYh54tJkHN5LGJjhvKBAlouuz3eJQEorMf9RVje52h7agHRygeoPed0=
</HostId>
</Error>

This URL in the xsi:schemaLocation http://www.salesforce.com/schema/springsecurity also points to a path that is no longer available

I tried this xsd file http://force-spring.herokuapp.com/force-springsecurity-1.2.xsd hosted on git which seems to have the right definition for fss:oauth. But this didn't help.
I have tried all the other suggested workarounds such as modifying my pom.xml file and nothing has helped. I am stuck at this point. I even destroyed and recreated my project from scratch while trying various solutions and I get stuck at thesame spot.

I am not at all versed with the Spring MVC framework but I have read enough to understand what application.xml and pom.xml do. Any more insights on this issue will be highly appreciated.

Thanks
Ray Zhao 3Ray Zhao 3
This is my <beans... bracket for the applicationContext.xml file.  I just tried it yesterday and it worked for me. 
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:context="http://www.springframework.org/schema/context"
    xmlns:fss="http://www.salesforce.com/schema/springsecurity"
        xmlns:jdbc="http://www.springframework.org/schema/jdbc"
    xmlns:security="http://www.springframework.org/schema/security"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
                http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
                http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
        http://www.salesforce.com/schema/springsecurity http://force-spring.herokuapp.com/force-springsecurity-1.2.xsd
        http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">

Hope this helps!  Thanks to "iandrosov" for hosting the force-springsecurity-1.2.xsd file!
ray
 
jaco polet 18jaco polet 18
For me this one helped