5 Replies Latest reply on Aug 21, 2013 11:19 AM by Hugh Allen

    how to tunnel EJBs in JBoss 7 - http invokers

    Chris Bitmead Newbie

      In old versions of JBoss you could tunnel EJBs through http with a config like that below in jboss.xml. But now apparently jboss.xml is obsolete. There is a cryptic mention in the doco that jboss-ejb3.xml is somehow a replacement for jboss.xml, but its certainly not a drop-in replacement. So how to do the same thing in JBoss 7?

       

       

       

       

       

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">

       

       

      <jboss>

          <!-- <secure>false</secure>

          <container-configurations /> -->

          <enterprise-beans>

            <session>

               <ejb-name>SpFinOtherSession</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-stateful-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </session>

            <session>

               <ejb-name>Spm</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-stateful-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </session>

            <session>

               <ejb-name>SlaGenerator</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-stateless-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </session>

            <session>

               <ejb-name>NPCUpload</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-stateful-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </session>

            <session>

               <ejb-name>VerifyDb</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-stateful-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </session>

            <entity>

               <ejb-name>StateProgramManager</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>FundingCategory</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

      <!--    <entity>

               <ejb-name>StateProgramManager</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>Agreement</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>AgreementSubmissions</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>ServiceProvider</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>ClspRatio</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>SpAgreement</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>SpAgreementSubmission</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>OtherIncomeDetail</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>TargetsReportDetail</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>FinancialReportDetail</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>Submission</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>StatisticalLocalArea</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>DefaultStateSla</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>UploadSession</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>SpAgreementCategory</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity>

            <entity>

               <ejb-name>SpAgreementYear</ejb-name>

               <invoker-bindings>

                  <invoker>

                     <invoker-proxy-binding-name>http-entity-rmi-invoker</invoker-proxy-binding-name>

                  </invoker>

               </invoker-bindings>

            </entity> -->

      <!--         <entity>

                        <ejb-name>ServiceProvider</ejb-name>

                        <jndi-name>ejb/ServiceProvider</jndi-name>

                  <resource-ref>

                      <res-ref-name>jdbc/DefaultDS</res-ref-name>

                      <resource-name>npc</resource-name>

                  </resource-ref>

                  <invoker-bindings>

                     <invoker>

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

                     </invoker>

                  </invoker-bindings>

       

              </entity> -->

          </enterprise-beans>

          <resource-managers>

            <resource-manager>

              <res-name>jdbc/DefaultDS</res-name>

              <res-jndi-name>java:/jdbc/DefaultDS</res-jndi-name>

            </resource-manager>

            <resource-manager>

              <res-name>jdbc/datasink</res-name>

              <res-jndi-name>java:/datasink</res-jndi-name>

            </resource-manager>

      <!--     <resource-manager res-class="org.jboss.ejb.deployment.MailResource"> -->

            <resource-manager>

              <res-name>mail/npcmail</res-name>

              <res-jndi-name>java:/Mail</res-jndi-name>

            </resource-manager>

          </resource-managers>

         <invoker-proxy-bindings>

            <invoker-proxy-binding>

               <name>http-entity-rmi-invoker</name>

               <invoker-mbean>jboss:service=invoker,type=http</invoker-mbean>

               <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>

               <proxy-factory-config>

              <client-interceptors>

                <home>

                  <interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                  <interceptor call-by-value="false">org.jboss.invocation.InvokerInterceptor</interceptor>

                  <interceptor call-by-value="true">org.jboss.invocation.MarshallingInvokerInterceptor</interceptor>

                </home>

                <bean>

                  <interceptor>org.jboss.proxy.ejb.EntityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                  <interceptor call-by-value="false">org.jboss.invocation.InvokerInterceptor</interceptor>

                  <interceptor call-by-value="true">org.jboss.invocation.MarshallingInvokerInterceptor</interceptor>

                </bean>

                <list-entity>

                  <interceptor>org.jboss.proxy.ejb.ListEntityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                  <interceptor call-by-value="false">org.jboss.invocation.InvokerInterceptor</interceptor>

                  <interceptor call-by-value="true">org.jboss.invocation.MarshallingInvokerInterceptor</interceptor>

                </list-entity>

              </client-interceptors>

               </proxy-factory-config>

            </invoker-proxy-binding>

            <invoker-proxy-binding>

               <name>http-stateless-rmi-invoker</name>

               <invoker-mbean>jboss:service=invoker,type=http</invoker-mbean>

               <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>

               <proxy-factory-config>

              <client-interceptors>

                <home>

                  <interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                  <interceptor call-by-value="false">org.jboss.invocation.InvokerInterceptor</interceptor>

                  <interceptor call-by-value="true">org.jboss.invocation.MarshallingInvokerInterceptor</interceptor>

                </home>

                <bean>

                  <interceptor>org.jboss.proxy.ejb.StatelessSessionInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                  <interceptor call-by-value="false">org.jboss.invocation.InvokerInterceptor</interceptor>

                  <interceptor call-by-value="true">org.jboss.invocation.MarshallingInvokerInterceptor</interceptor>

                </bean>

              </client-interceptors>

               </proxy-factory-config>

            </invoker-proxy-binding>

            <invoker-proxy-binding>

               <name>http-stateful-rmi-invoker</name>

               <invoker-mbean>jboss:service=invoker,type=http</invoker-mbean>

               <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>

               <proxy-factory-config>

              <client-interceptors>

                <home>

                  <interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                  <interceptor call-by-value="false">org.jboss.invocation.InvokerInterceptor</interceptor>

                  <interceptor call-by-value="true">org.jboss.invocation.MarshallingInvokerInterceptor</interceptor>

                </home>

                <bean>

                  <interceptor>org.jboss.proxy.ejb.StatefulSessionInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>

                  <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>

                  <interceptor call-by-value="false">org.jboss.invocation.InvokerInterceptor</interceptor>

                  <interceptor call-by-value="true">org.jboss.invocation.MarshallingInvokerInterceptor</interceptor>

                </bean>

              </client-interceptors>

               </proxy-factory-config>

            </invoker-proxy-binding>

         </invoker-proxy-bindings>

      </jboss>

        • 1. Re: how to tunnel EJBs in JBoss 7 - http invokers
          Stephen Coy Master

          I believe that this feature is available now in the WildFly 8 alpha release, built on top of the new undertow web server.

           

          It's not currently available in JBossAS 7.

          • 2. Re: how to tunnel EJBs in JBoss 7 - http invokers
            Hugh Allen Newbie

            Same issue here, but needed to tackle it months ago.

             

            Customers started upgrading to Java 7 for production app with downloaded JNLP Swing client, and Java 7 does NOT "just work" on the client with JBoss4 server. AT ALL. We had to scramble.

             

            Developer in charge of porting app from JBoss4 to JBoss7 had experience with Spring Framework and discovered that in JBoss 7, the solution is Spring Framework HTTP Invoker:

             

            http://www.javatpoint.com/spring-remoting-by-http-invoker-example

             

            See also:

             

            https://community.jboss.org/thread/176229

             

            We have Spring HTTP Invoker with JBoss7 running on Linux servers in production with no major problems. (Also got HornetQ and LDAP working.)

             

            NOTE: Works fine with Java 7_21 and prior - Java 7_25 appears to have issues - not sure if they are related to CHANGE IN JAVA manifest format for JAR files??? One customer could ONLY connect with 7_25 IF JAVA CONSOLE IS ENABLED! Without Java Console, connection craps out.

             

            https://blogs.oracle.com/java/entry/java_se_7_update_25

             

            Spring HTTP Invoker seems stable, but maybe not fast. In our app, it can take up to 30 seconds to get a Spring HTTP Invoker connection over the Internet. And App startup is significantly slower than JBoss4 for some reason. But once client initialization is done, app is very responsive with improved JPA.

             

            Concur with reply from Stephen Coy:

            JBoss AS 8 Alpha (FireFly) has new HTTP Invoker built in that may simplify app and improve performance. Just downloaded that but have not tried to run it yet. Where is the documentation?

            • 3. Re: how to tunnel EJBs in JBoss 7 - http invokers
              Chris Bitmead Newbie

              Thanks for the tip about Spring invoker.

               

              I'm curious what you mean by Java 7 not working with JBoss 4 because we're on JBoss 4.2 and we have a Swing JNLP app with tunnelling, and it seems ok with Java 7, as far as I see.

              • 4. Re: how to tunnel EJBs in JBoss 7 - http invokers
                jaikiran pai Master

                Hugh Allen wrote:

                 

                 

                Concur with reply from Stephen Coy:

                JBoss AS 8 Alpha (FireFly) has new HTTP Invoker built in that may simplify app and improve performance. Just downloaded that but have not tried to run it yet. Where is the documentation?

                I blogged about it here http://jaitechwriteups.blogspot.in/2013/07/wildfly-800alpha3-released-with-support.html

                • 5. Re: how to tunnel EJBs in JBoss 7 - http invokers
                  Hugh Allen Newbie

                  > I'm curious what you mean by Java 7 not working with JBoss 4 because we're on JBoss 4.2 and we have a Swing JNLP app with tunnelling, and it seems ok with Java 7, as far as I see.

                   

                  When we use Java 7 JRE to access JBoss4.2.3GA from Swing client, the JNLP download works and we get a logon screen presented.

                   

                  But then:

                  javax.naming.AuthenticationException: Failed to login using protocol=other [Root exception is javax.security.ahtu.login.LoginException: No LoginModules configured for other]

                   

                  Have never been able to get around this, but Java 6 clients work great.

                   

                  These JBoss4 issues may be resolvable, but are not worth the effort, since we have moved on and will upgrade servers to JBoss7.

                   

                  Separately, we also have a Java label printing app that is NOT EJB, and can be downloaded as Applet or JNLP App. JNLP works with both Java 6 and 7, but Applet does not with Java 7. But I know Oracle is just about deprecating Applets, and changing security around them.

                   

                  I was surprised by all this since I have been using Java since 1.01. Java 7 is one of the most disruptive Java upgrades in memory. Coupled with the nasty transition of JBoss into Red Hat (did not use JBoss5 or 6), this has diverted resources into unexpected directions with a lot of R&D required.

                   

                  But it does seem we ended up in a better place. Had to ditch JBoss4 and Java6.