spring-attic / spring-social-samples

Samples of using Spring Social
http://projects.spring.io/spring-social
Apache License 2.0
532 stars 807 forks source link

Exclude el-api transitive dependencies. #5

Closed HeinrichFilter closed 13 years ago

HeinrichFilter commented 13 years ago

This was done for javax.servlet.jsp.jstl and org.glassfish.web. I could not get the app to run using "mvn tomcat:run" without this change.

The exception I got when browsing to http://localhost:8080/spring-social-quickstart/signin was:

javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/WEB_002dINF/views/signin_jsp, and the class loader (instance of org/codehaus/classworlds/RealmClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1120) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:890) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:851) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:756) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) root cause

java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.servlet.jsp.JspApplicationContext.getExpressionFactory()Ljavax/el/ExpressionFactory;" the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/WEB_002dINF/views/signin_jsp, and the class loader (instance of org/codehaus/classworlds/RealmClassLoader) for resolved class, javax/servlet/jsp/JspApplicationContext, have different Class objects for the type javax/el/ExpressionFactory used in the signature org.apache.jsp.WEB_002dINF.views.signin_jsp._jspInit(signin_jsp.java:25) org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52) org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1120) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:890) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:851) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:756) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

HeinrichFilter commented 13 years ago

Hmm, ok, the changes are part of the pull request but my eclipse xml formatter made unnecessary changes. I'll try and redo it with correct formatting later.

Is the xml format definition for eclipse that you guys use available from somewhere?

kdonald commented 13 years ago

I don't understand Heinrich. mvn tomcat:run works fine for me. Neither jstl-api or jstl-impl appears to depend on el-api transitively according to the Maven dependency hierarchy. What am I missing?

HeinrichFilter commented 13 years ago

Thank you for the quick response.

I tried a clean checkout on my pc at work and everything runs as expected without my changes to the pom file. There must be something wrong with my setup at home.

When running "mvn dependency:tree" on a fresh checkout at home "el-api" is listed as a dependency but on my work pc it does not show up.

Sorry for the "false alarm"

kdonald commented 13 years ago

No problem! Thanks for the feedback!