Newbie can't deploy web own JSP

2002-06-09 Thread Bryan Zimmer

Greetings,

I have Tomcat4-4.0.3 configured to run with Apache. I am trying to deploy my
own simple web application but have had no success.

My application (actually copied from a book) consists of a bean called
(JSPCal/Cal.class) and a jsp page to display a Calendar by calling the
bean's methods.

I am running RedHat Linux version 7.3 on my tomcat server.

What steps do I have to do to install my own web app?
I did the following:

1. Created an alias for the directory in httpd.conf
Alias "/baz-jsp/" "/var/tomcat4/webapps/baz-jsp/"

2. I copied the same information for the  entry that I had down
for the "examples" application.

3. I created /var/tomcat4/webapps/baz-jsp with the subdirectories jsp and
WEB-INF. I copied the web.xml from the /var/tomcat4/webapps/examples
directory. I didn't change much. I don't understand web.xml, but most of it
looked like system-y stuff (like the "filter" entries). The there were the
names of some servlets but nothing about JSP's. So I did not add information
about my Cal.jsp or my bean JSPCal.class in the web.xml.

4. I created a classes subdirectory of WEB-INF and put Cal.class (the bean)
there. I put Cal.jsp in the jsp subdirectory of
/var/tomcat4/webapps/baz-jsp.

5. Back in /etc/httpd/conf/httpd.conf, I created an entry for "baz-jsp"
using the same WarpConnection as for examples.

6. Basically I tried to get "baz-jsp" looking like examples, as configured.

By the way, I have never been successful in getting the opening page for
tomcat to display...the famous one that shows the in the upper left corner.
I get to the examples by pointing my browser at
http://mail.baz-tech.com/examples/.
(This should be inaccessible from outside my firewall.)

This gives my an index of three directories. When I tried the same thing as
http://mail.baz-tech.com/baz-jsp/ I got an error message in the browser,
"Resource not available."

Can anyone tell me the basics of setting up a web application, or point me
to any good resources on the subject?

Thanks for your time.

Bryan Zimmer



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




Problems stopping tomcat 4.0.4 on linux

2002-07-07 Thread Bryan Zimmer

Greetings,

I am running Tomcat and Apache together on a RedHat Linux box. Up until
recently they seem to have done quite well. I recently encountered a problem
that I can not trace to any configuration change that I made - I made few or
none - although the problem seems related to configuration. Just today I
installed the rpm version of Tomcat 4.0.4, upgrading from 4.0.3, first
wiping out the old tomcat installation (but saving the important config
files in a different directory). I still get the same results.

On RedHat, the startup script is invoked by issuing the command "service
tomcat4 start", and correspondingly to shut down "service tomcat4 stop".
What happens is that Tomcat seems to start up without complaint, although
its /webapps/examples directory was inaccessible. That may have been an
Apache problem configuring mod_webapp.so and the WarpConnection, or the
directory aliases (do they end with a slash or not? Is there a printed or
online guide to configuring mod_webapp and WarpConnection?).

However, when I issued the command "service tomcat4 stop", I got the
following output:

Stopping tomcat4:
Using CATALINA_BASE:   /var/tomcat4
Using CATALINA_HOME:   /var/tomcat4
Using CATALINA_TMPDIR: /var/tomcat4/temp
Using JAVA_HOME:   /usr/java/jdk   <<--- symbolic link to my
/usr/java/j2sdk1.4.0
Catalina.stop: java.net.NoRouteToHostException: No route to host
java.net.NoRouteToHostException: No route to host
 at java.net.PlainSocketImpl.socketConnect(Native Method)
 at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
 at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
 at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
 at java.net.Socket.connect(Socket.java:425)
 at java.net.Socket.connect(Socket.java:375)
 at java.net.Socket.(Socket.java:290)
 at java.net.Socket.(Socket.java:118)
 at org.apache.catalina.startup.Catalina.stop(Catalina.java:831)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:683)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
  FAILED

Tomcat actually did stop, but I can't understand the meaning of "No route to
host". The localhost and the machines external IP addresses are both in my
routing table. I checked all the config files I could think of, but couldn't
come up with any ideas.

