This discussion is archived
0 Replies Latest reply: Dec 5, 2011 2:35 AM by JosephHwang RSS

org.apache.jasper.JasperException:Unable to compile class for JSP exception

JosephHwang Newbie
Currently Being Moderated
I use eclipse indigo and jboss 7.

I coded ejb3 like below

import javax.ejb.Remote;

public interface IHelloWorldPort {
public String sayHello(String name);

import javax.ejb.Stateless;

public class HelloWorldBean implements IHelloWorldPort {
public String sayHello(String name) {
// TODO Auto-generated method stub
return "Hello " + name ;

in another web project I coded like below

====== display.jsp =======

<%@ page import="javax.naming.*"%>
<%@ page import=""%> // this line throws exception !

<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>EJB Hello World</title>
try {
Context ctx = new InitialContext();
IHelloWorldPort hello = (IHelloWorldPort)ctx.lookup("HelloWorldBean/remote"); // exception !!
String id = request.getParameter("id");

Exceptions are thrown like below :

org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 7 in the generated java file
Only a type can be imported. resolves to a package

An error occurred at line: 18 in the jsp file: /display.jsp
IHelloWorldPort cannot be resolved to a type

I can't import ejb3 interface on jsp file. jsp web project is connected to ejb3 project by build path. I have no idea what is wrong
Kindly inform me of your advice! Thanks in advance.

Edited by: 변강쇠 on 2011. 12. 5 오후 7:35


  • Correct Answers - 10 points
  • Helpful Answers - 5 points