use*_*620 3 java spring-security
我正在尝试构建一个Java应用程序,使用Database.com Java SDK访问存储在Database.com中的数据.我已经按照qucik start guide @ http://forcedotcom.github.com/java-sdk/quick-start中给出的步骤进行了操作.当应用程序部署在tomcat服务器上时,我得到以下异常
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [security- config.xml]
Offending resource: ServletContext resource [/WEB-INF/spring/servlet-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 15 in XML document from ServletContext resource [/WEB-INF/spring/security-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'fss:oauth'.
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
at
Run Code Online (Sandbox Code Playgroud)
这是security-config.xml代码.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:security="http://www.springframework.org/schema/security"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:fss="http://www.salesforce.com/schema/springsecurity"
xsi:schemaLocation="http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.salesforce.com/schema/springsecurity
http://media.developerforce.com/schema/force-springsecurity-1.2.xsd">
<!-- SFDC OAuth security config -->
<fss:oauth logout-from-force-dot-com="true">
<fss:connectionName name="forceDatabase"/>
</fss:oauth>
<!-- Configure Spring Security -->
<!-- use-expressions and hasRole only needed if jsp tags are used.
If not using jsp tags you can omit the use-expressions property and set access="ROLE_USER" on the intercept-url tags -->
<security:http entry-point-ref="authenticationProcessingFilterEntryPoint" use-expressions="true">
<security:anonymous />
<!-- Uncomment this section to enable security -->
<!--
<security:intercept-url pattern="/**" access="isAuthenticated()" />
-->
<!-- sets this as the authentication filter over the default -->
<security:custom-filter position="FORM_LOGIN_FILTER" ref="authenticationFilter"/>
<security:custom-filter position="LOGOUT_FILTER" ref="logoutFilter"/>
</security:http>
Run Code Online (Sandbox Code Playgroud)
我可以看到元素oauth可以在xsd http://media.developerforce.com/schema/force-springsecurity-1.2.xsd上找到.我已经尝试将其更改为xsd的不同版本.但我没有成功.
请帮我解决这个问题.
我不确定这是否会有所帮助,但我遇到了与标签类似的问题:.
这是我的XML:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint id="HelloWorldService" implementor="com.client.webservices.ratecard.StandardHelloWorldService" address="/HelloWorldService" />
Run Code Online (Sandbox Code Playgroud)
我尝试了一切无济于事,直到我发现Eclipse代理设置为直接,我在代理后面.我仍然可以从Apache站点(http://cxf.apache.org/jaxws)获得第一组XSD定义,但是在其中你可以看到他们正在导入更多的XSD,此时重定向失败了因此我得到了这样的非常奇怪的错误.
然后我在首选项中将Eclipse代理设置为Native,错误神奇地消失了.
我希望这也适用于你的情况.
| 归档时间: |
|
| 查看次数: |
32261 次 |
| 最近记录: |