3 Replies Latest reply: Feb 4, 2013 12:09 AM by 971693 RSS

    How to run Jolt services using Apache tomcat

    971693
      Hi,

      We have created a sample program that communicates java with C using Jolt Tuxedo,that is working fine.
      So we are going ahead and creating GUI based Application. We created jsp program that will communicate with java through Web server(Apache tomcat)

           Currently Our problem is when we are trying to execute jsp program,we are getting below error. Can u please help us.


           bea.jolt.SessionException: Cannot connect to 127.0.0.1
           bea.jolt.JoltSession.logon(JoltSession.java:297)
           bea.jolt.JoltSession.<init>(JoltSession.java:125)
           dsas.ToUpper.upper(Unknown Source)
           org.apache.jsp.jsp.ToUpper_jsp._jspService(ToUpper_jsp.java:74)
           org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
           org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
           org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
           org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:722)


      Iam thinking whether any configuration settings has to be done in Apache Tomcat inorder to access Jolt services?
      FYI,I have add jolt.jar and joltadmin.jar inside lib folder of apache tomcat.

      We are using HP-UX 11.31 OS, Tuxedo11GR1,apache Tomcat 7.0.26 and java 1.6

      Edited by: 968690 on Jan 30, 2013 10:12 AM

      Edited by: 968690 on Jan 30, 2013 10:22 AM
        • 1. Re: How to run Jolt services using Apache tomcat
          971693
          We are using Tuxedo11GR1 ,apache tomcat 7.0.26 and Java1.6.
          • 2. Re: How to run Jolt services using Apache tomcat
            Todd Little-Oracle
            Hi,

            How are you creating the Jolt session? Can you post your JSP? I'm assuming you have verified that Jolt is configured and working on the Tuxedo domain?

            Regards,
            Todd Little
            Oracle Tuxedo Chief Architect
            • 3. Re: How to run Jolt services using Apache tomcat
              971693
              my JSP : ToUpper.jsp

              <%@ page language="java" import="dsas.ToUpper"%>
              <html>
              <head>
              <title>JOLT</title>
              </head>
              <% ToUpper u =new ToUpper(); %>
              <body>
              <form action="ToUpper" method="post">
              <input type="text" name="Name"/> <br>
              <input type="text" value = <%=u.upper()%>/> <br>
              <br><br><br>
              </form>
              </body>
              </html>


              My Java program: ToUpper.Java

              import bea.jolt.*;

              package com.java

              public class ToUpper

              {

                   public String upper()

              {

                   JoltSession session;
              JoltSessionAttributes sattr;

                   JoltRemoteService toupperfml;

                   JoltTransaction trans;

                   String userName=null;

                   String userPassword=null;

                   String appPassword=null;

                   String userRole="myapp";

                   String name1 = " ";

                   
              int i;
                   
              try
                   {

                   sattr = new JoltSessionAttributes();

                   sattr.setString(sattr.APPADDRESS, "//135.161.84.42:7000");

                   System.out.println("Authentication Level set To :"+
              sattr.checkAuthenticationLevel());

                   switch (sattr.checkAuthenticationLevel())

                   {
                   
              case JoltSessionAttributes.NOAUTH:
              break;
                   
              case JoltSessionAttributes.APPASSWORD:
              appPassword = "123456";
                   
              break;

                   case JoltSessionAttributes.USRPASSWORD:
                   
              userName = "myname";
              userPassword = "123456";//not required
                   
              appPassword = "123456";//not required

                   break;

                   }

                   sattr.setInt(sattr.IDLETIMEOUT, 300);

                   session = new JoltSession(sattr, userName, userRole,
              userPassword, appPassword);

                   toupperfml = new JoltRemoteService ("TOUPPERFML", session);

                   
              toupperfml.setString("NAME","hello");

                   
              toupperfml.call(null);
                   
              name1 = toupperfml.getStringDef("NAME",null);


                   }
                   catch(ServiceException se){

                   System.out.println("Exception caught error no is:"+se.getErrno());

                   se.printStackTrace();
              }

                   return name1;

                   }
              // end main
              } // end ToUpper


              import bea.jolt.*;

              package com.java

              public class ToUpper

              {

                   public String upper()

              {

                   JoltSession session;
              JoltSessionAttributes sattr;

                   JoltRemoteService toupperfml;

                   JoltTransaction trans;

                   String userName=null;

                   String userPassword=null;

                   String appPassword=null;

                   String userRole="myapp";

                   String name1 = " ";

                   
              int i;
                   
              try
                   {

                   sattr = new JoltSessionAttributes();

                   sattr.setString(sattr.APPADDRESS, "//135.161.84.42");

                   System.out.println("Authentication Level set To :"+
              sattr.checkAuthenticationLevel());

                   switch (sattr.checkAuthenticationLevel())

                   {
                   
              case JoltSessionAttributes.NOAUTH:
              break;
                   
              case JoltSessionAttributes.APPASSWORD:
              appPassword = "123456";
                   
              break;

                   case JoltSessionAttributes.USRPASSWORD:
                   
              userName = "myname";
              userPassword = "123456";//not required
                   
              appPassword = "123456";//not required

                   break;

                   }

                   sattr.setInt(sattr.IDLETIMEOUT, 300);

                   session = new JoltSession(sattr, userName, userRole,
              userPassword, appPassword);

                   toupperfml = new JoltRemoteService ("TOUPPERFML", session);

                   
              toupperfml.setString("NAME","hello");

                   
              toupperfml.call(null);
                   
              name1 = toupperfml.getStringDef("NAME",null);


                   }
                   catch(ServiceException se){

                   System.out.println("Exception caught error no is:"+se.getErrno());

                   se.printStackTrace();
              }

                   return name1;

                   }
              // end main
              } // end ToUpper

              Directory structure
              ==================
              apache-tomcat-7.0.26/webapps/jspweb/WEB-INF/classes/dsas/ToUpper.class
              apache-tomcat-7.0.26/webapps/jspweb/WEB-INF/lib/jolt.jar
              apache-tomcat-7.0.26/webapps/jspweb/WEB-INF/lib/joltadmin.jar
              apache-tomcat-7.0.26/webapps/jspweb/jsp/ToUpper.jsp




              Software used:
              -------------

              OS:HP-UX 11.31
              Tuxedo:Tuxedo11GR1
              JAVA: JAVA1.6
              Apache tomcat 7.0.26

              FYI,dint change any of the configuration file ,server.xml and web.xml.

              Please help me!!!