Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

Joseph HwangDec 4 2011 — edited Dec 5 2011
I use eclipse indigo and jboss 7.

I coded ejb3 like below

import javax.ejb.Remote;

@Remote
public interface IHelloWorldPort {
public String sayHello(String name);
}

======
import javax.ejb.Stateless;

@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="com.aaa.ejb3.IHelloWorldPort"%> // this line throws exception !

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>EJB Hello World</title>
</head>
<body>
<%
try {
Context ctx = new InitialContext();
IHelloWorldPort hello = (IHelloWorldPort)ctx.lookup("HelloWorldBean/remote"); // exception !!
String id = request.getParameter("id");
out.println(hello.sayHello(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. com.aaa.ejb3.IHelloWorldPort 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

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 1 2012
Added on Dec 4 2011
0 comments
166 views