Can anyone help me solve this dilemma?

Also, I had to use the --nodeps switch on rpm when installing 4.0.4, because
rpm was unaware of the existence of log4j on my machine, but that's another
matter.

Thanks,

Bryan A. Zimmer
[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: FW: Problems stopping tomcat 4.0.4 on linux

2002-07-07 Thread Bryan Zimmer

According to my process table "ps -ef f" Tomcat4 and its numerous 
sub-threads had indeed started. I haven't tweaked the config files so 
I'm not yet sure if it's responding at all as a standalone server.

Good guess, though.


On Sunday 07 July 2002 09:01 pm, Daniel Farinha wrote:
> That reminds me of the error I get every time I try to shutdown
> Tomcat when it is not actually running, only I get a
> "java.net.ConnectException: Connection refused". This happens often
> during my messing up with the configuration files, since the startup
> script never outputs any errors, including the fact that Tomcat might
> not have started at all (you really have to look at logs/catalina.out
> if you're not sure). When I realise something's gone wrong and try
> stopping Tomcat (without realising it wasn't running at all) then end
> up getting the Exception, along with the thread stack.
>
> Perhaps the NoRouteToHostException is also related to Tomcat not
> having initialised properly, since you do have that problem in
> /webapps/examples?
>
> Dan
>
> > -Original Message-
> > From: Bryan Zimmer [mailto:[EMAIL PROTECTED]]
> > Sent: 08 July 2002 02:42
> > To: Tomcat Users
> > Subject: Problems stopping tomcat 4.0.4 on linux
> >
> >
> > Greetings,
> >
> > I am running Tomcat and Apache together on a RedHat Linux
> > box. Up until recently they seem to have done quite well. I
> > recently encountered a problem that I can not trace to any
> > configuration change that I made - I made few or none -
> > although the problem seems related to configuration. Just
> > today I installed the rpm version of Tomcat 4.0.4, upgrading
> > from 4.0.3, first wiping out the old tomcat installation (but
> > saving the important config files in a different directory).
> > I still get the same results.
> >
> > On RedHat, the startup script is invoked by issuing the
> > command "service tomcat4 start", and correspondingly to shut
> > down "service tomcat4 stop". What happens is that Tomcat
> > seems to start up without complaint, although its
> > /webapps/examples directory was inaccessible. That may have
> > been an Apache problem configuring mod_webapp.so and the
> > WarpConnection, or the directory aliases (do they end with a
> > slash or not? Is there a printed or online guide to
> > configuring mod_webapp and WarpConnection?).
> >
> > However, when I issued the command "service tomcat4 stop", I
> > got the following output:
> >
> > Stopping tomcat4:
> > Using CATALINA_BASE:   /var/tomcat4
> > Using CATALINA_HOME:   /var/tomcat4
> > Using CATALINA_TMPDIR: /var/tomcat4/temp
> > Using JAVA_HOME:   /usr/java/jdk   <<--- symbolic link to
> > my /usr/java/j2sdk1.4.0
> > Catalina.stop: java.net.NoRouteToHostException: No route to host
> > java.net.NoRouteToHostException: No route to host
> >  at java.net.PlainSocketImpl.socketConnect(Native Method)
> >  at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:295)
> >  at
> > java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:161)
> >  at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:148)
> >  at java.net.Socket.connect(Socket.java:425)
> >  at java.net.Socket.connect(Socket.java:375)
> >  at java.net.Socket.(Socket.java:290)
> >  at java.net.Socket.(Socket.java:118)
> >  at org.apache.catalina.startup.Catalina.stop(Catalina.java:831)
> >  at org.apache.catalina.startup.Catalina.execute(Catalina.java:683)
> >  at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
> >  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)  at
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess
> > orImpl.java:39
> > )
> >  at
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth
> > odAccessorImpl
> > .java:25)
> >  at java.lang.reflect.Method.invoke(Method.java:324)
> >  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
> >   FAILED
> >
> > Tomcat actually did stop, but I can't understand the meaning
> > of "No route to host". The localhost and the machines
> > external IP addresses are both in my routing table. I checked
> > all the config files I could think of, but couldn't come up
> > with any ideas.
> >
> > Can anyone help me solve this dilemma?
> >
> > Also, I had to use the --nodeps switch on rpm when installing
> > 4.0.4, because rpm was unaware of the existence of log4j on
> > my machine, but that's another matter.
> >
> > Thanks,
> >
> > Bryan A. Zimmer
> > [EMAIL PROTECTED]
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:tomcat-user-> [EMAIL PROTECTED]>
> > For
> > additional commands,
> > e-mail: <mailto:[EMAIL PROTECTED]>

