Re: How to start a web app?

2004-07-09 Thread Michael Labhard
Right.  So should we improve the documentation or improve all the readers of 
the documentation?  Let's see ...  Documentation, or all the readers of the 
those  docs ... Improve the docs, or all the readers of the docs ...  
Hmmm ...  What could the answer be?  Boy!  That's a tough one!


On Friday 09 July 2004 08:19 am, Mike Curwen wrote:
 Wouldn't it be easier to assume (in all things, not just tomcat docs)
 that unless 'recursion' is specifically mentioned, that a given process
 is *not* recursive?

 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automat
 ic%20Application%20Deployment

 Where in the 3rd bullet do you get the idea that tomcat would search
 recursively through the directory specified in 'appBase' ?

  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
  Sent: Friday, July 09, 2004 1:41 AM
  To: [EMAIL PROTECTED]
  Subject: RE: How to start a web app?
 
 
 
 
  -Original Message-
  From: QM
  Long story short:  Tomcat does not search the webapps
  directory recursively for webapps; it loads contexts that
  are immediate children of the webapps directory.
 
  Essential information.
 
  I do wish someone would make that explicit in the tomcat
  documentation.
 
 
  regards DaveP.
 
 
  ** snip here **
 
  --

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to start a web app?

2004-07-09 Thread Michael Labhard
On Friday 09 July 2004 09:15 am, Mike Curwen wrote:
 The point I was attempting to make is that there is nothing wrong with
 the docs,

Yes, I know.  And the point that I am trying to make is that several readers 
of the documentation disagree with you on this point.  And that is, in my 
opinion, sufficient reason to conclude that there _is_, or at least may be, 
something wrong with the docs.

It's really pointless to argue that the docs are semantically correct.  It 
doesn't matter.  What matters is whether or not they helped the readers.  
That's all that matters.  If they did then they may be semantically gibberish 
and yet they are good.  If they did not then they are wrong, regardless of 
semantics.

As an aside.  The place to fix this problem with the docs, in my opinion, is 
in the error messages.  If the error messages told the user exactly what 
mistake it made then the problem with the docs would be irrelevant.  So, 
instead of Cannot access XXX it should say, I found a subdirectory of 
webapps of the correct name but it doesn't contain a WEB-INF directory so I 
cannot proceed.  Or, I found a subdir and a WEB-INF dir and a web.xml there 
but it doesn't have XXX in the YYY place.  Then no one would care about the 
semantics of the other documentation -- it would be redundantly obscure.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to start a web app?

2004-07-08 Thread Michael Labhard
I installed a new, extremely simple application in 
$CATALINA_HOME/webapps/springapps/index.html.  When I attempt to view this 
with

http://localhost:8080/springapps/index.html

I get Error: 404.  The requested resource (/springapps/index.html) is not 
available.

So I'm reading and it says that I have to start the application by going 
into the Tomcat Manager.  So I fix the $CATALINA_HOME/conf/tomcat-users.xml 
file so that I have both admin and manager roles.  Then I go to the Tomcat 
homepage localhost:8080.  I can log into the Administration page no problem. 
But when I try to get to the Manager it says,

Access to the specified resource (Access to the requested resource has been 
denied) has been forbidden.

I'm stumped.  Don't know where to go from here.  Seems like this shouldn't be 
this difficult.  Any suggestions?

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to start a web app?

2004-07-08 Thread Michael Labhard
Mike:

Thanks for the response.  This application is slightly different but has the 
identical problem.  Yes I have a web.xml.  The directory structure for the 
app looks like this:

===
/opt/tomcat/webapps/springapps/:
niagra2

/opt/tomcat/webapps/springapps/niagra2:
WEB-INF  index.jsp

/opt/tomcat/webapps/springapps/niagra2/WEB-INF:
lib  web.xml
===

The web.xml file contains this:

===
?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 
2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'

web-app

/web-app
===

Tomcat was stop/started.  Still when I try

http://localhost:8080/springapps/niagra2/index.jsp

I get

 The requested resource (/springapps/niagra2/index.jsp) is not available.

Any other suggestions?

-- Michael

