IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
Expand all | Collapse all

problem connection servlet with Tamino server

  • 1.  problem connection servlet with Tamino server

    Posted Tue January 16, 2007 01:40 AM

    Hi guys,
    I’m trying to connect to a tamino server thru a simple conexionServlet.java.
    When I try to use the class TConnection It appear and error “unhandled exception type TServletAvailableException”.
    Changing it by adding at the line “throws ServletException, IOException”, the command ‘TException’ it appears the error “TException is not compatible with httpServletservice”.
    I don’t know how to solve this and this example it’s very simple but I can’t do it work.
    Thanks a lot,
    Diego

    This is the code:

    public class ConexionServlet extends HttpServlet {

    public void init( ServletConfig config ) throws ServletException	{
    super.init( config );
    //Do nothing for now.
    }
    
    public void service( HttpServletRequest req, HttpServletResponse res )
    throws ServletException, IOException {
    
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/html");
    
    // Print out a program header to stdout
    salida.println( "<p>ProcessPersons sample program</p>" );
    salida.println( "<p>Connecting to Tamino database " + DATABASE_URI + ", ...</p>" );
    
    // Obtain the connection factory
    TConnectionFactory connectionFactory = TConnectionFactory.getInstance();
    // Obtain the connection to the database
    TConnection connection = connectionFactory.newConnection( DATABASE_URI );
    }
    
    
    
    // URI of the Tamino database, please edit accordingly
    private final static String DATABASE_URI = "http://localhost/tamino/mydb";
    

    }


    #webMethods-Tamino-XML-Server-APIs
    #API-Management
    #webMethods


  • 2.  RE: problem connection servlet with Tamino server

    Posted Tue January 16, 2007 08:03 AM

    The servlet interface is defined and you can’t change by adding unrelated exceptions to the throws clause.

    Catch the exception in your code and do something like:

    throw new ServletException(texception)

    to pass the exception back out.


    #webMethods
    #webMethods-Tamino-XML-Server-APIs
    #API-Management


  • 3.  RE: problem connection servlet with Tamino server

    Posted Tue January 16, 2007 08:18 PM

    I think I have solve the problem now.
    Thanks a lot for your reply Mark.
    Diego


    #webMethods
    #API-Management
    #webMethods-Tamino-XML-Server-APIs