-- 
Bryan A. Zimmer
[EMAIL PROTECTED]

 Populus vult decipi.
[The people like to be deceived.]


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




Re: FW: Problems stopping tomcat 4.0.4 on linux

2002-07-08 Thread Bryan Zimmer

I'm afraid I got this wrong again. I checked my process table again and
indeed Tomcat had not started at all, and upon trying to stop, I got the
exact message you described, "Connection refused".

What worked for you in this circumstance?

I don't think I am doing anything different as far as configuration goes:
has Tomcat4 changed in version 4.0.4? Mainly what I have done, since tomcat
doesn't even start standalone, is change all the instances of "localhost" in
server.xml to my server's external dns name, the name it formerly worked
under when I was using 4.0.3. Since it is a test environment, there is no
"www" alias or anything.

Of course, I tweaked tomcat4.conf to show where my java was located, and
uncommented the parts of catalina.policy that had to do with granting
permissions to /webapps/examples.

I am still clueless now that the problem has changed: tomcat4 won't even
start standalone.

Please tell me what worked for you before, I am obviously missing something,
configuration-wise.

Thanks,
Bryan A. Zimmer
[EMAIL PROTECTED]

- Original Message -
From: "Bryan Zimmer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "'Tomcat Users List'"
<[EMAIL PROTECTED]>
Sent: Sunday, July 07, 2002 9:22 PM
Subject: Re: FW: Problems stopping tomcat 4.0.4 on linux


