3 Replies Latest reply on Jan 22, 2007 1:15 AM by mnrz

    why Seam doesnt know my session beans in Tomcat?

    mnrz

      Hi

      Seam version:1.1.0 GA
      Tomcat: 5.5

      my application is deploying in tomcat with no exception but the Seam doesnt know my session beans.
      I checked every line of all config files and there is nothing incorrect.
      the Tomcat's console displays that it only understands datasource defined in persistence.xml

      here is components.xml:

      <components>
      
       <!-- 120 second conversation timeout -->
       <component name="org.jboss.seam.core.manager">
       <property name="conversationTimeout">120000</property>
       </component>
      
       <component class="org.jboss.seam.core.Ejb" installed="true" />
       <component name="org.jboss.seam.core.init">
       <property name="debug">true</property>
       <property name="myFacesLifecycleBug">false</property>
       <!-- JNDI name pattern for JBoss EJB 3.0 -->
       <property name="jndiPattern">#{ejbName}/local</property>
       </component>
      
      </components>
      


      faces-config.xml
      <faces-config>
      
       <!-- Phase listener needed for all Seam applications -->
      
       <lifecycle>
       <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
       </lifecycle>
      
      </faces-config>
      
      


      web.xml:
       <listener>
       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
      
       <!-- Propagate conversations across redirects -->
       <filter>
       <filter-name>Seam Redirect Filter</filter-name>
       <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
       </filter>
      
       <filter-mapping>
       <filter-name>Seam Redirect Filter</filter-name>
       <url-pattern>*.seam</url-pattern>
       </filter-mapping>
      
       <!-- JSF -->
      
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       </context-param>
      
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
      
       <context-param>
       <param-name>facelets.DEVELOPMENT</param-name>
       <param-value>true</param-value>
       </context-param>
      
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet>
      
       <!-- Faces Servlet Mapping -->
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.seam</url-pattern>
       </servlet-mapping>
      
       <!-- MyFaces -->
       <listener>
       <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
       </listener>
      
       <!-- JSF RI -->
       <!--
       <listener>
       <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
       </listener>
       -->
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       </welcome-file-list>
      
      


      session bean:
      @Stateful
      @Scope(ScopeType.SESSION)
      @Name("indexSearch")
      public class IndexSearchAction implements IndexSearch {
      
       private Log log;
      //rest of code...
      
      }
      


      thanks so much

        • 1. Re: why Seam doesnt know my session beans in Tomcat?
          gavin.king

          So you have a seam.properties file?

          Post the startup log.

          • 2. Re: why Seam doesnt know my session beans in Tomcat?
            mnrz

            no, there is no seam.properties

            here is the startup log:

            INFO: XML validation disabled
            INFO 21-01 08:33:23,734 (FacesConfigurator.java:feedStandardConfig:151) -Reading standard config org/apache/myfaces/resource/standard-faces-config.xml
            INFO 21-01 08:33:24,531 (FacesConfigurator.java:feedClassloaderConfigurations:250) -Reading config jar:file:/E:/jakarta-tomcat-5.5.9/webapps/searchengine/WEB-INF/lib/jboss-seam-debug.jar!/META-INF/faces-config.
            INFO 21-01 08:33:24,546 (FacesConfigurator.java:feedClassloaderConfigurations:250) -Reading config jar:file:/E:/jakarta-tomcat-5.5.9/webapps/searchengine/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/faces-config.xml
            INFO 21-01 08:33:24,609 (FacesConfigurator.java:feedClassloaderConfigurations:250) -Reading config jar:file:/E:/jakarta-tomcat-5.5.9/webapps/searchengine/WEB-INF/lib/jboss-seam.jar!/META-INF/faces-config.xml
            INFO 21-01 08:33:24,640 (FacesConfigurator.java:feedClassloaderConfigurations:250) -Reading config jar:file:/E:/jakarta-tomcat-5.5.9/webapps/searchengine/WEB-INF/lib/jsf-facelets.jar!/META-INF/faces-config.xml
            INFO 21-01 08:33:24,671 (FacesConfigurator.java:feedWebAppConfig:411) -Reading config /WEB-INF/faces-config.xml
            INFO 21-01 08:33:25,296 (StartupServletContextListener.java:initFaces:99) -ServletContext 'E:\jakarta-tomcat-5.5.9\webapps\searchengine\' initialized.
            INFO 21-01 08:33:25,312 (StartupServletContextListener.java:handleSerialFactory:140) -Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory
            INFO 21-01 08:33:25,312 (SeamListener.java:contextInitialized:31) -Welcome to Seam 1.1.0.GA
            INFO 21-01 08:33:25,375 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/core, package: org.jboss.seam.core, prefix: org.jboss.seam.core
            INFO 21-01 08:33:25,390 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/framework, package: org.jboss.seam.framework, prefix: org.jboss.seam.core.framework
            INFO 21-01 08:33:25,390 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/jms, package: org.jboss.seam.jms, prefix: org.jboss.seam.jms
            INFO 21-01 08:33:25,406 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/drools, package: org.jboss.seam.drools, prefix: org.jboss.seam.drools
            INFO 21-01 08:33:25,406 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/remoting, package: org.jboss.seam.remoting, prefix: org.jboss.seam.remoting
            INFO 21-01 08:33:25,421 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/theme, package: org.jboss.seam.theme, prefix: org.jboss.seam.theme
            INFO 21-01 08:33:25,437 (Scanner.java:scan:86) -scanning: /E:/jakarta-tomcat-5.5.9/webapps/searchengine/WEB-INF/lib/jboss-seam.jar
            INFO 21-01 08:33:25,453 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/drools, package: org.jboss.seam.drools, prefix: org.jboss.seam.drools
            INFO 21-01 08:33:25,453 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/remoting, package: org.jboss.seam.remoting, prefix: org.jboss.seam.remoting
            INFO 21-01 08:33:25,453 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/theme, package: org.jboss.seam.theme, prefix: org.jboss.seam.theme
            INFO 21-01 08:33:25,453 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/core, package: org.jboss.seam.core, prefix: org.jboss.seam.core
            INFO 21-01 08:33:25,453 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/jms, package: org.jboss.seam.jms, prefix: org.jboss.seam.jms
            INFO 21-01 08:33:25,453 (Initialization.java:addNamespace:530) -Namespace: http://jboss.com/products/seam/framework, package: org.jboss.seam.framework, prefix: org.jboss.seam.core.framework
            INFO 21-01 08:33:25,468 (Initialization.java:initComponentsFromXmlDocument:126) -reading /WEB-INF/components.xml
            INFO 21-01 08:33:25,750 (Initialization.java:initComponentsFromXmlDocuments:106) -reading jar:file:/E:/jakarta-tomcat-5.5.9/webapps/searchengine/WEB-INF/lib/jboss-seam.jar!/META-INF/components.xml
            INFO 21-01 08:33:25,796 (Initialization.java:loadFromResource:591) -reading properties from: /jndi.properties
            INFO 21-01 08:33:25,812 (Initialization.java:init:425) -initializing Seam
            INFO 21-01 08:33:25,812 (Scanner.java:scan:86) -scanning: /E:/jakarta-tomcat-5.5.9/webapps/searchengine/WEB-INF/lib/jboss-seam.jar
            INFO 21-01 08:33:27,968 (Component.java:<init>:245) -Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
            INFO 21-01 08:33:28,125 (Initialization.java:addComponents:664) -Installing components...
            INFO 21-01 08:33:28,125 (Component.java:<init>:245) -Component: org.jboss.seam.core.applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ApplicationContext
            INFO 21-01 08:33:28,125 (Component.java:<init>:245) -Component: org.jboss.seam.core.exceptions, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Exceptions
            INFO 21-01 08:33:28,140 (Component.java:<init>:245) -Component: org.jboss.seam.core.conversationStack, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationStack
            INFO 21-01 08:33:28,140 (Component.java:<init>:245) -Component: org.jboss.seam.remoting.messaging.subscriptionRegistry, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.remoting.messaging.Subscription
            INFO 21-01 08:33:28,156 (Component.java:<init>:245) -Component: org.jboss.seam.core.isUserInRole, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.IsUserInRole
            INFO 21-01 08:33:28,156 (Component.java:<init>:245) -Component: org.jboss.seam.core.redirect, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Redirect
            INFO 21-01 08:33:28,156 (Component.java:<init>:245) -Component: org.jboss.seam.debug.contexts, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.debug.Contexts
            INFO 21-01 08:33:28,359 (Component.java:<init>:245) -Component: org.jboss.seam.framework.currentDatetime, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.framework.CurrentDatetime
            INFO 21-01 08:33:28,375 (Component.java:<init>:245) -Component: org.jboss.seam.core.switcher, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.Switcher
            INFO 21-01 08:33:28,375 (Component.java:<init>:245) -Component: org.jboss.seam.core.conversation, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Conversation
            INFO 21-01 08:33:28,390 (Component.java:<init>:245) -Component: org.jboss.seam.framework.currentDate, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.framework.CurrentDate
            INFO 21-01 08:33:28,390 (Component.java:<init>:245) -Component: org.jboss.seam.theme.themeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.theme.ThemeSelector
            INFO 21-01 08:33:28,390 (Component.java:<init>:245) -Component: org.jboss.seam.core.facesMessages, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesMessages
            INFO 21-01 08:33:28,406 (Component.java:<init>:245) -Component: org.jboss.seam.core.persistenceContexts, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.PersistenceContexts
            INFO 21-01 08:33:28,406 (Component.java:<init>:245) -Component: org.jboss.seam.core.safeActions, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.SafeActions
            INFO 21-01 08:33:28,406 (Component.java:<init>:245) -Component: org.jboss.seam.core.validation, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Validation
            INFO 21-01 08:33:28,421 (Component.java:<init>:245) -Component: org.jboss.seam.core.businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.BusinessProcessContext
            INFO 21-01 08:33:28,421 (Component.java:<init>:245) -Component: org.jboss.seam.core.sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.SessionContext
            INFO 21-01 08:33:28,421 (Component.java:<init>:245) -Component: org.jboss.seam.core.messages, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.Messages
            INFO 21-01 08:33:28,421 (Component.java:<init>:245) -Component: org.jboss.seam.core.conversationList, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationList
            INFO 21-01 08:33:28,437 (Component.java:<init>:245) -Component: org.jboss.seam.core.facesPage, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.FacesPage
            INFO 21-01 08:33:28,437 (Component.java:<init>:245) -Component: org.jboss.seam.core.conversationEntries, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationEntries
            INFO 21-01 08:33:28,453 (Component.java:<init>:245) -Component: org.jboss.seam.debug.introspector, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.debug.Introspector
            INFO 21-01 08:33:28,468 (Component.java:<init>:245) -Component: org.jboss.seam.core.pages, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Pages
            INFO 21-01 08:33:28,468 (Component.java:<init>:245) -Component: org.jboss.seam.theme.theme, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.theme.Theme
            INFO 21-01 08:33:28,484 (Component.java:<init>:245) -Component: org.jboss.seam.core.resourceBundle, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.ResourceBundle
            INFO 21-01 08:33:28,484 (Component.java:<init>:245) -Component: org.jboss.seam.core.localeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.LocaleSelector
            INFO 21-01 08:33:28,500 (Component.java:<init>:245) -Component: org.jboss.seam.remoting.remotingConfig, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.remoting.RemotingConfig
            INFO 21-01 08:33:28,500 (Component.java:<init>:245) -Component: org.jboss.seam.core.httpError, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.HttpError
            INFO 21-01 08:33:28,500 (Component.java:<init>:245) -Component: org.jboss.seam.core.facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.FacesContext
            INFO 21-01 08:33:28,500 (Component.java:<init>:245) -Component: org.jboss.seam.core.uiComponent, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.UiComponent
            INFO 21-01 08:33:28,515 (Component.java:<init>:245) -Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.core.Manager
            INFO 21-01 08:33:28,515 (Component.java:<init>:245) -Component: org.jboss.seam.core.events, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Events
            INFO 21-01 08:33:28,515 (Component.java:<init>:245) -Component: org.jboss.seam.core.userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.UserPrincipal
            INFO 21-01 08:33:28,531 (Component.java:<init>:245) -Component: org.jboss.seam.core.interpolator, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Interpolator
            INFO 21-01 08:33:28,531 (Component.java:<init>:245) -Component: org.jboss.seam.core.locale, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Locale
            INFO 21-01 08:33:28,531 (Component.java:<init>:245) -Component: org.jboss.seam.core.ejb, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Ejb
            INFO 21-01 08:33:28,546 (Component.java:<init>:245) -Component: org.jboss.seam.core.eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.EventContext
            INFO 21-01 08:33:28,546 (Component.java:<init>:245) -Component: org.jboss.seam.core.pageContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PageContext
            INFO 21-01 08:33:28,546 (Component.java:<init>:245) -Component: org.jboss.seam.core.conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.ConversationContext
            INFO 21-01 08:33:28,546 (Component.java:<init>:245) -Component: org.jboss.seam.framework.currentTime, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.framework.CurrentTime
            INFO 21-01 08:33:28,562 (Component.java:<init>:245) -Component: org.jboss.seam.core.expressions, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Expressions
            INFO 21-01 08:33:28,562 (Component.java:<init>:245) -Component: org.jboss.seam.core.pojoCache, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.PojoCache
            INFO 21-01 08:33:28,578 (Lifecycle.java:startup:151) -starting up: org.jboss.seam.core.ejb
            INFO 21-01 08:33:28,578 (Ejb.java:startup:41) -starting the embedded EJB container
            WARN 21-01 08:33:29,500 (BeanSchemaBinding.java:init:227) -You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
            INFO 21-01 08:33:30,343 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/DefaultDS'
            INFO 21-01 08:33:31,281 (LocalTxDataSource.java:bindConnectionFactory:117) -Bound datasource to JNDI name 'java:/dvdDatasource'
            INFO 21-01 08:33:32,281 (Ejb3Deployment.java:create:467) -EJB3 deployment time took: 953
            INFO 21-01 08:33:32,671 (MCKernelAbstraction.java:install:84) -installing bean: jboss.j2ee:jar=jboss-seam,name=Dispatcher,service=EJB3 with dependencies:
            INFO 21-01 08:33:33,125 (EJBContainer.java:start:553) -STARTED EJB: org.jboss.seam.core.Dispatcher ejbName: Dispatcher
            INFO 21-01 08:33:33,187 (Initialization.java:init:431) -done initializing Seam
            Jan 21, 2007 8:33:34 AM org.apache.coyote.http11.Http11Protocol start
            INFO: Starting Coyote HTTP/1.1 on http-8080
            Jan 21, 2007 8:33:34 AM org.apache.jk.common.ChannelSocket init
            INFO: JK: ajp13 listening on /0.0.0.0:8009
            Jan 21, 2007 8:33:34 AM org.apache.jk.server.JkMain start
            INFO: Jk running ID=0 time=0/78 config=null
            Jan 21, 2007 8:33:34 AM org.apache.catalina.storeconfig.StoreLoader load
            INFO: Find registry server-registry.xml at classpath resource
            Jan 21, 2007 8:33:34 AM org.apache.catalina.startup.Catalina start
            INFO: Server startup in 17578 ms
            


            I thought it is the problem of persistence.xml so I put the one for dvdStore as you see it knows the persistence.xml file because it logs the jndiName for that but there is no track of my session bean. it doesnt know it as a seam component.
            there is no special code for my session bean for now.
            this is a big project I am responsible for it and I should start it up very soon.

            Thanks Gavin.

            • 3. Re: why Seam doesnt know my session beans in Tomcat?
              mnrz

              finally I could resolve the problem but it was very strange to me!
              I have nothing in seam.properties and it is empty, It didnt work just because of missing that file.

              lots of thanks