On Thursday 08 July 2004 09:48 am, Mike Curwen wrote:
 in order to be considered a webapp, you need to have an empty web.xml
 file in the WEB-INF folder under springapps.  Do you have this?

 empty means web.xml contains:

 web-app
 /web-app

 You will also need to restart Tomcat for it to pick this up.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to start a web app?

2004-07-08 Thread Michael Labhard
 Long story short:  Tomcat does not search the webapps directory
 recursively for webapps; it loads contexts that are immediate children
 of the webapps directory.

 -QM

QM:

Thank you.  That was it.  I thought I could create subfolders at will.  I must 
put all apps only one folder below.

Any ideas about the problem with the Manager?  I still cannot use it.  
Shouldn't I get a login screen as I do with the Administration option?

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to start a web app?

2004-07-08 Thread Michael Labhard
On Thursday 08 July 2004 11:14 am, Andrew Janian wrote:
 You don't get a login screen, you get a login popup.  Not getting that
 either?

Nope, not getting that either.  I did see it once, yesterday.  Ever since, 
nothing.  I have even reinstalled Tomcat without benefit.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to start a web app?

2004-07-08 Thread Michael Labhard
On Thursday 08 July 2004 11:50 am, Andrew Janian wrote:
 Are you sure that Tomcat itself is running?  

Would I not have trouble getting the Home page and logging into the 
Administration page were it not?  Also, I can install, run and use JSP pages 
deployed to $CATALINA_HOME/webapps.  I'm pretty sure it's running.

 Did the manager webapp get 
 loaded.  You should see in the logs that the manager webapp, administraion
 app, and a couple other examples get loaded if you are using Tomcat out of
 the box and have not disabled it.  

The log file shows these lines:

Jul 8, 2004 11:24:19 AM org.apache.catalina.core.StandardHostDeployer remove
INFO: Removing web application at context path /manager
Jul 8, 2004 11:24:19 AM org.apache.catalina.core.StandardHostDeployer remove
INFO: Removing web application at context path /admin
Jul 8, 2004 11:24:19 AM org.apache.catalina.logger.LoggerBase stop
INFO: unregistering logger Catalina:type=Logger,path=/admin,host=localhost

Jul 8, 2004 11:24:29 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL 
file:/etc/tomcat/Catalina/localhost/manager.xml

Jul 8, 2004 11:24:26 AM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL 
file:/etc/tomcat/Catalina/localhost/admin.xml



 Did you provide a username and password 
 when the box popped up?  What was the result if so?

Yes, I did but it was the wrong ones and I was denied access at that time.  I 
haven't had another chance.

tomcat-users.xml looks like this:

?xml version='1.0' encoding='utf-8'?
tomcat-users
  role rolename=tomcat/
  role rolename=role1/
  role rolename=manager/
  role rolename=admin/
  user username=mel password=tomcat roles=tomcat,admin,manager/
  user username=tomcat password=tomcat roles=tomcat/
  user username=role1 password=tomcat roles=role1/
/tomcat-users

My username is mel.

-- Michael


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



install task problem

2004-07-07 Thread Michael Labhard
I cannot figure out how to get the ant install task to work.  I have a WAR 
file built in the main source directory ./myapp.war.  Here is the relevant 
part of the build.xml:

target name=install description=Install application in Tomcat
depends=deploywar
install url=${tomcat.manager.url}
 username=${tomcat.manager.username}
 password=${tomcat.manager.password}
 path=/websubdir/myapp
 war=jar:file:./myapp.war!/ /
/target

Error:

java.io.IOException: Server returned HTTP response code: 401 for URL: 
http://localhost:8080/manager/install?path=%2Fwebsubdir%2Fmyappwar=jar%3Afile%3A.
%2Fmyapp.war%21%2F

Nothing else shows up in the logs.

Any advise?  Thanks.

-- Michael



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: install task problem

2004-07-07 Thread Michael Labhard
Addendum:

The problem isn't specific to the install task.  The list task yields this 
error:

java.io.IOException: Server returned HTTP response code: 401 for URL: 
http://localhost:8080/manager/list

