users@glassfish.java.net

Re: Glassfish EJB3 and Wicket

From: Sahoo <Sahoo_at_Sun.COM>
Date: Sat, 26 Apr 2008 22:46:02 +0530

glassfish_at_javadesktop.org wrote:
> Thank you,
>
> I read the FAQ. But I still have the problem.
> My ejb-jar and my war file are running in the same Glassfish AS.
> First I build my ejb jar and deploy it. The I build my war and the deploy it.
>
> My code now:
> Properties props = new Properties();
> props.setProperty("java.naming.factory.initial",
> "com.sun.enterprise.naming.SerialInitContextFactory");
> props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
> props.setProperty("java.naming.factory.state",
> "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
>
>
Which part of the FAQ suggested you to use these properties? Since you
are in same AS, no need for them.
> try {
> Context context = new InitialContext(props);
>
> userDelegate = (IUserDelegate) context.lookup("com.xxxx.business.IUserDelegate");
> } catch (NamingException e) {
> e.printStackTrace();
> }
>
> com.xxxx.business.IUserDelegate is the assigned JNDI name for the Bean. I do not specify
> another name for the Bean.
>
> But the error is:
> javax.naming.NamingException: ejb ref resolution error for remote business interfacecom.xxxx.business.IUserDelegate [Root exception is java.lang.ClassNotFoundException: com.xxxxx.business.IUserDelegate]
> at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:425)
> ...
>
> So now the war cannot find the Interface?
>
>
You need to package the bean interfaces in the war.

I recommend you use IDE like NetBeans to help you in development of
proper Java EE applications. You can avoid such issues.

Thanks,
Sahoo
> Thanks.
> [Message sent by forum member 'marsias' (marsias)]
>
> http://forums.java.net/jive/thread.jspa?messageID=271652
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>