Connection to tamino thru a servlet URGENT

Hi guys,

I can connect to a tamino server thru a simple Test.java file without any problem. When I take my code and put it within a servlet running over Tomcat/Apache, the Server becomes Not Available!

Does any one of you knows why?
Thx a lot

Fady Kaddoum

Start with checking the classpath within the Tomcat environment. It needs to include all .jar files of the API.

Hi Christian

Actually yes, all jar files are included and the tamino function (TConnection) is compiling, the servlet is running but it throws a TServerNotAvailableException!

Is that what you meant by checking the classpath or need i do more than that?

Fady

Fady Kaddoum

Hi Fady,

Christian is referring to the classpath defined within Tomcat’s environment.

There are a number of potential problems, but we would need more information to indentify the most likely problem:
  - is Tomcat on the same machine as Tamino?
  - is this the machine that you ran your successful test from?
  - which OS is used on each machine?
  - which Tamino & API version is being used?
  - which Tomcat & Apache versions?
  - do the Tomcat / Apache logs give any relevant information?
  - could you post the source of Test.java?

Thanks,
Trevor.

Hello Trevor!

To answaer your questions:

- No, actually Tomcat is running on a machine & Tamino on another one within the same network. Tamino can be administered from the machine where Tomcat is running!

- Yes, Test.java runs successfully on the machine where the servlet does not run and throws the ServerNotAvailableException (This is why I thought directly it is a problem of configuration of Tomcat)

- Tomcat is running on Windows 2000 Professional whereas Tamino is running on a Windows 2000 Advanced Server

- Tamino version 3.1.1.1, Tamino Java API v 3.1.1

- Apache Tomecat 4.0

- No, actually it logs the message generated by the exception (ServerNotAvailable) neither more nor less than that

- Yep of course, but as it names shows, Test.java just tests the connection to the server, so actually it is a two lines programs that open the connection to a specific DB started on Tamino and then closes it, not more than that:
try {
con = TConnectionFactory.getInstance().newConnection(dbPath);

}
catch (TServerNotAvailableException e) {
throw new ServerDownException(“Invalid, server or database name”);
}




-

Fady Kaddoum

Oups! the code again is:
try {
con = TConnectionFactory.getInstance().newConnection(“http://10.2.72.151/tamino/mydb”);
con.close();
}
catch (TServerNotAvailableException e) {
System.out.println(e.getMessage());
}
catch (TConnectionCloseException e) {
System.out.println(e.getMessage());
}

Fady Kaddoum

Hi Fady,

that is a puzzle! Could you perhaps post the Servlet’s code, and the classpath which Tomcat is using?

Just so that we know it: which webserver are you using, and which machine is it running on?

Thanks,
Trevor.

Hi Trevor,

Actually I rechecked my CLASSPATH, I had the right classpath for my JSPs but NOT my servlets, so I fixed the classpath for the servlets and now it is working great!

Thanks a lot Trevor, I know at one point in time it was really wierd but now it works

Thx again

Fady Kaddoum