This content has been marked as final.
Show 5 replies
-
1. Re: Why can not inject EJB to WebBean?
jimmy.jimmy.shine.gmail.com Apr 2, 2010 4:36 PM (in response to jimmy.jimmy.shine.gmail.com)I used JBoss6.0 M2 to run it!
-
2. Re: Why can not inject EJB to WebBean?
meetoblivion Apr 2, 2010 6:04 PM (in response to jimmy.jimmy.shine.gmail.com)Try using @EJB. Do you know what version of weld you're using? I know there are some issues w/ EJB integration and I believe this is one of them.
-
3. Re: Why can not inject EJB to WebBean?
jimmy.jimmy.shine.gmail.com Apr 3, 2010 5:14 AM (in response to jimmy.jimmy.shine.gmail.com)Thanks for your reply, John.
First,I used Weld1.0.1 Final.
I had been tried use @EJB to inject the session bean, it had no problem on start the JBoss6.0M2.
But when I used the attachmentAction in JSF pages.
The JSF page is:
<h:form>
<h:outputText value="#{attachmentAction.message}"></h:outputText>
<h:inputText value="#{attachmentAction.attachment.name}"/>
<h:commandButton value="Add" action="#{attachmentAction.add}" />
</h:form>
The error like these below:
[javax.enterprise.resource.webcontainer.jsf.application] Error Rendering View[/view/framework/attachs/add.xhtml]: javax.el.ELException: /view/framework/attachs/add.xhtml @11,52 value="#{attachmentAction.message}": org.jboss.ejb3.common.resolvers.spi.UnresolvableReferenceException: Could not resolve reference [EJB Reference: beanInterface 'com.vaalhaai.framework.attachs.service.AttachmentService', beanName '', mappedName 'null'] in AbstractVFSDeploymentContext@19807859{vfszip:/D:/jboss-6.0.0.M2/server/default/deploy/vaalhaai.war/}
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:107)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
at javax.faces.component.UIOutput.getValue(UIOutput.java:168)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:338)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:336)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:872)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
at java.lang.Thread.run(Thread.java:619)
I relly know how to inject the ejb to the webbean.
I had read the replies that Gavin King said, had @LocalBean annotation to the stateless ejb.
Thanks! -
4. Re: Why can not inject EJB to WebBean?
pmuir Apr 12, 2010 12:20 PM (in response to jimmy.jimmy.shine.gmail.com)JBoss AS 6 M2 still has some issues with no-interface view EJBs, hence why this isn't working for you. It doesn't look like this is fixed for M3 either, but will be for M4 I hope.
Anyway, just add a local interface.
-
5. Re: Why can not inject EJB to WebBean?
jimmy.jimmy.shine.gmail.com Apr 16, 2010 8:57 AM (in response to jimmy.jimmy.shine.gmail.com)Thanks for Pete!
In fact,now I changed my project used SSH now.
Hope the JBoss AS 6 RC will fixed it.