users@glassfish.java.net

RE: ejb 3.0 problems

From: Dru Devore <ddevore_at_duckhouse.us>
Date: Wed, 26 Mar 2008 11:44:42 -0700
I guess I wasn't clear enough. The beans accessing the database are the session beans I am trying to access. I removed the @Stateless from the business logic class because it was not meant to be a bean. It had the notation because it was needed for making it a web service which I was using for quick and dirty testing of the method. I could make changes to the data and hit a button on the test page generated.

Though I am not actually running it from the servlet sending the reference to the timer task that it is being run from seems to be working so I think you for your time.

Solution found but question still remains:

This still leaves the question of why won't the generated lookup code generated by NB work? It should it all looks correct but for some reason Glassfish does not seem to like it.

---
Dru Devore


-------- Original Message --------
Subject: Re: ejb 3.0 problems
From: glassfish@javadesktop.org
Date: Wed, March 26, 2008 2:33 pm
To: users@glassfish.dev.java.net

Hi Dru,

If you remove the @Stateless annotation from the bean class and it's not defined as a bean in a corresponding ejb-jar.xml it won't be recognized as an enterprise bean component.

Regarding access to a bean's local interface, which exact kind of class is attempting to acquire the reference? Since it's a stateless session bean, injection into the servlet class is a good option.
Just add the @EJB <LocalIntfType> fieldName; to the Servlet class. There are alternatives listed in our EJB FAQ as well :

https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#POJOLocalEJB

--ken
[Message sent by forum member 'ksak' (ksak)]

http://forums.java.net/jive/thread.jspa?messageID=266013

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net