hi all
i tried to create a
EJB component(Entity Bean)and deploy it in the J2EE APP SERVER....
the deployment process is a success...
when i tried to run my client program written in
JSP i get the following
error:
---------------------------
org.apache.jasper.JasperException:Unable to compile class for JSP
No
java compiler was found to compile the generated source for the JSP
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the
TOMCAT server.....
---------------------------
i have also tried the procedure given above i.e.,by copying the tools.jar to the specified location but still i am getting the same error ...
my client program is:
---------------------------
<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="javax.ejb.*" %>
<%@page import="javax.naming.*" %>
<%@page import="javax.naming.InitialContext" %>
<%@page import="javax.rmi.PortableRemoteObject" %>
<%@page import="java.rmi.RemoteException" %>
<%@page import="Account" %>
<%@page import="AccountHome" %>
<%!
private Account account=null;
public void jspInit()
{
try
{
String name=request.getParameter("name");
String id=request.getParameter("id");
InitialContext initial=new InitialContext();
Object obj=initial.lookup("java:comp/env/ejb/AccountJSP");
AccountHome accountHome=(AccountHome)PortableRemoteObject.narrow(obj,AccountHome.class);
account=accountHome.create(name,id);
} catch (RemoteException ex) {
System.out.println("RemoteException: Couldn't create Account bean."+ ex.getMessage());
} catch (CreateException ex) {
System.out.println("CreateException: Couldn't create Account bean."+ ex.getMessage());
} catch (NamingException ex) {
System.out.println("Unable to lookup home: "+ "AccountHome "+ ex.getMessage());
} catch(Exception ex) {
System.out.println("Exception:"+ex.getMessage()); }
}
public void jspDestroy() {
account= null;
}
%>
<html>
<head><title>Account Insert JSP Page</title></head>
<body>
<form method="get">
<table border='0'>
<tr>
<td>Enter Name:</td><td><input type="text" name="name"></td>
</tr>
<tr>
<td>Enter Id:</td><td><input type="text" name="id"></td>
</tr>
<tr>
<td><input type="submit" value="Insert"></td>
</tr>
</table>
</form>
<%=account.getName() %>
<%=account.getId() %>
</body>
</html>
----------------------------------------------
please help me in solving it out at the earliest..
regards
karthik