You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mark Liu <ma...@yahoo.com> on 2003/01/25 09:04:48 UTC

Deployment Problem: Got No Clue!

I am running Tomcat 4.1.12 on my Windows 2000 system.

Tomcat runs pretty well.  The examples run pretty
well.

I created an x509 directory under webapps, i.e., I
have C:\Tomcat4_1_12\webapps\x509 now.

Then I created 2 folders under x509: WEB-INF and Test,
i.e., I have

C:\Tomcat4_1_12\webapps\x509\WEB-INF

and

C:\Tomcat4_1_12\webapps\x509\Test

now. 

Under WEB-INF I have web.xml and a folder called
classes.

i.e., C:\Tomcat4_1_12\webapps\x509\WEB-INF\classes.

I put Marty Hall's ShowParametersPostForm.html under
Test, and his ShowParameters.class &
ServletUtilities.class under classes.

I was able to see the ShowParametersPostForm.html page
via this link:

http://localhost/x509/Test/ShowParametersPostForm.html

But then when I fill up the form and hit submit, I
always get this:

type Status report

message /x509/servlet/ShowParameters

description The requested resource
(/x509/servlet/ShowParameters) is not available.

However, if I move the structure to Tomcat's examples
folder, it works great.

Please note that I have changed servlet path specified
in ShowParametersPostForm.html to

<FORM ACTION="../servlet/ShowParameters"
METHOD="POST">

Also please note that I have added x509 context in
server.xml under conf, like so:

<!-- Project X509 context -->
        <Context path="/x509" docBase="x509"
         debug="0" reloadable="true"
privileged="true"/>

I do not understand why it does not work under my x509
directory.  I have been trying this for the whole day!

Any kind help please?

Thanks a lot.

Mark



__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Problem running 2 instances of Tomcat

Posted by Emerson Cargnin <em...@tre-sc.gov.br>.
why don't you use ifconfig to get two ip addresses ont he same machine? 
so you don't have to bother with ports...

John Turner wrote:

>
> Change the ports in server.xml.  Each Tomcat needs its own shutdown 
> port and its own Connector port.
>
> John
>
> On Tue, 13 May 2003 09:41:40 -0700 (PDT), Mark Liu 
> <ma...@yahoo.com> wrote:
>
>> I do need to run 2 instances of Tomcat on the same Sun
>> work station (the OS is Solaris 9).
>>
>> I am running one on port 80, and when I tried to run
>> another one on 8080, I got the following
>> java.net.BindException.  It seems that ports 8009 and
>> 8005 are being used by the other instance of Tomcat.
>>
>> So, how can I get around this?  Can I change these
>> port numbers somewhere?  Thanks.
>>
>> ***** The exceptions ********
>>
>> May 13, 2003 11:23:48 AM
>> org.apache.coyote.http11.Http11Protocol start
>> INFO: Starting Coyote HTTP/1.1 on port 8080
>> May 13, 2003 11:23:48 AM
>> org.apache.coyote.http11.Http11Protocol start
>> INFO: Starting Coyote HTTP/1.1 on port 8443
>> May 13, 2003 11:23:49 AM
>> org.apache.jk.common.ChannelSocket init
>> INFO: Port busy 8009 java.net.BindException: Address
>> already in use
>> May 13, 2003 11:23:49 AM
>> org.apache.jk.common.ChannelSocket init
>> INFO: JK2: ajp13 listening on /0.0.0.0:8010
>> May 13, 2003 11:23:49 AM org.apache.jk.server.JkMain
>> start
>> INFO: Jk running ID=1 time=14/639 
>> config=/export/home/tomcat4.1.24/conf/jk2.properties
>> StandardServer.await: create[8005]:
>> java.net.BindException: Address already in use
>> java.net.BindException: Address already in use
>> at java.net.PlainSocketImpl.socketBind(Native
>> Method)
>> at
>> java.net.PlainSocketImpl.bind(PlainSocketImpl.java:321)
>> at
>> java.net.ServerSocket.bind(ServerSocket.java:308)
>> at
>> java.net.ServerSocket.bind(ServerSocket.java:266)
>> at
>> java.net.ServerSocket.<init>(ServerSocket.java:182)
>> at
>> org.apache.catalina.core.StandardServer.await(StandardServer.java:510)
>> at
>> org.apache.catalina.startup.Catalina.start(Catalina.java:521)
>> at
>> org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
>> at
>> org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>> 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:203)
>> Stopping service Tomcat-Standalone
>>
>> __________________________________
>> Do you Yahoo!?
>> The New Yahoo! Search - Faster. Easier. Bingo.
>> http://search.yahoo.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>
>
>

