简体   繁体   中英

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

while trying to run my app-engine spring project, i am getting the blow error. I have xslt in my spring security file but still getting the error. And eclipse is creating a file named 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

spring-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>

It is because you are running wrong file in Eclipse. Make sure you have selected the class where your mail function is and then press the Run button(the little green on top).

The issue is resolved automatically. It might be some bug of eclipse, b'cox when I started the eclipse another day, my project work fine. Even i didn't made any changes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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