11 Replies Latest reply on May 20, 2008 3:37 PM by chris.simons

    OC4J deployment problem (could not proxy delegate)

    justaaq

      hello to all
      am trying to deploy SEAM on OC4J 10.1.3.1 based on the Blog provided by Jason
      My Link


      am actually facing many problems but the one that scared me the most is the  (could not proxy delegate) Exception that keeps appearing in random order.
      some times a simple restart to the application server would solve the issue but on some other times i had to get a new copy to make it work
      the application is
      JPA/Hibernate on OC4J 10.1.3.1
      i am getting the following Exception :



      |javax.el.ELException: /index.xhtml: java.lang.RuntimeException: could not proxy delegate
           at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:48)
           at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
           at com.sun.facelets.compiler.UILeaf.encodeAll(UILeaf.java:149)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
           at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
           at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623)
           at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
           at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
           at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
           at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
           at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
           at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
           at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
           at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.RuntimeException: could not proxy delegate
           at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyDelegate(HibernatePersistenceProvider.java:124)
           at org.jboss.seam.persistence.EntityManagerProxy.getDelegate(EntityManagerProxy.java:95)
           at org.hibernate.search.jpa.impl.FullTextEntityManagerImpl.getDelegate(FullTextEntityManagerImpl.java:154)
           at org.jboss.seam.persistence.EntityManagerProxy.getDelegate(EntityManagerProxy.java:95)
           at org.jboss.seam.persistence.HibernatePersistenceProvider.getSession(HibernatePersistenceProvider.java:351)
           at org.jboss.seam.persistence.HibernatePersistenceProvider.registerSynchronization(HibernatePersistenceProvider.java:223)
           at org.jboss.seam.persistence.ManagedPersistenceContext.joinTransaction(ManagedPersistenceContext.java:131)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:112)
           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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
           at org.jboss.seam.Component.unwrap(Component.java:2108)
           at org.jboss.seam.Component.getInstance(Component.java:1887)
           at org.jboss.seam.Component.getInstance(Component.java:1840)
           at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2182)
           at org.jboss.seam.Component.getValueToInject(Component.java:2134)
           at org.jboss.seam.Component.injectAttributes(Component.java:1598)
           at org.jboss.seam.Component.inject(Component.java:1416)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:40)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.foo.service.impl.ServiceBeanImpl_$$_javassist_2.getBars(ServiceBeanImpl_$$_javassist_2.java)
           at com.foo.BlankManagedBean.getCount(BlankManagedBean.java:26)
           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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:46)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
           at com.foo.BlankManagedBean_$$_javassist_1.getCount(BlankManagedBean_$$_javassist_1.java)
           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.el.BeanELResolver.getValue(BeanELResolver.java:292)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:73)
           at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
           at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at com.sun.facelets.el.ELText$ELTextVariable.writeText(ELText.java:184)
           at com.sun.facelets.el.ELText$ELTextComposite.writeText(ELText.java:108)
           at com.sun.facelets.compiler.TextInstruction.write(TextInstruction.java:45)
           ... 35 more
      Caused by: java.lang.ClassCastException: oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl
           at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyDelegate(HibernatePersistenceProvider.java:116)
           ... 101 more |
      



      it seems like the toplink and hibernate are conflicting for some reason although i added the orion-application.xml
      with the following value


      |<?xml version="1.0"?>
      
      <orion-application  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-application-10_0.xsd"  deployment-version="10.1.3.1.0" default-data-source="jdbc/OracleDS" component-classification="external" schema-major-version="10" schema-minor-version="0" >
           <web-module id="iota-web" path="iota-web.war" />
           <persistence path="persistence" />
           <imported-shared-libraries>
                <import-shared-library name="hibernate"/>
                <remove-inherited name="oracle.toplink"/>
                <remove-inherited name="oracle.persistence"/>
                <remove-inherited name="oracle.xml"/>
                <remove-inherited name="oracle.xml.security"/>
           </imported-shared-libraries>
           <principals path="principals.xml" />
           <jazn provider="XML" />
           <log>
                <file path="application.log" />
           </log>
      </orion-application>  |



      but OC4J seems not to recpect that from time to time causing the Hibernate and Toplink to collide.
      FYI i am using Postgresql as database.
      can any one help please ?


      thanks in advance


      ABD

        • 1. Re: OC4J deployment problem (could not proxy delegate)
          jbalunas.jbalunas.jboss.org

          This sounds like a JPA provider issue. 


          What does your persistence.xml look like? 


          Are you using hibernate as your provider?


          • 2. Re: OC4J deployment problem (could not proxy delegate)
            jasondlee

            Yeah...if we could see your persistence.xml file, that would really help. If I recall correctly, you might also need to make sure you are not bundling the Hibernate jars in your archive, but using those provided by the shared library.  And, for what it's worth, you have my condolences with regard to oc4j.  I certainly feel your pain. :)

            • 3. Re: OC4J deployment problem (could not proxy delegate)
              justaaq

              first of all thanks for the reply
              i tried to search for Hibernate files in the project and i couldnt find any.
              any way here is my persistance.xml
              i took it form the archetype provided by jason along with the whole project :)


              |
              <?xml version="1.0" encoding="UTF-8"?>
              <persistence version="1.0"
                   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">
                   <persistence-unit name="myPersistenceUnit">
                        <class>com.savvy.dvld.entity.Dvldteam</class>
                        <exclude-unlisted-classes>true</exclude-unlisted-classes>
                        <properties>
                             <property name="hibernate.transaction.manager_lookup_class"
                                  value="org.hibernate.transaction.OC4JTransactionManagerLookup" />
                             <property name="hibernate.dialect"
                                  value="org.hibernate.dialect.PostgreSQLDialect" />
                             <property name="hibernate.connection.driver_class"
                                  value="org.postgresql.Driver" />
                             <property name="hibernate.connection.username"
                                  value="postgres" />
                             <property name="hibernate.connection.password"
                                  value="000" />
                             <property name="hibernate.connection.url"
                                  value="jdbc:postgresql:postgres" />
                             <property name="hibernate.hbm2ddl.auto" value="update" />
              
              
                             <property name="toplink.logging.level" value="INFO" />
                             <property name="toplink.jdbc.driver"
                                  value="org.postgresql.Driver" />
                             <property name="toplink.jdbc.url"
                                  value="jdbc:postgresql:postgres" />
                             <property name="toplink.jdbc.user" value="postgres" />
                             <property name="toplink.jdbc.password" value="000" />
                             <property name="toplink.ddl-generation"
                                  value="create-tables" />
              
                        </properties>
                   </persistence-unit>
              </persistence>|
              



              • 4. Re: OC4J deployment problem (could not proxy delegate)
                justaaq

                Dear Jason, it seems that you have gone through the same headache I am starting to experience... One strategic questions: How possible is it to reach to a reliable deployment of a seam application over OC4J?


                We are stuck with OC4J in our current project, and the timeframe is very tight. We thought that using seam with all of its time-saving feature can help... however we are starting to have doubts and reliability concerns.


                Did you do a full seam project over OC4J, and how reliable was it?


                Should we better consider going back to Seam 1.1, since OC4J supports J2EE 1.4, and we are ok with POJOs?


                What IDE did you use, and did you manage to connect it directly to OC4J (embedded, or stand-alone)?


                What are your recommendations?




                Thank you Jason

                • 5. Re: OC4J deployment problem (could not proxy delegate)
                  jbalunas.jbalunas.jboss.org

                  Well your persistence.xml does not state a provider so oc4j will use its default (toplink).  You also have a mixture of properties - some for toplink and some for hibernate.


                  To use hibernate set your provider in the persistence.xml to be:


                  <provider>org.hibernate.ejb.HibernatePersistence</provider>
                  



                  To use toplink you need to tell seam not to use the internal hibernate persistence provider.  See JBSEAM-1946 for details.


                  This will be handled in a better way soon - but for now you need to add this to the components.xml in order to use a different JPA provider.


                  <component name="org.jboss.seam.persistence.persistenceProvider"
                          scope="stateless" class="org.jboss.seam.persistence.PersistenceProvider">
                  </component> 
                  



                  For more OC4J information you should check out the OC4J reference guide chapters.   Let us know if you run into any other issues, or a problem with the docs.


                  Thanks,
                  Jay

                  • 6. Re: OC4J deployment problem (could not proxy delegate)
                    jasondlee

                    Dear Jason, it seems that you have gone through the same headache I am starting to experience... One strategic questions: How possible is it to reach to a reliable deployment of a seam application over OC4J?


                    No, I only did prototyping, but I did get the application working.  I did have some lingering issues (though I can't recall what they were), but they seemed to be caused more by the state of my prototype than by the framework, though.


                    Should we better consider going back to Seam 1.1, since OC4J supports J2EE 1.4, and we are ok with POJOs?

                    What IDE did you use, and did you manage to connect it directly to OC4J (embedded, or stand-alone)?

                    What are your recommendations?


                    With regard to the version, I can't really say.  I'm not aware of any advantage 1.1 would have over 2.x, and, tbh, I'd be surprised to hear that is any. :)  For the IDE, I used NetBeans 6 since it has better GlassFish support, which brings me to your next question.


                    I'm a big GlassFish fan, so I typically did a lot of my work there, as I knew Seam had no (major :) issues running there.  Once I got my application working, I'd then deploy to the wonder that is OC4J and see what broke, then dug around to find a fix.  Personally, I think I'd do that in your case as well, though you're certainly free to use some other app server (JBoss is good, I hear. :)  Developing under OC4J 10.1.3 is, IME, extremely painful, so if you can push that back a bit until you get your app in hand, I think you'll be better off.  Eventually, though, you're going to have to deal with that pain, but I found it helpful to separate any pains in getting my app configured and basically working from those related to deploying to oc4j. :P

                    • 7. Re: OC4J deployment problem (could not proxy delegate)
                      justaaq

                      thanks guys for the replies :)


                      to Jay Balunas :
                      the problem with the documantation is that it is for OC4J 11 not 10 and am using OC4J 10 .
                      i tried following the steps (i really did) but no use i always getting all sorts of deployment Exception (it make sense since i was trying to follow steps that were designed to a full EE5 server and try to apply them to 1.4 Server oc4j 10 )
                      we have requested updates to the documentation but it is low on the priority list :) as some of the guys on jboss replied .

                      to Jason :
                      thanks for the replay to all my Questions :)
                      but do you have any idea why this exception appearing in Random order ? am trying to deploy your exact archetype application and it is giving me the same Exception from time to time
                      any ideas :)

                      • 8. Re: OC4J deployment problem (could not proxy delegate)
                        jbalunas.jbalunas.jboss.org

                        I'm sorry I did not notice the version :)


                        Did you have any luck with the persistenceProvider suggestion?

                        • 9. Re: OC4J deployment problem (could not proxy delegate)
                          justaaq

                          nop it didnt work
                          but thanks any way :)
                          any way due to this strange exception and the fact that the number of people who deployed SEAM to OC4J 10 is low we decided to use some other technology for this coming project .
                          but for our next project we will consider using seam (since OC4J 11 will be most probably in the market soon and it is supported on the documantation ).
                          SEAM provide many cool stuff .
                          thanks to all
                          and Cya later :)



                          • 10. Re: OC4J deployment problem (could not proxy delegate)
                            jbalunas.jbalunas.jboss.org

                            I am sorry to hear that - I'm sure we could work around your problem. 


                            It really does seem like the persistence provider issue because of the exception, and that you are using toplink.


                            -Jay

                            • 11. Re: OC4J deployment problem (could not proxy delegate)

                              We are about to embark on the Seam 2.0 - OC4J 10.1.3 endeavor.  It's not going to be fun.  Our client, after approving and then denying JBoss AS usage, now says that 11gAS - with Oracle's no mention of a release date - is not a good solution and that we should stick with 10.1.3.


                              Jason provided a great example of getting Seam to work on OC4J10 but I am still very much worried about the upcoming pains involved in migrating our app to OC4J10.


                              Does anyone have any idea when 11g AS may be taken out of technology preview?  It's quite the concern for me; they say it will be released in Calendar Year 2008


                              Jason - do you have any suggestions for applying your Maven archetype to a project that hasn't been using Maven?


                              Thanks.