You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Jacky Liu (JIRA)" <ji...@apache.org> on 2011/05/13 11:07:47 UTC
[jira] [Commented] (GERONIMO-5288) Cannot use @EJB in java ee
component(servlet, JSF) to inject ejb object
[ https://issues.apache.org/jira/browse/GERONIMO-5288?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032923#comment-13032923 ]
Jacky Liu commented on GERONIMO-5288:
-------------------------------------
I choose Geronimo samples "calculator" to demonstrate my ideas.
Firstly, in ..\calculator\calculator-ejb\src\main\java\org\apache\geronimo\samples\slsb\calculator\calculator.java add
import javax.ejb.Local;
import javax.ejb.Remote;
Secondly, add
@Local(CalculatorLocal.class)
@Remote(CalculatorRemote.class)
to explicitly implicate EJB local business interface use CalcluatorLocal.class as an interface and EJB remote business interface use CalculatorRemote.class as an interface.
Then with "import org.apache.geronimo.samples.slsb.calculator.CalculatorLocal;" in ..\calculator\calculator-war\src\main\java\org\apache\geronimo\samples\calculator\CalculatorServlet.java , we CAN use @EJB to inject ejb object, that is, "private CalculatorLocal calc = null;" executes successfully.
With that, bug fixed.
BUT in Geronimo v2.1, EJB local business interface CAN BE FOUND without explicitly implication. So there's still a problem here.
> Cannot use @EJB in java ee component(servlet, JSF) to inject ejb object
> -----------------------------------------------------------------------
>
> Key: GERONIMO-5288
> URL: https://issues.apache.org/jira/browse/GERONIMO-5288
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: Web Profile
> Affects Versions: 3.0
> Reporter: Forrest Xia
> Assignee: Ivan
> Fix For: 3.0
>
>
> I tried two new java ee 6 samples "jpa20demo-javaee6" and "ejbtimer-javaee6", they both failed at injecting ejb object in JSF managed bean or servlet.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira