Dynamic loading of JSPs

2002-08-04 Thread Ralf Ebert

Hi,

for a small CMS-like application I want to load JSP files dynamically
from a database and not from the file system. I looked through the
Jasper sources to find out how this could be done without patching
Tomcat but couldn't find any clue on this. Is there any API or
something for this ?
As far as I found out, the main class for loading the JSP sources is
JspCServletContext. But is there any chance to use another
implementation of such a context class by regular means ?

Regards,
Ralf


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




install a new servlet

2002-08-04 Thread Christine Redman

Hi,
I have just signed up with a new hosting company that offers servlets,
and every time I upload a new Servlet, They have asked me to inform them
so they can restart tomcat.

I have been informed that this means they haven't configured their system
correctly, and would dearly love to be able to help them?

I am not an experienced Tomcat user, so I don't even know which part of the
manual to point them at. Can anyone help?

Cheers,

Matt



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




[ANNOUNCEMENT] Tomcat 4.1.8 Beta

2002-08-04 Thread Remy Maucherat

Tomcat 4.1.8 Beta has been released. It includes major bugfixes to 
Jasper over the previous Tomcat 4.1.7 Beta (please refer to the release 
notes for the complete list).

Relese notes:
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.8-beta/RELEASE-NOTES

Downloads (source and binaries):
http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.8-beta/

Important note: When upgrading from another Tomcat 4.x release, Tomcat's 
work directory must be cleared.

Remy


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




DataSource Problems - Unresolved Issues

2002-08-04 Thread sean.schofield

I've been having extreme difficulty getting the DataSource to work with
Tomcat 4.0.4.  I did finally manage to get it working though.  I have two
goals for this email.  1) To tell people who are struggling how I got it to
work and 2) To ask the Tomcat experts if there are problems in the latest
version that require the hacks that I used or am I just doing things
wrong?

First, I started with Tomcat 4.0.3 (and Oracle 8i) and followed the very
limited available documentation on the subject.  I was able to get look up
my data source with JNDI but that was it.  I couldn't get an actual
connection.  Then I tried Tomcat 4.0.4 and got a new error message in the
Tomcat console about how TyrexDataSourceFactory couldn't find
org.hsql.jdbcDriver class.  That was odd b/c I was trying to use the Oracle
driver!  Btw, I did copy the oracle driver to the common/lib dir so it
should've found it.  Also, I noticed in the 4.0.4 release notes it said that
there were error msgs for Tyrex added so that's probably why I was getting
those all of a sudden.

I noticed that the examples Context had some mapping related to this so I
commented that out but that didn't help.  Then I decided I would look at the
source for the TyrexDataSourceFactory since I suspected that it was using
the default driver b/c it didn't know about mine (or couldn't find it).  I
changed the defaults to be the relevant stuff for my Oracle db and
recompiled that class only into a special jar which I made sure was in the
classpath before starting Tomcat.  This worked!  Actually I don't know for
sure that it worked b/c I did this at home and the db is at work but it
stopped complaining about the driver and just said it couldn't connect to
the db (which I expected).

To recap, I was using Tomcat 4.0.4 and had the Oracle driver in the
common/lib directory.  I also mapped the data source in the deployment
descriptor of my web app.  Here are the relevant portions of the server.xml
and web.xml files respectively:

!-- Oracle Connection Pooling Stuff --

Context path=/ect docBase=ect debug=0 reloadable=false
override=true
Resource name=jdbc/ClassroomTest_DS auth=Container
type=javax.sql.DataSource/
ResourceParams name=jdbc/ClassroomTest_DS
parameternameuser/namevaluesomeUser/value/parameter

parameternamepassword/namevaluesomePassword/value/parameter
parameter
namedriverClassName/name
valueoracle.jdbc.driver.OracleDriver/value
/parameter
parameter
namedriverName/name
valuejdbc:oracle:thin:@somePlace:1521:someName/value
/parameter
parameter
namemaxActive/name
value8/value
/parameter
parameter
namemaxIdle/name
value4/value
/parameter
/ResourceParams
/Context

...

!-- deployment descriptor code --
resource-ref
res-ref-namejdbc/ClassroomTest_DS/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref



// java client code (in JSP)

InitialContext jndiContext = null;
Context context = null;
DataSource dataSource = null;

try
{
jndiContext = new InitialContext();
context = (Context)jndiContext.lookup(java:comp/env);

dataSource = (DataSource)context.lookup(jdbc/ClassroomTest_DS);
System.out.println(datasource found.);

}
catch (Exception e)
{
System.out.println(*** Lookup Failed:  + e);
}

Hopefully, this can help somebody out there get this working.  Also,
hopefully someone can explain to me what I'm doing wrong or whether there is
an outstanding issue in the Tomcat source that is being worked on.

