没有用于file的嵌入式样式表指令:spring-security.xml

时间:2014-02-09 11:34:29

标签: java eclipse spring spring-security

在尝试运行我的应用程序引擎弹簧项目时,我收到了打击错误。 我在我的spring安全文件中有xslt但仍然收到错误。 eclipse正在创建一个名为spring-security.out.xml的文件

16:54:39,148 INFO  [main] Main  - javax.xml.transform.TransformerFactory=null
16:54:39,151 INFO  [main] Main  - java.endorsed.dirs=C:\Program Files\Java\jdk1.7.0_45\jre\lib\endorsed
16:54:39,156 INFO  [main] Main  - launchFile: E:\spring+gapp_32kepler\workspace_new\.metadata\.plugins\org.eclipse.wst.xsl.jaxp.launching\launch\launch.xml
16:54:39,264 FATAL [main] Main  - No embedded stylesheet instruction for file: file:/E:/spring+gapp_32kepler/workspace_new/cms/war/WEB-INF/spring-security.xml
org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/E:/spring+gapp_32kepler/workspace_new/cms/war/WEB-INF/spring-security.xml
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:223)
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:187)
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.Main.main(Main.java:73)
Caused by: org.eclipse.wst.xsl.jaxp.debug.invoker.TransformationException: No embedded stylesheet instruction for file: file:/E:/spring+gapp_32kepler/workspace_new/cms/war/WEB-INF/spring-security.xml
    at org.eclipse.wst.xsl.jaxp.debug.invoker.internal.JAXPSAXProcessorInvoker.transform(JAXPSAXProcessorInvoker.java:213)
    ... 2 more

弹簧security.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:p="http://www.springframework.org/schema/p" 
 xsi:schemaLocation="http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
   http://www.springframework.org/schema/security 
   http://www.springframework.org/schema/security/spring-security-3.1.xsd">

  <!-- This is where we configure Spring-Security  -->
  <security:http auto-config="false" use-expressions="true" access-denied-page="/jsp/admin/login" entry-point-ref="authenticationEntryPoint" >

     <security:intercept-url pattern="/jsp/admin" access="permitAll"/>
     <security:intercept-url pattern="/jsp/admin/**" access="hasRole('ROLE_ADMIN')"/>

     <security:intercept-url pattern="/jsp/user/**" access="permitAll"/>

       <security:logout invalidate-session="true" logout-success-url="/jsp/admin/login" logout-url="/logout" />

    <security:custom-filter ref="authenticationFilter" position="FORM_LOGIN_FILTER"/>
  </security:http>

   <!--  Custom filter to deny unwanted users even though registered -->

   <!-- Custom filter for username and password. The real customization is done in the customAthenticationManager -->
   <bean id="authenticationFilter" class="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter"
      p:authenticationManager-ref="customAuthenticationManager"
      p:authenticationFailureHandler-ref="customAuthenticationFailureHandler"
      p:authenticationSuccessHandler-ref="customAuthenticationSuccessHandler" />

  <!-- Custom authentication manager. In order to authenticate, username and password must not be the same -->
  <bean id="customAuthenticationManager" class="com.tut.yudi.authentication.CustomAuthenticationManager" />

   <!-- We just actually need to set the default failure url here -->
   <bean id="customAuthenticationFailureHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler"
     p:defaultFailureUrl="/login?error=true" />

    <!-- We just actually need to set the default target url here -->
   <bean id="customAuthenticationSuccessHandler" class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler"
     p:defaultTargetUrl="/jsp/admin/home" />

   <!-- The AuthenticationEntryPoint is responsible for redirecting the user to a particular page, like a login page,
       whenever the server sends back a response requiring authentication -->
   <!-- See Spring-Security Reference 5.4.1 for more info -->
   <bean id="authenticationEntryPoint"  class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint"
     p:loginFormUrl="/login"/>

  <!-- The tag below has no use but Spring Security needs it to autowire the parent property of 
      org.springframework.security.authentication.ProviderManager. Otherwise we get an error 
      A probable bug. This is still under investigation-->

     <security:authentication-manager/>
</beans>

2 个答案:

答案 0 :(得分:2)

这是因为您在Eclipse中运行了错误的文件。 确保选择了邮件功能所在的类,然后按“运行”按钮(顶部的绿色小点)。

答案 1 :(得分:0)

问题自动解决。 这可能是日食的一些错误,当我另一天开始日食时b'cox,我的项目工作正常。即使我没有做任何改变。