1 2 Previous Next 26 Replies Latest reply on Dec 4, 2006 10:32 AM by lowecg2004 Go to original post
      • 15. Re: Oracle ADF

        I have this working now. I edited the sample and rebuilt it with ANT and it works fine. It is a problem caused by Eclipse + MyEclipse plugin, and how I the projects setup. I had deployed jboss-seam.jar to the jboss-4.0.3/server/all/lib folder, and it needs to be in the applications .ejb3 jar file and only there.

        • 16. Re: Oracle ADF
          khaliq

          Even i have been getting class cast exception , but i was surprised to note that i am getting CoreTable but unable to cast it to CoreTable variable.

          ex : CoreTable corTab = (CoreTable) table where table is a UIComponent.

          when i do table.getClass().getName() i get coretable object , but unable to cast this coreTable variable.

          If you have encountered similar problem , please let me know how you have overcome this issue.

          Thanks

          "nusa" wrote:
          Thanks Deniss,

          Yes that works, except that I got a ClassCastException with this code:
          UIXTable table = (UIXTable)Contexts.getEventContext().get("otherBean");
          


          The 'otherBena' is defined as :
          @Name("otherBean")
          @Scope(org.jboss.seam.ScopeType.EVENT)
          public class OtherBean {
           private UIXTable table;
           public setTable(UIXTable table)
           public UIXTable getTable()
           ...
          }
          


          Any idea ?

          Thanks.


          • 17. Re: Oracle ADF
            mrohad

            I am using Trinidad which is the same as ADF and it doesn't work , I wonder if u can tell me why

            web.xml:

            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
            
             <!-- trinidad -->
             <filter>
             <filter-name>trinidad</filter-name>
             <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>trinidad</filter-name>
             <!-- This assumes that the FacesServlet has been registered -->
             <!-- under the name "faces" -->
             <servlet-name>Faces Servlet</servlet-name>
             </filter-mapping>
            
             <servlet>
             <servlet-name>resources</servlet-name>
             <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
             </servlet>
            
            <!-- This cannot be configured currently -->
            <servlet-mapping>
             <servlet-name>resources</servlet-name>
             <url-pattern>/adf/*</url-pattern>
            </servlet-mapping>
            <context-param>
             <param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
             <param-value>false</param-value>
            </context-param>
            <context-param>
             <param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
             <param-value>com.sun.facelets.FaceletViewHandler</param-value>
            </context-param>
            <context-param>
             <param-name>org.apache.myfaces.trinidadinternal.DISABLE_CONTENT_COMPRESSION</param-name>
             <param-value>true</param-value>
            </context-param>
            
            
            
             <context-param>
             <param-name>facelets.VIEW_MAPPINGS</param-name>
             <param-value>*.jsp</param-value>
             </context-param>
            
            
            
            
            
            
            
            
             <!-- Seam -->
             <listener>
             <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
             </listener>
            
             <!-- Propagate conversations across redirects -->
             <filter>
             <filter-name>Seam Redirect Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
             </filter>
            
             <!-- ajax4jsf -->
             <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <url-pattern>*.seam</url-pattern>
             </filter-mapping>
            
             <filter-mapping>
             <filter-name>Seam Redirect Filter</filter-name>
             <url-pattern>*.seam</url-pattern>
             </filter-mapping>
            
             <filter>
             <filter-name>Seam Exception Filter</filter-name>
             <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Exception Filter</filter-name>
             <url-pattern>*.jsf</url-pattern>
             </filter-mapping>
            
             <!-- JSF -->
             <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>client</param-value>
             </context-param>
            
             <context-param>
             <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
             <param-value>com.sun.facelets.FaceletViewHandler</param-value>
             </context-param>
            
             <context-param>
             <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.jsp</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.REFRESH_PERIOD</param-name>
             <param-value>2</param-value>
             </context-param>
             <context-param>
             <param-name>facelets.DEVELOPMENT</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>com.sun.faces.validateXml</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>com.sun.faces.verifyObjects</param-name>
             <param-value>true</param-value>
             </context-param>
             <context-param>
             <param-name>org.ajax4jsf.SKIN</param-name>
             <param-value>DEFAULT</param-value>
             </context-param>
            
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
            
             <!-- Faces Servlet Mapping -->
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.seam</url-pattern>
             </servlet-mapping>
            
             <!-- MyFaces ok-->
             <listener>
             <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
             </listener>
             <!-- tomo -->
             <context-param>
             <param-name>facelets.LIBRARIES</param-name>
             <param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
             </context-param>
            
            
             <filter>
             <filter-name>MyFacesExtensionsFilter</filter-name>
             <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
             <init-param>
             <param-name>maxFileSize</param-name>
             <param-value>20m</param-value>
             </init-param>
             </filter>
            
            <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
            <filter-mapping>
             <filter-name>MyFacesExtensionsFilter</filter-name>
             <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
             <servlet-name>Faces Servlet</servlet-name>
            </filter-mapping>
            
            <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
            <filter-mapping>
             <filter-name>MyFacesExtensionsFilter</filter-name>
             <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
            </filter-mapping>
            
            
            
            
            
            
            </web-app>
            

            faces-config
            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE faces-config
             PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
             "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
            
            <faces-config>
            
             <!--trinidad-->
             <application>
             <variable-resolver>org.jboss.seam.jsf.SeamVariableResolver</variable-resolver>
             <default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id>
            
             <locale-config>
             <default-locale>en</default-locale>
             <supported-locale>iw_il</supported-locale>
             </locale-config>
             <message-bundle>com.wannabet.utils.validationMessages</message-bundle>
             </application>
            
            
            
            
            
             <!-- Navigation rules for the Booking demo app -->
            
             <navigation-rule>
             <navigation-case>
             <from-outcome>catEvents</from-outcome>
             <to-view-id>/event/categoryEvetns.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             <navigation-case>
             <from-outcome>login</from-outcome>
             <to-view-id>/home.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             <navigation-case>
             <from-outcome>register</from-outcome>
             <to-view-id>/register.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             <navigation-case>
             <from-outcome>joinWager</from-outcome>
             <to-view-id>/wager/joinWager.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             <navigation-case>
             <from-outcome>suggestions</from-outcome>
             <to-view-id>/suggestion/suggestions.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             <navigation-case>
             <from-outcome>eventWagers</from-outcome>
             <to-view-id>/wager/eventWagers.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             <navigation-case>
             <from-outcome>addWager</from-outcome>
             <to-view-id>/wager/addWager.jsp</to-view-id>
             <redirect/>
             </navigation-case>
            
             </navigation-rule>
            
             <navigation-rule>
            
             <from-view-id>/hotel.jsp</from-view-id>
            
             <navigation-case>
             <from-outcome>book</from-outcome>
             <to-view-id>/book.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             </navigation-rule>
            
             <navigation-rule>
            
             <from-view-id>/book.jsp</from-view-id>
            
             <navigation-case>
             <from-outcome>confirm</from-outcome>
             <to-view-id>/confirm.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             </navigation-rule>
            
             <navigation-rule>
            
             <from-view-id>/confirm.jsp</from-view-id>
            
             <navigation-case>
             <from-outcome>catEvents</from-outcome>
             <to-view-id></to-view-id>
             <redirect/>
             </navigation-case>
            
             <navigation-case>
             <from-outcome>back</from-outcome>
             <to-view-id>/book.jsp</to-view-id>
             <redirect />
             </navigation-case>
            
             </navigation-rule>
            
            
             <component>
             <component-type>requestTimeOutput</component-type>
             <component-class>com.wannabet.core.tags.UIRequestTimeOutput</component-class>
             </component>
            
             <!-- Select one of the two standard persistence lifecycle models for the Seam application -->
            
             <lifecycle>
             <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
             </lifecycle>
            
            
             <!--convertors-->
             <converter>
             <converter-id>ParsedQuestionConverter</converter-id>
             <converter-class>com.wannabet.converter.ParsedQuestionConverter</converter-class>
             </converter>
            
             <!-- ADF -->
            
            
            
            </faces-config>
            


            i am not getting any exception although the tags ain't rendered and this is what i am getting in my console
            14:53:29,796 WARN [HtmlRenderKitImpl] Unsupported component-family/renderer-type: org.apache.myfaces.trinidad.Output/org.apache.myfaces.trinidad.Text
            14:53:29,796 ERROR [STDERR] 22/09/2006 14:53:29 org.apache.myfaces.trinidad.component.UIXComponentBase _getRendererImpl
            WARNING: Could not find renderer for CoreOutputText[UIXFacesBeanImpl, id=_id46], rendererType = org.apache.myfaces.trinidad.Text
            14:53:29,816 ERROR [HtmlResponseStateManager] No component states to be saved in client response!
            14:53:29,826 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.PRETTY_HTML' found, using default value true
            14:53:29,826 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ALLOW_JAVASCRIPT' found, using default value true
            14:53:29,826 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.DETECT_JAVASCRIPT' found, using default value false
            14:53:29,826 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.AUTO_SCROLL' found, using default value false
            14:53:29,826 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.ADD_RESOURCE_CLASS' found, using default value org.apache.myfaces.renderkit.html.util.DefaultAddResource
            14:53:29,826 INFO [MyfacesConfig] No context init parameter 'org.apache.myfaces.CHECK_EXTENSIONS_FILTER' found, using default value true
            14:53:29,826 WARN [HtmlRenderKitImpl] Unsupported component-family/renderer-type: org.apache.myfaces.trinidad.Output/org.apache.myfaces.trinidad.Text


            • 18. Re: Oracle ADF
              khaliq

              You can find working example of ADF faces with seam here
              http://wiki.jboss.org/wiki/attach?page=JBossSeam%2Fadfregistration.zip
              or you can see here for more information
              http://jds.id.lv/export/sites/default/articles/seam-adf.html

              • 19. Re: Oracle ADF
                khaliq

                Nusa,

                How did you solve your cast exception problem ??

                Thanks

                • 20. Re: Oracle ADF
                  mrohad

                  thanks , I can make ADF/Trinidad work forme , but not with ajax4jsf , when i am adding ajax4jsf.jar to my web-inf/lib the ADF components stop getting rendered...any idea?
                  Thanks again

                  • 21. Re: Oracle ADF

                    I tried to get Trinidad to work with Seam/Facelets in a portlet (JSR-168) environment, short research releaved that there're problems with myfaces, facelets, jsf and portlet containers acting together. Most of the problems are how request, response and all sorts of different sessions are handled inside these frameworks.
                    For example, Myfaces makes a lot of assumptions, like casting general Request to implementation specific Requests etc, casting objects to MyFaces Impl classes with additional accessor (like setExternalContext), which don't hold when used along with other frameworks.

                    Thus adding one more (ajax4jsf) is likely to cause additional problems which can only made disappear by adding a lot of unmaintable wrappers and compatabily objects, which in turn make the whole more unstable.

                    Trinidad replaces some of the internal render components (like one for h:commandButton) and i guess ajax4jsf doesn't like that.


                    • 22. Re: Oracle ADF
                      lowecg2004

                      khaliq/Nusa,

                      I am also getting the cast exception. I was able to create a regular JSF managed bean and bind/cast to it just fine however, binding to a Seam component caused the cast exception:

                      Caused by: java.lang.ClassCastException: org.apache.myfaces.trinidad.component.core.data.CoreTable cannot be cast to org.apache.myfaces.trinidad.component.core.data.CoreTable

                      I can only speculate at this point, but I assume it's something to do with AOP mechanisms changing something about the class during the binding process. Generally in Seam one would be injecting classes based on interfaces or entity beans rather than 'raw' object instance. I would appreciate it if someone could explain what's going on here or direct me to some further reading.

                      The reason I was binding the table to the Seam component was to get a handle on the component before render response so that I could initialise row selection for the <tr:table ... rowSelection="single"> mode. This requires direct access to the component instance after it has been bound to its data. From what I can tell, my efforts were in vein due to the life cycle of Facelets:

                      * BEFORE_RENDER_RESPONSE event fired;
                      * facelets build process starts, binding to my seam component occurs;
                      * getter is called for the component;
                      * data model factory is called;
                      * AFTER_RENDER_RESPONSE event fired;

                      Basically, the last possible hook into this process (that I could find) was with the getter for the component or even the data model factory (yuk!). Since the actual data model binding occurs after this, there is nothing that I can use to set the selected row keys.

                      As a general comment, I have been able to do this sort of processing easily under the Java Studio Creator 2 application model using the prerender() method on my backing beans. This is essentially a hook invoked during the BEFORE_RENDER_RESPONSE phase. With this in mind, I tried experimenting with Seam "org.jboss.seam.beforePhase" event but this is fired before facelets even starts building its tree. I understand that the JSC2 approach and the facelets approach are very different, but it does seem odd that there is no way to get at the underlying JSF components before they are rendered. I assume that facelets tree is built during this phase? Or perhaps (probably) I'm missing something, but I have searched for the best part of a day on this and not come across anything.

                      C.

                      • 23. Re: Oracle ADF
                        gavin.king

                        This is a simple classloading problem, and will be solved as soon as you take the time to learn and understand Java EE / J2EE classloading.

                        It has absolutely nothing to do with AOP. (??!)

                        And of course, Seam has a much more sophisticated feature than the ugly-ass and totally evil prerender() crap, ie. page actions. You will find this feature discussed extensively in the Seam documentation.

                        • 24. Re: Oracle ADF
                          gavin.king

                          Ahem, sorry for being aggressive. I really need to learn how to not drink beer and answer forum posts. :-(

                          • 25. Re: Oracle ADF
                            lowecg2004

                            Gavin,

                            Yes a good advert for "don't drink and drive" ;) Apology accepted.

                            As stated in my post, it was only speculation and I was clearly wrong. While my assumption now appears rather naive (and, yes, I feel suitably embarrassed) please appreciate that many us on the forum are not yet well versed in the subtleties of AOP and classloading. In my class cast example I was able to bind to a regular managed bean but not via a Seam binding "because Seam used a different classloading mechanism to get the underlying class". Surely this IS quite subtle from a regular Seam programmers pov? Is this something that could be cleared up in the Seam reference, say introduce a section from a "Seam and the JEE environment" interaction perspective?

                            I would have taken the time to acquaint myself with the subtleties of JEE classloading but having read that documentation you'll know that stuff is not exactly 'light' reading hence my polite request for direction to the required material. RTFM is often a fair response but when the 'M' is something as big and vague as the JEE spec then some direction would be appreciated.

                            I agree with you that preprender does not work under Seam. I personally DO NOT want to be dealing with the raw JSF component instances. But let's face it, there will be a lot of people migrating to Seam from JSC who are used to having exactly that sort of experience of JSF programming. I only got onto to this because of the way in which the Trinidad built-in table selections work. Again, maybe something in the Seam reference could 'educate' people who may be used to other JSF programming models?

                            Anyway please accept my apologies if I upset you. I really appreciate the help you are giving myself and others on this forum. I will refrain from speculation from now on and I will now go away to read up on classloading and try to understand what's going on.

                            Best Regards,

                            Chris.

                            • 26. Re: Oracle ADF
                              lowecg2004
                              1 2 Previous Next