1 2 Previous Next 23 Replies Latest reply on Mar 31, 2007 2:01 PM by Eugene Batogov

    SEAM don't can find session bean !!

    Eugene Batogov Newbie

      Hello.
      I have next problem with SEAM (1.2.1.GA)
      -------------------------------
      My config:
      JSF: jsf-1.2_04-b10-p01
      SEAM: 1.2.1.GA
      JBoss: 4.0.5.GA
      OS: Gentoo Linux (AMD64)
      VM: BEA JRockIt 6.0 and Sun JVM 6.0
      ---------------------------------
      I created one entity (User) and one Session Bean (UserActionBean).
      This is my ejb-jar.xml:
      ---------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <ejb-jar
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
      version="3.0">

      <![CDATA[No Description.]]>
      <display-name>Generated by AndroMDA EJB3 Cartridge</display-name>

      <enterprise-beans>



      <![CDATA[

      ]]>

      <ejb-name>UserActionBean</ejb-name>
      org.it.itMail.service.UserActionRemote
      org.it.itMail.service.UserActionLocal
      <ejb-class>org.it.itMail.service.UserActionBean</ejb-class>
      <session-type>Stateful</session-type>
      <transaction-type>Container</transaction-type>




      <![CDATA[

      ]]>

      <ejb-name>UserDao</ejb-name>
      org.it.itMail.domain.UserDao
      <ejb-class>org.it.itMail.domain.UserDaoImpl</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>


      </enterprise-beans>


      <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>




      <assembly-descriptor>
      <interceptor-binding>
      <ejb-name>*</ejb-name>
      <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
      </interceptor-binding>
      </assembly-descriptor>

      </ejb-jar>
      ---------------------------
      When I start JBoss, EJB3Deployer install this two component properly. So they available from JNDI.
      This part log from JBoss:
      -------------------------------
      01:50:13,292 INFO [JmxKernelAbstraction] jboss.jca:name=jdbc/itMail,service=DataSourceBinding
      01:50:13,473 INFO [Version] Hibernate EntityManager 3.2.0.GA
      01:50:13,489 INFO [Version] Hibernate Annotations 3.2.0.GA
      01:50:13,508 INFO [Environment] Hibernate 3.2.0.ga
      01:50:13,514 INFO [Environment] hibernate.properties not found
      01:50:13,516 INFO [Environment] Bytecode provider name : javassist
      01:50:13,521 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      01:50:13,634 INFO [Ejb3Configuration] found EJB3 Entity bean: org.it.itMail.domain.User
      01:50:13,642 WARN [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
      01:50:13,698 INFO [Configuration] Reading mappings from resource: META-INF/orm.xml
      01:50:13,701 INFO [Ejb3Configuration] [PersistenceUnit: itMail] no META-INF/orm.xml found
      01:50:13,893 INFO [AnnotationBinder] Binding entity from annotated class: org.it.itMail.domain.User
      01:50:13,915 INFO [QueryBinder] Binding Named query: User.findAll => select user from User AS user
      01:50:13,968 INFO [EntityBinder] Bind entity org.it.itMail.domain.User on table USERS
      01:50:14,345 INFO [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
      01:50:14,348 INFO [InjectedDataSourceConnectionProvider] Using provided datasource
      01:50:14,700 INFO [SettingsFactory] RDBMS: MySQL, version: 5.0.34-log
      01:50:14,700 INFO [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
      01:50:14,729 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
      01:50:14,737 INFO [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
      01:50:14,740 INFO [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
      01:50:14,742 INFO [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
      01:50:14,742 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
      01:50:14,742 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
      01:50:14,743 INFO [SettingsFactory] JDBC batch size: 15
      01:50:14,743 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
      01:50:14,744 INFO [SettingsFactory] Scrollable result sets: enabled
      01:50:14,745 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
      01:50:14,745 INFO [SettingsFactory] Connection release mode: auto
      01:50:14,746 INFO [SettingsFactory] Maximum outer join fetch depth: 2
      01:50:14,746 INFO [SettingsFactory] Default batch fetch size: 1
      01:50:14,746 INFO [SettingsFactory] Generate SQL with comments: disabled
      01:50:14,746 INFO [SettingsFactory] Order SQL updates by primary key: disabled
      01:50:14,747 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
      01:50:14,749 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
      01:50:14,750 INFO [SettingsFactory] Query language substitutions: {}
      01:50:14,750 INFO [SettingsFactory] JPA-QL strict compliance: enabled
      01:50:14,750 INFO [SettingsFactory] Second-level cache: enabled
      01:50:14,750 INFO [SettingsFactory] Query cache: disabled
      01:50:14,751 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
      01:50:14,752 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
      01:50:14,752 INFO [SettingsFactory] Structured second-level cache entries: disabled
      01:50:14,759 INFO [SettingsFactory] Statistics: disabled
      01:50:14,759 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
      01:50:14,760 INFO [SettingsFactory] Default entity-mode: pojo
      01:50:14,808 INFO [SessionFactoryImpl] building session factory
      01:50:15,201 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
      01:50:15,206 INFO [SchemaUpdate] Running hbm2ddl schema update
      01:50:15,206 INFO [SchemaUpdate] fetching database metadata
      01:50:15,209 INFO [SchemaUpdate] updating schema
      01:50:15,300 INFO [TableMetadata] table found: itMail.USERS
      01:50:15,300 INFO [TableMetadata] columns: [id, first_name, last_name]
      01:50:15,300 INFO [TableMetadata] foreign keys: []
      01:50:15,300 INFO [TableMetadata] indexes: [primary]
      01:50:15,307 INFO [SchemaUpdate] schema update complete
      01:50:15,314 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      01:50:15,867 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=itMail-0.1.0-SNAPSHOT.ear,jar=itMail-core-0.1.0-SNAPSHOT.jar,name=UserActionBean,service=EJB3 with dependencies:
      01:50:15,867 INFO [JmxKernelAbstraction] persistence.units:ear=itMail-0.1.0-SNAPSHOT.ear,jar=itMail-core-0.1.0-SNAPSHOT.jar,unitName=itMail
      01:50:15,867 INFO [JmxKernelAbstraction] jboss.j2ee:ear=itMail-0.1.0-SNAPSHOT.ear,jar=itMail-core-0.1.0-SNAPSHOT.jar,name=UserDao,service=EJB3
      01:50:15,869 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=itMail-0.1.0-SNAPSHOT.ear,jar=itMail-core-0.1.0-SNAPSHOT.jar,name=UserDao,service=EJB3 with dependencies:
      01:50:15,869 INFO [JmxKernelAbstraction] persistence.units:ear=itMail-0.1.0-SNAPSHOT.ear,jar=itMail-core-0.1.0-SNAPSHOT.jar,unitName=itMail
      01:50:16,144 INFO [EJBContainer] STARTED EJB: org.it.itMail.domain.UserDaoImpl ejbName: UserDao
      01:50:16,211 INFO [EJBContainer] STARTED EJB: org.it.itMail.service.UserActionBean ejbName: UserActionBean
      01:50:16,256 INFO [SimpleStatefulCache] Initializing SimpleStatefulCache with maxSize: 100000 timeout: 300 for jboss.j2ee:ear=itMail-0.1.0-SNAPSHOT.ear,jar=itMail-core-0.1.0-SNAPSHOT.jar,name=UserActionBean,service=EJB3
      01:50:16,259 INFO [EJB3Deployer] Deployed: file:/home/jee/jboss-4.0.5.GA/server/default/deploy/itMail-0.1.0-SNAPSHOT.ear/itMail-core-0.1.0-SNAPSHOT.jar
      01:50:16,261 INFO [TomcatDeployer] deploy, ctxPath=/itMail, warUrl=.../tmp/deploy/tmp46547itMail-web-0.1.0-SNAPSHOT-exp.war/
      -------------------------------------------
      When SEAM deploy this components:
      -------------------------------
      ...
      1:50:18,911 INFO [Component] Component: user, scope: EVENT, type: ENTITY_BEAN, class: org.it.itMail.domain.User
      01:50:18,917 INFO [Component] Component: userAction, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: org.it.itMail.service.UserActionBean, JNDI: itMail-0.1.0-SNAPSHOT/UserActionBean/local
      01:50:18,933 INFO [Lifecycle] starting up: org.jboss.seam.servlet.multipartFilter
      01:50:18,934 INFO [Lifecycle] starting up: org.jboss.seam.servlet.exceptionFilter
      01:50:18,937 INFO [Lifecycle] starting up: org.jboss.seam.ui.graphicImage.dynamicImageResource
      01:50:18,938 INFO [Lifecycle] starting up: org.jboss.seam.servlet.redirectFilter
      01:50:18,938 INFO [Lifecycle] starting up: org.jboss.seam.ui.resource.webResource
      01:50:18,942 INFO [Initialization] done initializing Seam
      01:50
      -------------------------------
      When all deployed OK. But when I get page from browser, show this error:
      -----------------------------------
      1:50:20,319 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 26s:453ms
      01:50:46,851 INFO [ServletCacheAdministrator] Created new instance of ServletCacheAdministrator
      01:50:46,852 INFO [ServletCacheAdministrator] Created new application-scoped cache at key: __oscache_cache
      01:50:46,933 ERROR [STDERR] 29.03.2007 1:50:46 com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
      INFO: JSF1027: [it-mail] The ELResolvers for JSF were not registered with the JSP container.
      01:50:46,967 INFO [Lifecycle] starting up: org.jboss.seam.security.identity
      01:50:47,400 ERROR [SeamPhaseListener] uncaught exception
      java.lang.IllegalArgumentException: value of context variable is not an instance of the component bound to the context variable: userAction
      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.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
      at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
      at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
      at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
      at org.jboss.seam.pages.Page.enter(Page.java:229)
      at org.jboss.seam.core.Pages.enterPage(Pages.java:276)
      at org.jboss.seam.jsf.AbstractSeamPhaseListener.enterPage(AbstractSeamPhaseListener.java:276)
      at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:214)
      at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:56)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      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)

      -----------------------------------
      So, SEAM don't can find properly deployed session bean!!!
      What I do wrong ?
      Very wait answer....




        • 1. Re: SEAM don't can find session bean !!
          Eugene Batogov Newbie

          Do really nobody know how resolve this trouble ?

          • 2. Re: SEAM don't can find session bean !!
            Wayne Bagguley Newbie

            do you have seam.properties in the right place?

            • 3. Re: SEAM don't can find session bean !!
              Shane Bryzak Master

              Post the code for your session bean.

              • 4. Re: SEAM don't can find session bean !!
                Eugene Batogov Newbie

                waynebagguley: Yes, I put seam.properties (size: 0 b)
                in root ejb.jar

                This is parent class for session bean:
                ----------
                package org.it.itMail.service;

                /**
                * Autogenerated EJB session bean base class UserActionBean.
                *
                *
                */
                @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
                @javax.ejb.Remote({org.it.itMail.service.UserActionRemote.class})
                public abstract class UserActionBase
                implements org.it.itMail.service.UserActionRemote
                {
                // ------ 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;

                // --------- Attribute Definitions ------------

                /**
                * The user property
                */
                protected org.it.itMail.domain.User user;


                // --------------- Constructors ---------------

                public UserActionBase()
                {
                super();
                }

                // ------- Accessors for Attributes ----------


                // ------ 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)
                public org.it.itMail.domain.User getUser(java.lang.Integer id)
                {
                if (id == null)
                {
                throw new IllegalArgumentException(
                "org.it.itMail.service.UserActionBean.getUser(java.lang.Integer id) - 'id' can not be null");
                }
                try
                {
                return this.handleGetUser(id);
                }
                catch (Throwable th)
                {
                throw new org.it.itMail.service.UserActionException(
                "Error performing 'org.it.itMail.service.UserAction.getUser(java.lang.Integer id)' --> " + th,
                th);
                }
                }

                /**
                * Performs the core logic for {@link #getUser(java.lang.Integer)}
                */
                protected abstract org.it.itMail.domain.User handleGetUser(java.lang.Integer id)
                throws java.lang.Exception;

                /**
                *
                */
                @javax.ejb.TransactionAttribute(javax.ejb.TransactionAttributeType.REQUIRED)
                public void getUsers()
                {
                try
                {
                this.handleGetUsers();
                }
                catch (Throwable th)
                {
                throw new org.it.itMail.service.UserActionException(
                "Error performing 'org.it.itMail.service.UserAction.getUsers()' --> " + th,
                th);
                }
                }

                /**
                * Performs the core logic for {@link #getUsers()}
                */
                protected abstract void handleGetUsers()
                throws java.lang.Exception;


                // -------- Lifecycle Callbacks --------------

                }------------------
                This is session bean, which seam don't can find:
                -----------------------------------

                package org.it.itMail.service;

                import java.util.List;

                import javax.ejb.Remove;
                import javax.ejb.Stateful;

                import org.it.itMail.domain.*;
                import org.jboss.annotation.ejb.LocalBinding;
                import org.jboss.seam.annotations.Destroy;
                import org.jboss.seam.annotations.Name;
                import org.jboss.seam.annotations.Scope;
                import org.jboss.seam.annotations.datamodel.DataModel;

                /**
                * @see org.it.itMail.service.UserActionBean
                */
                /**
                * Do not specify the javax.ejb.Stateful annotation
                * Instead, define the session bean in the ejb-jar.xml descriptor
                * @javax.ejb.Stateful
                */
                /**
                * Uncomment to enable webservices for UserActionBean
                *@javax.jws.WebService(endpointInterface = "org.it.itMail.service.UserActionWSInterface")
                */
                @Stateful
                @Name("userAction")

                public class UserActionBean
                extends org.it.itMail.service.UserActionBase
                {
                /**
                *
                */
                private static final long serialVersionUID = 5450987872243833212L;
                @DataModel
                private List < User > userList;
                // --------------- Constructors ---------------

                public UserActionBean()
                {
                super();
                }

                // -------- Business Methods Impl --------------

                /**
                * @see org.it.itMail.service.UserActionBase#getUser(java.lang.Integer)
                */
                protected org.it.itMail.domain.User handleGetUser(java.lang.Integer id)
                throws java.lang.Exception
                {
                //TODO: put your implementation here.
                // Dummy return value, just that the file compiles
                return null;
                }

                /**
                * @see org.it.itMail.service.UserActionBase#getUsers()
                */
                protected void handleGetUsers()
                throws java.lang.Exception
                {
                userList = (List < User >) this.getUserDao().loadAll();

                }


                // -------- Lifecycle Callback Implementation --------------


                // ----------- Destroy Method Implementation -----------


                /**
                * Remove lifecycle method
                */
                @Destroy @Remove
                public void remove() {
                handleDestroy();
                }

                /**
                * @see org.it.itMail.service.UserActionBean#destroy()
                */
                protected void handleDestroy()
                {
                //TODO: put your implementation here
                }
                }
                ------------
                :)
                -----------------------------------

                • 5. Re: SEAM don't can find session bean !!
                  Wayne Bagguley Newbie

                  Don't you need an @Begin somewhere?

                  • 6. Re: SEAM don't can find session bean !!
                    Eugene Batogov Newbie

                    Why I must add @Begin annotation to Session bean, and where I must put it.

                    • 7. Re: SEAM don't can find session bean !!
                      Wayne Bagguley Newbie

                      Try adding @Begin(join=true) to the action method that is getting called

                      • 8. Re: SEAM don't can find session bean !!
                        Shane Bryzak Master

                        Your session bean has no local interface.

                        • 9. Re: SEAM don't can find session bean !!
                          Eugene Batogov Newbie

                          shane.bryzak@jboss.com: My session bean has the local interface:
                          --------------
                          package org.it.itMail.service;

                          /**
                          * Local component interface for the UserActionBean session bean.
                          *
                          */
                          public interface UserActionLocal
                          {

                          // ----------- Accessors For Constants ------------


                          // ------------ Business Methods -----------------

                          /**
                          *
                          */
                          public org.it.itMail.domain.User getUser(java.lang.Integer id);

                          /**
                          *
                          */
                          public void getUsers();


                          // ------------ Lifecycle Methods -----------------

                          public void destroy();
                          }
                          ----------------

                          • 10. Re: SEAM don't can find session bean !!
                            Gavin King Master

                            Then it needs to implement that interface!

                            • 11. Re: SEAM don't can find session bean !!
                              Stuart Robertson Novice

                              Your local interface must be annotated with @Local, right?

                              • 12. Re: SEAM don't can find session bean !!
                                Eugene Batogov Newbie

                                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 ...

                                • 13. Re: SEAM don't can find session bean !!
                                  Stuart Robertson Novice

                                  Again, is your interface annoted with @Local, as required by the spec?

                                  I didn't see it if so. Try adding it, so your interface declaration looks like this:

                                  @Local
                                  public interface UserManagerLocal
                                  {
                                  ...
                                  


                                  You may also have an easier time if you play with seam-gen a bit. Create a new project, add a few actions, and see what the code it creates looks like. Even if you just throw it away afterwards, you may find it helpful (I did).

                                  • 14. Re: SEAM don't can find session bean !!
                                    Eugene Batogov Newbie

                                    I change local interface:
                                    -----------------------------------------
                                    package org.it.itMail.service;

                                    import javax.ejb.*;

                                    /**
                                    * Local component interface for the UserManagerBean session bean.
                                    *
                                    */
                                    @Local
                                    public interface UserManagerLocal
                                    {

                                    // ----------- Accessors For Constants ------------


                                    // ------------ Business Methods -----------------

                                    /**
                                    *
                                    */
                                    public java.util.List loadUsers();

                                    }
                                    -----------------------------------------

                                    But SEAM don't find session bean again !!!
                                    :(((((((((

                                    1 2 Previous Next