TIA,

- sean


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




Re: Standalone Tomcat on port 80 without root privileges

2002-08-04 Thread Leos Urban

Ralph,
thank you very much for tip.

Solution of my problem is in two lines in file /etc/sysconfig/ipchains
(Linux RH 7.3 box):
-I input --proto TCP --dport 80 -j REDIRECT 8080
-I input --proto TCP --dport 443 -j REDIRECT 8443
and then restart ipchains (/etc/init.d/ipchains restart).

Now I have tomcat-only website with SSL support, executed as tomcat4 user
(non-root), with listening on port 80 (443). Management of this site is
easy.
I dont need to experiment with mod_jk and other Apache-related things.
Our server is small I hope that performance will not be so poor (on static
pages).
Thanks.
Leos

// index: linux ipchains port forward apache 80 tomcat 8080 root privilege

- Original Message -
From: Ralph Einfeldt [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Friday, August 02, 2002 10:25 AM
Subject: AW: Standalone Tomcat on port 80 without root privileges


Some ideas:
- Use a proxy that redirects all requests on port 80 to 8080.
- Use nat and map port 80 to 8080 (port forwarding)

 -Ursprngliche Nachricht-
 Von: Leos Urban [mailto:[EMAIL PROTECTED]]
 Gesendet: Freitag, 2. August 2002 09:53
 An: [EMAIL PROTECTED]
 Betreff: Standalone Tomcat on port 80 without root privileges

 How to run tomcat JSPs and servlets on Linux on port 80 without root
 privileges?


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




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




integrating tomcat 4.04 into iplanet 4.1 using nsapi_redirector on linux

2002-08-04 Thread Jerry Birchler

Has anyone done this?

If so, I would like some help. I have compiled the redirector and validated
that it is getting invoked, my connector is up and listening, I validated
that the class files used for ajp13 are getting invoked, I set up my
obj.conf file, the server.xml file and my workers.properties file, but I
only get this when I hit a JSP page:

HTTP 500 - Internal server error
Internet Explorer

After playing around a bit more, I get a little better results() in that
the browser returns html, but it is not running the JSP. Instead all code
between % and % shows up when I view the page source, but is otherwise
hidden. When I view a JSP in netscape's doc root, I see the entire text
rendered and all code between % and % as if it were just text. So, the
bottom line is that a JSP referenced from netscape to tomcat in tomcat's doc
root behaves different than JSP in netscape's doc root. I got this result by
changing the mime type for jsp to text/plain from it's default value of
magnus-internal/servlet. Reverting the mime back to magnus-internal/servlet
produces the same error 500 message. Changing the IE to display
non-friendly errors did not shed any light on this. The only difference in
logs for this is that when I revert back to the magnus-internal/servlet mime
type, I get this in the netscape errors log:

[02/Aug/2002:00:09:13] config (32160): for host XX.XX.XXX.XXX trying to GET
/examples/jsp/snp/snoop.jsp, handle-processed reports: no way to service
request for /examples/jsp/snp/snoop.jsp

I don't get this error when I change the mime-type to text/plain. BEA
suggests using text/jsp for integrating its application server. I tried that
and got the same result after restarting netscape. I've even tried arbitrary
values and got the same result. Finally, I removed the mime altogether--same
result--no errors, but JSP does not execute and is hidden unless I source
the page. Same thing.

One other detail that may be important is that my linux machine has two
NICS. One is a fixed external IP, and the other is a fixed local IP. My
network is working fine, but I was just wondering if there are special
configuration considerations for a multi-homed system. My guess is no,
because most production applications I've worked on are multi-homed.

# #Here is my makefile process:
1. Download tomcat 4.04 connectors source
2. copy the Makefile.solaris to Makefile.linux (which was not a part of the
distribution, unfortunately)
3. changed references from SOLARIS and solaris to LINUX and linux
4. added SUITSPOT_HOME to /etc/bashrc
5. changed this line in the Makefile from:

INCLUDEDIR=$(SUITSPOT_HOME)/include

to:

INCLUDEDIR=$(SUITSPOT_HOME)/plugins/include

6. created a links shell and gave it execute access:

# vi links:
ln -fs ../common/jk_ajp12_worker.o
ln -fs ../common/jk_ajp13.o
ln -fs ../common/jk_ajp13_worker.o
ln -fs ../common/jk_connect.o

# chmod +x links

I had to do this because the references are not quite right in the Makefile

7. Then I ran the Makefile using gmake like this:

# gmake -f Makefile.linux all

It failed for references. I ran my links shell and reran make like this:

# ./links
# gmake -f Makefile.linux all

That built nsapi_redirector.so. I created some directories and copied the
binary into /opt/tomcat/bin/netscape/linux/i386.

Hopefully, someone has actually done the specific thing I am trying to do.
I've included all relevant files below if it will help someone help me.

# vi /etc/init.d/tomcat
#!/bin/sh
CLASSPATH=/opt/tomcat/common/lib/servlet.jar
export CLASSPATH
su - webserv -c /opt/tomcat/bin/catalina.sh $@

# vi /opt/tomcat/conf/jk/workers.properties
#  Begin worker.properties **
worker.ajp13.type=ajp13

#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
#   lbfactor must be  0
#   Low lbfactor means less work done by the worker.
worker.ajp13.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.ajp13.cachesize

#
#-- DEFAULT LOAD BALANCER WORKER DEFINITION --
#-
#

#
# The loadbalancer (type lb) worker perform weighted round-robin
# load balancing with sticky sessions.
# Note:
#   If a worker dies, the load balancer will check its state
#once in a while. Until then all work is redirected to peer
#worker.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp13

#
# worker.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
worker.tomcat_home=/opt/tomcat

#
# worker.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
worker.java_home=/usr/java

#
# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=/

#
#-- ADVANCED MODE 

Re: Tomcat 4 Suse 8

2002-08-04 Thread Carlos

yes it works well
- Original Message -
From: Steve Russell [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Thursday, August 01, 2002 7:38 PM
Subject: Tomcat 4  Suse 8


 I gave up on trying to get Tomcat 4 to work with Suse 7.2


 Has anyone gotten tomcat 4.* to work on suse 8?

 Steve



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




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




Host Alias and wild cards

2002-08-04 Thread koen

Hi,

I have been trying to get wildcards to work for the alias of a tomcat Host
like this :

  Host name=test2.kmoware.com debug=0 appBase=webapps2 unpackWARs=true
Alias*.com/Alias
Alias*.org/Alias
Alias*.net/Alias
Logger className=org.apache.catalina.logger.FileLogger
 directory=logs  prefix=urlforwarding suffix=.log
timestamp=true/
 Context path= docBase=ROOT debug=0/
  /Host

but doesnt work ?!!

does anybody know if you can use wild cards anyway ??? Is this planned ??

In the tomcat sources(StandardEngineMapper.java)  I read this ( very disappointing ) :

// Find a matching Host by alias.  FIXME - Optimize this!
if (host == null) {
if (debug = 2)
engine.log( Trying an alias match);
Container children[] = engine.findChildren();
for (int i = 0; i  children.length; i++) {
String aliases[] = ((Host) children[i]).findAliases();
for (int j = 0; j  aliases.length; j++) {
if (server.equals(aliases[j])) {
host = (Host) children[i];
break;
}
}
if (host != null)
break;
}
}




Met vriendelijke groeten,
Best Regards,
 
Koen
 
--
Koen Maes - [EMAIL PROTECTED]
www.domainnames.be - www.domeinnamen.be
A. Thierylaan 15
3001 Leuven (B)
Phone   +32 16 406088
Fax   +32 70 702394
Mobile   +32 476 511003
--
This message and any attachm



Host Alias and wild cards,
koen











 
--  
Chronological
--
  

 
  

 
  --  
  Thread 
  --  
  





  
  
  
  
  002801c23bdb$06bcfa80$d301000a@krimson">
  Reply via email to
  
  













Host Alias and wild cards,
koen











 
--  
Chronological
--
  

 
  

 
  --  
  Thread 
  --  
  





  
  
  
  
  002801c23bdb$06bcfa80$d301000a@krimson">
  Reply via email to
  
  













Host Alias and wild cards,
koen











 
--  
Chronological
--
  

 
  

 
  --  
  Thread 
  --  
  





  
  
  
  
  002801c23bdb$06bcfa80$d301000a@krimson">
  Reply via email to
  
  













Host Alias and wild cards,
koen











 
--  
Chronological
--
  

 
  

 
  --  
  Thread 
  --  
  





  
  
  
  
  002801c23bdb$06bcfa80$d301000a@krimson">
  Reply via email to
  
  













Host Alias and wild cards,
koen











 
--  
Chronological
--
  

 
  

 
  --  
  Thread 
  --  
  





  
  
  
  
  002801c23bdb$06bcfa80$d301000a@krimson">
  Reply via email to
  
  










 












Host Alias and wild cards
koen


 






  
  





Reply via email to



  
  





 
 







Re: integrating tomcat 4.04 into iplanet 4.1 using nsapi_redirector on linux

2002-08-04 Thread Cunningham Emmett


Wow. that was long.
Suggestions:
   1. In workers.properties change localhost to the
FQDN (Fully Qualified Domain Name).
   2. Check to see if iPlanet is in fact forwarding
the request to the redirector OR if it is serving the
request itself. Frequently folks make the content
under tomcat available to the iPlanet Web Server via 
a symlink and this obfuscates the matter. Though this
technique is good for delivering static content and
speeding up the overall process by reducing the burden

on the redirector.
 To check if iPlanet is forwarding the request to
the redirector, tail -f iPlanet log/access and
nsapi.log. There should be a collection of activity on
both sides for each request. If you have it on the
iPlanet side but not the redirector side (of iPlanet)
then you have a problem in obj.conf. My experience is
that you have a problem in obj.conf, almost always.

If you have doubts then attach obj.conf to your
response. I'll take a look at it.
emmett


--- Jerry Birchler [EMAIL PROTECTED] wrote:
 Has anyone done this?
 
 If so, I would like some help. I have compiled the
 redirector and validated
 that it is getting invoked, my connector is up and
 listening, I validated
 that the class files used for ajp13 are getting
 invoked, I set up my
 obj.conf file, the server.xml file and my
 workers.properties file, but I
 only get this when I hit a JSP page:
 
 HTTP 500 - Internal server error
 Internet Explorer
 
 After playing around a bit more, I get a little
 better results() in that
 the browser returns html, but it is not running the
 JSP. Instead all code
 between % and % shows up when I view the page
 source, but is otherwise
 hidden. When I view a JSP in netscape's doc root, I
 see the entire text
 rendered and all code between % and % as if it
 were just text. So, the
 bottom line is that a JSP referenced from netscape
 to tomcat in tomcat's doc
 root behaves different than JSP in netscape's doc
 root. I got this result by
 changing the mime type for jsp to text/plain from
 it's default value of
 magnus-internal/servlet. Reverting the mime back to
 magnus-internal/servlet
 produces the same error 500 message. Changing the IE
 to display
 non-friendly errors did not shed any light on
 this. The only difference in
 logs for this is that when I revert back to the
 magnus-internal/servlet mime
 type, I get this in the netscape errors log:
 
 [02/Aug/2002:00:09:13] config (32160): for host
 XX.XX.XXX.XXX trying to GET
 /examples/jsp/snp/snoop.jsp, handle-processed
 reports: no way to service
 request for /examples/jsp/snp/snoop.jsp
 
 I don't get this error when I change the mime-type
 to text/plain. BEA
 suggests using text/jsp for integrating its
 application server. I tried that
 and got the same result after restarting netscape.
 I've even tried arbitrary
 values and got the same result. Finally, I removed
 the mime altogether--same
 result--no errors, but JSP does not execute and is
 hidden unless I source
 the page. Same thing.
 
 One other detail that may be important is that my
 linux machine has two
 NICS. One is a fixed external IP, and the other is a
 fixed local IP. My
 network is working fine, but I was just wondering if
 there are special
 configuration considerations for a multi-homed
 system. My guess is no,
 because most production applications I've worked on
 are multi-homed.
 
 # #Here is my makefile process:
 1. Download tomcat 4.04 connectors source
 2. copy the Makefile.solaris to Makefile.linux
 (which was not a part of the
 distribution, unfortunately)
 3. changed references from SOLARIS and solaris to
 LINUX and linux
 4. added SUITSPOT_HOME to /etc/bashrc
 5. changed this line in the Makefile from:
 
 INCLUDEDIR=$(SUITSPOT_HOME)/include
 
 to:
 
 INCLUDEDIR=$(SUITSPOT_HOME)/plugins/include
 
 6. created a links shell and gave it execute
 access:
 
 # vi links:
 ln -fs ../common/jk_ajp12_worker.o
 ln -fs ../common/jk_ajp13.o
 ln -fs ../common/jk_ajp13_worker.o
 ln -fs ../common/jk_connect.o
 
 # chmod +x links
 
 I had to do this because the references are not
 quite right in the Makefile
 
 7. Then I ran the Makefile using gmake like this:
 
 # gmake -f Makefile.linux all
 
 It failed for references. I ran my links shell and
 reran make like this:
 
 # ./links
 # gmake -f Makefile.linux all
 
 That built nsapi_redirector.so. I created some
 directories and copied the
 binary into /opt/tomcat/bin/netscape/linux/i386.
 
 Hopefully, someone has actually done the specific
 thing I am trying to do.
 I've included all relevant files below if it will
 help someone help me.
 
 # vi /etc/init.d/tomcat
 #!/bin/sh
 CLASSPATH=/opt/tomcat/common/lib/servlet.jar
 export CLASSPATH
 su - webserv -c /opt/tomcat/bin/catalina.sh $@
 
 # vi /opt/tomcat/conf/jk/workers.properties
 #  Begin worker.properties
 **
 worker.ajp13.type=ajp13
 
 #
 # Specifies the load balance factor when used with
 # a load balancing worker.
 # Note:
 #   lbfactor must be  0
 #   Low