RE: [tomcat] Newbie question about getting first servlet working in tomcat on iseries v5r2

2004-09-04 Thread Ernesto Echeverría
To me this sounds like a directory misplacement.

Can you elaborate on:

What directories have you placed your files into?
Are you using the ROOT webapp?
Have you tried the tomcat sample applications? 
If you type the html file name into the url does your app work?

Other tip I could give you now has to do with working the simple
configurations first and then climbing on the complexity ladder.
For example why don't you try your webapp in the tomcat instance directly
and later worrying about configuring mod_jk passthru.

Regards.

José Ernesto Echeverría
[EMAIL PROTECTED]

 

-Original Message-
From: Ralph A. Borriello [mailto:[EMAIL PROTECTED] 
Sent: Viernes, 03 de Septiembre de 2004 11:50 p.m.
To: [EMAIL PROTECTED]
Subject: [tomcat] Newbie question about getting first servlet working in
tomcat on iseries v5r2

Hello all,  

I work on an as/400 (iseries) version v5r2. I have setup a apache/tomcat
server instance under the ibm http server and am trying to get a simple
helloservlet servlet to work properly. The server instance is referencing
version 1.3 of the jdk. I have compiled the java using jedit and jcompile
plugin on windows and copied and pasted the html and class files to the
iseries via a mapped drive  

The sample is a html file and a class file. It is a simple form where the
servlet just mirrors back the name that was typed on the form. When I enter
the name, I get a page cannot be found error. The url is modified to look
like this: http://10.126.2.2:8082/HelloServlet?user_name=asdasdf (as I typed
asdasdf).

I have included the source for the html, the java program, and the server
logs. In them it does say that it cant find the servlet called HelloServlet,
but it is there. Do I have to package the files in a .war file ?? I have
scoured the documenation that I could find on the iseries and the tomcat
sites and have tried many things but cant get it working. Any help would be
greatly appreciated. 
Thanks for taking the time to read this :) 

If this is the wrong forum for this type of question or if there is a better
one, please let me know. 

All the object authorites give full access to *public and the user that the
server is running under. 

The httpd.conf file: 


# Apache Default server configuration
LoadModule jk_module /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM

# General setup directives
HotBackup Off
CgiConvMode %%MIXED/MIXED%%
TimeOut 3
KeepAlive Off
DocumentRoot /www/apachedft/htdocs
AddLanguage en .en

# Deny most requests for any file
JkWorkersFile /www/apachedft/conf/workers.properties
JkLogFile /www/apachedft/logs/jk.log
JkLogLevel Error
JkMount /calc mytomcat
ServerUserID QTMHHTTP
DirectoryIndex index.html

  order allow,deny
  deny from all
  Options -Indexes -ExecCGI -includes
  AllowOverride Limit Options


# Allow requests for files in document root 
  order allow,deny
  allow from all

Listen *:8082
LogLength 10485760
LogLevel Debug
AccessFileName .htaccess






The html file:



 
Please enter your name: 
 









the java program: 

/**
 * This program is an example from the book "Internet
 * programming with Java" by Svetlin Nakov. It is freeware. 
 * For more information: http://www.nakov.com/books/inetjava/
 */
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*; 
 
public class HelloServlet extends HttpServlet { 
public void doGet (HttpServletRequest aRequest, 
HttpServletResponse aResponse) 
throws ServletException, IOException { 
aResponse.setContentType("text/html"); 
ServletOutputStream out = aResponse.getOutputStream(); 
String userName = aRequest.getParameter("user_name"); 
out.println(""); 
out.println(""); 
out.println("\tHello Servlet"); 
out.println(""); 
out.println(""); 
out.println("\tHello, " + userName + ""); 
out.println(""); 
}
}





