4 Replies Latest reply on Aug 9, 2006 4:28 AM by Pete Muir

    Component Not getting Initialized by Seam

    sateesh kumar Newbie

      Hi All,

      I have a Stateless SessionBean which is not getting initialized by Seam when i depoly the .ear File..

      The SesionBean is

      
      @Name("dpaSliderListener")
      @Stateless
      @Interceptors(SeamInterceptor.class)
      
      public class SliderListener implements ISliderListenerLocal {
      
       public String setValue(String selectedVal){
       return "You selected "+selectedVal;
       }
      
      }
      


      My components.xml is
      <components>
       <component name="org.jboss.seam.core.init">
       <property name="debug">true</property>
       <property name="myFacesLifecycleBug">true</property>
       <property name="jndiPattern">DPA/#{ejbName}/local</property>
       </component>
       <component name="org.jboss.seam.core.manager">
       <property name="conversationTimeout">120000</property>
       </component>
       <component class="org.jboss.seam.core.Ejb" installed="false"/>
      </components>
      


      In my .xhtml file i have the java script as listed below
       <script type="text/javascript" src="seam/remoting/resource/remote.js">
       </script>
       <script type="text/javascript" src="seam/remoting/interface.js?dpaSliderListener">
       </script>
       <script type="text/javascript">
       //<![CDATA[
       function sendData(document.currentSlider.valueX) {
       Seam.Component.getInstance("dpaSliderListener").setValue(document.currentSlider.valueX, setValueForSlider);
       }
       function setValueForSlider(result) {
       alert(result);
       }
      
       // ]]>
       </script>
      


      Here is the Console log
      
       16:37:17,688 INFO [EARDeployer] Init J2EE application: file:/D:/MyServers/JBoss4.0.4P1/server/default/deploy/DPA.ear
      16:37:23,767 WARN [MainDeployer] Found non-jar deployer for jboss-seam.jar: MBeanProxyExt[jboss.ejb3:service=EJB3Deploy
      er]
      16:38:47,039 INFO [Ejb3DescriptorHandler] adding class annotation org.jboss.annotation.internal.DefaultInterceptorMarke
      r to com.lmco.dpa.SliderListener org.jboss.annotation.internal.DefaultInterceptorMarkerImpl@1fc6dc6
      16:38:47,211 INFO [Ejb3Deployment] EJB3 deployment time took: 1031
      16:38:47,289 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=DPA.ear,jar=DPA-ejb.jar,name=SliderListener,s
      ervice=EJB3 with dependencies:
      16:38:47,461 INFO [EJBContainer] STARTED EJB: com.lmco.dpa.SliderListener ejbName: SliderListener
      16:38:47,523 INFO [EJB3Deployer] Deployed: file:/D:/MyServers/JBoss4.0.4P1/server/default/tmp/deploy/tmp46165DPA.ear-co
      ntents/DPA-ejb.jar
      16:38:47,742 INFO [TomcatDeployer] deploy, ctxPath=/DPA-war, warUrl=.../tmp/deploy/tmp46165DPA.ear-contents/DPA-war-exp
      .war/
      16:38:49,242 INFO [FacesConfigurator] Reading standard config org/apache/myfaces/resource/standard-faces-config.xml
      16:38:49,461 INFO [FacesConfigurator] Reading config jar:file:/D:/MyServers/JBoss4.0.4P1/server/default/tmp/deploy/tmp4
      6165DPA.ear-contents/jboss-seam.jar!/META-INF/faces-config.xml
      16:38:49,461 INFO [FacesConfigurator] Reading config jar:file:/D:/MyServers/JBoss4.0.4P1/server/default/tmp/deploy/tmp4
      6165DPA.ear-contents/jboss-seam-ui.jar!/META-INF/faces-config.xml
      16:38:49,477 INFO [FacesConfigurator] Reading config jar:file:/D:/MyServers/JBoss4.0.4P1/server/default/tmp/deploy/tmp4
      6165DPA.ear-contents/jboss-seam-debug.jar!/META-INF/faces-config.xml
      16:38:49,492 INFO [FacesConfigurator] Reading config jar:file:/D:/MyServers/JBoss4.0.4P1/server/default/tmp/deploy/tmp4
      6165DPA.ear-contents/jsf-facelets.jar!/META-INF/faces-config.xml
      16:38:49,492 INFO [FacesConfigurator] Reading config jar:file:/D:/MyServers/JBoss4.0.4P1/server/default/tmp/deploy/tmp4
      6165DPA.ear-contents/DPA-war-exp.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/faces-config.xml
      16:38:49,508 INFO [FacesConfigurator] Reading config jar:file:/D:/MyServers/JBoss4.0.4P1/server/default/tmp/deploy/tmp4
      6165DPA.ear-contents/DPA-war-exp.war/WEB-INF/lib/jboss-seam.jar!/META-INF/faces-config.xml
      16:38:49,524 INFO [FacesConfigurator] Reading config /WEB-INF/faces-config.xml
      16:38:49,758 WARN [LocaleUtils] Locale name in faces-config.xml null or empty, setting locale to default locale : en_US
      
      16:38:50,180 INFO [StartupServletContextListener] ServletContext 'D:\MyServers\JBoss4.0.4P1\server\default\.\tmp\deploy
      \tmp46165DPA.ear-contents\DPA-war-exp.war\' initialized.
      16:38:50,180 INFO [ServletContextListener] Welcome to Seam 1.0.1.GA
      16:38:50,242 INFO [Initialization] no components.xml file found
      16:38:50,242 INFO [Initialization] reading properties from: /jndi.properties
      16:38:50,258 INFO [Initialization] initializing Seam
      16:38:50,399 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jbos
      s.seam.core.Init
      16:38:50,539 INFO [Component] component =Component(org.jboss.seam.core.init) and hashCode =3723432 BeanClass =class org
      .jboss.seam.core.Init getClass =class org.jboss.seam.Component
      16:38:50,539 INFO [Component] result =org.jboss.seam.core.Init@adb3f getClass=org.jboss.seam.core.Init@adb3f hashCod
      e =711487
      16:38:50,539 INFO [Component] Component: org.jboss.seam.core.pages, scope: APPLICATION, type: JAVA_BEAN, class: org.jbo
      ss.seam.core.Pages
      16:38:50,555 INFO [Component] Component: events, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Events
      
      16:38:50,571 INFO [Component] Component: org.jboss.seam.core.manager, scope: EVENT, type: JAVA_BEAN, class: org.jboss.s
      eam.core.Manager
      16:38:50,602 INFO [Component] Component: switcher, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.Switcher
      16:38:50,617 INFO [Component] Component: redirect, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.Red
      irect
      16:38:50,617 INFO [Component] Component: httpError, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Htt
      pError
      16:38:50,633 INFO [Component] Component: userPrincipal, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core
      .UserPrincipal
      16:38:50,649 INFO [Component] Component: isUserInRole, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.
      IsUserInRole
      16:38:50,664 INFO [Component] Component: conversation, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core
      .Conversation
      16:38:50,680 INFO [Component] Component: conversationList, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.Con
      versationList
      16:38:50,680 INFO [Component] Component: conversationStack, scope: PAGE, type: JAVA_BEAN, class: org.jboss.seam.core.Co
      nversationStack
      16:38:50,696 INFO [Component] Component: facesContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.
      FacesContext
      16:38:50,696 INFO [Component] Component: pageContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.P
      ageContext
      16:38:50,711 INFO [Component] Component: eventContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.
      EventContext
      16:38:50,711 INFO [Component] Component: sessionContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.cor
      e.SessionContext
      16:38:50,727 INFO [Component] Component: statelessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.c
      ore.StatelessContext
      16:38:50,727 INFO [Component] Component: applicationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam
      .core.ApplicationContext
      16:38:50,742 INFO [Component] Component: conversationContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.sea
      m.core.ConversationContext
      16:38:50,742 INFO [Component] Component: businessProcessContext, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.
      seam.core.BusinessProcessContext
      16:38:50,805 INFO [Component] Component: locale, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.Locale
      16:38:50,805 INFO [Component] Component: messages, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.Messages
      
      16:38:50,821 INFO [Component] Component: interpolator, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.In
      terpolator
      16:38:50,821 INFO [Component] Component: facesMessages, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.cor
      e.FacesMessages
      16:38:50,836 INFO [Component] Component: resourceBundle, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.Re
      sourceBundle
      16:38:50,867 INFO [Component] Component: localeSelector, scope: SESSION, type: JAVA_BEAN, class: org.jboss.seam.core.Lo
      caleSelector
      16:38:50,883 INFO [Component] Component: uiComponent, scope: STATELESS, type: JAVA_BEAN, class: org.jboss.seam.core.UiC
      omponent
      16:38:50,899 INFO [Component] Component: org.jboss.seam.remoting.messaging.subscriptionRegistry, scope: APPLICATION, ty
      pe: JAVA_BEAN, class: org.jboss.seam.remoting.messaging.SubscriptionRegistry
      16:38:50,914 INFO [Component] Component: pojoCache, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Poj
      oCache
      16:38:51,102 INFO [Component] component =Component(applicationContext) and hashCode =4990595 BeanClass =class org.jboss
      .seam.core.ApplicationContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.ApplicationContext@1748ba4 getClass=org.jboss.seam.core.Ap
      plicationContext@1748ba4 hashCode =24415140
      16:38:51,102 INFO [Component] component =Component(isUserInRole) and hashCode =8116333 BeanClass =class org.jboss.seam.
      core.IsUserInRole getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.IsUserInRole@bdff3b getClass=org.jboss.seam.core.IsUserInR
      ole@bdff3b hashCode =12451643
      16:38:51,102 INFO [Component] component =Component(statelessContext) and hashCode =907329 BeanClass =class org.jboss.se
      am.core.StatelessContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.StatelessContext@f09995 getClass=org.jboss.seam.core.State
      lessContext@f09995 hashCode =15767957
      16:38:51,102 INFO [Component] component =Component(userPrincipal) and hashCode =10135900 BeanClass =class org.jboss.sea
      m.core.UserPrincipal getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.UserPrincipal@1e4d960 getClass=org.jboss.seam.core.UserPri
      ncipal@1e4d960 hashCode =31775072
      16:38:51,102 INFO [Component] component =Component(sessionContext) and hashCode =24859001 BeanClass =class org.jboss.se
      am.core.SessionContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.SessionContext@121f956 getClass=org.jboss.seam.core.Sessio
      nContext@121f956 hashCode =19003734
      16:38:51,102 INFO [Component] component =Component(facesContext) and hashCode =24686841 BeanClass =class org.jboss.seam
      .core.FacesContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.FacesContext@aab87f getClass=org.jboss.seam.core.FacesCont
      ext@aab87f hashCode =11188351
      16:38:51,102 INFO [Component] component =Component(businessProcessContext) and hashCode =3587082 BeanClass =class org.j
      boss.seam.core.BusinessProcessContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.BusinessProcessContext@17360be getClass=org.jboss.seam.cor
      e.BusinessProcessContext@17360be hashCode =24338622
      16:38:51,102 INFO [Component] component =Component(eventContext) and hashCode =30698528 BeanClass =class org.jboss.seam
      .core.EventContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.EventContext@106e02e getClass=org.jboss.seam.core.EventCon
      text@106e02e hashCode =17227822
      16:38:51,102 INFO [Component] component =Component(pageContext) and hashCode =6819952 BeanClass =class org.jboss.seam.c
      ore.PageContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.PageContext@f3387 getClass=org.jboss.seam.core.PageContext
      @f3387 hashCode =996231
      16:38:51,102 INFO [Component] component =Component(conversationContext) and hashCode =735 BeanClass =class org.jboss.se
      am.core.ConversationContext getClass =class org.jboss.seam.Component
      16:38:51,102 INFO [Component] result =org.jboss.seam.core.ConversationContext@bc839a getClass=org.jboss.seam.core.Co
      nversationContext@bc839a hashCode =12354458
       16:38:51,117 INFO [Initialization] done initializing Seam
      16:38:51,196 INFO [EARDeployer] Started J2EE application: file:/D:/MyServers/JBoss4.0.4P1/server/default/deploy/DPA.ear
      



      How ever in my .xhtml page when i view the source i don't see the dpaSliderListener.js File and hence it is giving a JavaScript Error ..

      I don't see any Error in the server console..

      I see the stateless session bean in my JNDI View..

       Global JNDI Namespace
      
       +- XAConnectionFactory (class: org.jboss.mq.SpyXAConnectionFactory)
       +- DPA (class: org.jnp.interfaces.NamingContext)
       | +- SliderListener (class: org.jnp.interfaces.NamingContext)
       | | +- local (proxy: $Proxy62 implements interface com.lmco.dpa.ISliderListenerLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject)
       +- TopicConnectionFactory (class: org.jboss.naming.LinkRefPair)
      



      Thanks
      Sateesh

        • 1. Re: Component Not getting Initialized by Seam
          Pete Muir Master

          Do you have a seam.properties in your ejb-jar?

          • 2. Re: Component Not getting Initialized by Seam
            sateesh kumar Newbie

            Yes,

            I don have empty seam.properties file in my ejb-jar..

            Sateesh

            • 3. Re: Component Not getting Initialized by Seam
              sateesh kumar Newbie

               

              "klsateesh" wrote:
              Yes,

              I DO have empty seam.properties file in my ejb-jar..

              Sorry it was a Typo. I have the empty seam.properties and still i am having the issue of component not getting initialized..!!

              Sateesh


              • 4. Re: Component Not getting Initialized by Seam
                Pete Muir Master

                I think something is wrong with it, if it was being read it say that it's reading seam.properties:

                09:28:59,415 INFO [TomcatDeployer] deploy, ctxPath=/seam-selectitems, warUrl=.../tmp/deploy/tmp43353jboss-seam-selectitems.ear-contents/jboss-seam-selectitems-exp.war/
                09:28:59,521 INFO [ServletContextListener] Welcome to Seam 1.0.1.GA
                09:28:59,521 INFO [Initialization] reading components.xml
                09:28:59,545 INFO [Initialization] reading properties from: /seam.properties
                09:28:59,545 INFO [Initialization] reading properties from: /jndi.properties
                09:28:59,546 INFO [Initialization] initializing Seam
                ...
                09:29:00,496 INFO [Scanner] scanning: /home/pmuir/jboss-4.0.4.GA/server/default/tmp/deploy/tmp43353jboss-seam-selectitems.ear-contents/jboss-seam-selectitems.jar
                09:29:00,506 INFO [Component] Component: clientType, scope: CONVERSATION, type: ENTITY_BEAN, class: org.jboss.seam.example.selectitems.ClientType
                09:29:00,507 INFO [Component] Component: branch, scope: CONVERSATION, type: ENTITY_BEAN, class: org.jboss.seam.example.selectitems.Branch
                09:29:00,508 INFO [Component] Component: mailerExample, scope: EVENT, type: JAVA_BEAN, class: org.jboss.seam.example.mailer.MailerExample
                09:29:00,518 INFO [Component] Component: client, scope: CONVERSATION, type: ENTITY_BEAN, class: org.jboss.seam.example.selectitems.Client
                09:29:00,523 INFO [Component] Component: clientAction, scope: CONVERSATION, type: STATEFUL_SESSION_BEAN, class: org.jboss.seam.example.selectitems.ClientActionBean, JNDI: jboss-seam-selectitems/ClientActionBean/local
                09:29:00,541 INFO [Initialization] done initializing Seam