[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Using annotations in JSP gives JasperException
jainsau
do-not-reply at jboss.com
Mon Jul 9 10:32:33 EDT 2007
I am using JBoss 4.2 GA and created a simple EJB app and a web client. When I annotate an ejb interface variable as @EJB in a JSP file (I know it is not a good idea to access EJBs in JSPs but this is just a test program) , and try to access the JSP I get the following error:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 5 in the jsp file: /index.jsp
Syntax error, annotations are only available if source level is 5.0
2: <%@page import="javax.ejb.EJB"%>
3:
4: <%!
5: @EJB
6: private Convertor converter;
7: public void jspInit() {
8: try {
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
---------------------------------------------
Seems like JASPER is not supporting annotations in default server configuration in JBoss 4.2 GA. Am I right or do I need to make some other configuration changes so that my web app is jdk 5.0 enabled?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062005#4062005
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062005
More information about the jboss-user
mailing list