[JBoss Seam] - Injecting several beans of the same type/kind/class
by toni
Hi,
is it possible to reference several entity beans of the same type from a JSF page without adding anything to the faces-config.xml?
So that if I have the bean class EmailAddress I could simply write in my JSF page the following code:
<h:inputText value="#{emailAddress}"/>
<h:inputText value="#{emailAddress2}"/>
<h:inputText value="#{emailAddress3}"/>
I defined them in a SFSB as follows:
@Name("emailAction")
@Stateful
public class EmailActionBean implements EmailAction
{
@In(create = true)
EntityManager entityManager;
@In(create = true)
@Out
EmailAddress emailAddress;
@In(create = true)
@Out
EmailAddress emailAddress2;
@In(create = true)
@Out
EmailAddress emailAddress3;
....
}
Does seam automatically create the three instances, when the JSF page is called and even so no method of the SFSB has been invoked yet?
I thought that the JSP page only can reference the other two entity beans, once the SFSB has been invoke in some way.
However, the first bean seams to be always ready, because it's name matches it's class name (in bean style).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030329#4030329
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030329
19Â years, 1Â month
[JNDI/Naming/Network] - Parallel EARs
by uetz
Hi,
we are trying to deploy the same Application parallel in one Jboss container. We use exploded EAR directories with different context-roots. Intention: Using one development host, each developer should have his own deployment including EJBs and JSPs to play with.
How can I isolate the deployments from each other? I think the problem is the JNDI-Names which are not unique. When I try to create a remote interface to an EJB:
<%
ServiceLocator serviceLocator = ServiceLocator.getInstance();
MyEJBRemoteHome home = (MyEJBRemoteHome) serviceLocator.getRemoteHome("ejb/MyEJB", MyEJBRemoteHome.class);
MyEJBBusiness myEJB = home.create();
%>
I get the following exception (when calling the home.create() method):
java.lang.IllegalArgumentException: null object name
org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:494)
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:638)
org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
sun.rmi.transport.Transport$1.run(Transport.java:153)
java.security.AccessController.doPrivileged(Native Method)
sun.rmi.transport.Transport.serviceCall(Transport.java:149)
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
java.lang.Thread.run(Thread.java:595)
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:119)
org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:37)
org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
$Proxy595.create(Unknown Source)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:51)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4030325#4030325
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4030325
19Â years, 1Â month