Portion of the web.xml file: 


  
 
  servlet1 


  HelloServlet 
   
  
  3
 
   
   
  HelloServlet
  
 
  3   


 

  servlet1
   
 
  /*  

  
 
  servlet1 

  
  /*   
 
 
 





the error_log messages: 

ZSRV_MSG0018: File /www/apachedft/htdocs/HelloServlet does not exist,
refeerer: http://10.126.2.2:8082/helloform.html
ZSRV_MSG0016: URI in request GET /HelloServlet?user_name=asdasdf HTTP/1.1
is not valid, referer: http://10.126.2.2:8082/helloform.html  



the jvmstdout.txt log: 


Starting up StartupThread   
Starting tomcat. Check logs/tomcat.lo

Newbie question about getting first servlet working in tomcat on iseries v5r2

2004-09-03 Thread Ralph A. Borriello
Hello all,  

I work on an as/400 (iseries) version v5r2. I have setup a apache/tomcat server 
instance under the ibm http server and am trying to get a simple helloservlet servlet 
to work properly. The server instance is referencing version 1.3 of the jdk. I have 
compiled the java using jedit and jcompile plugin on windows and copied and pasted the 
html and class files to the iseries via a mapped drive  

The sample is a html file and a class file. It is a simple form where the servlet just 
mirrors back the name that was typed on the form. When I enter the name, I get a page 
cannot be found error. The url is modified to look like this: 
http://10.126.2.2:8082/HelloServlet?user_name=asdasdf (as I typed asdasdf).

I have included the source for the html, the java program, and the server logs. In 
them it does say that it cant find the servlet called HelloServlet, but it is there. 
Do I have to package the files in a .war file ?? I have scoured the documenation that 
I could find on the iseries and the tomcat sites and have tried many things but cant 
get it working. Any help would be greatly appreciated. 
Thanks for taking the time to read this :) 

If this is the wrong forum for this type of question or if there is a better one, 
please let me know. 

All the object authorites give full access to *public and the user that the server is 
running under. 

The httpd.conf file: 


# Apache Default server configuration
LoadModule jk_module /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM

# General setup directives
HotBackup Off
CgiConvMode %%MIXED/MIXED%%
TimeOut 3
KeepAlive Off
DocumentRoot /www/apachedft/htdocs
AddLanguage en .en

# Deny most requests for any file
JkWorkersFile /www/apachedft/conf/workers.properties
JkLogFile /www/apachedft/logs/jk.log
JkLogLevel Error
JkMount /calc mytomcat
ServerUserID QTMHHTTP
DirectoryIndex index.html

  order allow,deny
  deny from all
  Options -Indexes -ExecCGI -includes
  AllowOverride Limit Options


# Allow requests for files in document root

  order allow,deny
  allow from all

Listen *:8082
LogLength 10485760
LogLevel Debug
AccessFileName .htaccess






The html file:


 
 
Please enter your name: 
 
 
 







the java program: 

/** 
 * This program is an example from the book "Internet 
 * programming with Java" by Svetlin Nakov. It is freeware. 
 * For more information: http://www.nakov.com/books/inetjava/ 
 */ 
import java.io.*; 
import javax.servlet.*; 
import javax.servlet.http.*; 
 
public class HelloServlet extends HttpServlet { 
public void doGet (HttpServletRequest aRequest, 
HttpServletResponse aResponse) 
throws ServletException, IOException { 
aResponse.setContentType("text/html"); 
ServletOutputStream out = aResponse.getOutputStream(); 
String userName = aRequest.getParameter("user_name"); 
out.println(""); 
out.println(""); 
out.println("\tHello Servlet"); 
out.println(""); 
out.println(""); 
out.println("\tHello, " + userName + ""); 
out.println(""); 
} 
}





Portion of the web.xml file: 


  
 
  servlet1 


  HelloServlet 
   
  
  3
 
   
   
  HelloServlet
  
 
  3   


 

  servlet1
   
 
  /*  

  
 
  servlet1 

  
  /*   
 
 
 





the error_log messages: 

ZSRV_MSG0018: File /www/apachedft/htdocs/HelloServlet does not exist, refeerer: 
http://10.126.2.2:8082/helloform.html
ZSRV_MSG0016: URI in request GET /HelloServlet?user_name=asdasdf HTTP/1.1   is not 
valid, referer: http://10.126.2.2:8082/helloform.html  



the jvmstdout.txt log: 


Starting up StartupThread   
Starting tomcat. Check logs/tomcat.log for error messages   
cannot load servlet name: servlet1: HelloServlet
Library /QSYS.LIB/QHTTPSVR.LIB/QZTCJK.SRVPGM loaded 
Running ... 
End waiting 
Running fine




Sorry for the length of the email, I could not find any other errors anywhere. 

any help is appreciated. 

thanks

Ralph A. Borriello 

[EMAIL PROTECTED]