If I enter http://localhost:8080; in my browser the main Tomcat page comes 
up.  I can enter the administration page after logging in.  But if I try to 
open the manager I get a directory listing of the 
$CATALINA_HOME/server/webapps/manager directory.

Stopping and restarting Tomcat doesn't help.

Please advise.

-- Michael





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: I've officially decided that JSTL is one of the worst things to ever happen

2004-07-04 Thread Michael Labhard
This is like a painter blaming the paint because he cannot create as well as 
Rembrandt.  Pick a language, any language.  Now it's your job to make 
software that works with it.  Nobody's going to buy the argument that you're 
a victim of the tools.  

On Sunday 04 July 2004 12:41 pm, Ivan Jouikov wrote:
 I worked on a large C++ project with 8 other people, and
 everything seemed to go fine, until we released the product.  Once it was
 put to the real test, we realized that fixing bugs and redistributing it to
 the users is a dead-end HARD job.  Never touching C++ again unless at a gun
 point.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



javax.servlet.jsp.tagext package

2004-06-17 Thread Michael Labhard
I have spent considerable time searching for the package  
javax.servlet.jsp.tagext on Tomcat 5 (0.26) without finding it.  Can anyone 
suggest where I might find it, please?  Thank you.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: javax.servlet.jsp.tagext package

2004-06-17 Thread Michael Labhard
On Thursday 17 June 2004 01:31 pm, Filip Hanik - Dev wrote:
 jakarta-servletapi-5

Thank you for pointing me here.

I have built from source and the README.txt in the jakarta-servletapi-5 
directory states that a servlet.jar file should be built from the classes.  
However it isn't and the build.xml does not have a task to do this.  Is this 
a bug or how do people use these classes?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Managing Session Objects - Preventing a Degredation in Performance

2004-05-29 Thread Michael Labhard
One more option, if you absolutely cannot control the lifetimes of the session 
objects because the user at the browser is in control and may or may not need 
the object for some time to come,  

create a caching system by writing the oldest, largest or least used objects 
to a database in such a way they can be recovered if needed.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



n00b cannot get jar files to work.

2004-05-27 Thread Michael Labhard
How do I get jar files to work?

Learning Tomcat I have a simple HelloServlet class.  When compiled and the 
class file is inserted into the directory

/opt/tomcat/webapps/test/WEB-INF/classes/example

and the web.xml file given below is placed in 

/opt/tomcat/webapps/test/WEB-INF/

and tomcat is restarted then the url

http://localhost:8080/test/hello

page reads:

Hello, world!

But if the same class is placed in a jar file and this jar file is inserted 
into any of the following directories and given permissions tomcat:tomcat

/opt/tomcat/webapps/test/WEB-INF/lib
/opt/tomcat/common/lib
/opt/tomcat/shared/lib

when tomcat is restarted and the same url is addressed first there is

 Blank page 

the second time the page is refreshed there is

Status 500:
javax.servlet.ServletException: Wrapper cannot find servlet class 

example.HelloServlet or a class it depends on

and the third and all subsequent times the page is refreshed there is

Status 400:
 Servlet hello is not available

How do I get jar files to work?  Thank you.

-- Michael

Appendix:

web.xml file:

?xml version=1.0 encoding=ISO-8859-1?

web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
version=2.4
  servlet
servlet-namehello/servlet-name
servlet-classexample.HelloServlet/servlet-class
  /servlet

  servlet-mapping
url-pattern/hello/url-pattern
servlet-namehello/servlet-name
  /servlet-mapping
/web-app


HelloServlet.java:

package example;

import java.io.*;
import java.util.*;

import javax.servlet.http.*;
import javax.servlet.*;

