2 Replies Latest reply on May 3, 2011 11:27 AM by aagenielsen

    Weld, war and Tomcat

    aagenielsen

      We are using Weld 1.1.0 in a JSF 2.1 applikation and we are struggleing with war files and Tomcat 6.0.32.

       

      Our production environment are currently using "pure" war files and exploded apps are not permitted ! It is true that Weld does not work unless the war files are exploded ? Our own little test show no beans when running the app unexploded, but alle our beans when exploded

       

      .....

          public List<Bean> getJndiBeans() {

              List<Bean> jndiBeans=new ArrayList<Bean>();

              Context initCtx;

              try {

                  initCtx = new InitialContext();

                  Context envCtx = (Context) initCtx.lookup("java:comp/env");

                  BeanManagerImpl bm= (BeanManagerImpl) envCtx.lookup("BeanManager");

                  for (Object bean : Arrays.asList(bm.getBeans().toArray())) {

                      jndiBeans.add((Bean) bean);

                  }

       

              } catch (NamingException e) {

                  // TODO Auto-generated catch block

                  e.printStackTrace();

              }

       

              return jndiBeans;

          }

      ......

      ......

       

                  <rich:dataTable var="bean" value="#{simpleTest.jndiBeans}">

                      <f:facet name="header">

                          <h:column>Name</h:column>

                          <h:column>Scope</h:column>

                      </f:facet>

                      <h:column>

                          <h:outputText value="#{bean.name}" />

                      </h:column>

                      <h:column>

                          <h:outputText value="#{bean.scope.name}" />

                      </h:column>

                  </rich:dataTable>

       

       

      Anyone ?

       

      best regards

      aage

        • 1. Weld, war and Tomcat
          alesj

          This is *JBossAS* forum, not Tomcat. ;-)

          Or are you talking about running your app in JBossAS?

          The archived/unexploded app should work ootb in JBossAS.

          • 2. Weld, war and Tomcat
            aagenielsen

            I know it is a jBoss forum - but Tomcat are embedded in jBoss and you guys are among the "wise" ones....

             

            If theres is no known issues when using jBoss, weld and war - that is a good answer.

             

            thx

            aage