繁体   English   中英

没有文件的嵌入式样式表指令:spring-security.xml

[英]No embedded stylesheet instruction for file: spring-security.xml

尝试运行我的App引擎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>

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

该问题已自动解决。 当我第二天开始食食时,可能是食欲的bug,b'cox,我的项目工作正常。 甚至我都没有做任何改变。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM