0 Replies Latest reply on Nov 5, 2008 10:08 PM by Coen Damen

    Backing bean not picked up by Seam during startup

    Coen Damen Novice

      Hi,


      I am new to Seam, I am having a problem to get Seam pickup a backing bean in the WAR project. The backing bean is in src/main/java/some.package


      This is the code.


      @Stateless
      @Name("distributorBacking")
      public class DistributorBacking {
      
              CalculatorRemote calculator;
      
              public String getTekst() {
      
                      try {
                              Properties properties = new Properties();
                              properties.put("java.naming.factory.initial",
                                              "org.jnp.interfaces.NamingContextFactory");
                              properties.put("java.naming.factory.url.pkgs",
                                              "org.jboss.naming:org.jnp.interfaces");
                              properties.put("java.naming.provider.url", "jnp://localhost:1099");
                              Context ctx = new InitialContext(properties);
      
                              calculator = (CalculatorRemote) ctx
                                              .lookup("umbrella/CalculatorImpl/remote");
                      } catch (NamingException e) {
                              // TODO Auto-generated catch block
                              e.printStackTrace();
                      }
      
                      return calculator.getOk();
              }
      }
      
      



      The following text should be shown in the jsf page:


      <li>The value of the value is 
          <h:outputText value="#{distributorBacking.tekst}"></h:outputText></li>
      



      I have a distributed environment, so one Webserver (JBoss 4.2.2) and one (AppServer JBoss 4.2.3) but I am still working only on the 4.2.2. So the lookup is just for testing.


      The issue is that if I put the managed-bean in the faces-config.xml, everything works fine. But in Seam I shouldn't have to do that.


      So, why is the backing-bean not picked up at startup time? I see in the JBoss logs that it creates components for all beans, but not this one. Perhaps the location of the bean is invalid??



      Hope anyone knows the issue, thanks,
      Coenos