-
1. Re: EJB Client Error, Help.
prabhakar Jun 14, 2003 9:28 AM (in response to huangyufu)Post your client code.
-prabhakar -
2. Re: EJB Client Error, Help.
huangyufu Jun 16, 2003 11:40 AM (in response to huangyufu)public class UserClientBean
{
public UserClientBean() {
}
public void startup () {
System.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
System.setProperty("java.naming.provider.url",
"localhost:1099");
try
{
InitialContext jndiContext = new InitialContext();
System.out.println("Got context \n");
Object ref = jndiContext.lookup("User");
System.out.println("Got reference \n");
UserHome home = (UserHome)
PortableRemoteObject.narrow (ref,UserHome.class);
home.create("user name", "role1", "111-112-1234", "111-112-1234",
"111-112-1234", "Cell Number", "abc");
home.create("useee eee", "role2", "333333333333", "888888888888",
"999999999999", "Page Number", "abcccc");
User user = home.findByPrimaryKey(new UserPK("user name"));
System.out.println(user.getAlternativeEmail());
}catch(Exception e) {
System.out.println(e.toString());
}
}
public static void main (String args[]) {
UserClientBean user = new UserClientBean();
user.startup();
}
}
Thanks a lot. -
3. Re: EJB Client Error, Help.
huangyufu Jun 16, 2003 12:13 PM (in response to huangyufu)Do I need to set CLASSPATH for all JARs of %JBOSS_HOME%\client? Thanks.
-
4. Re: EJB Client Error, Help.
huangyufu Jun 16, 2003 1:58 PM (in response to huangyufu)After I set some client jars path. I got this:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.jnp.interfaces.NamingContext.(NamingContext.java:89)
at org.jnp.interfaces.NamingContextFactory.getInitialContext(NamingContextFactory.java:42)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.(InitialContext.java:195)
at UserClientBean.startup(UserClientBean.java:30)
at UserClientBean.main(UserClientBean.java:54)
Which JAR file I need to set?