> According to my process table "ps -ef f" Tomcat4 and its numerous
> sub-threads had indeed started. I haven't tweaked the config files so
> I'm not yet sure if it's responding at all as a standalone server.
>
> Good guess, though.
>
>
> On Sunday 07 July 2002 09:01 pm, Daniel Farinha wrote:
> > That reminds me of the error I get every time I try to shutdown
> > Tomcat when it is not actually running, only I get a
> > "java.net.ConnectException: Connection refused". This happens often
> > during my messing up with the configuration files, since the startup
> > script never outputs any errors, including the fact that Tomcat might
> > not have started at all (you really have to look at logs/catalina.out
> > if you're not sure). When I realise something's gone wrong and try
> > stopping Tomcat (without realising it wasn't running at all) then end
> > up getting the Exception, along with the thread stack.
> >
> > Perhaps the NoRouteToHostException is also related to Tomcat not
> > having initialised properly, since you do have that problem in
> > /webapps/examples?
> >
> > Dan
> >
> > > -Original Message-
> > > From: Bryan Zimmer [mailto:[EMAIL PROTECTED]]
> > > Sent: 08 July 2002 02:42
> > > To: Tomcat Users
> > > Subject: Problems stopping tomcat 4.0.4 on linux
> > >
> > >
> > > Greetings,
> > >
> > > I am running Tomcat and Apache together on a RedHat Linux
> > > box. Up until recently they seem to have done quite well. I
> > > recently encountered a problem that I can not trace to any
> > > configuration change that I made - I made few or none -
> > > although the problem seems related to configuration. Just
> > > today I installed the rpm version of Tomcat 4.0.4, upgrading
> > > from 4.0.3, first wiping out the old tomcat installation (but
> > > saving the important config files in a different directory).
> > > I still get the same results.
> > >
> > > On RedHat, the startup script is invoked by issuing the
> > > command "service tomcat4 start", and correspondingly to shut
> > > down "service tomcat4 stop". What happens is that Tomcat
> > > seems to start up without complaint, although its
> > > /webapps/examples directory was inaccessible. That may have
> > > been an Apache problem configuring mod_webapp.so and the
> > > WarpConnection, or the directory aliases (do they end with a
> > > slash or not? Is there a printed or online guide to
> > > configuring mod_webapp and WarpConnection?).
> > >
> > > However, when I issued the command "service tomcat4 stop", I
> > > got the following output:
> > >
> > > Stopping tomcat4:
> > > Using CATALINA_BASE:   /var/tomcat4
> > > Using CATALINA_HOME:   /var/tomcat4
> > > Using CATALINA_TMPDIR: /var/tomcat4/temp
> > > Using JAVA_HOME:   /usr/java/jdk   <<--- symbolic link to
> > > my /usr/java/j2sdk1.4.0
> > > Catalina.stop: java.net.NoRouteToHostException: No route to host
> > > java.net.NoRouteToHostException: No route to host
> > >  at java.net.PlainSocketImpl.socketConnect(Native Method)
> > >  at java.net.PlainS

Re: Problems starting tomcat 4.0.4 on linux Was: Problems stopping tomcat 4.0.4 on linux

2002-07-08 Thread Bryan Zimmer

Still having problems, now with starting tomcat4.
Since I got your earlier message, as I said earlier, I am now getting what
seem to be "OK" startups from the /etc/init.d/tomcat4 script, but tomcat
never actually starts, so as a result I got the same  message you described.

I decided to try a couple of things after studying the script
"/etc/init.d/tomcat4".

There is a startup script in /usr/bin called dtomcat4, with options "start",
"stop", "run", etc. I decided to run the script directly. I su'd to be user
tomcat4, and issued the command "dtomcat4 run", which gave the following
output:
Using CATALINA_BASE:   /var/tomcat4
Using CATALINA_HOME:   /var/tomcat4
Using CATALINA_TMPDIR: /var/tomcat4/temp
Using JAVA_HOME:   /usr/java/jdk
ERROR reading /var/tomcat4/conf/server.xml
At Line 324 /Server/Service/Connector/
className=org.apache.catalina.connector.warp.WarpConnector port=8008
minProcessors=5 maxProcessors=75 enableLookups=true appBase=webapps
acceptCount=10 debug=0

Catalina.start: java.lang.ClassNotFoundException:
org.apache.catalina.connector.warp.WarpConnector
java.lang.ClassNotFoundException:
org.apache.catalina.connector.warp.WarpConnector
 at
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader
.java:1127)
 at
org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader
.java:992)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)
 at java.lang.Class.forName0(Native Method)
 ...
[ class heirarchy snipped ]

 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)

On an earlier attempt it had given me the error:
Error at server.xml line 84
Class not found: org.apache.catalina.connector.Ajp13Connecter

So I commented out the Ajp13  tag to see what else would
happen.

Obviously I either don't have the "connector" classes at all, or the
CLASSPATH wasn't being set to include them. Does anyone have any idea?

