문제

After updating servlet-api provided dependency in pom from 2.3 to 2.5, unit tests for our custom Struts 1.1 RequestProcessor started to fail with NoClassDefFoundError: javax/servlet/jsp/JspException, which indeed is lacking in servlet-api-2.5, compared to 2.3.

I use JUnit 4.11 and JMockit 1.2 for unit testing.

Interestingly, the application works fine after deploying it to JBoss 5.1.

Is Struts 1.1 compatible with web apps using servlet api 2.5?

Maybe JBoss 5.1 servlet-api is different from servlet-api-2.5 taken from maven repository?

도움이 되었습니까?

해결책

javax.servlet.JspException is an exception that is defined in the JSP API. The JSP API is an extension of the Servlet API.

The reason why you don't experience this issue in JBoss 5.1 is because JBoss 5.1 contains jsp-api.jar inside the JBOSS_HOME\common\lib directory.

Just include the same jar as a dependency in your Struts test project.

I hope this helps.

다른 팁

you need to add jsp-api to you dependencies http://search.maven.org/#search|ga|1|a%3A%22jsp-api%22

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top