7 Replies Latest reply on Apr 2, 2007 12:59 PM by mgrouch

    Seam application displays no data from DB

    mgrouch Expert

      My Seam JPA application displays no data from DB running in WebLogic. No exceptions in a log. All forms are rendered in browser but no data rows are coming from DB. Same application works fine in JBoss. I have datasource configured in weblogic (it is same that used by other apps with no problems).
      I suspect there is something wrong with wiring with entity manager.
      Any hints? Thanks

        • 1. Re: Seam application displays no data from DB
          Joshua Jackson Master

          I suspect you wrote the <h:dataTable> incorrectly :)
          Show it to us here

          • 2. Re: Seam application displays no data from DB
            mgrouch Expert

            It works on JBoss, but not on weblogic. All *.xhtml pages are generated by
            seamGen

            • 3. Re: Seam application displays no data from DB
              Stuart Robertson Novice

              I think you'll need to post some more info for this. In JBoss, how is your DS configured? How is it configured in WebLogic? Can you do a test to verify your DS is functional within WebLogic, and that it contains the data you expect?

              • 4. Re: Seam application displays no data from DB
                mgrouch Expert

                Seam application displays no data from DB.

                My DB DataSource is working fine in Weblogic (it is used by other apps with no problems).

                The problem is somewhere between seam and hibernate entity manager

                My persistence.xml

                
                <?xml version="1.0" encoding="UTF-8"?>
                <!-- Persistence deployment descriptor for dev profile -->
                <persistence xmlns="http://java.sun.com/xml/ns/persistence"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
                 version="1.0">
                
                 <!-- JBoss Config
                 <persistence-unit name="PortalPilot" transaction-type="JTA">
                 <provider>org.hibernate.ejb.HibernatePersistence</provider>
                 <jta-data-source>java:/PortalPilotDatasource</jta-data-source>
                 <properties>
                 <property name="hibernate.show_sql" value="true"/>
                 <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
                 <property name="hibernate.dialect" value="org.hibernate.dialect.SybaseDialect"/>
                 <property name="hibernate.hbm2ddl.auto" value="false"/>
                 </properties>
                 </persistence-unit>
                 -->
                
                
                 <!-- WebLogic Config -->
                 <persistence-unit name="PortalPilot" transaction-type="JTA">
                 <provider>org.hibernate.ejb.HibernatePersistence</provider>
                 <jta-data-source>DBDataSource</jta-data-source>
                 <properties>
                 <property name="hibernate.show_sql" value="true"/>
                 <property name="hibernate.dialect" value="org.hibernate.dialect.SybaseDialect"/>
                 <property name="hibernate.hbm2ddl.auto" value="false"/>
                 <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
                 <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
                 </properties>
                 </persistence-unit>
                
                </persistence>
                


                components.xml

                <?xml version="1.0" encoding="UTF-8"?>
                <components xmlns="http://jboss.com/products/seam/components"
                 xmlns:core="http://jboss.com/products/seam/core"
                 xmlns:drools="http://jboss.com/products/seam/drools"
                 xmlns:security="http://jboss.com/products/seam/security"
                 xmlns:mail="http://jboss.com/products/seam/mail"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation=
                 "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.1.xsd
                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.1.xsd
                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.1.xsd
                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-1.2.xsd
                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.1.xsd">
                
                 <core:init debug="true" jndi-pattern="PortalPilot/#{ejbName}/local"/>
                
                 <core:manager concurrent-request-timeout="500"
                 conversation-timeout="120000"
                 conversation-id-parameter="cid"
                 conversation-is-long-running-parameter="clr"/>
                
                 <core:managed-persistence-context name="entityManager"
                 auto-create="true"
                 entity-manager-factory="#{PortalPilotEntityManagerFactory}"/>
                
                 <core:entity-manager-factory name="PortalPilotEntityManagerFactory"
                 persistence-unit-name="PortalPilot"/>
                
                 <core:ejb installed="false"/>
                
                 <drools:rule-base name="securityRules">
                 <drools:rule-files><value>/security.drl</value></drools:rule-files>
                 </drools:rule-base>
                
                 <security:identity authenticate-method="#{authenticator.authenticate}"
                 security-rules="#{securityRules}"
                 remember-me="true"/>
                
                 <event type="org.jboss.seam.notLoggedIn">
                 <action expression="#{redirect.captureCurrentView}"/>
                 </event>
                 <event type="org.jboss.seam.postAuthenticate">
                 <action expression="#{redirect.returnToCapturedView}"/>
                 </event>
                
                 <mail:mail-session host="localhost" port="2525" username="test" password="test" />
                
                 <!-- For use with jBPM pageflow or process management -->
                 <!--
                 <core:jbpm>
                 <core:process-definitions></core:process-definitions>
                 <core:pageflow-definitions></core:pageflow-definitions>
                 </core:jbpm>
                 -->
                
                </components>
                


                • 5. Re: Seam application displays no data from DB
                  mgrouch Expert

                  I've noticed

                  11:21:11,839 DEBUG [Component] seam component not found PortalComment
                  11:21:11,839 DEBUG [SeamVariableResolver] could not resolve name

                  messages in log

                  SeamVariableResolver is not resolving component names

                  • 6. Re: Seam application displays no data from DB
                    mgrouch Expert

                    And there is this error, which might give more light on the problem



                    12:22:51,003 DEBUG [Events] Processing event:org.jboss.seam.preAuthenticate
                    12:22:51,003 DEBUG [SeamVariableResolver] resolving name: authenticator
                    12:22:51,003 DEBUG [Component] seam component not found: authenticator
                    12:22:51,003 DEBUG [SeamVariableResolver] could not resolve name
                    12:22:51,003 ERROR [SeamLoginModule] Error invoking login method
                    javax.faces.el.EvaluationException: Exception while invoking expression #{authenticator.authenticate}
                    at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:165)
                    at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
                    at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:75)
                    at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:148)
                    at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:104)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
                    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                    at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                    at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                    at org.jboss.seam.security.Identity.authenticate(Identity.java:247)
                    at org.jboss.seam.security.Identity.authenticate(Identity.java:240)
                    at org.jboss.seam.security.Identity.login(Identity.java:170)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at com.sun.el.parser.AstValue.invoke(AstValue.java:174)
                    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:286)
                    at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                    at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
                    at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
                    at javax.faces.component.UICommand.broadcast(UICommand.java:106)
                    at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
                    at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
                    at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
                    at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
                    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
                    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
                    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
                    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
                    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
                    at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
                    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                    at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                    at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3151)
                    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
                    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
                    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
                    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
                    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
                    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
                    Caused by: javax.faces.el.PropertyNotFoundException: Base is null: authenticator
                    at org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:460)
                    at org.apache.myfaces.el.MethodBindingImpl.resolveToBaseAndProperty(MethodBindingImpl.java:180)
                    at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:114)
                    ... 60 more
                    12:22:51,144 DEBUG [Identity] Login failed for:
                    javax.security.auth.login.LoginException: Login Failure: all modules ignored
                    at javax.security.auth.login.LoginContext.invoke(LoginContext.java:921)
                    at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                    at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                    at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                    at org.jboss.seam.security.Identity.authenticate(Identity.java:247)
                    at org.jboss.seam.security.Identity.authenticate(Identity.java:240)
                    at org.jboss.seam.security.Identity.login(Identity.java:170)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:585)
                    at com.sun.el.parser.AstValue.invoke(AstValue.java:174)
                    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:286)
                    at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                    at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
                    at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
                    at javax.faces.component.UICommand.broadcast(UICommand.java:106)
                    at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
                    at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
                    at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
                    at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
                    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
                    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
                    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
                    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
                    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
                    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
                    at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
                    at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                    at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
                    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                    at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
                    at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
                    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3151)
                    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
                    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
                    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
                    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
                    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
                    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)


                    • 7. Re: Seam application displays no data from DB
                      mgrouch Expert

                      Found it! SeamGen puts action classes under WEB-INF/dev directory by default. This works on JBoss but not on WebLogic.
                      If action classes are put under WEB-INF/classes (as usually) the app
                      works on WebLogic too.