[jboss-user] [JBoss Seam] - Re: SEAM don't can find session bean !!
JohnBat26
do-not-reply at jboss.com
Thu Mar 29 17:46:38 EDT 2007
I try recreate my project again. But SEAM don't find session bean afresh ! :(((((((((
This is my local interface:
--------------------------------
package org.it.itMail.service;
/**
* Local component interface for the UserManagerBean session bean.
*
*/
public interface UserManagerLocal
{
// ----------- Accessors For Constants ------------
// ------------ Business Methods -----------------
/**
*
*/
public java.util.List loadUsers();
}
-------------------------------------
This is my PARENT BEAN for session bean:
-------------------------------------
package org.it.itMail.service;
/**
* Autogenerated EJB session bean base class UserManagerBean.
*
*
*/
@javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
@javax.ejb.Local({org.it.itMail.service.UserManagerLocal.class})
@javax.ejb.Remote({org.it.itMail.service.UserManagerRemote.class})
public abstract class UserManagerBase
implements org.it.itMail.service.UserManagerLocal, org.it.itMail.service.UserManagerRemote
{
// ------ Session Context Injection ------
@javax.annotation.Resource
protected javax.ejb.SessionContext context;
// ------ Persistence Context Definitions --------
/**
* Inject persistence context itMail
*/
@javax.persistence.PersistenceContext(unitName = "itMail")
protected javax.persistence.EntityManager emanager;
// ------ DAO Injection Definitions --------
/**
* Inject DAO UserDao
*/
@javax.ejb.EJB
private org.it.itMail.domain.UserDao userDao;
// --------------- Constructors ---------------
public UserManagerBase()
{
super();
}
// ------ DAO Getters --------
/**
* Get the injected DAO UserDao
*/
protected org.it.itMail.domain.UserDao getUserDao()
{
return this.userDao;
}
// -------- Business Methods --------------
/**
*
*/
@javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
@org.jboss.seam.annotations.Begin
public java.util.List loadUsers()
{
try
{
return this.handleLoadUsers();
}
catch (Throwable th)
{
throw new org.it.itMail.service.UserManagerException(
"Error performing 'org.it.itMail.service.UserManager.loadUsers()' --> " + th,
th);
}
}
/**
* Performs the core logic for {@link #loadUsers()}
*/
protected abstract java.util.List handleLoadUsers()
throws java.lang.Exception;
// -------- Lifecycle Callbacks --------------
}
-------------------------------------
This is my session bean directly:
--------------------------------------
package org.it.itMail.service;
import java.util.List;
import org.it.itMail.domain.*;
import org.jboss.seam.annotations.datamodel.DataModel;
/**
* @see org.it.itMail.service.UserManagerBean
*/
/**
* Do not specify the javax.ejb.Stateless annotation
* Instead, define the session bean in the ejb-jar.xml descriptor
* @javax.ejb.Stateless
*/
/**
* Uncomment to enable webservices for UserManagerBean
*@javax.jws.WebService(endpointInterface = "org.it.itMail.service.UserManagerWSInterface")
*/
@javax.ejb.Stateless
@org.jboss.seam.annotations.Name("userManager")
public class UserManagerBean
extends org.it.itMail.service.UserManagerBase
{
// --------------- Constructors ---------------
@DataModel
private List < User > userList;
public UserManagerBean()
{
super();
}
// -------- Business Methods Impl --------------
/**
* @see org.it.itMail.service.UserManagerBase#loadUsers()
*/
protected java.util.List handleLoadUsers()
throws java.lang.Exception
{
userList = (List < User >) this.getUserDao().loadAll();
return null;
}
// -------- Lifecycle Callback Implementation --------------
}
---------------------------------------
This is piece JNDI view from JMX console:
-----------------------------------
+- itMail-0.1.0-SNAPSHOT (class: org.jnp.interfaces.NamingContext)
| +- Dispatcher (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy106 implements interface org.jboss.seam.core.LocalDispatcher,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| +- UserDao (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy95 implements interface org.it.itMail.domain.UserDao,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| +- UserManagerBean (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy100 implements interface org.it.itMail.service.UserManagerLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
| | +- remote (proxy: $Proxy98 implements interface org.it.itMail.service.UserManagerRemote,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBObject)
| +- TransactionListener (class: org.jnp.interfaces.NamingContext)
| | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
| | +- local (class: java.lang.Object)
-----------------------------------
This is my xhtml:
------------------------------
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:c="http://java.sun.com/jstl/core">
<h:form>
<h:outputText value="Welcome to JBoss SEAM+ Ajax4jsf+RichFaces"/>
<h:commandButton value="???????? ?????????????" action="#{userManager.loadUsers}"/>
</h:form>
------------------------------
This is piece log from JBoss:
-------------------------------------
...
01:38:32,384 INFO [Component] Component: userManager, scope: STATELESS, type: STATELESS_SESSION_BEAN, class: org.it.itMail.service.UserManagerBean, JNDI: itMail-0.1.0-SNAPSHOT/UserManagerBean/local
01:38:32,397 INFO [Lifecycle] starting up: org.jboss.seam.servlet.multipartFilter
01:38:32,398 INFO [Lifecycle] starting up: org.jboss.seam.servlet.exceptionFilter
01:38:32,402 INFO [Lifecycle] starting up: org.jboss.seam.ui.graphicImage.dynamicImageResource
01:38:32,402 INFO [Lifecycle] starting up: org.jboss.seam.servlet.redirectFilter
01:38:32,403 INFO [Lifecycle] starting up: org.jboss.seam.ui.resource.webResource
01:38:32,406 INFO [Initialization] done initializing Seam
01:38:32,466 ERROR [STDERR] 30.03.2007 1:38:32 com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Sun's JavaServer Faces implementation (1.2_04-b10-p01) for context 'it-mail'
01:38:32,834 ERROR [STDERR] 30.03.2007 1:38:32 com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
01:38:33,695 INFO [SeamFilter] Initializing filter: org.jboss.seam.servlet.multipartFilter
01:38:33,695 INFO [SeamFilter] Initializing filter: org.jboss.seam.servlet.redirectFilter
01:38:33,695 INFO [SeamFilter] Initializing filter: org.jboss.seam.servlet.exceptionFilter
01:38:33,730 INFO [EARDeployer] Started J2EE application: file:/home/jee/jboss-4.0.5.GA/server/default/deploy/itMail-0.1.0-SNAPSHOT.ear/
01:38:33,792 INFO [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
01:38:33,860 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
01:38:33,873 INFO [JkMain] Jk running ID=0 time=0/37 config=null
01:38:33,880 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 26s:257ms
...
1:39:12,257 ERROR [STDERR] 30.03.2007 1:39:12 com.sun.faces.lifecycle.InvokeApplicationPhase execute
WARNING: value of context variable is not an instance of the component bound to the context variable: userManager
java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: userManager
at org.jboss.seam.Component.getInstance(Component.java:1655)
at org.jboss.seam.Component.getInstance(Component.java:1610)
at org.jboss.seam.Component.getInstance(Component.java:1604)
at org.jboss.seam.jsf.SeamELResolver.getValue(SeamELResolver.java:49)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:68)
at com.sun.el.parser.AstValue.getTarget(AstValue.java:63)
at com.sun.el.parser.AstValue.invoke(AstValue.java:153)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
at javax.faces.component.UICommand.broadcast(UICommand.java:383)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
------------------------------------
HELP, PLEASE ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4032952#4032952
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4032952
More information about the jboss-user
mailing list