Hi,
I am getting this wierd exception:
javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/jasper/servlet/JasperLoader) previously initiated loading for a different type with name "javax/el/ExpressionFactory
I am trying to develop a simple login page which has username in first page and on the second page we have to show user's security image and ask for password. Here is what I did:
1. Implemented a LoginController class which shows the login.jsp form in first request.
2. If user submits a blank username then LoginValidator handles that and show the login form again with the error.
3. If user enters a username, which passes the validator and the request reaches the onSubmit() in LoginController. In the LoginController, security image is retrieved based on the username and then redirected to success view.
4. Till here everything is working fine. Now the problem starts when there is no security image for a user and we have to show the loginform again with an error message. This is what I did:
5. Below is my JSP implementation to show this error message:Code:if (securityImagePath == null) { errors.reject("no.security.image", "Security Image not found"); return showForm(request, response, errors); }
So, when the login form is shown again to show this error, it gives the below error:Code:<spring:hasBindErrors name="loginBean"> <b>Please fix all errors!</b> <p>There were ${errors.errorCount} errors</p> <c:forEach var="errMsgObj" items="${errors.allErrors}"> <li> <spring:message code="${errMsgObj.code}" text="${errMsgObj.defaultMessage}"/> </li> </c:forEach> </spring:hasBindErrors>
I figured out that it is below piece of code which is causing this issue. If i remove this code from my JSP page then no exception occurs but also "Security Image not found" error message is also not shown.Code:javax.servlet.ServletException: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/jasper/servlet/JasperLoader) previously initiated loading for a different type with name "javax/el/ExpressionFactory" org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784) org.apache.jsp.com_satmetrix_core_webui_app_WebUI.login.login_jsp._jspService(login_jsp.java:782)
We are using JBoss 4.2 as server. I have checked and I don't have el-api.jar in my WEB-INF/lib folder. Only jar which contains this "javax/el/ExpressionFactory" class is jsp-api-2.1.jar.Code:<c:forEach var="errMsgObj" items="${errors.allErrors}"> <li> <spring:message code="${errMsgObj.code}" text="${errMsgObj.defaultMessage}"/> </li> </c:forEach>
Any help is much appreciated !!! This issue is killing me.


Reply With Quote
