Hi,

you're probably looking for the portable JNDI syntax, as explained
here: http://java.sun.com/javaee/6/docs/tutorial/doc/gipjf.html

> And one last question, in the end the author mentions that the @Named
> annotation is not useful. How would it look like without it?

I think he probably means that you could just do it like this:

bind(EJB3TestRemote.class).toProvider(fromJndi(EJB3TestRemote.class,"EJB3Test/
remote"));

And then simply:
@Inject
private EJB3TestRemote test;

...if you don't want to bind different EJB3TestRemotes to different
names.
I haven't tried this though - I'm simply using the @EJB annotation to
inject EJBs in GlassFish.

Chris

On Mar 10, 10:03 pm, opn <open...@gmx.net> wrote:
> Hello!
>
> I found an interesting blog entry today and tried to implement it in a
> test application.
>
> Here is the 
> url:http://gianluigidavassiuk.blogspot.com/2009/11/ejb3-plus-guice-how-ex...
>
> Now, as mentioned in the topic, im using Glassfish that runs in
> netbeans or i have a tomcat 6 server accessible via lan or internet
> where i am (trying to) deploying my application.
>
> Now my only problem is that i dont know what i have to use as the
> identifier for the bean to look it up in those two environments
> (glassfish / tomcat).
>
> "bind(EJB3TestRemote.class) .annotatedWith(Names.named("EJB3TestRemote")) 
> .toProvider(fromJndi(EJB3TestRemote.class,"EJB3Test/
> remote"));"
>
> The author says thats specific to JBoss. What do i have to use?
>
> -----
>
> 01      public class  NiceClass {
> 02
> 03       @Inject @Named("EJB3TestRemote")
> 04       private EJB3TestRemote test;
> 05
> 06       public void tryJndi() throws NamingException {
> 07
> 08        System.out.println( test.statelessMethod("JBOSS HELLO") );
> 09       }
> 10      }
>
> Can i use Constructor injection in that style too?
>
> And one last question, in the end the author mentions that the @Named
> annotation is not useful. How would it look like without it?
>
> I'd be really happy if there was someone who can give me detailed
> information about this. I think while googling i found a link to a
> Guice book that gives information about this but for Guice 1.0

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to