老大救命啊!!!
我的第一个EJB到现在还没弄好 :( 求老大帮忙啊
ejb部署应该没问题(jboss没有错误提示)
客户端是这样:
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.ejb.*;
import javax.rmi.PortableRemoteObject;
import QueryInterface.*;
import QueryBean.*;
import java.util.*;
public class Test
{
public static void main(String[] args)
{
try
{
Properties env=new Properties();
env.setProperty("Context.INITIAL_CONTEXT_FACTORY","org.jnp.interfaces.NamingContextFactory");
env.setProperty("Context.PROVIDER_URL","localhost:1099");
env.setProperty("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
InitialContext ic=null;
ic = new InitialContext(env);
QueryInterface.TestQueryHome home = (QueryInterface.TestQueryHome)
PortableRemoteObject.narrow(ref, QueryInterface.TestQueryHome.class);
QueryBean qb = home.create();
System.out.println(qb.query("","jdbc:odbc:ServletDB","",""));
}
catch(Exception e)
{
System.out.println(e.toString());
}
}
}
执行的时候提示:
javax.naming.CommunicationException:Cant't find SerialContextProperder
好象是JNDI环境有错误。
老大帮我看看吧