I tried re-installing the rpms for tomcat4-4.0.4-full-noarch.jpp.rpm (or
whatever it's called) and also the rpm for the webapps.

I got an error:

Preparing...
##
tomcat4 warning: /etc/rc.d/init.d/tomcat4 saved as
/etc/rc.d/init.d/tomcat4.rpmorig
error: unpacking of archive
failed on file /var/tomcat4/server/lib/servlets-cgi.renametojar;3d2a4ecd:
cpio: read failed - Bad file descriptor
tomcat4-webapps
##

Is this the culprit? Or am I looking at two different problems? Does anyone
have any ideas? I have no been without tomcat for a few days during an
intensive testing period.

Any help would be very much appreciated.



- Original Message -
From: "Daniel Farinha" <[EMAIL PROTECTED]>
To: "'Tomcat Users List'" <[EMAIL PROTECTED]>; "'Bryan Zimmer'"
<[EMAIL PROTECTED]>
Sent: Sunday, July 07, 2002 9:01 PM
Subject: FW: Problems stopping tomcat 4.0.4 on linux


> That reminds me of the error I get every time I try to shutdown Tomcat
> when it is not actually running, only I get a
> "java.net.ConnectException: Connection refused". This happens often
> during my messing up with the configuration files, since the startup
> script never outputs any errors, including the fact that Tomcat might
> not have started at all (you really have to look at logs/catalina.out if
> you're not sure). When I realise something's gone wrong and try stopping
> Tomcat (without realising it wasn't running at all) then end up getting
> the Exception, along with the thread stack.
>
> Perhaps the NoRouteToHostException is also related to Tomcat not having
> initialised properly, since you do have that problem in
> /webapps/examples?
>
> Dan
>
> > -Original Message-
> > From: Bryan Zimmer [mailto:[EMAIL PROTECTED]]
> > Sent: 08 July 2002 02:42
> > To: Tomcat Users
> > Subject: Problems stopping tomcat 4.0.4 on linux
> >
> >
> > Greetings,
> >
> > I am running Tomcat and Apache together on a RedHat Linux
> > box. Up until recently they seem to have done quite well. I
> > recently encountered a problem that I can not trace to any
> > configuration change that I made - I made few or none -
> > although the problem seems related to configuration. Just
> > today I installed the rpm version of Tomcat 4.0.4, upgrading
> > from 4.0.3, first wiping out the old tomcat installation (but
> > saving the important config files in a different directory).
> > I still get the same results.
> >
> > On RedHat, the startup script is invoked by issuing the
> > command 

Port 8080

2002-07-09 Thread Bryan Zimmer

Greetings,

I am running Tomcat version 4.0.4 with Apache 1.3.26.

Before I installed version 4.0.4, I had no trouble accessing my tomcat
applications, by saying, for example:

mozilla http://my.server.name/examples

This would bring up the $CATALINA_HOME/webapps/examples application
directory, from which I could choose JSP examples or servlets. I could also
do the same with my self-written JSP's, which resided in the directory
$CATALINA_HOME/webapps/baz-jsp.

In that case I could say:

netscape http://my.server.name/baz-jsp

and get to the index.html of that directory.

Now, and perhaps I've installed correctly because this was supposed to work
before, and didn't:

mozilla (or netscape or whatever) http://my.server.name:8080/baz-jsp
(or http://my.server.name:8080/examples)

My question is, how can I get regular port 80 access so the client doesn't
need to specify port 8080 and tomcat is integrated seamlessly with Apache?

Is it something simple, like jus adjusting the port number in server.xml? I
have had some many configuration trials I haven't even tried this. I don't
want to mess up Tomcat-Apache.

Can anyone tell me how to do this? Any advice much appreciated.

I am running with mod_webapp.so, by the way.

Thanks,

Bryan A. Zimmer
[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Newbie needs config help for tomcat4

2002-03-04 Thread Bryan Zimmer

Hello all,

Here's the setup:

I have been running Apache 1.3 and recently decided to switch to JSP from
CGI. So I downloaded tomcat-4.0.1. I use Linux, so I found an RPM-format
distribution of tomcat4.

I need to learn how to deploy my own JSP's, which I haven't been able to do
yet.

I can run the examples that come with Tomcat4. I managed to find the
"webapp.so" module and enough other information about configuration that,
after modifying my httpd.conf file and creating a "WarpConnection" through
port 8008, I could run the test programs in the examples folder (mine is at
/var/tomcat4/webapps/examples, aliased to "/examples/") . I installed all
this on my test server.

I can now browse to http://(my.server.name)/examples/ and run the JSP
examples.I do not have to specify the port as 8008.

Now I want to install and test some of my own JSP's, but I can't find
documentation on how to do this. I have a book, "JSP and Java, A Complete
Guide to Website Development", by Art Taylor, but it focuses on Tomcat
version 3. So I haven't even been able to deploy a simple JSP example.

Can someone help me with this? I have plans to put Apache and Tomcat into a
production environment, and I wonder if I need to revert back to Tomcat
version 3. I need either some configuration advice on how to deploy my own
JSP or perhaps someone can recommend a good book or on-line tutorial on the
subject.

I considered a newer Tomcat, but starting with 4.0.2 they seem to require
the experimental Apache version 2. And I can't tell whether to use the
webapp.so module or mod_jk.so.

All help gratefully appreciated.

Thanks,


Bryan Zimmer
[EMAIL PROTECTED]




smime.p7s
Description: application/pkcs7-signature