-- 
Emerson Cargnin
Analista de Sitemas
Setor de Desenvolvimento de Sistemas - TRE-SC
tel : (048) - 251-3700 - Ramal 3181




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Problem running 2 instances of Tomcat

Posted by John Turner <to...@johnturner.com>.
Change the ports in server.xml.  Each Tomcat needs its own shutdown port 
and its own Connector port.

John

On Tue, 13 May 2003 09:41:40 -0700 (PDT), Mark Liu <ma...@yahoo.com> 
wrote:

> I do need to run 2 instances of Tomcat on the same Sun
> work station (the OS is Solaris 9).
>
> I am running one on port 80, and when I tried to run
> another one on 8080, I got the following
> java.net.BindException.  It seems that ports 8009 and
> 8005 are being used by the other instance of Tomcat.
>
> So, how can I get around this?  Can I change these
> port numbers somewhere?  Thanks.
>
> ***** The exceptions ********
>
> May 13, 2003 11:23:48 AM
> org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on port 8080
> May 13, 2003 11:23:48 AM
> org.apache.coyote.http11.Http11Protocol start
> INFO: Starting Coyote HTTP/1.1 on port 8443
> May 13, 2003 11:23:49 AM
> org.apache.jk.common.ChannelSocket init
> INFO: Port busy 8009 java.net.BindException: Address
> already in use
> May 13, 2003 11:23:49 AM
> org.apache.jk.common.ChannelSocket init
> INFO: JK2: ajp13 listening on /0.0.0.0:8010
> May 13, 2003 11:23:49 AM org.apache.jk.server.JkMain
> start
> INFO: Jk running ID=1 time=14/639 
> config=/export/home/tomcat4.1.24/conf/jk2.properties
> StandardServer.await: create[8005]:
> java.net.BindException: Address already in use
> java.net.BindException: Address already in use
> at java.net.PlainSocketImpl.socketBind(Native
> Method)
> at
> java.net.PlainSocketImpl.bind(PlainSocketImpl.java:321)
> at
> java.net.ServerSocket.bind(ServerSocket.java:308)
> at
> java.net.ServerSocket.bind(ServerSocket.java:266)
> at
> java.net.ServerSocket.<init>(ServerSocket.java:182)
> at
> org.apache.catalina.core.StandardServer.await(StandardServer.java:510)
> at
> org.apache.catalina.startup.Catalina.start(Catalina.java:521)
> at
> org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
> at
> org.apache.catalina.startup.Catalina.process(Catalina.java:180)
> 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:203)
> Stopping service Tomcat-Standalone
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Problem running 2 instances of Tomcat

Posted by Mark Liu <ma...@yahoo.com>.
I do need to run 2 instances of Tomcat on the same Sun
work station (the OS is Solaris 9).

I am running one on port 80, and when I tried to run
another one on 8080, I got the following
java.net.BindException.  It seems that ports 8009 and
8005 are being used by the other instance of Tomcat.

So, how can I get around this?  Can I change these
port numbers somewhere?  Thanks.

***** The exceptions ********

May 13, 2003 11:23:48 AM
org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
May 13, 2003 11:23:48 AM
org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8443
May 13, 2003 11:23:49 AM
org.apache.jk.common.ChannelSocket init
INFO: Port busy 8009 java.net.BindException: Address
already in use
May 13, 2003 11:23:49 AM
org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8010
May 13, 2003 11:23:49 AM org.apache.jk.server.JkMain
start
INFO: Jk running ID=1 time=14/639 
config=/export/home/tomcat4.1.24/conf/jk2.properties
StandardServer.await: create[8005]:
java.net.BindException: Address already in use
java.net.BindException: Address already in use
        at java.net.PlainSocketImpl.socketBind(Native
Method)
        at