public class HelloServlet extends HttpServlet {
  public void doGet (
HttpServletRequest  req,
HttpServletResponse res
) throws ServletException, IOException
  {
res.setContentType(text/html);
PrintWriter pw = res.getWriter();

pw.println(!DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 
Transitional//EN\);
pw.println();
pw.println(head);
pw.println(meta http-equiv=\Content-Type\ content=\text/html; 
charset=ISO-8859-1\);
pw.println();
pw.println(!-- The Servlet expression tags interpolate script variables 
into the HTML --);
pw.println();
pw.println(titleHello, world!/title);
pw.println(/head);
pw.println();
pw.println(body bgcolor=white);
pw.println();
pw.println(h1Hello, world!/h1);
pw.println();
pw.println(/body);
pw.close();
  }

  public HelloServlet() {}
}


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: n00b cannot get jar files to work.

2004-05-27 Thread Michael Labhard
Thank you for the reply.

I assume that you meant the opposite when you wrote, There's no reason it 
should work in a jar, and it SHOULD work in a jar.

When tomcat was installed it inserted a user and a group both named tomcat 
on my machine (I'm using Gentoo Linux 2.6.4).  However, I changed the 
permissions to the jar file to my own permissions and group users but that 
did not help.  Anything else I can investigate?  I'm really stuck and have 
been working for days on just this one problem of getting Tomcat to see 
classes in jar files.  Any help would be much appreciated.

-- Michael

On Thursday 27 May 2004 09:48 am, Shapira, Yoav wrote:
 Hi,
 The class itself and web.xml look fine (though we usually tell people to
 put servlet-name before url-pattern in the servlet-mapping element, for
 backwards compatibility and/or historical reasons).  There's no reason
 it should work in a jar.  Webapps/test/WEB-INF/lib is the right place to
 put that jar.  What are tomcat:tomcat permissions?  The permissions
 should be such that the server user can read the jar.

 Yoav Shapira
 Millennium Research Informatics

 -Original Message-
 From: Michael Labhard [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 27, 2004 12:39 PM
 To: [EMAIL PROTECTED]
 Subject: n00b cannot get jar files to work.
 
 How do I get jar files to work?
 
 Learning Tomcat I have a simple HelloServlet class.  When compiled

 and

 the
 class file is inserted into the directory
 
  /opt/tomcat/webapps/test/WEB-INF/classes/example
 
 and the web.xml file given below is placed in
 
  /opt/tomcat/webapps/test/WEB-INF/
 
 and tomcat is restarted then the url
 
 http://localhost:8080/test/hello
 
 page reads:
 
  Hello, world!
 
 But if the same class is placed in a jar file and this jar file is

 inserted

 into any of the following directories and given permissions

 tomcat:tomcat

  /opt/tomcat/webapps/test/WEB-INF/lib
  /opt/tomcat/common/lib
  /opt/tomcat/shared/lib
 
 when tomcat is restarted and the same url is addressed first there is
 
   Blank page 
 
 the second time the page is refreshed there is
 
  Status 500:
  javax.servlet.ServletException: Wrapper cannot find servlet

 class

  example.HelloServlet or a class it depends on
 
 and the third and all subsequent times the page is refreshed there is
 
  Status 400:
   Servlet hello is not available
 
 How do I get jar files to work?  Thank you.
 
 -- Michael
 
 Appendix:
 
 web.xml file:
 
 ?xml version=1.0 encoding=ISO-8859-1?
 
 web-app xmlns=http://java.sun.com/xml/ns/j2ee;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
 http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
 version=2.4
   servlet
 servlet-namehello/servlet-name
 servlet-classexample.HelloServlet/servlet-class
   /servlet
 
   servlet-mapping
 url-pattern/hello/url-pattern
 servlet-namehello/servlet-name
   /servlet-mapping
 /web-app
 
 
 HelloServlet.java:
 
 package example;
 
 import java.io.*;
 import java.util.*;
 
 import javax.servlet.http.*;
 import javax.servlet.*;
 
 public class HelloServlet extends HttpServlet {
   public void doGet (
 HttpServletRequest  req,
 HttpServletResponse res
 ) throws ServletException, IOException
   {
 res.setContentType(text/html);
 PrintWriter pw = res.getWriter();
 
 pw.println(!DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0
 Transitional//EN\);
 pw.println();
 pw.println(head);
 pw.println(meta http-equiv=\Content-Type\ content=\text/html;
 charset=ISO-8859-1\);
 pw.println();
 pw.println(!-- The Servlet expression tags interpolate script
 variables
 into the HTML --);
 pw.println();
 pw.println(titleHello, world!/title);
 pw.println(/head);
 pw.println();
 pw.println(body bgcolor=white);
 pw.println();
 pw.println(h1Hello, world!/h1);
 pw.println();
 pw.println(/body);
 pw.close();
   }
 
   public HelloServlet() {}
 }
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 This e-mail, including any attachments, is a confidential business
 communication, and may contain information that is confidential,
 proprietary and/or privileged.  This e-mail is intended only for the
 individual(s) to whom it is addressed, and may not be saved, copied,
 printed, disclosed or used by anyone else.  If you are not the(an) intended
 recipient, please immediately delete this e-mail from your computer system
 and notify the sender.  Thank you.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail

Re: n00b cannot get jar files to work.

2004-05-27 Thread Michael Labhard
Yoav:

I would except the machine I am working on is an amd64 Opteron processor and I 
doubt that the binaries would work.  Gentoo built tomcat from the 5.0.18 
source and that what I am working with.

Any way to confirm that tomcat's classpath actually contains the jar file?

-- Michael

 Hi,
 Try installing it from the normal distribution at jakarta.apache.org,
 not an RPM or another package specific to your system.  The normal
 distro installation is simple: download and unzip to a directory of your
 choice.  It doesn't created any new users or groups and doesn't require
 special permissions setup.

 Yoav Shapira
 Millennium Research Informatics

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: n00b cannot get jar files to work.

2004-05-27 Thread Michael Labhard

 Why do you doubt they'd work?  I'd give them a shot if I were you --
 after all, that IS on of the main points of Java ;)

Oh, I see.  It didn't occur to me that Tomcat was itself written in java.  
But, of course!

So I downloaded the binaries and used them for the same tests just as you 
recommended, however there was no difference at all in the results.  The jar 
file still does not work.  By the way, I have double and triple checked that 
the jar file does indeed contain the very same class.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: n00b cannot get jar files to work.

2004-05-27 Thread Michael Labhard
On Thursday 27 May 2004 11:04 am, Parsons Technical Services wrote:
 Wonder if the manifest or index of the jar is not correct? That could cause
 problems.

The jar manifest is empty:

Manifest-Version: 1.0
Created-By: 1.4.2-rc1 (Blackdown Java-Linux Team)

I think this is right.  Only signed files should be listed.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: n00b cannot get jar files to work.

2004-05-27 Thread Michael Labhard
Yoav:

As happens the realization of the solution came to me as a result of our 
exchanges.  I had improperly built the jar file.  The servlet was in a 
package example but the jar file did not contain a directory example that 
contained the class.  It just contained the class.  What I should have done 
is created the jar file and then EXPANDED it in the tomcat webapps class 
location.  Then it would have been clear that the problem was the structure 
of the jar.  Once the jar had a valid structure everything worked.

This is the JDK I'm using: blackdown-jdk-1.4.2_rc1.

Thank you very much for helping me with this.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



n00b applet URI question

2004-05-27 Thread Michael Labhard
I have a simple project like this:

--
/opt/tomcat/webapps/hello:
HelloWorld.jsp  META-INF  WEB-INF

/opt/tomcat/webapps/hello/META-INF:
MANIFEST.MF

/opt/tomcat/webapps/hello/WEB-INF:
classes  lib  web.xml

/opt/tomcat/webapps/hello/WEB-INF/classes/xptoolkit/web:
HelloWorldServlet.class

/opt/tomcat/webapps/hello/WEB-INF/lib:
greetmodel.jar  helloapplet.jar
---

which should ultimately activate the HelloWorldApplet in the helloapplet.jar 
file and display Hello World from the JSP file:

HelloWorld.jsp:
[EMAIL PROTECTED] contentType=text/html%
[EMAIL PROTECTED] pageEncoding=UTF-8%
html
headtitleHello World/title/head
body

jsp:plugin type=applet
code=xptoolkit.applet.HelloWorldApplet
archive=helloapplet.jar
height=200
width=200
align=center
jsp:fallback
pplugin not supported/p
/jsp:fallback
/jsp:plugin
/body
/html

However I only see a message Loading java applet ... and nothing more.  Is 
the JSP file wrong, maybe the archive path to the applet is not correct? 
Thank you.

-- Michael

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]