<%@ page contentType="text/html; charset=GBK" %>
<%@ page import="java.rmi.*" %>
<%@ page import="javax.rmi.*" %>
<%@ page import="java.util.*" %>
<%@ page import="javax.ejb.*" %>
<%@ page import="javax.naming.*" %>   
<%@ page import="sun.misc.*" %>
<%@ page import="test.*" %><%
try {      String s1 = "t3://192.168.192.121:7001";
Properties properties = new Properties();
properties.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");
properties.put("java.naming.provider.url", s1);
InitialContext ctx = new InitialContext(properties);String userid="user";out.print("1");
Object objRef =ctx.lookup("helloRemote");//java:comp/env/ejb/exrateCMPEJB")
out.print("2");
 
helloRemoteHome home=(helloRemoteHome)javax.rmi.PortableRemoteObject.narrow(objRef,helloRemoteHome.class); 
out.print("3");
 
 
//helloHome home= (helloHome)ctx.lookup("hello");
 
//helloRemote hello1 = home.create("567");
out.print("4");helloRemote hello2 = home.findByPrimaryKey(userid);
out.println("fck.........:"+hello2.getUsername());System.out.println(hello2.getUsername()); //hello1.remove();
 hello2.remove();
}
catch(Exception e)
{
out.print(e);}
%>    <HTML><BODY BGCOLOR="white" >
  AWfs
<HR>
</BODY>
</HTML>