java.net.PlainSocketImpl.bind(PlainSocketImpl.java:321)
        at
java.net.ServerSocket.bind(ServerSocket.java:308)
        at
java.net.ServerSocket.bind(ServerSocket.java:266)
        at
java.net.ServerSocket.<init>(ServerSocket.java:182)
        at
org.apache.catalina.core.StandardServer.await(StandardServer.java:510)
        at
org.apache.catalina.startup.Catalina.start(Catalina.java:521)
        at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
        at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
        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:203)
Stopping service Tomcat-Standalone

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Deployment Problem: Got No Clue!

Posted by Mark Liu <ma...@yahoo.com>.
Really?  This was not a requirement for earlier
versions of Tomcat, right?

Here is my web.xml for my x509 application:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!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>
  <display-name>X509 Project</display-name>
  <description>
     X509 Public Key Certificate Authentication
  </description>
</web-app>

Please continue to educate.  Thanks a lot!


--- vim m <vi...@yahoo.com> wrote:
> What does your web.xml file contain? For every
> servlet
> in your application, you should have a <servlet>
> element and a mapping element. 
> 
> 
> 
> 
> --- Mark Liu <ma...@yahoo.com> wrote:
> > I am running Tomcat 4.1.12 on my Windows 2000
> > system.
> > 
> > Tomcat runs pretty well.  The examples run pretty
> > well.
> > 
> > I created an x509 directory under webapps, i.e., I
> > have C:\Tomcat4_1_12\webapps\x509 now.
> > 
> > Then I created 2 folders under x509: WEB-INF and
> > Test,
> > i.e., I have
> > 
> > C:\Tomcat4_1_12\webapps\x509\WEB-INF
> > 
> > and
> > 
> > C:\Tomcat4_1_12\webapps\x509\Test
> > 
> > now. 
> > 
> > Under WEB-INF I have web.xml and a folder called
> > classes.
> > 
> > i.e.,
> C:\Tomcat4_1_12\webapps\x509\WEB-INF\classes.
> > 
> > I put Marty Hall's ShowParametersPostForm.html
> under
> > Test, and his ShowParameters.class &
> > ServletUtilities.class under classes.
> > 
> > I was able to see the ShowParametersPostForm.html
> > page
> > via this link:
> > 
> >
>
http://localhost/x509/Test/ShowParametersPostForm.html
> > 
> > But then when I fill up the form and hit submit, I
> > always get this:
> > 
> > type Status report
> > 
> > message /x509/servlet/ShowParameters
> > 
> > description The requested resource
> > (/x509/servlet/ShowParameters) is not available.
> > 
> > However, if I move the structure to Tomcat's
> > examples
> > folder, it works great.
> > 
> > Please note that I have changed servlet path
> > specified
> > in ShowParametersPostForm.html to
> > 
> > <FORM ACTION="../servlet/ShowParameters"
> > METHOD="POST">
> > 
> > Also please note that I have added x509 context in
> > server.xml under conf, like so:
> > 
> > <!-- Project X509 context -->
> >         <Context path="/x509" docBase="x509"
> >          debug="0" reloadable="true"
> > privileged="true"/>
> > 
> > I do not understand why it does not work under my
> > x509
> > directory.  I have been trying this for the whole
> > day!
> > 
> > Any kind help please?
> > 
> > Thanks a lot.
> > 
> > Mark
> > 
> > 
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> > now.
> > http://mailplus.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:  
> >
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: At my wits' end: Using JavaBean in JSP

Posted by William Wragg <wi...@datapro.co.uk>.
Jasper compiles my Beans for me. What I do is clear out the 
$CATALINA_HOME/work/Standalone/localhost/MyApp and then when Japser 
compiles the JSP's for the first time and there are no classes (or the java 
source has changed) for the Bean, it will compile the Bean for me when it 
is used in a page. This is using 4.0.4 is it different for later versions?

At 09:59 23/05/2003, you wrote:

