Hi, I am a little stumped...
I have deployed a
test EJB inside a war to
JBoss. JBoss says that it has deployed the package, Hello.war
This war has the following structure:
..\
HelloBean.class
HelloHome.class
HelloObject.class
test.jsp
meta-inf\
ejb-jar.xml
manifest.mf
Now I am not conforming to the MVC standards by implementing a call to the EJB from within "test.jsp", but I know you can do it, so I need to test. My
jsp file has the following code:
<%@ page import="HelloHome.*, javax.naming.InitialContext,javax.naming.Context"%>
<html> .. etc. etc and then the
java piece
<%
Context initCtx = new InitialContext();
try {
Object object = initCtx.lookup("java:comp/env/ejb/hello");
HelloHome helloHome = (HelloHome)
javax.rmi.PortableRemoteObject.narrow(object, HelloHome.class);
HelloObject bean = helloHome.create();
} catch (Exception e) {
%> There has been an error <%
}
%>
<%= bean.sayHello() %>
When I load the page from the browser, JBoss goes wild and I get the following response
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated
servlet error:
[javac] Compiling 1 source file
[javac] C:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\deploy\server\default\deploy\work\MainEngine\localhost\Hello\test_jsp.java:7: package HelloHome does not exist
[javac] import HelloHome.*;
[javac] ^
[javac] C:\jboss-3.2.1_tomcat-4.1.24\server\default\tmp\deploy\server\default\deploy\work\MainEngine\localhost\Hello\test_jsp.java:54: cannot resolve symbol
[javac] symbol : class HelloHome
[javac] location: class org.apache.jsp.test_jsp
[javac] HelloHome helloHome = (HelloHome)
WHAT AM I DOING WRONG ???!!!