7 Replies Latest reply on Nov 11, 2008 7:40 PM by chris.simons

    Problem runing Seam + OC4J 10.1.3.1

    ricardoalonso

      Hi guys,


      I'm new in Seam world, but already work with faces, ajax and ejb. I trying to run a Seam app in OC4J 10g. I've already run a simple page, but when I try to run a page with a data table, the table isn't rendered. The ejb runs ok and get the data from the db, but looks like it doesn't expose the collection, with @DataModel annotation.


      The other problem is that it doen't inject the logger, annotated with @Logger.


      Any help will be welcome.


      Thanks.

        • 1. Re: Problem runing Seam + OC4J 10.1.3.1
          jbalunas.jbalunas.jboss.org

          Have you looked in the reference guide chapter on OC4j?

          • 2. Re: Problem runing Seam + OC4J 10.1.3.1
            ricardoalonso

            Hi Jay,


            I flowed exactly this instructions. The hello world words, but the data table doesn't.


            This is my Ejb class:



            @Stateless
            @Name("gerente")
            @Scope(ScopeType.SESSION)
            public class Gerente implements Serializable, GerenteLocal{
                 
                 @PersistenceContext
                 protected EntityManager manager;
                 
                 @Logger
                 Log log;
                 
                 @DataModel("pessoas")
                 protected List<PessoaEntity> pessoas;
            
                 public void findPessoas(){
                      System.out.println("Buscando pessoas...");
                      pessoas = manager.createQuery("from PessoaEntity").getResultList();
                      System.out.println("Pessoas achadas: " + pessoas.size());
                 }



            and this the dataTable:


                      <h:dataTable var="_p" value="#{pessoas}">
                           <h:column>
                                <f:facet name="header">ID</f:facet>
                                #{_p.id}
                           </h:column>
                           <h:column>
                                <f:facet name="header">Nome</f:facet>
                                #{_p.nome}
                           </h:column>
                      </h:dataTable>
            



            If I call the page in browser, i can see only the header. In JBoss it works.


            I also called the debug.seam page and can see the gerente instance em session context, but not see pessoas instance.


            Any idea?

            • 3. Re: Problem runing Seam + OC4J 10.1.3.1
              ricardoalonso

              The action

              findPessoas()

              is execute with sucess and print the correct number in output.


              And, as i said in first post, the logger isn't inject.

              • 4. Re: Problem runing Seam + OC4J 10.1.3.1
                ricardoalonso

                the solution i found is just not use EJB 3.0, just JavaBeans.
                If anyone knows how to solve the problem runing EJB 3.0 in OC4J with seam, i appreciate to know.


                Thanks

                • 5. Re: Problem runing Seam + OC4J 10.1.3.1

                  Just my two cents...


                  I struggled with Seam and OC4J (10.1.3) for such a long time until I finally gave up.  Just getting things to deploy properly was one thing; but even after that point, it was a never ending laundry list of errors and issues that I had to work through to resolve.  Oracle support was absolutely NO help (this was even before they released WebLogic, go figure) and they were unable to assist me on, what was in hindsight, some very simple stuff.  If you have to in any way deploy Seam to OC4J in a production environment I hope you will look closely at your alternatives (including application server alternatives).  If you're not using EJB 3 (which, if you're not - you're missing out on a huge advantage of using Seam) then you'll be better off.

                  • 6. Re: Problem runing Seam + OC4J 10.1.3.1
                    jbalunas.jbalunas.jboss.org

                    Hello,


                    Many of the issues that I have run into with Seam on OC4J appeared to be oddities or requirements of OC4J, and not issues specifically with Seam.  I understand your pain, and wish these items were easier to avoid. 


                    Unfortunately at this point the OC4J reference guide chapter is not a priority for updating, especially since BEA was acquired by Oracle.  The WebLogic chapter was just updated for the Seam 2.1.0.SP1 release and is up to date.


                    Regards,
                    Jay

                    • 7. Re: Problem runing Seam + OC4J 10.1.3.1

                      Jay,


                      I agree and I should have prefaced my message with a similar note.


                      OC4J is notoriously odd in the way it handles classloading and EJB3 support was more or less an afterthought.  It's a difficult app. server to work with no matter what framework you use.


                      I agree wholeheartedly that it is not a Seam problem and the latest entrance of Oracle's WebLogic platform (which we are moving towards) more or less nullifies OC4J.  In fact, it simply will not be supported any longer.  I do not recommend using it at all.  Go WebLogic if you have to use Oracle. :)