>If this file is correct (typo excepted)
>/export/home/tomcat4.1.24/webapps/ROOT/WEB-INF/classes/corsevlets/StringBean.java
>then the problem is that you need to deploy the compiled class file and 
>not the source. Jasper doesn't compile beans for you.
>
>Mark Liu wrote:
>>I searched the Web for a while, and found that quite
>>many people had the same problem.  But no one solution
>>I found on the Web solved the problem.
>>The problem is that my JSP page just can't get
>>compiled. And here are the exceptions:
>>org.apache.jasper.JasperException:
>>coreservlets.StringBean
>>   [snip]
>>java.lang.ClassNotFoundException:
>>coreservlets.StringBean
>>   [snip]
>>Before you take it for granted that it's a path
>>problem, I do have the correct path for everything!
>>I did try <%@ page import="coreservlets.StringBean" %>
>>at the top of the jsp page, it does not help!
>>*** The Bean class is from *************
>>*** Marty Hall's Core Servlets *********
>>*** and so is the StringBean.jsp***
>>package coreservlets;
>>public class StringBean {
>>   private String message = "No message specified";
>>   // Some people suggested that I
>>   // add the default constructor, which
>>   // does not help solve the problem.
>>   public StringBean()
>>   {}
>>   public String getMessage() {
>>     return(message);
>>   }
>>   public void setMessage(String message) {
>>     this.message = message;
>>   }
>>}
>>*** And the JSP page is right here ****
>><!-- this import below does not help -->
>><%@ page import="coreservlets.StringBean" %>
>><HTML>
>><HEAD>
>><TITLE>Using JavaBeans with JSP</TITLE>
>></HEAD>
>><BODY>
>><TABLE BORDER=5 ALIGN="CENTER">
>>   <TR><TH CLASS="TITLE">
>>       Using JavaBeans with JSP</TABLE>
>>
>><jsp:useBean id="stringBean"
>>class="coreservlets.StringBean" />
>><OL>
>><LI>Initial value (getProperty):
>><!-- the problem persists even if I do
>>      name="coreservlets.stringBean" below
>>-->
>>     <I><jsp:getProperty 
>> name="stringBean"                         property="message" /></I>
>><LI>Initial value (JSP expression):
>>     <I><%= stringBean.getMessage() %></I>
>><LI><jsp:setProperty 
>>name="stringBean"                      property="message" 
>>      value="Best string bean: Fortex"
>>/>
>>     Value after setting property with setProperty:
>>     <I><jsp:getProperty 
>> name="stringBean"                         property="message" /></I>
>><LI><% stringBean.setMessage("My favorite: Kentucky
>>Wonder"); %>
>>     Value after setting property with scriptlet:
>>     <I><%= stringBean.getMessage() %></I>
>></OL>
>>
>></BODY>
>></HTML>
>>*** end of the JSP ***
>>On the Solaris system where I run tomcat4.1.24, the
>>Bean file is at
>>/export/home/tomcat4.1.24/webapps/ROOT/WEB-INF/classes/corsevlets/StringBean.java
>>and the JSP is at
>>/export/home/tomcat4.1.24/webapps/ROOT/StringBean.jsp
>>My tomcat server is running well, servlets work just
>>great.
>>This is the first time I try working with JavaBeans
>>and got so much trouble.  Really do not understand why
>>I am getting those exceptions.  Any idea please?
>>
>>__________________________________
>>Do you Yahoo!?
>>The New Yahoo! Search - Faster. Easier. Bingo.
>>http://search.yahoo.com
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.483 / Virus Database: 279 - Release Date: 19/05/2003

Re: At my wits' end: Using JavaBean in JSP

Posted by Jon Wingfield <jo...@mkodo.com>.
If this file is correct (typo excepted)
/export/home/tomcat4.1.24/webapps/ROOT/WEB-INF/classes/corsevlets/StringBean.java
then the problem is that you need to deploy the compiled class file and 
not the source. Jasper doesn't compile beans for you.

Mark Liu wrote:
> I searched the Web for a while, and found that quite
> many people had the same problem.  But no one solution
> I found on the Web solved the problem.
> 
> The problem is that my JSP page just can't get
> compiled. And here are the exceptions:
> 
> org.apache.jasper.JasperException:
> coreservlets.StringBean
>   [snip]
> java.lang.ClassNotFoundException:
> coreservlets.StringBean
>   [snip]
> 
> Before you take it for granted that it's a path
> problem, I do have the correct path for everything!
> 
> I did try <%@ page import="coreservlets.StringBean" %>
> at the top of the jsp page, it does not help!
> 
> *** The Bean class is from *************
> *** Marty Hall's Core Servlets *********
> *** and so is the StringBean.jsp***
> 
> package coreservlets;
> 
> public class StringBean {
>   private String message = "No message specified";
> 
>   // Some people suggested that I
>   // add the default constructor, which
>   // does not help solve the problem.
> 
>   public StringBean()
>   {}
> 
>   public String getMessage() {
>     return(message);
>   }
> 
>   public void setMessage(String message) {
>     this.message = message;
>   }
> }
> 
> *** And the JSP page is right here ****
> 
> <!-- this import below does not help -->
> <%@ page import="coreservlets.StringBean" %> 
> 
> <HTML>
> <HEAD>
> <TITLE>Using JavaBeans with JSP</TITLE>
> </HEAD>
> 
> <BODY>
> 
> <TABLE BORDER=5 ALIGN="CENTER">
>   <TR><TH CLASS="TITLE">
>       Using JavaBeans with JSP</TABLE>
>  
> <jsp:useBean id="stringBean"
> class="coreservlets.StringBean" />
> 
> <OL>
> <LI>Initial value (getProperty):
> 
> <!-- the problem persists even if I do
>      name="coreservlets.stringBean" below
> -->
> 
>     <I><jsp:getProperty name="stringBean" 
>                         property="message" /></I>
> 
> <LI>Initial value (JSP expression):
>     <I><%= stringBean.getMessage() %></I>
> <LI><jsp:setProperty name="stringBean" 
>                      property="message" 
>                      value="Best string bean: Fortex"
> />
>     Value after setting property with setProperty:
>     <I><jsp:getProperty name="stringBean" 
>                         property="message" /></I>
> 
> <LI><% stringBean.setMessage("My favorite: Kentucky
> Wonder"); %>
>     Value after setting property with scriptlet:
>     <I><%= stringBean.getMessage() %></I>
> </OL>
>              
> </BODY>
> </HTML>
> *** end of the JSP ***
> 
> On the Solaris system where I run tomcat4.1.24, the
> Bean file is at
> /export/home/tomcat4.1.24/webapps/ROOT/WEB-INF/classes/corsevlets/StringBean.java
> 
> and the JSP is at
> /export/home/tomcat4.1.24/webapps/ROOT/StringBean.jsp
> 
> My tomcat server is running well, servlets work just
> great.
> 
> This is the first time I try working with JavaBeans
> and got so much trouble.  Really do not understand why
> I am getting those exceptions.  Any idea please?
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: At my wits' end: Using JavaBean in JSP: sorry for a typo

Posted by Mark Liu <ma...@yahoo.com>.
Sorry, in the previous message I have a typo
"corsevlets".

Please note that it is just a typo in that message.  I
do have the correct spelling "coreservlets" on my
system.

> On the Solaris system where I run tomcat4.1.24, the
> Bean file is at
>
/export/home/tomcat4.1.24/webapps/ROOT/WEB-INF/classes/corsevlets/StringBean.java


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


At my wits' end: Using JavaBean in JSP

Posted by Mark Liu <ma...@yahoo.com>.
I searched the Web for a while, and found that quite
many people had the same problem.  But no one solution
I found on the Web solved the problem.

The problem is that my JSP page just can't get
compiled. And here are the exceptions:

org.apache.jasper.JasperException:
coreservlets.StringBean
  [snip]
java.lang.ClassNotFoundException:
coreservlets.StringBean
  [snip]

Before you take it for granted that it's a path
problem, I do have the correct path for everything!

I did try <%@ page import="coreservlets.StringBean" %>
at the top of the jsp page, it does not help!

*** The Bean class is from *************
*** Marty Hall's Core Servlets *********
*** and so is the StringBean.jsp***

package coreservlets;

public class StringBean {
  private String message = "No message specified";

  // Some people suggested that I
  // add the default constructor, which
  // does not help solve the problem.

  public StringBean()
  {}

  public String getMessage() {
    return(message);
  }

  public void setMessage(String message) {
    this.message = message;
  }
}

*** And the JSP page is right here ****

<!-- this import below does not help -->
<%@ page import="coreservlets.StringBean" %> 

<HTML>
<HEAD>
<TITLE>Using JavaBeans with JSP</TITLE>
</HEAD>

<BODY>

<TABLE BORDER=5 ALIGN="CENTER">
  <TR><TH CLASS="TITLE">
      Using JavaBeans with JSP</TABLE>
 
<jsp:useBean id="stringBean"
class="coreservlets.StringBean" />

<OL>
<LI>Initial value (getProperty):

<!-- the problem persists even if I do
     name="coreservlets.stringBean" below
-->

    <I><jsp:getProperty name="stringBean" 
                        property="message" /></I>

<LI>Initial value (JSP expression):
    <I><%= stringBean.getMessage() %></I>
<LI><jsp:setProperty name="stringBean" 
                     property="message" 
                     value="Best string bean: Fortex"
/>
    Value after setting property with setProperty:
    <I><jsp:getProperty name="stringBean" 
                        property="message" /></I>

<LI><% stringBean.setMessage("My favorite: Kentucky
Wonder"); %>
    Value after setting property with scriptlet:
    <I><%= stringBean.getMessage() %></I>
</OL>
             
</BODY>
</HTML>
*** end of the JSP ***

On the Solaris system where I run tomcat4.1.24, the
Bean file is at
/export/home/tomcat4.1.24/webapps/ROOT/WEB-INF/classes/corsevlets/StringBean.java

and the JSP is at
/export/home/tomcat4.1.24/webapps/ROOT/StringBean.jsp

My tomcat server is running well, servlets work just
great.

This is the first time I try working with JavaBeans
and got so much trouble.  Really do not understand why
I am getting those exceptions.  Any idea please?


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How to have a customized error page?

Posted by Mark Liu <ma...@yahoo.com>.
Hi, the path you provide between the location tag
*must* start with /, otherwise, you can't start the
server.

This also implies that
http://yourhost:port/error/404.html will not work.

Any idea?

--- Werner van Mook <we...@connecties.com> wrote:
> HI,
> 
> Haven't you maybe forgotten the starting / in the
> <location> tag?
> If I'm correct this makes the path to the error page
> absolute.
> Otherwise you could also make the location a
> complete URL as in :
> http://yourhost:port/error/404.html
> 
> I haven't tried that so I'm not sure if it will be
> working correctly.
> 
> Werner
> 
> 
> On Sunday, May 18, 2003, at 08:47 AM, Mark Liu
> wrote:
> 
> > Thanks.  This works.
> >
> > But there is a little problem.  It seems that I
> cannot
> > specify an absolute path to the error page.
> >
> > Say, if the name of my web application is myweb
> and if
> > the server receives a request
> >
> > http://www.myserver.com/myweb/badrequest.html,
> >
> > My web server will present
> >
> > http://www.myserver.com/myweb/error/404.html,
> which is
> > OK and works as expected.
> >
> > But if the server receives a request for
> >
> >
>
http://www.myserver.com/myweb/no_such_folder/badrequest.html,
> >
> >
> > then my server will attempt to present
> >
> >
>
http://www.myserver.com/myweb/no_such_folder/error/404.html,
> >
> >
> > which is certainly bad, since no_such_folder does
> not
> > exist on my server.
> >
> > You see the point?
> >
> > In conclusion, I want my server to present
> > http://www.myserver.com/myweb/error/404.html for
> all
> > bad requests.  How to handle this?
> >
> > Thanks
> >
> > --- Werner van Mook <we...@connecties.com> wrote:
> >> To create custom error list add the following to
> >> web.xml :
> >>
> >>
> >> <error-page>
> >>      <error-code>404</error-code>
> >>      <location>/error/404.html</location>
> >> </error-page>
> >>
> >> you have to adjust the location to the location
> of
> >> your error page.
> >>
> >> Werner
> >>
> >> On Saturday, May 17, 2003, at 08:26 AM, Mark Liu
> >> wrote:
> >>
> >>> If we request a page which does not exist, we
> see
> >>> this:
> >>>
> >>> HTTP Status 404 - /badrequest.html
> >>> ---------------------------
> >>> type Status report
> >>>
> >>> message /badrequest.html
> >>> description The requested resource
> >> (/badrequest.html)
> >>> is not available.
> >>> ---------------------------
> >>> Apache Tomcat/4.1.24
> >>>
> >>> How can I have a customized error message like
> so:
> >>>
> >>> Sorry, the page cannot be found!
> >>>
> >>> __________________________________
> >>> Do you Yahoo!?
> >>> The New Yahoo! Search - Faster. Easier. Bingo.
> >>> http://search.yahoo.com
> >>>
> >>>
> >>
> >
>
---------------------------------------------------------------------
> >>> To unsubscribe, e-mail:
> >> tomcat-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
> >> tomcat-user-help@jakarta.apache.org
> >>>
> >>
> >>
> >>
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> tomcat-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> tomcat-user-help@jakarta.apache.org
> >>
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How to have a customized error page?

Posted by Werner van Mook <we...@connecties.com>.
HI,

Haven't you maybe forgotten the starting / in the <location> tag?
If I'm correct this makes the path to the error page absolute.
Otherwise you could also make the location a complete URL as in :
http://yourhost:port/error/404.html

I haven't tried that so I'm not sure if it will be working correctly.

Werner


On Sunday, May 18, 2003, at 08:47 AM, Mark Liu wrote:

> Thanks.  This works.
>
> But there is a little problem.  It seems that I cannot
> specify an absolute path to the error page.
>
> Say, if the name of my web application is myweb and if
> the server receives a request
>
> http://www.myserver.com/myweb/badrequest.html,
>
> My web server will present
>
> http://www.myserver.com/myweb/error/404.html, which is
> OK and works as expected.
>
> But if the server receives a request for
>
> http://www.myserver.com/myweb/no_such_folder/badrequest.html,
>
>
> then my server will attempt to present
>
> http://www.myserver.com/myweb/no_such_folder/error/404.html,
>
>
> which is certainly bad, since no_such_folder does not
> exist on my server.
>
> You see the point?
>
> In conclusion, I want my server to present
> http://www.myserver.com/myweb/error/404.html for all
> bad requests.  How to handle this?
>
> Thanks
>
> --- Werner van Mook <we...@connecties.com> wrote:
>> To create custom error list add the following to
>> web.xml :
>>
>>
>> <error-page>
>>      <error-code>404</error-code>
>>      <location>/error/404.html</location>
>> </error-page>
>>
>> you have to adjust the location to the location of
>> your error page.
>>
>> Werner
>>
>> On Saturday, May 17, 2003, at 08:26 AM, Mark Liu
>> wrote:
>>
>>> If we request a page which does not exist, we see
>>> this:
>>>
>>> HTTP Status 404 - /badrequest.html
>>> ---------------------------
>>> type Status report
>>>
>>> message /badrequest.html
>>> description The requested resource
>> (/badrequest.html)
>>> is not available.
>>> ---------------------------
>>> Apache Tomcat/4.1.24
>>>
>>> How can I have a customized error message like so:
>>>
>>> Sorry, the page cannot be found!
>>>
>>> __________________________________
>>> Do you Yahoo!?
>>> The New Yahoo! Search - Faster. Easier. Bingo.
>>> http://search.yahoo.com
>>>
>>>
>>
> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail:
>> tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>> tomcat-user-help@jakarta.apache.org
>>>
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> tomcat-user-help@jakarta.apache.org
>>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How to have a customized error page?

Posted by Mark Liu <ma...@yahoo.com>.
Thanks.  This works.

But there is a little problem.  It seems that I cannot
specify an absolute path to the error page.

Say, if the name of my web application is myweb and if
the server receives a request

http://www.myserver.com/myweb/badrequest.html,

My web server will present 

http://www.myserver.com/myweb/error/404.html, which is
OK and works as expected.

But if the server receives a request for 

http://www.myserver.com/myweb/no_such_folder/badrequest.html,


then my server will attempt to present

http://www.myserver.com/myweb/no_such_folder/error/404.html,


which is certainly bad, since no_such_folder does not
exist on my server.

You see the point?  

In conclusion, I want my server to present
http://www.myserver.com/myweb/error/404.html for all
bad requests.  How to handle this?

Thanks

--- Werner van Mook <we...@connecties.com> wrote:
> To create custom error list add the following to
> web.xml :
> 
> 
> <error-page>
>      <error-code>404</error-code>
>      <location>/error/404.html</location>
> </error-page>
> 
> you have to adjust the location to the location of
> your error page.
> 
> Werner
> 
> On Saturday, May 17, 2003, at 08:26 AM, Mark Liu
> wrote:
> 
> > If we request a page which does not exist, we see
> > this:
> >
> > HTTP Status 404 - /badrequest.html
> > ---------------------------
> > type Status report
> >
> > message /badrequest.html
> > description The requested resource
> (/badrequest.html)
> > is not available.
> > ---------------------------
> > Apache Tomcat/4.1.24
> >
> > How can I have a customized error message like so:
> >
> > Sorry, the page cannot be found!
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Search - Faster. Easier. Bingo.
> > http://search.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: How to have a customized error page?

Posted by Werner van Mook <we...@connecties.com>.
To create custom error list add the following to web.xml :


<error-page>
     <error-code>404</error-code>
     <location>/error/404.html</location>
</error-page>

you have to adjust the location to the location of your error page.

Werner

On Saturday, May 17, 2003, at 08:26 AM, Mark Liu wrote:

> If we request a page which does not exist, we see
> this:
>
> HTTP Status 404 - /badrequest.html
> ---------------------------
> type Status report
>
> message /badrequest.html
> description The requested resource (/badrequest.html)
> is not available.
> ---------------------------
> Apache Tomcat/4.1.24
>
> How can I have a customized error message like so:
>
> Sorry, the page cannot be found!
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


How to have a customized error page?

Posted by Mark Liu <ma...@yahoo.com>.
If we request a page which does not exist, we see
this:

HTTP Status 404 - /badrequest.html
---------------------------
type Status report

message /badrequest.html
description The requested resource (/badrequest.html)
is not available.
---------------------------
Apache Tomcat/4.1.24

How can I have a customized error message like so:

Sorry, the page cannot be found!

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Deployment Problem: Got No Clue!

Posted by vim m <vi...@yahoo.com>.
What does your web.xml file contain? For every servlet
in your application, you should have a <servlet>
element and a mapping element. 




--- Mark Liu <ma...@yahoo.com> wrote:
> I am running Tomcat 4.1.12 on my Windows 2000
> system.
> 
> Tomcat runs pretty well.  The examples run pretty
> well.
> 
> I created an x509 directory under webapps, i.e., I
> have C:\Tomcat4_1_12\webapps\x509 now.
> 
> Then I created 2 folders under x509: WEB-INF and
> Test,
> i.e., I have
> 
> C:\Tomcat4_1_12\webapps\x509\WEB-INF
> 
> and
> 
> C:\Tomcat4_1_12\webapps\x509\Test
> 
> now. 
> 
> Under WEB-INF I have web.xml and a folder called
> classes.
> 
> i.e., C:\Tomcat4_1_12\webapps\x509\WEB-INF\classes.
> 
> I put Marty Hall's ShowParametersPostForm.html under
> Test, and his ShowParameters.class &
> ServletUtilities.class under classes.
> 
> I was able to see the ShowParametersPostForm.html
> page
> via this link:
> 
>
http://localhost/x509/Test/ShowParametersPostForm.html
> 
> But then when I fill up the form and hit submit, I
> always get this:
> 
> type Status report
> 
> message /x509/servlet/ShowParameters
> 
> description The requested resource
> (/x509/servlet/ShowParameters) is not available.
> 
> However, if I move the structure to Tomcat's
> examples
> folder, it works great.
> 
> Please note that I have changed servlet path
> specified
> in ShowParametersPostForm.html to
> 
> <FORM ACTION="../servlet/ShowParameters"
> METHOD="POST">
> 
> Also please note that I have added x509 context in
> server.xml under conf, like so:
> 
> <!-- Project X509 context -->
>         <Context path="/x509" docBase="x509"
>          debug="0" reloadable="true"
> privileged="true"/>
> 
> I do not understand why it does not work under my
> x509
> directory.  I have been trying this for the whole
> day!
> 
> Any kind help please?
> 
> Thanks a lot.
> 
> Mark
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> http://mailplus.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>