5 Replies Latest reply on Apr 18, 2003 3:25 AM by didi1976

    Container configuration

    didi1976

      Hi,

      I am trying to port my project from 3.0.4 to 3.2 but now I am stuck. Where are the <home-invoker> and <bean-invoker> tags now?

      This is how my old jboss.xml looked like:

      <container-configurations>
      <container-configuration extends="Standard Stateful SessionBean">
      <container-name>HTTP Stateful SessionBean</container-name>
      <home-invoker>jboss:service=invoker,type=zhttp</home-invoker>
      <bean-invoker>jboss:service=invoker,type=zhttp</bean-invoker>
      </container-configuration>
      <container-configuration extends="Clustered Stateful SessionBean">
      <container-name>Clustered HTTP Stateful SessionBean</container-name>
      <home-invoker>jboss:service=invoker,type=zhttpHA</home-invoker>
      <bean-invoker>jboss:service=invoker,type=zhttpHA</bean-invoker>
      </container-configuration>
      </container-configurations>

      I have implemented my own invoker which does some compression on the marshalled values. In general it is based on the http invoker of JBoss.

      Can anybody tell me how I have to configure my SFSB to use this invoker now.

      Thanks,
      Dietmar

        • 1. Re: Container configuration

          You can now have multiple invokers per EJB
          container.
          They are called invoker-proxy-bindings

          see standardjboss.xml for examples
          and jboss_3_2.dtd for details

          Regards,
          Adrian

          • 2. Re: Container configuration
            didi1976

            Hi,

            ok, i have changed it that way:

            <invoker-proxy-bindings>
            <invoker-proxy-binding>
            gzip
            <invoker-mbean>jboss:service=invoker,type=zhttp</invoker-mbean>
            <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>
            <proxy-factory-config>
            <client-interceptors>

            at.softsolution.jboss.invocation.http.interfaces.ClientMethodInterceptor


            at.softsolution.jboss.invocation.http.interfaces.ClientMethodInterceptor

            </client-interceptors>
            </proxy-factory-config>
            </invoker-proxy-binding>
            </invoker-proxy-bindings>

            And my SFSB referres to that proxy-binding:
            <invoker-bindings>

            <invoker-proxy-binding-name>gzip</invoker-proxy-binding-name>

            </invoker-bindings>

            Now I get till the create of the SFSB. Then I am getting a ClassCastException because I get a org.jboss.invocation.http.infertaces.HttpInvokerProxy instead of mine.

            • 3. Re: Container configuration

              From a quick glance, you are missing some client interceptors

              Compare yours with this

              http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/jbosstest/src/resources/invokers/META-INF/jboss.xml?annotate=1.2

              Regards,
              Adrian

              • 4. Re: Container configuration
                didi1976

                I have added the interceptors like the example shows.

                Now it looks that way:
                <invoker-proxy-binding>
                gzip
                <invoker-mbean>jboss:service=gzip-invoker,type=zhttp</invoker-mbean>
                <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>
                <proxy-factory-config>
                <client-interceptors>

                org.jboss.proxy.ejb.HomeInterceptor
                org.jboss.proxy.SecurityInterceptor
                org.jboss.proxy.TransactionInterceptor
                org.jboss.invocation.InvokerInterceptor


                org.jboss.proxy.ejb.StatefulSessionInterceptor
                org.jboss.proxy.SecurityInterceptor
                org.jboss.proxy.TransactionInterceptor
                org.jboss.invocation.InvokerInterceptor

                </client-interceptors>
                </proxy-factory-config>
                </invoker-proxy-binding>

                I also moved the jndi-name tag of the SFSB into the reference of the invoker-proxy-binding:

                <ejb-name>UserSessionBean</ejb-name>
                <local-jndi-name>ejb/local/UserSessionBean</local-jndi-name>
                <invoker-bindings>

                <invoker-proxy-binding-name>gzip</invoker-proxy-binding-name>
                <jndi-name>UserSessionBean</jndi-name>

                </invoker-bindings>


                Now the server is using my invoker but the client uses the jboss http invoker.

                I am getting the following exception on the client:
                java.lang.ClassCastException

                at org.jboss.invocation.http.interfaces.Util.invoke(Util.java:87)

                at org.jboss.invocation.http.interfaces.HttpInvokerProxy.invoke(HttpInvokerProxy.java:87)

                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:92)

                at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)

                at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)

                at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:175)

                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:82)

                at $Proxy1.create(Unknown Source)

                at at.softsolution.esa.client.gui.LoginPanel$1.run(LoginPanel.java:250)

                The server throws the following exception:
                08:44:19,913 ERROR [Util] exception reading byte array
                java.lang.ClassCastException
                at at.softsolution.jboss.invocation.http.interfaces.Util.fromGZipByteArr
                ay(Util.java:162)
                at at.softsolution.jboss.invocation.http.servlet.InvokerServlet.processR
                equest(InvokerServlet.java:119)
                at at.softsolution.jboss.invocation.http.servlet.InvokerServlet.doPost(I
                nvokerServlet.java:173)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                icationFilterChain.java:247)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                ilterChain.java:193)

                • 5. Re: Container configuration
                  didi1976

                  Forget my last message ...

                  Because the structure of the packages is similar to the one of the jboss http invoker (including the class names ...) I have importet the wrong class ...