Hi everybody?
I'm installed and running successfully with
Apache(1.3.9)/Jserv(1.1)/Gunjsp100 .
But I'm having trouble with using
Jonas(Jonas 1.3) in conjunction with Apache/Jserv/Gunjsp100.
Try to run it with Apache,EJBServer.
bash-2.02$ EJBServer
-Djava.security.policy=$JONAS_ROOT/java.policy &
[4]
2720
[3]
Done
EJBServer -Djava.security.policy=$JONAS_ROOT/java.policy
bash-2.02$
JOnAS Server, version 1.6, running on rmi.
JDBC DataSource jdbc_1
is mapped on Oracle1.properties
EJBHome:sb.JOnASOpBeanOpHome for
OpBean available
EJBHome:eb.JOnASAccountImplBeanAccountHome for
AccountImplBean
available
EJBHome:eb.JOnASAccountExplBeanAccountHome for
AccountExplBean available
Jonas server can't call ClientOp.jsp. complie
error.
==================================================================================
error
message:
===================================================================================
M025
/ClientOp.jsp:
java.lang.NoClassDefFoundError:
javax/naming/Context
at
java.lang.Class.newInstance0(Native
Method)
at
java.lang.Class.newInstance(Class.java, Compiled
Code)
at
org.gjt.jsp.JspServlet$Page.load(JspServlet.java, Compiled
Code)
at
org.gjt.jsp.JspServlet$Page.needToRecompile(JspServlet.java, Compiled
Code)
at
org.gjt.jsp.JspServlet$Page.process(JspServlet.java, Compiled
Code)
at
org.gjt.jsp.JspServlet.service(JspServlet.java, Compiled
Code)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
Code)
at
org.apache.jserv.JServConnection.processRequest(JServConnection.java,
Compiled Code)
at
org.apache.jserv.JServConnection.run(JServConnection.java, Compiled
Code)
at
java.lang.Thread.run(Thread.java:479)
===================================================================================
Here
My
source:
===================================================================================
<%@
page contentType="text/html; charset=EUC-KR" %>
<html>
<body>
<%@ page
import="javax.servlet.*,javax.servlet.http.*,java.util.*,javax.ejb.*,java.rmi.RemoteException,javax.ejb.*,java.lang.String,org.objectweb.jonas.common.Trace,javax.naming.*,javax.naming.InitialContext,javax.transaction.*,sb.*"
%>
<%
Properties p = new
Properties();
p.put(Context.PROVIDER_URL,
"rmi://203.248.69.50:1099");
p.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.rmi.registry.RegistryContextFactory");
Context initialContext = null;
try
{
initialContext = new
InitialContext(p);
}
catch (Exception e1)
{
out.println("Cannot get initial context for
JNDI: " + e1);
return;
}
UserTransaction utx = null;
try
{
utx = (UserTransaction)
initialContext.lookup("javax.transaction.UserTransaction");
}
catch
(Exception e2)
{
out.println("Cannot lookup UserTransaction:
"+e2);
return;
}
OpHome home = null;
try
{
home = (OpHome)
initialContext.lookup("OpHome");
}
catch
(Exception e)
{
out.println(
"Cannot lookup OpHome: " + e);
}
// OpBean creation
Op t1 =
null;
try
{
out.println("Create a bean");
t1 =
home.create("User1");
}
catch (Exception e)
{
out.println("Cannot create
OpBean: " + e);
}
// First transaction (committed)
try
{
out.println("Start a first
transaction");
utx.begin();
out.println("First request on
the new bean");
t1.buy(10);
out.println("Second request on
the bean");
t1.buy(20);
out.println("Commit the
transaction");
utx.commit();
}
catch (Exception e)
{
out.println("exception during 1st Tx: " +
e);
}
// Start another transaction (rolled
back)
try
{
out.println("Start a second
transaction");
utx.begin();
t1.buy(50);
out.println("Rollback the
transaction");
utx.rollback();
}
catch (Exception e)
{
out.println("exception during 2nd Tx: " +
e);
}
// Get the total bought, outside the
transaction
int val = 0;
try
{
out.println("Request outside
any transaction");
val =
t1.read();
}
catch (Exception e)
{
out.println("Cannot read value
on t1 : "+e);
}
if (val != 10+20)
{
out.println("Bad value read:
"+val);
}
else
System.out.println("value
read:" + val);
// Remove Session bean
try
{
t1.remove();
}
catch (Exception e)
{
out.println("Exception on buy:
"+e);
}
out.println("ClientOp OK.
Exiting.");
%>
<hr>
</body>
</html>
===================================================================================
I
add files (apache conf,jserv.conf,jserv.properies,zone.properties).
May
someone help me?
Thanks in advance.