Re: Removing the port identifier

2007-08-16 Thread David Rodríguez Fernández
In OSX you must use ipfw, i don't know how ipfw is used, but i think this
must be similar to iptables.

On 8/15/07, Stephen Caine <[EMAIL PROTECTED]> wrote:
>
> David,
>
> Do you know what the corresponding command (iptables) would be in OS X?
>
> > You can execute tihs iptables line (if you are using linux)
> > directly in the server where you run tomcat (substitute
> > xxx.xxx.xxx.xxx whith the ip address of your linux box):
> >
> > iptables -t nat -A PREROUTING -d xxx.xxx.xxx.xxx -p tcp -m tcp --
> > dport 443 -j DNAT --to-destination xxx.xxx.xxx.xxx:8443
>



-- 
Nadie es tan joven que no se pueda morir mañana, ni tan viejo que no pueda
vivir un día más.

– La Celestina (Fernando de Rojas, 1499)


JSP compile error - required library in tomcat/shared/lib

2007-08-16 Thread Rainer Frey
Hi all,

after moving a jar file from tomcat/common/lib to tomcat/shared/lib, JSPs
that use that library don't compile anymore, it says package does not
exist. It is a library from my company, used by all webapps in the server
installation. It used to be in tomcat/common/lib as it was used by a 
tomcat
valve that exists no longer. As it now needs other libraries in
tomcat/shared/lib, we want to move it.

Now, the classloader howto says:

> Common - This class loader contains additional classes that are made
> visible
> to both Tomcat internal classes and to all web applications. Normally,
> application classes should NOT be placed here.
>
> Shared - This class loader is the place to put classes and resources
> that you wish to share across ALL web applications (unless Tomcat
> internal classes also need access, in which case you should put them in
> the Common class loader instead)

This library is only used in our application code, mostly in servlets, but
also in some JSP, which can use it after being compiled. Only compiling
doesn't work. Logically, this is thus no code that tomcat internal classes
need.

One can argue, however, that the JSP compiler is a tomcat internal class,
and that using a library as compile class path means that this internal
class needs it, and it thus needs to be in tomcat/common/lib.

For me, this is not intuive, though, and I couldn't find any explicit
documentation about it. My question is now:
Must all libraries that contain classes used in JSPs be in 
tomcat/common/lib
(or WEB-INF/lib), or is this a bug in tomcat, or is this an error in our
installation/configuration?

Thanks,
Rainer Frey

P.S.:Here is the stack trace, showing no tomcat/shared/lib/anything in
classpath:

SEVERE: Javac exception
Compile failed; see the compiler error output for details.
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
at
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:441)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at 
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:287)
at
org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:84)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:417)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at
org.apache.coyote.tomcat5.

Re: IIS redirect to Apache

2007-08-16 Thread Pid

Tony Fountain wrote:

Hi,

Scenario: we purchased a product written in Java to integrate into our
reporting tool.  Our setup is such that our web application is written
in .NET and hosted on a web farm using IIS (5 or 6 depending on the
environment).  The product we purchased runs under Apache Tomcat/5.5.23
using 1.5.0_12-b04.  The product is integrated into our web portal using
frames and sending URL requests to Apache.  We are running into issues
with javascript code from the product generating errors for what I
suspect may be related to crossing domains (our web site and the Apache
server).  I figure I can resolve this by generating a proxy on the IIS
server to handle the request to the Apache server.


Can you describe the error in some more detail, and why you think a 
proxy server will resolve the problem?



My question is does anyone have any pointers on how to setup this type
of proxy?


Wrong forum to be asking about IIS config, I suspect, but you might luck 
 out.


p



Thanks,
Tony

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






smime.p7s
Description: S/MIME Cryptographic Signature


Re: Installing APR on Fedora

2007-08-16 Thread Rainer Jung

Hi Ole,

when you tried against your installed APR most likely the dev rpm, which 
includes the necessary header files for compiltions where not installed.


When you tried against a BUILD directory, most likely the APR library 
need for linking was not there.


Whichever way you choose, you need a full APR. I guess it would be 
easiest to install the dev RPMs for apr and apr-util and then use the 
installed files for configuring tcnative.


Now after you installed the additional dev packages (those are *not* the 
src packages), you might want to check, where those packages installed 
their contents to, because you need to give a path to the --with-apr 
flag. You can check package install pathes for rpm with


rpm -q --filesbypkg PACKAGENAME

If your packages choose the default system instalation pathes, you 
should be able to build without the with-apr flag. If the RPMs choose a 
special installation dir, but are build nicely, you will have shell 
scripts apr-1-config as part of one of the RPMs and you can give 
with-apr the path to this file as parameter, which will tell configure 
about the pathes of libs and headers. Lastly if you don't have the 
config script, but libs and headers are in lib/ and include/ below some 
dir, this dir will be a code value for with-apr.


HTH.

Rainer

Ole Ersoy wrote:

Hi Hassan,

I did the following:

rm -dfr tomcat-native-1.1.10-src/ tar xvfz tomcat-native.tar.gz
cd tomcat-native-1.1.10-src/jni/native
./configure --prefix=/usr/local/apr 
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/ && make && make install


And I still get:

le/rpmbuild/BUILD/apr-1.2.8/libapr-1.la -luuid -lcrypt -lpthread -ldl )
/usr/bin/ld: cannot find -lapr-1
collect2: ld returned 1 exit status
libtool: install: error: relink `libtcnative-1.la' with the above 
command before installing it

make: *** [install] Error 1

Thoughts?

Thanks again,
- Ole



Hassan Schroeder wrote:

On 8/15/07, Ole Ersoy <[EMAIL PROTECTED]> wrote:

I have a lot more progress now!  I get the following (The only 
important part is the bottom i think):


[EMAIL PROTECTED] native]# ./configure 
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/

...
libtool: install: error: relink `libtcnative-1.la' with the above 
command before installing it

make: *** [install] Error 1

Any idea what this means?


I'd suggest re-running this with a specific prefix to avoid potential
conflict with anything currently installed, e.g.

./configure --prefix=/usr/local/apr
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/

FWIW,


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
--
kippdata
informationstechnologie GmbH   Tel: 0228 98549 -0
Bornheimer Str. 33aFax: 0228 98549 -50
53111 Bonn www.kippdata.de

HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417
Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann
===
kippdata
informationstechnologie GmbH   Tel: +49 228 98549 -0
Bornheimer Str. 33aFax: +49 228 98549 -50
D-53111 Bonn   www.kippdata.de

HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417
Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Frequent "SEVERE: Unable to receive message through TCP channel" messages

2007-08-16 Thread Rainer Jung

nageshsrao wrote:

we are getting the GC printed on to the same catalina.out and we see that the
memberAdded messages appear almost at the time of GB getting printed, does
it prove that longer GC pauses are causing this? is there any other data
points/proof can be get?


E.g. -XX:+PrintGCApplicationStoppedTime


rearding "network problems", we are requesting the network to capture the
multicast traffic between these nodes, is there anything you suggest us to
do?


If you are doing the multicast only inside a subnet, the usual basic 
network monitoring should be sufficient. But often during phases were 
you have problems that might be network related it is good to keep in 
touch with the network people in order to discuss, if they know about 
any general network problems.


If you do multicasting crossing the borders of subnets, the network 
needs to use multicast group membership protocols, which involves 
complicated configuration of routers. Most users though don't need to 
cross subnets.



regaring "increase the membership timeout" we plan to increase this to 5
minutes, do you have any other suggestions.  tomcat startup takes almost 70
seconds ( it hosts almost 32 apps) and all of them are clustered.


I would expect, that your GC even with a big heap won't take longer than 
20 seconds. Most likely it's much less. On the other hand if you go to 5 
minutes, you would always need to wait 5 minutes between shutting down 
one node and starting it up again. It seems unreasonable to me, that IT 
staff will obey that. I would suggest 30 seconds and a clear message in 
the startup script, to remember people using it, that they have to wait 
30 seconds after stopping and before starting again.


Regards,

Rainer

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSP compile error - required library in tomcat/shared/lib

2007-08-16 Thread David Delbecq
As you guessed would be intuitive, yes, the JSP compiler include classes
in shared/lib (and also classes in webapp itself).
The shared/lib is the same as if you copy it's content to the
WEB-INF/lib folder. As your compiler does not include the shared/lib in
it's classpath, there can be various reason

1) You did not copy your jar to shared/lib. Considering the path of your
tomcat, it's not unreasonnable to think be you copied it to another to
tomcat :)
2) You did copy, but after startup of tomcat. Restart tomcat.
3) Your jar is broken (not ending with .jar, corrupted) and classloader
ignored it. Sun JAR classloader, from my experience, tend to load what
is availabe from truncated .jar without warning of truncation. As a
consequence only half of jar content is used.
4) You use a non tomcat provided webappClassloader that forgets to load
shared/lib. If that's the case, you are probably already aware of that
fact :)
5) A Cosmic ray did randomly swap a bit in your memory. That's how
experts explained an incorrect pooling result with electronic voting
device a few years ago in Belgium :D.

En l'instant précis du 16/08/07 09:44, Rainer Frey s'exprimait en ces
termes:
> Hi all,
>
> after moving a jar file from tomcat/common/lib to tomcat/shared/lib, JSPs
> that use that library don't compile anymore, it says package does not
> exist. It is a library from my company, used by all webapps in the server
> installation. It used to be in tomcat/common/lib as it was used by a 
> tomcat
> valve that exists no longer. As it now needs other libraries in
> tomcat/shared/lib, we want to move it.
>
> Now, the classloader howto says:
>
>   
>> Common - This class loader contains additional classes that are made
>> visible
>> to both Tomcat internal classes and to all web applications. Normally,
>> application classes should NOT be placed here.
>>
>> Shared - This class loader is the place to put classes and resources
>> that you wish to share across ALL web applications (unless Tomcat
>> internal classes also need access, in which case you should put them in
>> the Common class loader instead)
>> 
>
> This library is only used in our application code, mostly in servlets, but
> also in some JSP, which can use it after being compiled. Only compiling
> doesn't work. Logically, this is thus no code that tomcat internal classes
> need.
>
> One can argue, however, that the JSP compiler is a tomcat internal class,
> and that using a library as compile class path means that this internal
> class needs it, and it thus needs to be in tomcat/common/lib.
>
> For me, this is not intuive, though, and I couldn't find any explicit
> documentation about it. My question is now:
> Must all libraries that contain classes used in JSPs be in 
> tomcat/common/lib
> (or WEB-INF/lib), or is this a bug in tomcat, or is this an error in our
> installation/configuration?
>
> Thanks,
> Rainer Frey
>
> P.S.:Here is the stack trace, showing no tomcat/shared/lib/anything in
> classpath:
>
> SEVERE: Javac exception
> Compile failed; see the compiler error output for details.
> at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944)
> at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
> at
> org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:441)
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:422)
> at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:507)
> at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
> at 
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> at
> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:540)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> at
> org.apache.catalina.valves.RequestFilterValve.process(Request

Tomcat benchmark

2007-08-16 Thread Andrew Hole
Someone have a case study wich compare Tomcat with others application
servers?

Thanks a lot
Andrew


Re: Tomcat benchmark

2007-08-16 Thread Matthew Kerle
I assume you've already Googled what you're looking for and not found 
anything? What are you after exactly, performance or feature comparison? 
please be more specific...


I assume you're after more than this:
http://en.wikipedia.org/wiki/Comparison_of_application_servers

Andrew Hole wrote:

Someone have a case study wich compare Tomcat with others application
servers?

Thanks a lot
Andrew

  


--
Matthew Kerle IT Consultant Canberra, Australia Mobile: +61404 096 863 
Email : [EMAIL PROTECTED] Web : http://threebrightlights.blogspot.com/



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle

(see below for message context)

Ok, I've decided on using Http Basic authentication for my web service, 
and successfully configured tomcat to authenticate against the 
tomcat-users.xml file to the point where I can access a valid principal. 
But now I've got another problem.. :-)


I tried accessing the userDatabase which represents the memoryrealm, and 
got the below exception. I don't understand this as according to the API 
doc MemoryUserDatabase is an implementation of UserDatabase, and this is 
confirmed by looking at the source code for MemoryUserDatabase, which 
*does* implement that interface!


I'm stumped, does anyone know why this might be happening? Or am I doing 
something the wrong way...



//code to get tomcat UserDatabase, copied from 
ManagerServlet.roles(PrintWriter) from tomcat manager application.

Context ic = new InitialContext();
UserDatabase userdb = (UserDatabase )ic.lookup("java:comp/env/users"); 
// <- this line causes ClassCastException


SEVERE: Fault occurred!
java.lang.ClassCastException: 
org.apache.catalina.users.MemoryUserDatabase cannot be cast to 
org.apache.catalina.UserDatabase
   at 
myapp.service.webservice.ImageServiceImpl.EnumerateLOV(ImageServiceImpl.java:88)

   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:597)
   // stack trace elided...
   at 
org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

   // stack trace elided...
   at 
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)

   at java.lang.Thread.run(Thread.java:619)

//my context.xml

   
 type="org.apache.catalina.UserDatabase"/>




Matthew Kerle wrote:

Hi all

I'm developing a web service with xFire 1.2.3 / tomcat 5.5.23 / Java 
1.6.0_01, and we need to authenticate access by client applications 
coming in over SOAP. We're looking at using the tomcat-users.xml file 
to store user/pwd/role data until the customers Single Sign-On service 
is ready (which will be when pigs fly, if it keeps going as it has).


The application will be deployed internally so we don't need any SSL 
or digest authentication, we're looking at simple HTTP BASIC or SOAP 
headers  for the client to pass through their auth details. The 
complication is that we want to allow default access as well as 
authenticated access, and authenticate against the tomcat-users file.


eg - un-authenticated clients can still access the web service url, 
but get a public role, and authenticated clients get a privileged role.


I'm thinking we might be able to do part of that with the following 
tomcat-users.xml config by having an empty user declaration:


c
 
 
 


The question is how to authenticate against the tomcat-user database?
I've read the tomcat docs on memory realm: 
http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#MemoryRealm, 
and I want to expose the org.apache.catalina.UserDatabase class to the 
web service context via a . I'd like to be able to 
authenticate users without having to add a  to my 
web.xml, so that unauthenticated clients can still connect.


Am I on the right track? Or is there a much easier way than what I'm 
trying to do...


thanks!



--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle

oops, also here is my resource definition from my web.xml:

 
 
   
 Link to the UserDatabase instance from which we request lists of
 defined role names.  Typically, this will be connected to the global
 user database with a ResourceLink element in server.xml or the context
 configuration file for the Manager web application.
   
   users
   
 org.apache.catalina.UserDatabase
   
 

Matthew Kerle wrote:

(see below for message context)

Ok, I've decided on using Http Basic authentication for my web 
service, and successfully configured tomcat to authenticate against 
the tomcat-users.xml file to the point where I can access a valid 
principal. But now I've got another problem.. :-)


I tried accessing the userDatabase which represents the memoryrealm, 
and got the below exception. I don't understand this as according to 
the API doc MemoryUserDatabase is an implementation of UserDatabase, 
and this is confirmed by looking at the source code for 
MemoryUserDatabase, which *does* implement that interface!


I'm stumped, does anyone know why this might be happening? Or am I 
doing something the wrong way...



//code to get tomcat UserDatabase, copied from 
ManagerServlet.roles(PrintWriter) from tomcat manager application.

Context ic = new InitialContext();
UserDatabase userdb = (UserDatabase )ic.lookup("java:comp/env/users"); 
// <- this line causes ClassCastException


SEVERE: Fault occurred!
java.lang.ClassCastException: 
org.apache.catalina.users.MemoryUserDatabase cannot be cast to 
org.apache.catalina.UserDatabase
   at 
myapp.service.webservice.ImageServiceImpl.EnumerateLOV(ImageServiceImpl.java:88) 


   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:597)
   // stack trace elided...
   at 
org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116) 


   at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) 


   // stack trace elided...
   at 
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)

   at java.lang.Thread.run(Thread.java:619)

//my context.xml

   
 type="org.apache.catalina.UserDatabase"/>




Matthew Kerle wrote:

Hi all

I'm developing a web service with xFire 1.2.3 / tomcat 5.5.23 / Java 
1.6.0_01, and we need to authenticate access by client applications 
coming in over SOAP. We're looking at using the tomcat-users.xml file 
to store user/pwd/role data until the customers Single Sign-On 
service is ready (which will be when pigs fly, if it keeps going as 
it has).


The application will be deployed internally so we don't need any SSL 
or digest authentication, we're looking at simple HTTP BASIC or SOAP 
headers  for the client to pass through their auth details. The 
complication is that we want to allow default access as well as 
authenticated access, and authenticate against the tomcat-users file.


eg - un-authenticated clients can still access the web service url, 
but get a public role, and authenticated clients get a privileged role.


I'm thinking we might be able to do part of that with the following 
tomcat-users.xml config by having an empty user declaration:


c
 
 
 


The question is how to authenticate against the tomcat-user database?
I've read the tomcat docs on memory realm: 
http://tomcat.apache.org/tomcat-5.5-doc/realm-howto.html#MemoryRealm, 
and I want to expose the org.apache.catalina.UserDatabase class to 
the web service context via a . I'd like to be able 
to authenticate users without having to add a  
to my web.xml, so that unauthenticated clients can still connect.


Am I on the right track? Or is there a much easier way than what I'm 
trying to do...


thanks!





--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Gregor Schneider
InitialContext.lookup() gives you a simple object:

so change your code to

Context ic = new InitialContext();
Object o = ic.lookup("java:comp/env/users");

set a breakpoint and see, what type of object you're getting back.

hth

gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JSP compile error - required library in tomcat/shared/lib

2007-08-16 Thread Rainer Frey
Hi David,

thanks for your answer. What I forgot to say is that I use Tomcat 5.0.28. 
I'll comment inline to your options.

On Thursday 16 August 2007 10:41:30 David Delbecq wrote:
> As you guessed would be intuitive, yes, the JSP compiler include
> classes in shared/lib (and also classes in webapp itself).

Good to know.

> The shared/lib is the same as if you copy it's content to the
> WEB-INF/lib folder. As your compiler does not include the shared/lib in
> it's classpath, there can be various reason
>
> 1) You did not copy your jar to shared/lib. Considering the path of
> your tomcat, it's not unreasonnable to think be you copied it to
> another to tomcat :)

This installation is a nightly build of our application tomcat bundle, 
that contained the library in question in shared/lib.

> 2) You did copy, but after startup of tomcat. Restart tomcat.

It was already there before the first start.

> 3) Your jar is broken (not ending with .jar, corrupted) and classloader
> ignored it. Sun JAR classloader, from my experience, tend to load what
> is availabe from truncated .jar without warning of truncation. As a
> consequence only half of jar content is used.

It worked after moving it to common/lib.

> 4) You use a non tomcat provided webappClassloader that forgets to load
> shared/lib. If that's the case, you are probably already aware of that
> fact :)

Never used any custom classloader at all. On a previous installation, it 
worked with the library in shared/lib for servlets and already compiled 
JSPs.

> 5) A Cosmic ray did randomly swap a bit in your memory. That's how
> experts explained an incorrect pooling result with electronic voting
> device a few years ago in Belgium :D.

Sounds most plausibe then. Problem is, it happened with two installations 
on two machines at different times. So - probably also not the case :-)

So: how does the building of the classpath for JSP compilation work? 
Shouldn't all available libraries be on it? or only libraries that the 
JSP tries to use? There are many more libraries in shared/lib, and none 
is listed in the classpath of the error message.

Rainer
>
> En l'instant précis du 16/08/07 09:44, Rainer Frey s'exprimait en ces
>
> termes:
> > Hi all,
> >
> > after moving a jar file from tomcat/common/lib to tomcat/shared/lib,
> > JSPs that use that library don't compile anymore, it says package
> > does not exist. It is a library from my company, used by all webapps
> > in the server installation. It used to be in tomcat/common/lib as it
> > was used by a tomcat
> > valve that exists no longer. As it now needs other libraries in
> > tomcat/shared/lib, we want to move it.
> >
> > Now, the classloader howto says:
> >> Common - This class loader contains additional classes that are made
> >> visible
> >> to both Tomcat internal classes and to all web applications.
> >> Normally, application classes should NOT be placed here.
> >>
> >> Shared - This class loader is the place to put classes and resources
> >> that you wish to share across ALL web applications (unless Tomcat
> >> internal classes also need access, in which case you should put them
> >> in the Common class loader instead)
> >
> > This library is only used in our application code, mostly in
> > servlets, but also in some JSP, which can use it after being
> > compiled. Only compiling doesn't work. Logically, this is thus no
> > code that tomcat internal classes need.
> >
> > One can argue, however, that the JSP compiler is a tomcat internal
> > class, and that using a library as compile class path means that this
> > internal class needs it, and it thus needs to be in
> > tomcat/common/lib.
> >
> > For me, this is not intuive, though, and I couldn't find any explicit
> > documentation about it. My question is now:
> > Must all libraries that contain classes used in JSPs be in
> > tomcat/common/lib
> > (or WEB-INF/lib), or is this a bug in tomcat, or is this an error in
> > our installation/configuration?
> >
> > Thanks,
> > Rainer Frey
> >
> > P.S.:Here is the stack trace, showing no tomcat/shared/lib/anything
> > in classpath:
> >
> > SEVERE: Javac exception
> > Compile failed; see the compiler error output for details.
> > at
> > org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944) at
> > org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764) at
> > org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:373)
> > at
> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:441) at
> > org.apache.jasper.compiler.Compiler.compile(Compiler.java:422) at
> > org.apache.jasper.JspCompilationContext.compile(JspCompilationContext
> >.java:507) at
> > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
> >.java:274) at
> > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
> >92) at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> > at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at
> > org

Tracking active session in a tomcat cluster

2007-08-16 Thread Vinod Venkatraman

Hi,

I want to track all the active sessions of a tomcat 5.5 cluster. 
Particularly, I want to host a page on each cluster member which will
display all the sessions active on its cluster.

So I want to see a list of :
session-id, user-name, jvmRoute (of member to which this session is sticky
to).

What I have tried is :
Whenever a new session is created I create an object which implements
HttpSessionBindingListener 
and put in the session.

public void valueBound(HttpSessionBindingEvent event) {
synchronized(ActiveSessions.ACTIVE_SESSIONS) {
HttpSession session = event.getSession();
ActiveSessions.ACTIVE_SESSIONS.add(this);
System.out.println("VV Registered Session : " + this);
System.out.println("VV Active Sessions count : " +
ActiveSessions.ACTIVE_SESSIONS.size() + " :: Active Sessions : " +
ActiveSessions.ACTIVE_SESSIONS);
}
}

public void valueUnbound(HttpSessionBindingEvent event) {
synchronized(ActiveSessions.ACTIVE_SESSIONS) {
long expiredAt = System.currentTimeMillis();
ActiveSessions.ACTIVE_SESSIONS.remove(this);

// TODO : bookkeeping of expired sessions, write to a separate
log file.
System.out.println("VV Deregistered Session : " + this);

System.out.println("Session Expired : " + this + " Session
lasted from : " + createdAt + "-" + expiredAt);

System.out.println("VV Active Sessions count : " +
ActiveSessions.ACTIVE_SESSIONS.size() + " :: Active Sessions : " +
ActiveSessions.ACTIVE_SESSIONS);
}
}


Things work fine except for following case :

Say clusterMember1 is down when a new session is created at clusterMember2.

When clusterMember1 comes up it syncs it session state with clusterMember2
but valueBound() is 
never called in clusterMember1's JVM so I am unable to register this session
in clusterMember1's 
ACTIVE_SESSIONS list. Because of this my ACTIVE_SESSIONS list is not in sync
across cluster members.

Is this correct that valueBound will be called on only the cluster members
which were alive when the 
object was put in the session ?

Is there any other way I can track all active session of a cluster ?

Thanks,
Vinod
-- 
View this message in context: 
http://www.nabble.com/Tracking-active-session-in-a-tomcat-cluster-tf4278998.html#a12179367
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: utf-8 encoding problem

2007-08-16 Thread Mark Thomas
Try this then - this is my standard character encoding index.jsp test.

<%@ page contentType="text/html; charset=UTF-8" %>


   
 Character encoding test page
   
   
 Data posted to this form was:
 <%
   request.setCharacterEncoding("UTF-8");
   out.print(request.getParameter("mydata"));
 %>

 
 
   
   
   
 
   


To get the above working with GET, you'll need to make sure
URIEncoding="UTF-8" has been set on the connector as Nathan pointed
out earlier.

Mark

Joseph S wrote:
> POST
> 
> Mark Thomas wrote:
>> Joseph S wrote:
>>> When I did that my content displayed correctly, but on form submission
>>> it got corrupted.
>>
>> POST or GET?
>>
>> Mark
>>
>>
>> -
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle

//code
Object o = ic.lookup("java:comp/env/users");
System.out.println(o.getClass().getName()); // prints : 
"org.apache.catalina.users.MemoryUserDatabase"


doing instanceof tests on the returned object for MemoryUserDatabase & 
UserDatabase all fail, even though in debug that's clearly what it 
identifies as.


could this be a security manager thing? I notice that in the tomcat 
manager deployment descriptor it has privileged="true" in the Context 
tag. Are only privileged applications allowed access to the 
UserDatabase? (this would make sense as you could enumerate all users & 
passwords...)


Gregor Schneider wrote:

InitialContext.lookup() gives you a simple object:

so change your code to

Context ic = new InitialContext();
Object o = ic.lookup("java:comp/env/users");

set a breakpoint and see, what type of object you're getting back.

hth

gregor
  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle

this is weird, check this out:

//code (tomcat 5.5.23)
java.security.Principal p = request.getUserPrincipal();
System.out.println(p.getClass().getName().equals(MemoryUser.class.getName())); 
// prints "true"

System.out.println(p.getClass().equals(MemoryUser.class)); //prints "false"

So what this is saying is that the *names* of the classes are the same, 
but the actual classes are different. this is crazy...


Good news is that p.toString() prints out that users details in the form 
, so I can hack 
the role names out of that. but that's a very dirty hack and I'm amazed 
that this is so hard...


Does anyone have any input on why this might be so, and/or a better 
solution to convert the request principal to something I can get 
rolenames out of?


thanks!

Matthew Kerle wrote:

//code
Object o = ic.lookup("java:comp/env/users");
System.out.println(o.getClass().getName()); // prints : 
"org.apache.catalina.users.MemoryUserDatabase"


doing instanceof tests on the returned object for MemoryUserDatabase & 
UserDatabase all fail, even though in debug that's clearly what it 
identifies as.


could this be a security manager thing? I notice that in the tomcat 
manager deployment descriptor it has privileged="true" in the Context 
tag. Are only privileged applications allowed access to the 
UserDatabase? (this would make sense as you could enumerate all users 
& passwords...)




--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Web analyzer for Tomcat

2007-08-16 Thread Lyallex
Hi

I don't think webalizer is 'for' apache httpd, rather it will analyse
logs written in Common Logfile Format (and others). It doesn't matter
what he server is.
If you use the AccessLogValve to write your access logs then webalizer
seems to read these well. I'm a raw beginner with webalizer. I made
the mistake of not setting rotatable to false in the valve config and
couldn't figure out why I was only seeing one days worth of hits ...
duh!

Anyway, I think you should be able to figure out what is going on if
you use the docs at
http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html
also, reading the comments in sample.conf helped a lot.

I've been looking for a 'better' analysis tool for three days now and
haven't really found anything that touches webalizer (not for 'free'
anyway). If you find something better I'd love to know

Good Luck
Duncan

On 8/16/07, Kanchana Welagedara <[EMAIL PROTECTED]> wrote:
> Hi All
>
> Just like webalizer for apache php project what is the web analyzer
> available for tomcat?Can any one please let me know better user guide for
> configuring webalizer on tomcat?or some other web analyzer for tomcat?
>
> Thanks and Regards
> Kanchana
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread ian . blenk

I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three 
applications that are deployed from this 
server, two of which work fine with tomcat 5.5.12, however the third which uses 
an oracle 9i database gives me the 
following error "javax.servlet.ServletException: Cannot create JDBC driver of 
class '' for connect URL 'null' ". 
Basically I've included the same details form the Tomcat4 server.xml file into 
the tomcat 5.5 server.xml, rediting 
where necessary.

Things I have tried..

Placing the context into fragment files located either inside the applications 
META-INF folder or under 
tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as Tomcat 
could not find the apps, so I've 
left the context back in server.xml.
Rewriting the Resource params  as elements 
i.e.factory="com.ora.jsp.sql.DataSourceFactory"
Checked changed location of the JDBC jar file. classes12.jar 
catalina_home\common\lib\ AND 
catalina_home\webapps\[appname]\WEB-INF\lib
Checked changed the server.xml service-name and engine name to match previous 
TC4 server.xml version.
Added a Resourcelink element to the context - this is not present on the TC4 
version
Checked Tomcat logs.

I think that Tomcat is not able to read the  element, which is 
why the URL and driverClass are 
NULL. 

Which When I checked the Tomcat log files shows ...

16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
SEVERE: action: Cannot create JDBC driver of class '' for connect URL 'null'

Background info 
Using Apache 2.0 with mod_JK to serve pages on port 80
Java version 1.5

 server.xml 





  
  
 
  
  








  


  
   




  
  
 
  
  
  


  
 
   
  
   
  
 
 



  



  



*** end server.xml ***


*** App web.xml except ***

 

  JNDI DataSource for [appname] database.
  (From Oreilly "JavaServer Pages", Bergsten, 2nd Ed., page 485)

jdbc/oponline
javax.sql.DataSource
Container
  

*** end web.xml ***


Thanks

Ian

-- 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Peter Crowther
> From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
> So what this is saying is that the *names* of the classes are 
> the same, 
> but the actual classes are different. this is crazy...

I suspect the two classes are being loaded by different classloaders - a
common and entertaining* problem in Tomcat and other servlet containers.
You can find out by asking each for its classloader and comparing.

- Peter

* Depending on whether you're watching someone else try to solve the
problem, or having to wade through it yourself.  Best of luck!

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle

hmm, you have an interesting problem!

first thing I'd say is use this opportunity to upgrade to the 
ojdbc14.jar, which is the latest oracle jdbc driver and allows lots of 
nice enhancements.


second, I'm assuming that since the error is a servlet exception, that 
there's some servlet code manually handling a database connection (no 
comment *cough* *cough*) that it gets from a JNDI lookup?


third, try changing the  tag to a plain  tag, 
this is the Resource tag that I use in my app (and it works). caveat: I 
declare this in /META-INF/context.xml inside the  tag.


   

can you try this and let us know how it goes?

cheers!

[EMAIL PROTECTED] wrote:
I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three applications that are deployed from this 
server, two of which work fine with tomcat 5.5.12, however the third which uses an oracle 9i database gives me the 
following error "javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' ". 
Basically I've included the same details form the Tomcat4 server.xml file into the tomcat 5.5 server.xml, rediting 
where necessary.


Things I have tried..

Placing the context into fragment files located either inside the applications META-INF folder or under 
tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as Tomcat could not find the apps, so I've 
left the context back in server.xml.

Rewriting the Resource params  as elements 
i.e.factory="com.ora.jsp.sql.DataSourceFactory"
Checked changed location of the JDBC jar file. classes12.jar catalina_home\common\lib\ AND 
catalina_home\webapps\[appname]\WEB-INF\lib

Checked changed the server.xml service-name and engine name to match previous 
TC4 server.xml version.
Added a Resourcelink element to the context - this is not present on the TC4 
version
Checked Tomcat logs.

I think that Tomcat is not able to read the  element, which is why the URL and driverClass are 
NULL. 


Which When I checked the Tomcat log files shows ...

16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
SEVERE: action: Cannot create JDBC driver of class '' for connect URL 'null'

Background info 
Using Apache 2.0 with mod_JK to serve pages on port 80

Java version 1.5

 server.xml 





  
  
 
  

  








  



  
   
   enableLookups="true" redirectPort="8443" protocol="AJP/1.3" />




  
  
 resourceName="UserDatabase"/>
 
  
  
  



  
 
  timestamp="true"/> 
  
   
 factory="com.ora.jsp.sql.DataSourceFactory"
 user="myuser"
 password="mypassword"
 
dataSourceClassName="oracle.jdbc.pool.OracleConnectionCacheImpl"
 
URL="jdbc:oracle:thin:@sas-test.myserver.ac.uk:1521:MYTE"
 maxLimit="5" />
  
 

 



  




  



*** end server.xml ***


*** App web.xml except ***

 

  JNDI DataSource for [appname] database.
  (From Oreilly "JavaServer Pages", Bergsten, 2nd Ed., page 485)

jdbc/oponline
javax.sql.DataSource
Container
  

*** end web.xml ***


Thanks

Ian

  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle

Peter,
you're exactly right.

***code***
Class c1 = request.getUserPrincipal().getClass(); //get the class of the 
Principal that tomcat created , which is a MemoryUser instance

Class c2 = MemoryUser.class; // get the class loaded by the current loader
System.out.println(c1.getClassLoader().getClass.getName()); //prints 
"org.apache.catalina.loader.StandardClassLoader"
System.out.println(c2.getClassLoader().getClass.getName()); //prints 
"org.apache.catalina.loader.WebappClassLoader"


Great, so now I've got two different classloaders. Do you know if 
there's any way I can cast the Principal to a Memoryuser object and use 
it? do I have to load the MemoryUser class in the current classloader?


full kudos for figuring out the problem exactly, I never would have 
thought of that!


ps - This would be entertaining, if only I was the one who got to watch 
someone else wade through this!


Peter Crowther wrote:
From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
So what this is saying is that the *names* of the classes are 
the same, 
but the actual classes are different. this is crazy...



I suspect the two classes are being loaded by different classloaders - a
common and entertaining* problem in Tomcat and other servlet containers.
You can find out by asking each for its classloader and comparing.

- Peter

* Depending on whether you're watching someone else try to solve the
problem, or having to wade through it yourself.  Best of luck!


  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread ashish shrivastava
check this

http://evolutionnext.com/blog/2005/10/13/1129259088959.html



On 8/16/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:
>
> hmm, you have an interesting problem!
>
> first thing I'd say is use this opportunity to upgrade to the
> ojdbc14.jar, which is the latest oracle jdbc driver and allows lots of
> nice enhancements.
>
> second, I'm assuming that since the error is a servlet exception, that
> there's some servlet code manually handling a database connection (no
> comment *cough* *cough*) that it gets from a JNDI lookup?
>
> third, try changing the  tag to a plain  tag,
> this is the Resource tag that I use in my app (and it works). caveat: I
> declare this in /META-INF/context.xml inside the  tag.
>
>  type="javax.sql.DataSource"
>  maxActive="0"
>  maxIdle="10"
>  maxWait="500"
>  username="db_user"
>  password="db_pass"
>  driverClassName="oracle.jdbc.OracleDriver"
>  url="jdbc:oracle:thin:@server:1521:ORA_SID"/>
>
> can you try this and let us know how it goes?
>
> cheers!
>
> [EMAIL PROTECTED] wrote:
> > I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three
> applications that are deployed from this
> > server, two of which work fine with tomcat 5.5.12, however the third
> which uses an oracle 9i database gives me the
> > following error "javax.servlet.ServletException: Cannot create JDBC
> driver of class '' for connect URL 'null' ".
> > Basically I've included the same details form the Tomcat4 server.xmlfile 
> > into the tomcat
> 5.5 server.xml, rediting
> > where necessary.
> >
> > Things I have tried..
> >
> > Placing the context into fragment files located either inside the
> applications META-INF folder or under
> > tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as
> Tomcat could not find the apps, so I've
> > left the context back in server.xml.
> > Rewriting the Resource params  as elements i.e.factory="
> com.ora.jsp.sql.DataSourceFactory"
> > Checked changed location of the JDBC jar file. 
> > classes12.jarcatalina_home\common\lib\ AND
> > catalina_home\webapps\[appname]\WEB-INF\lib
> > Checked changed the server.xml service-name and engine name to match
> previous TC4 server.xml version.
> > Added a Resourcelink element to the context - this is not present on the
> TC4 version
> > Checked Tomcat logs.
> >
> > I think that Tomcat is not able to read the  element,
> which is why the URL and driverClass are
> > NULL.
> >
> > Which When I checked the Tomcat log files shows ...
> >
> > 16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
> > SEVERE: action: Cannot create JDBC driver of class '' for connect URL
> 'null'
> >
> > Background info
> > Using Apache 2.0 with mod_JK to serve pages on port 80
> > Java version 1.5
> >
> >  server.xml 
> >
> > 
> >
> > 
> >
> >   
> >   
> >
> >   
> >   
> >
> > 
> >  value="30"/>
> >
> >
> >  >   type="org.apache.catalina.UserDatabase"
> >description="User database that can be updated and saved"
> >factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
> >   pathname="conf/tomcat-users.xml" >
> >
> >
> >   
> >
> >
> >   
> >
> >  >enableLookups="true" redirectPort="8443"
> protocol="AJP/1.3" />
> >
> > 
> >
> >
> >>  resourceName="UserDatabase"/>
> >
> >
> >   
> >
> >
> >  reloadable="true">
> >>  directory="logs"  prefix="staff_access_log."
> suffix=".txt"
> >  pattern="combined" resolveHosts="false"/>
> >
> >prefix="oponline_log." suffix=".txt"
> > timestamp="true"/>
> >
> > >  factory="com.ora.jsp.sql.DataSourceFactory"
> >  user="myuser"
> >  password="mypassword"
> >  dataSourceClassName="
> oracle.jdbc.pool.OracleConnectionCacheImpl"
> >  URL="
> jdbc:oracle:thin:@sas-test.myserver.ac.uk:1521:MYTE"
> >  maxLimit="5" />
> >
> >  
> >  
> >
> > 
> >
> >   
> >
> > 
> >
> >   
> >
> > 
> >
> > *** end server.xml ***
> >
> >
> > *** App web.xml except ***
> >
> >  
> > 
> >   JNDI DataSource for [appname] database.
> >   (From Oreilly "JavaServer Pages", Bergsten, 2nd Ed., page 485)
> > 
> > jdbc/oponline
> > javax.sql.DataSource
> > Container
> >   
> >
> > *** end web.xml ***
> >
> >
> > Thanks
> >
> > Ian
> >
> >
>
> --
> Matthew Kerle
> IT Consultant
> Canberra, Australia
>
> Mobile: +61404 096 863
> Email : [EMAIL PROTECTED]
> Web : http://threebrightlights.blogspot.com/
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PRO

how to strip tomcat?

2007-08-16 Thread Manivannan Palanichamy
My laptop is having very low memory. I need to run minimal version of
tomcat. (stripped version of tomcat, to avoid memory hogging). Can you guys
give some tips on this -- like removing unnecessary jars & enabling dynamic
class/jar loading?

(My requirement is just to run few jsp pages, to enter/retrieve some values
to/from database, nothing else other than that)

-- 
Manivannan Palanichamy
http://mani.gw.googlepages.com/index.html


RE: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Peter Crowther
> From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
> Class c1 = request.getUserPrincipal().getClass(); //get the 
> class of the 
> Principal that tomcat created , which is a MemoryUser instance
> Class c2 = MemoryUser.class; // get the class loaded by the 
> current loader
> System.out.println(c1.getClassLoader().getClass.getName()); //prints 
> "org.apache.catalina.loader.StandardClassLoader"
> System.out.println(c2.getClassLoader().getClass.getName()); //prints 
> "org.apache.catalina.loader.WebappClassLoader"
> 
> Great, so now I've got two different classloaders. Do you know if 
> there's any way I can cast the Principal to a Memoryuser 
> object and use 
> it? do I have to load the MemoryUser class in the current classloader?

Right.  So request.getUserPrincipal() returns a class that's loaded by
one of Tomcat's classloaders.  You need to make sure that when you
reference MemoryUser, it's loaded by the same classloader.

Thinking aloud here, so apologies to the more experienced folks in the
community who will have better ideas... Is MemoryUser.class in any of
the jars in your webapp?  I'm not entirely sure why there's a second
copy of it, loaded by the webapp's classloader, in the system.  I'd
expect the webapp's classloader to be unable to find the class as your
webapp loads and punt the request for the class up the classloader
chain, returning the standard classloader's class.  But I may be
misunderstanding Tomcat's classloaders.

- Peter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tomcat performance on static content over SSL/non-SSL

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Leon,

Leon Rosenberg wrote:
> security by obscurity, that is.

Through I agree that claiming Apache httpd increases security, it is
certainly not security by obscurity. It is another layer between the
attacker and the goodies. You may disagree about the efficacy of that
layer, but it's not merely obscurity.

Changing your web server's "Server" header response to "MS ISS" would be
security-by-obscurity. ;)

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxE6X9CaO5/Lv0PARAuCYAJ9/zvgXON3Bq0XYg2twHlWr6+mWsQCgsGJC
R1E7oIVw3Khii9uhaI/37C8=
=Gir7
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to strip tomcat?

2007-08-16 Thread David Delbecq
taking a look at tomcat 5.5.23, i'll try to answer you

1) you can take a look at tomcat embedded, it *may* be stripped down,
but am not sure
2) in the core tomcat, there are perhaps only 2 or 3 jars you can
*perhaps* remove: tomcat-18n other than english, tomcat-ajp,
catalina-optional
3) as for you requirement about dynamic classloading, JVM does not do
the static initialize of a class file until it's actively used somewhere
(access to static properties / instanciation / parent of a class that
will be used). So you can have tons of completely unused class, they
will only take the space required by tho locate them)

En l'instant précis du 16/08/07 15:08, Manivannan Palanichamy
s'exprimait en ces termes:
> My laptop is having very low memory. I need to run minimal version of
> tomcat. (stripped version of tomcat, to avoid memory hogging). Can you guys
> give some tips on this -- like removing unnecessary jars & enabling dynamic
> class/jar loading?
>
> (My requirement is just to run few jsp pages, to enter/retrieve some values
> to/from database, nothing else other than that)
>
>   


-- 
http://www.noooxml.org/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat freezes up

2007-08-16 Thread Garg, Apoorv


Best Regards,
Apoorv


> _ 
> From: Garg, Apoorv  
> Sent: Thursday, August 16, 2007 9:14 AM
> To:   'users@tomcat.apache.org'
> Subject:  Tomcat freezes up
> 
> Hi,
> 
> I am using Tomcat 5.5.17. I have noticed that at times Tomcat freezes
> up and stops responding to requests. The only way to come out of this
> mode is to restart Tomcat. There is no definite pattern to this
> behaviour. I will appreciate all the help.
> 
> Thanks!
> 
> Apoorv Garg
> Dematic Corp. USA
> Software Products Engineering, R&D-4
> 507 Plymouth Ave NE
> Grand Rapids, MI 49505
> Phone: 616-9135044
> Fax: 616-9135024
> E-mail: [EMAIL PROTECTED]
> DEMATIC l Creating Logistics Results  
> 


Re: Multi-Gigabyte Uploads, Tomcat 2GB and higher uploads

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

DAvid,

David Hesson wrote:
> The
> content-length has a maximum value of 2.x billion, which is right under
> two gigabytes.

Is this a limit on commons-upload? The header itself can contain an
arbitrarily high number, so there's no inherent file-size limit on
uploads over HTTP.

> A 2.xGB file will result in a negative content length
> from integer overflow into the final, negative bit position.

I don't think so. Java doesn't overflow like C does. Attempting to read
an int that's too big results in an exception, not a negative result:

$ cat > IntReadTest.java
public class IntReadTest
{
public static void main(String[] args)
{
System.out.println(Integer.parseInt(args[0]));
}
}
^D
$ javac IntReadTest
$ java IntReadTest 2147483647
2147483647
$ java IntReadTest 2147483648
Exception in thread "main" java.lang.NumberFormatException: For input
string: "2147483648"
at
java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:463)
at java.lang.Integer.parseInt(Integer.java:497)
at IntReadTest.main(IntReadTest.java:5)
$

Now, if you were using an old version of mod_jk (which you didn't
mention), it's possible that the Content-Length header is being
corrupted. Since you have a filter chain, can you print the (String)
value of the Content-Length header before processing begins? That would
be helpful.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxFDy9CaO5/Lv0PARAtz1AJ9G5qHlz2n6nY2km68upW80z5OfOwCfTlo4
rDUomEV/r/L3L7DcjruMysc=
=tjSt
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle
you're exactly right again. I just checked my project settings, I had to 
add catalina.jar to the project libraries to get the class to compile, 
but I'd forgotten to prevent it from being deployed, so there was a copy 
of catalina.jar in my /WEB-INF/lib, doh!


So I configured it to not be deployed, and deleted the existing jar, so 
now I get a new problem, a NoClassDefFoundError on the MemoryUser class, 
which is referenced by my code. So now my class doesn't even load!! I 
have a feeling someone's gone to a fair bit of trouble to make sure I 
can't load this class!


the MemoryUser class is in catalina.jar, which is in the server/lib 
folder. would I be right in saying that web application code is barred 
from loading any classes from the server/lib directory?


any ideas Peter?

org.codehaus.xfire.XFireRuntimeException: Error invoking 
'myapp.service.webservice.ImageService.enumerateLOV(java.lang.String)'. 
Nested exception is java.lang.reflect.InvocationTargetException: null

java.lang.reflect.InvocationTargetException
   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:597)
   at 
org.codehaus.xfire.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:59)

   ... elided
   at 
org.codehaus.xfire.transport.http.XFireServlet.doPost(XFireServlet.java:116)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

   ... elided
   at 
org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1286)

   at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: 
org/apache/catalina/users/MemoryUser
   at 
myapp.service.webservice.ImageServiceImpl.enumerateLOV(ImageServiceImpl.java:67)

   ... 31 more

Peter Crowther wrote:

Right.  So request.getUserPrincipal() returns a class that's loaded by
one of Tomcat's classloaders.  You need to make sure that when you
reference MemoryUser, it's loaded by the same classloader.

Thinking aloud here, so apologies to the more experienced folks in the
community who will have better ideas... Is MemoryUser.class in any of
the jars in your webapp?  I'm not entirely sure why there's a second
copy of it, loaded by the webapp's classloader, in the system.  I'd
expect the webapp's classloader to be unable to find the class as your
webapp loads and punt the request for the class up the classloader
chain, returning the standard classloader's class.  But I may be
misunderstanding Tomcat's classloaders.

- Peter


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

Matthew Kerle wrote:
> this is weird, check this out:
> 
> //code (tomcat 5.5.23)
> java.security.Principal p = request.getUserPrincipal();
> System.out.println(p.getClass().getName().equals(MemoryUser.class.getName()));
> // prints "true"
> System.out.println(p.getClass().equals(MemoryUser.class)); //prints "false"

So, the class names are the same, but not the classes. This indicates
that you have the same class loaded using two different ClassLoaders. Do
you have a JAR file from the Tomcat distro sitting in your webapp's
WEB-INF/lib directory?

If so, you'll need to figure out how to deploy the JAR in one place but
use it everywhere ($CATALINA_HOME/common/lib for TC 5.5 and, I think,
just $CATALINA_HOME/lib for TC 6.0).

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxFOX9CaO5/Lv0PARAsBQAJ9vXQKyDl2T6FXHz9Ijw241juk1OQCgvf4+
UzPy8kYFxyvPhBiY7DSh04k=
=EM9K
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Peter Crowther
> From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
> the MemoryUser class is in catalina.jar, which is in the server/lib 
> folder. would I be right in saying that web application code 
> is barred 
> from loading any classes from the server/lib directory?

(light bulb comes on)

Ah yes, I remember this now from some ancient history on another
project.  It's a real pain, principally because the Principal interface
is IMO too limited.  We ended up with the horrible, horrible hack of
pulling the class out of catalina.jar, putting it in its own jar, and
deploying that in common/lib.  This, of course, means you no longer have
a default Tomcat install... but we couldn't find another way round the
problem.

- Peter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter,

Peter Crowther wrote:
> We ended up with the horrible, horrible hack of
> pulling the class out of catalina.jar, putting it in its own jar, and
> deploying that in common/lib.

Shouldn't it be acceptable to simply move catalina.jar from server/lib
to common/lib?

Sure, you'll still have a non-standard install, but it's easier to
script a setup like that than pulling specific classes out of the distro
(which may change from version to version).

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxFT79CaO5/Lv0PARAnV4AKCFlrCGXZRW6kAsuAKVALotClJZVQCgt35C
cCXiuO3XNkXko3SshrF9tpg=
=wR3z
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle

Hi Chris

I naively tried relocating the catalina.jar to /common/lib, and got the 
below error. Peter has a good comment to this problem in his reply, so 
I'll continue the thread in response to his mail.


many thanks!

cmd /c C:\servers\apache-tomcat-5.5.23\bin\catalina.bat run
Using CATALINA_BASE:   C:\Documents and 
Settings\mkerle\.IntelliJIdea60\system\tomcat_Unnamed_cb722476

Using CATALINA_HOME:   C:\servers\apache-tomcat-5.5.23
Using CATALINA_TMPDIR: C:\servers\apache-tomcat-5.5.23\temp
Using JRE_HOME:C:\Program Files\Java\jdk1.6.0
Connected to the target VM, address: '127.0.0.1:4958', transport: 'socket'
java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler
   at java.lang.Class.getDeclaredConstructors0(Native Method)
   at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
   at java.lang.Class.getConstructor0(Class.java:2699)
   at java.lang.Class.newInstance0(Class.java:326)
   at java.lang.Class.newInstance(Class.java:308)
   at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:225)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410)
Disconnected from the target VM, address: '127.0.0.1:4958', transport: 
'socket'

Disconnected from server


Christopher Schultz wrote:

Matt,
  
So, the class names are the same, but not the classes. This indicates

that you have the same class loaded using two different ClassLoaders. Do
you have a JAR file from the Tomcat distro sitting in your webapp's
WEB-INF/lib directory?

If so, you'll need to figure out how to deploy the JAR in one place but
use it everywhere ($CATALINA_HOME/common/lib for TC 5.5 and, I think,
just $CATALINA_HOME/lib for TC 6.0).

- -chris

  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Peter Crowther
> From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
> Shouldn't it be acceptable to simply move catalina.jar from server/lib
> to common/lib?
> 
> Sure, you'll still have a non-standard install, but it's easier to
> script a setup like that than pulling specific classes out of 
> the distro (which may change from version to version).

We wanted to add as few classes as possible to common - but, yes, that'd
be a more maintainable solution.  By that time we were maintaining quite
a heavily customised Tomcat anyway, so one more pain point was minor.

- Peter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle
no, see my previous reply, tomcat fails to bootstrap if catalina.jar is 
not in server/lib...


Christopher Schultz wrote:


Peter,
Shouldn't it be acceptable to simply move catalina.jar from server/lib
to common/lib?

Sure, you'll still have a non-standard install, but it's easier to
script a setup like that than pulling specific classes out of the distro
(which may change from version to version).


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle
I agree, the Principal interface is verily hobbled and almost useless 
(Go Sun!). The catalina implementations are much more user-friendly, but 
unfortunately difficult to access.


I can't really justify making the tomcat install non-standard (also 
probably not possible as it's owned by the client, not me) just to get 
access to this class. I'll go with another hack, in that although I 
can't refer directly to MemoryUser, I can still call it's toString() 
method, which prints out the  tag in it's entirety, which I can 
then munge for role names.


I can't believe something this simple is so hard, far out.

thanks so much for your help Peter, I would've been totally stuck 
without it!


Peter Crowther wrote:
From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
the MemoryUser class is in catalina.jar, which is in the server/lib 
folder. would I be right in saying that web application code 
is barred 
from loading any classes from the server/lib directory?



(light bulb comes on)

Ah yes, I remember this now from some ancient history on another
project.  It's a real pain, principally because the Principal interface
is IMO too limited.  We ended up with the horrible, horrible hack of
pulling the class out of catalina.jar, putting it in its own jar, and
deploying that in common/lib.  This, of course, means you no longer have
a default Tomcat install... but we couldn't find another way round the
problem.

- Peter
  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthew,

Matthew Kerle wrote:
> no, see my previous reply, tomcat fails to bootstrap if catalina.jar is
> not in server/lib...

That's too bad.

Why not just use the built-in authentication and authorization mechanism
instead of trying to use Tomcat's built-in classes to roll your own?

A more flexible option is to use securityfilter
(http://securityfilter.sourceforge.net) to handle everything.
securityfilter allows you to use Tomcat realms by dropping catalina.jar
into your webapp's library directory. Since securityfilter runs entirely
in your webapp, there are no classloading problems (even though Tomcat's
internal classes are used, they are loaded by the webapp's ClassLoader,
and are insulated from Tomcat, so they're safe).

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxFgg9CaO5/Lv0PARAr+tAJ9qFSDak0g2RVaM4ZP0col6JQUASwCgt1g/
gze5O3bGX+AwWdfa5Y8meLI=
=d06z
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle
just downloaded security filter and had a look, it looks very cool. If I 
had more robust requirements for my authentication (and more time!) I 
would probably use it.


At the moment though I've got a workable work-around in using the 
toString() method, so I'll just use that instead.


thanks Chris!

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthew,
Why not just use the built-in authentication and authorization mechanism
instead of trying to use Tomcat's built-in classes to roll your own?

A more flexible option is to use securityfilter
(http://securityfilter.sourceforge.net) to handle everything.
securityfilter allows you to use Tomcat realms by dropping catalina.jar
into your webapp's library directory. Since securityfilter runs entirely
in your webapp, there are no classloading problems (even though Tomcat's
internal classes are used, they are loaded by the webapp's ClassLoader,
and are insulated from Tomcat, so they're safe).

- -chris

--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: catalina error log

2007-08-16 Thread Caldarale, Charles R
> From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
> Subject: Re: catalina error log
> 
> you're missing the Apache Portable Runtime library from your PATH 
> variable. this  is not a serious problem, but if you don't 
> want to get this error then download the version of the library

If you don't need the performance enhancement and want to keep your life
simple, just comment out the APR listener in server.xml - that's the
source of the message.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Mario Ivankovits
Hi!
> A more flexible option is to use securityfilter
> (http://securityfilter.sourceforge.net) to handle everything.
>   
If you are already using spring have a look at ACEGI.
It is not really easy to install, but allows you to e.g. have different
login methods within the same webapp.

Regarding the principal. Remember, you can always use reflection to
break into an object (given you use no securitymanager or a liberal
configured one).

For example, I used for a while:

try
{
Method hasRoleMeth =
principal.getClass().getMethod("hasRole", String.class);
return (Boolean) hasRoleMeth.invoke(principal, role);
}
catch (NoSuchMethodException e)
{
log.error(e.getLocalizedMessage(), e);
}
catch (IllegalAccessException e)
{
log.error(e.getLocalizedMessage(), e);
}
catch (InvocationTargetException e)
{
log.error(e.getLocalizedMessage(), e);
}


Ciao,
Mario


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat freezes up

2007-08-16 Thread Manivannan Palanichamy
I posted the same question week back. People advised me to handle the
resource safely, like freeing up the database connections after use,
releasing file handles etc. I am very sure that I am doing that perfectly,
but still my tomcat freezes over long run. I've seen this case in many
instances. Is it an issue with tomcat thread handling? Because, in user
applications, these freezing problems happen most of the time, because of
poor thread handling.

Better we enter a bug/ discuss this issue in tomcat developers forum.

-- 
Manivannan Palanichamy
http://mani.gw.googlepages.com/index.html

On 8/16/07, Garg, Apoorv <[EMAIL PROTECTED]> wrote:
>
>
>
> Best Regards,
> Apoorv
>
>
> > _
> > From: Garg, Apoorv
> > Sent: Thursday, August 16, 2007 9:14 AM
> > To:   'users@tomcat.apache.org'
> > Subject:  Tomcat freezes up
> >
> > Hi,
> >
> > I am using Tomcat 5.5.17. I have noticed that at times Tomcat freezes
> > up and stops responding to requests. The only way to come out of this
> > mode is to restart Tomcat. There is no definite pattern to this
> > behaviour. I will appreciate all the help.
> >
> > Thanks!
> >
> > Apoorv Garg
> > Dematic Corp. USA
> > Software Products Engineering, R&D-4
> > 507 Plymouth Ave NE
> > Grand Rapids, MI 49505
> > Phone: 616-9135044
> > Fax: 616-9135024
> > E-mail: [EMAIL PROTECTED]
> > DEMATIC l Creating Logistics Results
> >
>


Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle

http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

this is why I can't reference any classes loaded from server/lib in my 
webapp, the server/lib classes are loaded by the web application 
classloader's "uncle", so to speak, the sibling of it's parent. so it 
makes sense that no web application has access to the server/lib jars. 
doh...!


Peter Crowther wrote:
From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
the MemoryUser class is in catalina.jar, which is in the server/lib 
folder. would I be right in saying that web application code 
is barred 
from loading any classes from the server/lib directory?



(light bulb comes on)

Ah yes, I remember this now from some ancient history on another
project.  It's a real pain, principally because the Principal interface
is IMO too limited.  We ended up with the horrible, horrible hack of
pulling the class out of catalina.jar, putting it in its own jar, and
deploying that in common/lib.  This, of course, means you no longer have
a default Tomcat install... but we couldn't find another way round the
problem.

- Peter


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tracking active session in a tomcat cluster

2007-08-16 Thread Filip Hanik - Dev Lists
Tomcat 5.5 has an all-to-all replication mechanism, hence all nodes 
should be identical. you would only need to see the sessions on one node 
to get a picture of what is looks like elsewhere.


there is a flag called "notifyListenersOnReplication" this is only for 
attribute replication for nodes that are up in the cluster.
When a "state transfer" is performed, ie, a new node joins the cluster, 
then nothing but serialization/deserialization is performed, and no 
listeners are called or events fired.


Filip

Vinod Venkatraman wrote:

Hi,

I want to track all the active sessions of a tomcat 5.5 cluster. 
Particularly, I want to host a page on each cluster member which will

display all the sessions active on its cluster.

So I want to see a list of :
session-id, user-name, jvmRoute (of member to which this session is sticky
to).

What I have tried is :
Whenever a new session is created I create an object which implements
HttpSessionBindingListener 
and put in the session.


public void valueBound(HttpSessionBindingEvent event) {
synchronized(ActiveSessions.ACTIVE_SESSIONS) {
HttpSession session = event.getSession();
ActiveSessions.ACTIVE_SESSIONS.add(this);
System.out.println("VV Registered Session : " + this);
System.out.println("VV Active Sessions count : " +
ActiveSessions.ACTIVE_SESSIONS.size() + " :: Active Sessions : " +
ActiveSessions.ACTIVE_SESSIONS);
}
}

public void valueUnbound(HttpSessionBindingEvent event) {
synchronized(ActiveSessions.ACTIVE_SESSIONS) {
long expiredAt = System.currentTimeMillis();
ActiveSessions.ACTIVE_SESSIONS.remove(this);

// TODO : bookkeeping of expired sessions, write to a separate
log file.
System.out.println("VV Deregistered Session : " + this);

System.out.println("Session Expired : " + this + " Session
lasted from : " + createdAt + "-" + expiredAt);

System.out.println("VV Active Sessions count : " +
ActiveSessions.ACTIVE_SESSIONS.size() + " :: Active Sessions : " +
ActiveSessions.ACTIVE_SESSIONS);
}
}


Things work fine except for following case :

Say clusterMember1 is down when a new session is created at clusterMember2.

When clusterMember1 comes up it syncs it session state with clusterMember2
but valueBound() is 
never called in clusterMember1's JVM so I am unable to register this session
in clusterMember1's 
ACTIVE_SESSIONS list. Because of this my ACTIVE_SESSIONS list is not in sync

across cluster members.

Is this correct that valueBound will be called on only the cluster members
which were alive when the 
object was put in the session ?


Is there any other way I can track all active session of a cluster ?

Thanks,
Vinod
  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat freezes up

2007-08-16 Thread Sebastiaan van Erk
It seems very unlikely to me that the problem is in the Tomcat code. It 
is very widely deployed and any deadlocks would be found relatively 
quickly unless you use a very obscure setup.


Did you do any standard deadlock debugging? E.g., thread dumps and 
deadlock analysis when the freeze occurs, debug in eclipse with the 
sysdeo plugin and examine the state of your application when the freeze 
occurs... etc.


Note that reporting a bug is not very useful when there is no 
information on how to reproduce the bug, you'll just get a WORKSFORME or 
NEEDINFO status on the bug.


Regards,
Sebastiaan

Manivannan Palanichamy wrote:

I posted the same question week back. People advised me to handle the
resource safely, like freeing up the database connections after use,
releasing file handles etc. I am very sure that I am doing that perfectly,
but still my tomcat freezes over long run. I've seen this case in many
instances. Is it an issue with tomcat thread handling? Because, in user
applications, these freezing problems happen most of the time, because of
poor thread handling.

Better we enter a bug/ discuss this issue in tomcat developers forum.



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Installing APR on Fedora

2007-08-16 Thread Ole Ersoy

Hi Jung,

That did the trick!

I downloaded and installed:
http://www.axint.net/apache/apr/binaries/rpm/i386/apr-devel-1.2.8-1.i386.rpm

Then I ran this:
./configure --with-apr=/usr/bin/apr-1-config && make && make install

That did the trick :-)

Thanks Jung, Hassan, and Stephen,
- Ole



Rainer Jung wrote:

Hi Ole,

when you tried against your installed APR most likely the dev rpm, which 
includes the necessary header files for compiltions where not installed.


When you tried against a BUILD directory, most likely the APR library 
need for linking was not there.


Whichever way you choose, you need a full APR. I guess it would be 
easiest to install the dev RPMs for apr and apr-util and then use the 
installed files for configuring tcnative.


Now after you installed the additional dev packages (those are *not* the 
src packages), you might want to check, where those packages installed 
their contents to, because you need to give a path to the --with-apr 
flag. You can check package install pathes for rpm with


rpm -q --filesbypkg PACKAGENAME

If your packages choose the default system instalation pathes, you 
should be able to build without the with-apr flag. If the RPMs choose a 
special installation dir, but are build nicely, you will have shell 
scripts apr-1-config as part of one of the RPMs and you can give 
with-apr the path to this file as parameter, which will tell configure 
about the pathes of libs and headers. Lastly if you don't have the 
config script, but libs and headers are in lib/ and include/ below some 
dir, this dir will be a code value for with-apr.


HTH.

Rainer

Ole Ersoy wrote:

Hi Hassan,

I did the following:

rm -dfr tomcat-native-1.1.10-src/ tar xvfz tomcat-native.tar.gz
cd tomcat-native-1.1.10-src/jni/native
./configure --prefix=/usr/local/apr 
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/ && make && make install


And I still get:

le/rpmbuild/BUILD/apr-1.2.8/libapr-1.la -luuid -lcrypt -lpthread -ldl )
/usr/bin/ld: cannot find -lapr-1
collect2: ld returned 1 exit status
libtool: install: error: relink `libtcnative-1.la' with the above 
command before installing it

make: *** [install] Error 1

Thoughts?

Thanks again,
- Ole



Hassan Schroeder wrote:

On 8/15/07, Ole Ersoy <[EMAIL PROTECTED]> wrote:

I have a lot more progress now!  I get the following (The only 
important part is the bottom i think):


[EMAIL PROTECTED] native]# ./configure 
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/

...
libtool: install: error: relink `libtcnative-1.la' with the above 
command before installing it

make: *** [install] Error 1

Any idea what this means?


I'd suggest re-running this with a specific prefix to avoid potential
conflict with anything currently installed, e.g.

./configure --prefix=/usr/local/apr
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/

FWIW,


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Matthew Kerle
Mario, you are a hero. do women come and worship you in the street? they 
should! Using reflection to break into an object of a foreign class is 
just...genius! this is the sort of thing that Ruby programmers do all 
the time, but is very hard to do in Java...


my final code (in the context of a ServiceImpl class for an xFire 
webservice, exception-handling & error-checking elided)


   //get Role from security Principal, which we 'happen to know', is
   // an instance of catalina MemoryUser.
   HttpServletRequest request = XFireServletController.getRequest();
   Principal principal = request.getUserPrincipal();
   String rolename = null;
   if(principal != null){
   
if(principal.getClass().getName().equalsIgnoreCase("org.apache.catalina.users.MemoryUser")){
   Iterator it =(Iterator) 
principal.getClass().getMethod("getRoles").invoke(principal);

   Object role = it.next();
   String role1 = 
(String)role.getClass().getMethod("getRolename").invoke(role);

   int i = 0;
   }else{
   String xml = principal.toString();
   rolename = xml.split("\"")[3]; // [1]=username, 
[2]=pass, [3]=roles

   }
   }else{
   rolename = "public";
   }


Mario Ivankovits wrote:

Hi!
  

A more flexible option is to use securityfilter
(http://securityfilter.sourceforge.net) to handle everything.
  


If you are already using spring have a look at ACEGI.
It is not really easy to install, but allows you to e.g. have different
login methods within the same webapp.

Regarding the principal. Remember, you can always use reflection to
break into an object (given you use no securitymanager or a liberal
configured one).

For example, I used for a while:

try
{
Method hasRoleMeth =
principal.getClass().getMethod("hasRole", String.class);
return (Boolean) hasRoleMeth.invoke(principal, role);
}
catch (NoSuchMethodException e)
{
log.error(e.getLocalizedMessage(), e);
}
catch (IllegalAccessException e)
{
log.error(e.getLocalizedMessage(), e);
}
catch (InvocationTargetException e)
{
log.error(e.getLocalizedMessage(), e);
}


Ciao,
Mario

  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem accessing context when starting as non-root

2007-08-16 Thread James Cook
Hi,

When I start tomcat (5.5.16) as a non-root user (tomcat) I am unable to
access anything I have set up in my context container and I see nothing
in the logs to help (the access log says 404 for all the requests). For 
example, I have the standard setup:
/usr/local/tomcat/latest/conf/Catalina/localhost/manager.xml

which contains:




I am using jsvc to start tomcat (under solaris 10) and when I use '-user
tomcat', the manager app is not loaded, but when I user '-user root' it is.

The entire /usr/local/tomcat/latest is chown'ed to tomcat:tomcat

Here is the snippet from my server.xml



  



The two example apps that I still have in webapps (balancer & webdav)
are deployed ok, but the other two that I have defined in
conf/Catalina/localhost (manager and host-manager) are nowhere to be 
seen. It is like the appBase is being loaded ok, but the docBase is 
being ignored!

I have searched high and low for a solution to this problem and found
nothing, which leads me to believe that it is something obvious to do 
with permissions that I'm doing wrong. Please help!

Thanks
James




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Multi-Gigabyte Uploads, Tomcat 2GB and higher uploads

2007-08-16 Thread Len Popp
There were in fact bugs with requests > 2GB in both Tomcat and mod_jk
which were fixed recently, as Rainer pointed out. (And some of the
code was using -1 if the content-length was too large.) Upgrading to
6.0.14 or the next 5.5 release should fix the problem.

There's no size limit on commons-fileupload as far as I can tell, but
I've never tried it with a huge file.
-- 
Len

On 8/16/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> DAvid,
>
> David Hesson wrote:
> > The
> > content-length has a maximum value of 2.x billion, which is right under
> > two gigabytes.
>
> Is this a limit on commons-upload? The header itself can contain an
> arbitrarily high number, so there's no inherent file-size limit on
> uploads over HTTP.
>
> > A 2.xGB file will result in a negative content length
> > from integer overflow into the final, negative bit position.
>
> I don't think so. Java doesn't overflow like C does. Attempting to read
> an int that's too big results in an exception, not a negative result:
>
> $ cat > IntReadTest.java
> public class IntReadTest
> {
> public static void main(String[] args)
> {
> System.out.println(Integer.parseInt(args[0]));
> }
> }
> ^D
> $ javac IntReadTest
> $ java IntReadTest 2147483647
> 2147483647
> $ java IntReadTest 2147483648
> Exception in thread "main" java.lang.NumberFormatException: For input
> string: "2147483648"
> at
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Integer.parseInt(Integer.java:463)
> at java.lang.Integer.parseInt(Integer.java:497)
> at IntReadTest.main(IntReadTest.java:5)
> $
>
> Now, if you were using an old version of mod_jk (which you didn't
> mention), it's possible that the Content-Length header is being
> corrupted. Since you have a filter chain, can you print the (String)
> value of the Content-Length header before processing begins? That would
> be helpful.
>
> - -chris
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGxFDy9CaO5/Lv0PARAtz1AJ9G5qHlz2n6nY2km68upW80z5OfOwCfTlo4
> rDUomEV/r/L3L7DcjruMysc=
> =tjSt
> -END PGP SIGNATURE-
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ClassCastException trying to cast MemoryUserDatabase to UserDatabase

2007-08-16 Thread Mario Ivankovits
Hi!
> Mario, you are a hero. do women come and worship you in the street?
Haha! Oh boy ... you don't want to know ...

Glad it helped you! :-)

Ciao,
Mario


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread ian . blenk
Thanks for your advice so far

I've upgraded to the latest Oracle ojdbc14.jar and placed it the 
myapp\WEB-INF\lib folder, I also tried it the 
Tomcat\common\lib for for good measure but still got the same results. I'll 
continue to use ojdbc14.jar from now 
though.

I've change the ResourceParams name to just Resource name but this causes 
Tomcat not to startup, the logs show the 
following trace...

*** Excerpt Tomcat 5.5.12 logs ***
16-Aug-2007 16:08:32 org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
*** end ***

Does this mean it's now reading the   element. ?

Thanks

Ian


Quoting ashish shrivastava <[EMAIL PROTECTED]>:

> check this
> 
> http://evolutionnext.com/blog/2005/10/13/1129259088959.html
> 
> 
> 
> On 8/16/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:
> >
> > hmm, you have an interesting problem!
> >
> > first thing I'd say is use this opportunity to upgrade to the
> > ojdbc14.jar, which is the latest oracle jdbc driver and allows lots of
> > nice enhancements.
> >
> > second, I'm assuming that since the error is a servlet exception, that
> > there's some servlet code manually handling a database connection (no
> > comment *cough* *cough*) that it gets from a JNDI lookup?
> >
> > third, try changing the  tag to a plain  tag,
> > this is the Resource tag that I use in my app (and it works). caveat: I
> > declare this in /META-INF/context.xml inside the  tag.
> >
> > >  type="javax.sql.DataSource"
> >  maxActive="0"
> >  maxIdle="10"
> >  maxWait="500"
> >  username="db_user"
> >  password="db_pass"
> >  driverClassName="oracle.jdbc.OracleDriver"
> >  url="jdbc:oracle:thin:@server:1521:ORA_SID"/>
> >
> > can you try this and let us know how it goes?
> >
> > cheers!
> >
> > [EMAIL PROTECTED] wrote:
> > > I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three
> > applications that are deployed from this
> > > server, two of which work fine with tomcat 5.5.12, however the third
> > which uses an oracle 9i database gives me the
> > > following error "javax.servlet.ServletException: Cannot create JDBC
> > driver of class '' for connect URL 'null' ".
> > > Basically I've included the same details form the Tomcat4 server.xmlfile
> into the tomcat
> > 5.5 server.xml, rediting
> > > where necessary.
> > >
> > > Things I have tried..
> > >
> > > Placing the context into fragment files located either inside the
> > applications META-INF folder or under
> > > tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as
> > Tomcat could not find the apps, so I've
> > > left the context back in server.xml.
> > > Rewriting the Resource params  as elements i.e.factory="
> > com.ora.jsp.sql.DataSourceFactory"
> > > Checked changed location of the JDBC jar file.
> classes12.jarcatalina_home\common\lib\ AND
> > > catalina_home\webapps\[appname]\WEB-INF\lib
> > > Checked changed the server.xml service-name and engine name to match
> > previous TC4 server.xml version.
> > > Added a Resourcelink element to the context - this is not present on the
> > TC4 version
> > > Checked Tomcat logs.
> > >
> > > I think that Tomcat is not able to read the  element,
> > which is why the URL and driverClass are
> > > NULL.
> > >
> > > Which When I checked the Tomcat log files shows ...
> > >
> > > 16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
> > > SEVERE: action: Cannot create JDBC driver of class '' for connect URL
> > 'null'
> > >
> > > Background info
> > > Using Apache 2.0 with mod_JK to serve pages on port 80
> > > Java version 1.5
> > >
> > >  server.xml 
> > >
> > > 
> > >
> > > 
> > >
> > >   
> > >   
> > >
> > >   
> > >   
> > >
> > > 
> > >  > value="30"/>
> > >
> > >
> > >  > >   type="org.apache.catalina.UserDatabase"
> > >description="User database that can be updated and saved"
> > >factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
> > >   pathname="conf/tomcat-users.xml" >
> > >
> > >
> > >   
> > >
> > >
> > >   
> > >
> > >  > >enableLookups="true" redirectPort="8443"
> > protocol="AJP/1.3" />
> > >
> > > 
> > >
> > >
> > >> >  resourceName="UserDatabase"/>
> > >
> > >
> > >   
> > >
> > >
> > >  > reloadable="true">
> > >> >  directory="logs"  prefix="staff_access_log."
> > suffix=".txt"
> > >  pattern="combined" resolveHosts="false"/>
> > >
> > >> prefix="oponline_log." suffix=".txt"
> > > timestamp="true"/>
> > >
> > > > >  factory="com.ora.jsp.sql.DataSourceFactory"
> > >  user="my

RE: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Propes, Barry L
why don't you use this jar? ojdbc14_g.jar

That's what I ended up upgrading to.

Let me know if you need it, Ian, and I'll send it to you offline.

Barry

And,  you should put it in the common/lib folder.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 16, 2007 10:27 AM
To: Tomcat Users List
Subject: Re: JDBC driver of class '' for connect URL 'null' in Tomcat
5.5.12


Thanks for your advice so far

I've upgraded to the latest Oracle ojdbc14.jar and placed it the 
myapp\WEB-INF\lib folder, I also tried it the 
Tomcat\common\lib for for good measure but still got the same results. I'll 
continue to use ojdbc14.jar from now 
though.

I've change the ResourceParams name to just Resource name but this causes 
Tomcat not to startup, the logs show the 
following trace...

*** Excerpt Tomcat 5.5.12 logs ***
16-Aug-2007 16:08:32 org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
*** end ***

Does this mean it's now reading the   element. ?

Thanks

Ian


Quoting ashish shrivastava <[EMAIL PROTECTED]>:

> check this
> 
> http://evolutionnext.com/blog/2005/10/13/1129259088959.html
> 
> 
> 
> On 8/16/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:
> >
> > hmm, you have an interesting problem!
> >
> > first thing I'd say is use this opportunity to upgrade to the
> > ojdbc14.jar, which is the latest oracle jdbc driver and allows lots of
> > nice enhancements.
> >
> > second, I'm assuming that since the error is a servlet exception, that
> > there's some servlet code manually handling a database connection (no
> > comment *cough* *cough*) that it gets from a JNDI lookup?
> >
> > third, try changing the  tag to a plain  tag,
> > this is the Resource tag that I use in my app (and it works). caveat: I
> > declare this in /META-INF/context.xml inside the  tag.
> >
> > >  type="javax.sql.DataSource"
> >  maxActive="0"
> >  maxIdle="10"
> >  maxWait="500"
> >  username="db_user"
> >  password="db_pass"
> >  driverClassName="oracle.jdbc.OracleDriver"
> >  url="jdbc:oracle:thin:@server:1521:ORA_SID"/>
> >
> > can you try this and let us know how it goes?
> >
> > cheers!
> >
> > [EMAIL PROTECTED] wrote:
> > > I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three
> > applications that are deployed from this
> > > server, two of which work fine with tomcat 5.5.12, however the third
> > which uses an oracle 9i database gives me the
> > > following error "javax.servlet.ServletException: Cannot create JDBC
> > driver of class '' for connect URL 'null' ".
> > > Basically I've included the same details form the Tomcat4 server.xmlfile
> into the tomcat
> > 5.5 server.xml, rediting
> > > where necessary.
> > >
> > > Things I have tried..
> > >
> > > Placing the context into fragment files located either inside the
> > applications META-INF folder or under
> > > tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as
> > Tomcat could not find the apps, so I've
> > > left the context back in server.xml.
> > > Rewriting the Resource params  as elements i.e.factory="
> > com.ora.jsp.sql.DataSourceFactory"
> > > Checked changed location of the JDBC jar file.
> classes12.jarcatalina_home\common\lib\ AND
> > > catalina_home\webapps\[appname]\WEB-INF\lib
> > > Checked changed the server.xml service-name and engine name to match
> > previous TC4 server.xml version.
> > > Added a Resourcelink element to the context - this is not present on the
> > TC4 version
> > > Checked Tomcat logs.
> > >
> > > I think that Tomcat is not able to read the  element,
> > which is why the URL and driverClass are
> > > NULL.
> > >
> > > Which When I checked the Tomcat log files shows ...
> > >
> > > 16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
> > > SEVERE: action: Cannot create JDBC driver of class '' for connect URL
> > 'null'
> > >
> > > Background info
> > > Using Apache 2.0 with mod_JK to serve pages on port 80
> > > Java version 1.5
> > >
> > >  server.xml 
> > >
> > > 
> > >
> > > 
> > >
> > >   
> > >   
> > >
> > >   
> > >   
> > >
> > > 
> > >  > value="30"/>
> > >
> > >
> > >  > >   type="org.apache.catalina.UserDatabase"
> > >description="User database that can be updated and saved"
> > >factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
> > >   pathname="conf/tomcat-users.xml" >
> > >
> > >
> > >   
> > >
> > >
> > >   
> > >
> > >  > >enableLookups="true" redirectPort="8443"
> > protocol="AJP/1.3" />
> > >
> > > 
> > >
> > >
> > >> >  resourceName="UserDatabase"/>
> > >
> > >
> > >   
> > >
> 

Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread David Smith

Hi Ian.

ojdbc14.jar needs to ONLY be in common/lib.  It won't work in 
myapp/WEB-INF/lib and won't work if you have the jar in both places.


Additionally you should take a look at the JDBC howto docs regarding 
what your  config in your myapp/META-INF/context.xml or 
conf/Catalina/localhost/myapp.xml should look like:


http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html#Oracle%208i%20with%20OCI%20client

My only editorial comment on the page is to NOT place your 
 or  definition in server.xml as recommended 
on the page.  Place it in context.xml or myapp.xml as I describe above.


--David

[EMAIL PROTECTED] wrote:


Thanks for your advice so far

I've upgraded to the latest Oracle ojdbc14.jar and placed it the myapp\WEB-INF\lib folder, I also tried it the 
Tomcat\common\lib for for good measure but still got the same results. I'll continue to use ojdbc14.jar from now 
though.


I've change the ResourceParams name to just Resource name but this causes Tomcat not to startup, the logs show the 
following trace...


*** Excerpt Tomcat 5.5.12 logs ***
16-Aug-2007 16:08:32 org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
*** end ***

Does this mean it's now reading the   element. ?

Thanks

Ian


Quoting ashish shrivastava <[EMAIL PROTECTED]>:

 


check this

http://evolutionnext.com/blog/2005/10/13/1129259088959.html



On 8/16/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:
   


hmm, you have an interesting problem!

first thing I'd say is use this opportunity to upgrade to the
ojdbc14.jar, which is the latest oracle jdbc driver and allows lots of
nice enhancements.

second, I'm assuming that since the error is a servlet exception, that
there's some servlet code manually handling a database connection (no
comment *cough* *cough*) that it gets from a JNDI lookup?

third, try changing the  tag to a plain  tag,
this is the Resource tag that I use in my app (and it works). caveat: I
declare this in /META-INF/context.xml inside the  tag.

  

can you try this and let us know how it goes?

cheers!

[EMAIL PROTECTED] wrote:
 


I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three
   


applications that are deployed from this
 


server, two of which work fine with tomcat 5.5.12, however the third
   


which uses an oracle 9i database gives me the
 


following error "javax.servlet.ServletException: Cannot create JDBC
   


driver of class '' for connect URL 'null' ".
 


Basically I've included the same details form the Tomcat4 server.xmlfile
   


into the tomcat
   


5.5 server.xml, rediting
 


where necessary.

Things I have tried..

Placing the context into fragment files located either inside the
   


applications META-INF folder or under
 


tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as
   


Tomcat could not find the apps, so I've
 


left the context back in server.xml.
Rewriting the Resource params  as elements i.e.factory="
   


com.ora.jsp.sql.DataSourceFactory"
 


Checked changed location of the JDBC jar file.
   


classes12.jarcatalina_home\common\lib\ AND
   


catalina_home\webapps\[appname]\WEB-INF\lib
Checked changed the server.xml service-name and engine name to match
   


previous TC4 server.xml version.
 


Added a Resourcelink element to the context - this is not present on the
   


TC4 version
 


Checked Tomcat logs.

I think that Tomcat is not able to read the  element,
   


which is why the URL and driverClass are
 


NULL.

Which When I checked the Tomcat log files shows ...

16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
SEVERE: action: Cannot create JDBC driver of class '' for connect URL
   


'null'
 


Background info
Using Apache 2.0 with mod_JK to serve pages on port 80
Java version 1.5

 server.xml 





 
org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/>
 


 
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
 


 
 

   
  


value="30"/>
 


   


 


 

  


protocol="AJP/1.3" />
 


   


 


 


  


reloadable="true">
 





suffix=".txt"
 


pattern="combined" resolveHosts="false"/>




prefix="oponline_log." suffix=".txt"
 


timestamp="true"/>

  
oracle.jdbc.pool.OracleConnectionCacheImpl"
 


URL="
   


jdbc:oracle:thin:@sas-test.myserver.ac.uk:1521:MYTE"
 


maxLimit="5" />




   

 

   

 



*** end server.xml ***


*** App web.xml except ***


   
 JNDI DataSource for [app

Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle

Hi David

David Smith wrote:
My only editorial comment on the page is to NOT place your 
 or  definition in server.xml as 
recommended on the page.  Place it in context.xml or myapp.xml as I 
describe above.


Just quickly, I was wondering why you recommend this? I know the tomcat 
docs have changed to reflect the deprecation of defining the 
 or  definition in server.xml, but I never 
understood why, and personally doing things that way is a serious pain 
for me since it means I need to build a separate deployment descriptor 
for dev, test & prod, which means I need to know the prod database 
details. which I don't want.


Is there a better way that the sysadmin can setup a JNDI datasource so 
that deployed war's don't have to contain database-specific details? the 
only way I've seen so far is to configure that in the server.xml...


cheers!

--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle
looks like your xml doc has an un-closed tag or similar, hate to suggest 
this but maybe can you recheck your change to make sure this isn't the case?


I'd suggest going with David's suggestion, and put your  
definition in a separate file called 'context.xml'. Explode your WAR, 
put this in /META-INF/ folder (create if doesn't exist), then re-deploy. 
your context.xml should look like this (tomcat 5.5+):


**start context.xml**


   
   	  auth="Container"

 type="javax.sql.DataSource"
 maxActive="0"
 maxIdle="10"
 maxWait="500"
 username="dbuser"
 password="dbuserpass"
 driverClassName="oracle.jdbc.OracleDriver"
 url="jdbc:oracle:thin:@server:1521:SID"/>


** end context.xml**



[EMAIL PROTECTED] wrote:

Thanks for your advice so far

I've upgraded to the latest Oracle ojdbc14.jar and placed it the myapp\WEB-INF\lib folder, I also tried it the 
Tomcat\common\lib for for good measure but still got the same results. I'll continue to use ojdbc14.jar from now 
though.


I've change the ResourceParams name to just Resource name but this causes Tomcat not to startup, the logs show the 
following trace...


*** Excerpt Tomcat 5.5.12 logs ***
16-Aug-2007 16:08:32 org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
*** end ***

Does this mean it's now reading the   element. ?

Thanks

Ian


Quoting ashish shrivastava <[EMAIL PROTECTED]>:

  

check this

http://evolutionnext.com/blog/2005/10/13/1129259088959.html



On 8/16/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:


hmm, you have an interesting problem!

first thing I'd say is use this opportunity to upgrade to the
ojdbc14.jar, which is the latest oracle jdbc driver and allows lots of
nice enhancements.

second, I'm assuming that since the error is a servlet exception, that
there's some servlet code manually handling a database connection (no
comment *cough* *cough*) that it gets from a JNDI lookup?

third, try changing the  tag to a plain  tag,
this is the Resource tag that I use in my app (and it works). caveat: I
declare this in /META-INF/context.xml inside the  tag.

   

can you try this and let us know how it goes?

cheers!

[EMAIL PROTECTED] wrote:
  

I'm upgrading from tomcat 4.1.24 to tomcat 5.5.12 on WinXP. I have three


applications that are deployed from this
  

server, two of which work fine with tomcat 5.5.12, however the third


which uses an oracle 9i database gives me the
  

following error "javax.servlet.ServletException: Cannot create JDBC


driver of class '' for connect URL 'null' ".
  

Basically I've included the same details form the Tomcat4 server.xmlfile


into the tomcat


5.5 server.xml, rediting
  

where necessary.

Things I have tried..

Placing the context into fragment files located either inside the


applications META-INF folder or under
  

tomcat\conf\Catalina\localhost. Neither of these seemd to work for me as


Tomcat could not find the apps, so I've
  

left the context back in server.xml.
Rewriting the Resource params  as elements i.e.factory="


com.ora.jsp.sql.DataSourceFactory"
  

Checked changed location of the JDBC jar file.


classes12.jarcatalina_home\common\lib\ AND


catalina_home\webapps\[appname]\WEB-INF\lib
Checked changed the server.xml service-name and engine name to match


previous TC4 server.xml version.
  

Added a Resourcelink element to the context - this is not present on the


TC4 version
  

Checked Tomcat logs.

I think that Tomcat is not able to read the  element,


which is why the URL and driverClass are
  

NULL.

Which When I checked the Tomcat log files shows ...

16-Aug-2007 09:25:46 org.apache.catalina.core.ApplicationContext log
SEVERE: action: Cannot create JDBC driver of class '' for connect URL


'null'
  

Background info
Using Apache 2.0 with mod_JK to serve pages on port 80
Java version 1.5

 server.xml 





  
org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/>
  

  
org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" debug="0"/>
  

  
  




value="30"/>
  




  


  



protocol="AJP/1.3" />
  




  


  




reloadable="true">
  

  

suffix=".txt"
  

 pattern="combined" resolveHosts="false"/>

  

prefix="oponline_log." suffix=".txt"
  

timestamp="true"/>

   
oracle.jdbc.pool.OracleConnectionCacheImpl"
  

 URL="


jdbc:oracle:thin:@sas-test.myserver.ac.uk:1521:MYTE"
   

Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

Matthew Kerle wrote:
> I never
> understood why, and personally doing things that way is a serious pain
> for me since it means I need to build a separate deployment descriptor
> for dev, test & prod, which means I need to know the prod database
> details. which I don't want.

Actually, this is the whole point: the deployment descriptor is
different for each environment, which makes a whole lot of sense to /me/.

> Is there a better way that the sysadmin can setup a JNDI datasource so
> that deployed war's don't have to contain database-specific details? the
> only way I've seen so far is to configure that in the server.xml...

Why not have your sysadmin manage the deployment descriptor for your
production deployments?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxHbA9CaO5/Lv0PARAn+IAJ9DjuZ9rrVu3lO3XLqMs3zM3WQl/gCfaH01
F2rQxahMVwj+77VYSekqQWM=
=X32x
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread David Smith
In my experience, a resource is usually only relevant to one webapp.  
There's no need to put it in server.xml as a GlobalNamingResource unless 
you want that resource available in all your webapps.  Moving the 
resource to the  block of a context.xml file also makes it so 
resources can come and go with deployment of an individual webapp 
without restarting tomcat and disrupting all the webapps.


Developers could define their Resources in the  
...  block of server.xml and then add a 
 element to the context.xml file.  That'll get you out of 
having database specific information in the  element.  
See this page for further details on that:


http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

--David

Matthew Kerle wrote:


Hi David

David Smith wrote:

My only editorial comment on the page is to NOT place your 
 or  definition in server.xml as 
recommended on the page.  Place it in context.xml or myapp.xml as I 
describe above.



Just quickly, I was wondering why you recommend this? I know the 
tomcat docs have changed to reflect the deprecation of defining the 
 or  definition in server.xml, but I never 
understood why, and personally doing things that way is a serious pain 
for me since it means I need to build a separate deployment descriptor 
for dev, test & prod, which means I need to know the prod database 
details. which I don't want.


Is there a better way that the sysadmin can setup a JNDI datasource so 
that deployed war's don't have to contain database-specific details? 
the only way I've seen so far is to configure that in the server.xml...


cheers!




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Hassan Schroeder
On 8/16/07, Len Popp <[EMAIL PROTECTED]> wrote:

> You're right that putting server-specific info in context.xml in the
> .war is no good when the app could be installed on different servers.

Isn't that what build.properties files are for? :-)

-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle

Hi Chris

my experience has been: one tomcat instance per dev/test/prod, & the 
webapp on each instance always points to the same database (dev 
tomcat->dev db, test tomcat -> test db etc), so the database connection 
on a /single/ instance never changes. However when promoting code from 
dev to test to prod, you want to use the one war file and not have to 
fiddle around in it's guts to promote a change, otherwise there's the 
chance of error's creeping in. (prod app pointing to dev/test anyone?)


Most of the sysadmin's I've worked with really don't like the idea of 
having to rip open a war and update some weird config file just to do a 
deploy. the alternative is I know all the passwords and build a war for 
each target, which is a crap solution.


We should just be able to configure a datasource for a particular 
context in the target instance, and then forever after all deployments 
are database transparent. Am i missing something?


I can't understand why it would be better to target a war file for a 
database, than have the configuration live in the instance and the war 
file is database-agnostic. makes change migration a *lot* easier.


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

Matthew Kerle wrote:
  

I never
understood why, and personally doing things that way is a serious pain
for me since it means I need to build a separate deployment descriptor
for dev, test & prod, which means I need to know the prod database
details. which I don't want.



Actually, this is the whole point: the deployment descriptor is
different for each environment, which makes a whole lot of sense to /me/.

  

Is there a better way that the sysadmin can setup a JNDI datasource so
that deployed war's don't have to contain database-specific details? the
only way I've seen so far is to configure that in the server.xml...



Why not have your sysadmin manage the deployment descriptor for your
production deployments?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxHbA9CaO5/Lv0PARAn+IAJ9DjuZ9rrVu3lO3XLqMs3zM3WQl/gCfaH01
F2rQxahMVwj+77VYSekqQWM=
=X32x
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 5.0.19 and EL expressions allowed

2007-08-16 Thread Dimitris Mouchritsas
Hi everyone.
I'm testing this code:


  ${ table_data.package_price +
  ( road_assistance_2year == '-' ? 0.0 : road_assistance_2year ) +
  ( comp_offer_data.hasInsurance ? table_data.insuranceValue : 0.0 ) }


and in Tomcat 6.0.13 it works fine.
However in Tomcat 5.0.19 the page stops proccessing and and exception is
thrown. Tomcat complains that he cannot
convert String '-' to a java.lang.Double. I tried to change the code a
little to this:


  

  
  

  


and later on just do ${ table_data.package_price + road_assist_price +
insured_price }
but I still get the same error. Why can't Tomcat just fail the test in
when and is there a work around?

PS. Yes road_assistance_2year can either be a price, or a '-' indicating
N/A.



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Len Popp
How do you use a build.properties file to define a JNDI resource? Or
do you create JDBC connections a different way?
-- 
Len

On 8/16/07, Hassan Schroeder <[EMAIL PROTECTED]> wrote:
> On 8/16/07, Len Popp <[EMAIL PROTECTED]> wrote:
>
> > You're right that putting server-specific info in context.xml in the
> > .war is no good when the app could be installed on different servers.
>
> Isn't that what build.properties files are for? :-)
>
> --
> Hassan Schroeder  [EMAIL PROTECTED]
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Len Popp
The reason is that server.xml is for the whole server, so when you
change something you have to restart the whole server rather than just
the one application.

You're right that putting server-specific info in context.xml in the
.war is no good when the app could be installed on different servers.
-- 
Len


On 8/16/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:
> Hi David
>
> David Smith wrote:
> > My only editorial comment on the page is to NOT place your
> >  or  definition in server.xml as
> > recommended on the page.  Place it in context.xml or myapp.xml as I
> > describe above.
>
> Just quickly, I was wondering why you recommend this? I know the tomcat
> docs have changed to reflect the deprecation of defining the
>  or  definition in server.xml, but I never
> understood why, and personally doing things that way is a serious pain
> for me since it means I need to build a separate deployment descriptor
> for dev, test & prod, which means I need to know the prod database
> details. which I don't want.
>
> Is there a better way that the sysadmin can setup a JNDI datasource so
> that deployed war's don't have to contain database-specific details? the
> only way I've seen so far is to configure that in the server.xml...
>
> cheers!
>
> --
> Matthew Kerle
> IT Consultant
> Canberra, Australia
>
> Mobile: +61404 096 863
> Email : [EMAIL PROTECTED]
> Web : http://threebrightlights.blogspot.com/
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle
now that sounds good! the only thing is I don't see how that maps to a 
DataSource declaration, the  element in 
 doesn't seem to allow the full range of 
properties that you need to define a database connection, eg - 
username/password/driverClassName/url etc...


Where would you define these?

David Smith wrote:
In my experience, a resource is usually only relevant to one webapp.  
There's no need to put it in server.xml as a GlobalNamingResource 
unless you want that resource available in all your webapps.  Moving 
the resource to the  block of a context.xml file also makes 
it so resources can come and go with deployment of an individual 
webapp without restarting tomcat and disrupting all the webapps.


Developers could define their Resources in the  
...  block of server.xml and then add a 
 element to the context.xml file.  That'll get you out 
of having database specific information in the  
element.  See this page for further details on that:


http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

--David




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 5.0.19 and EL expressions allowed

2007-08-16 Thread Hassan Schroeder
On 8/6/07, Dimitris Mouchritsas <[EMAIL PROTECTED]> wrote:

> 
>   
> 
>   
>   
> 
>   
> 

Maybe just something like:



? HTH,
-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Hassan Schroeder
On 8/16/07, Len Popp <[EMAIL PROTECTED]> wrote:
> How do you use a build.properties file to define a JNDI resource? Or
> do you create JDBC connections a different way?

Not sure I understand the question -- we're talking about putting
a Resource element in META-INF/context.xml, right? So the details
of that element can be configured via a properties file, eh?

-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Len Popp
I don't get it. Are you assuming that the programmer would put the
JDBC server info in a build.properties file that is used at compile
time? That doesn't work unless the programmer knows all the servers
the app will eventually be deployed on - which isn't always the case
for me.
-- 
Len

On 8/16/07, Hassan Schroeder <[EMAIL PROTECTED]> wrote:
> On 8/16/07, Len Popp <[EMAIL PROTECTED]> wrote:
> > How do you use a build.properties file to define a JNDI resource? Or
> > do you create JDBC connections a different way?
>
> Not sure I understand the question -- we're talking about putting
> a Resource element in META-INF/context.xml, right? So the details
> of that element can be configured via a properties file, eh?
>
> --
> Hassan Schroeder  [EMAIL PROTECTED]
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NoSuchMethod shutdown error

2007-08-16 Thread Dan Armbrust
That was the next thing I looked into after I solved this bug.  I
"fixed" it by commenting out the  line in
the server.xml file.

My take on the native APR stuff (which is likely completely wrong
since it consists of what I learned in about a 2 minute skim of some
documentation) was that it was really only going to help performance
when interfacing with apache, or possibly, in the way it handles HTTP
connections.  My app doesn't interface with apache, and it doesn't get
loaded by HTTP connections anyway - plus we distribute to customers
using all sorts of different hardware and software combinations.  So
the whole native thing is really a non starter for my application.

Thanks for the note, however.  That was going to be my next question,
had I not found out how to disable the warnings.

Dan

On 8/14/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:
> also, I noticed that you have some "Failed Shutdown of Apache Portable
> Runtime" errors, if you want to make that message go away grab the APR
> native library for your platform and drop it into %JAVA_HOME%/bin
>
> symptoms:
> on startup something like the following gets printed out:
> INFO: The Apache Tomcat Native library which allows optimal performance
> in production environments was not found on the java.library.path
>
> and on shutdown->
> INFO: Failed shutdown of Apache Portable Runtime
>
> Basically,  tomcat looks for a native library that lets it do funky
> stuff related to performance. In development we don't usually care about
> performance, but if you want to get rid of those messages, then the
> easiest way is to drop the tomcat native dll onto the system path, the
> best place being %JAVA_HOME%/bin
>
> read about the APR:
> http://tomcat.apache.org/tomcat-5.5-doc/apr.html
>
> I downloaded it here:
> http://apr.apache.org/download.cgi
>
>
> --
>
> * Matthew Kerle
> ** IT Consultant* **
> * Canberra, Australia*
>

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle
it's doable, some of my teammates use that method, but it's a pain in 
the butt because you basically have to create 3 WARs per release (one 
for each target). considering a struts/hibernate/spring/xFire 
application is about 30mb in 3rd party jars, that's a lot of space. ok 
HD space is cheap, but it's still no excuse for poor procedure.


To do it you would basically create different build targets in your ant 
script, with each one using custom props from your build.props file, eg 
- so you would have targets dev/test/prod/all, running all would build 
wars for dev, test & prod. you use a  tag to replace a 
pre-formatted pattern like ##db_user##, ##db_pwd## etc in your 
deployment descriptor with the target details. it's a crappy hack for 
bad programmers.


Len Popp wrote:

How do you use a build.properties file to define a JNDI resource? Or
do you create JDBC connections a different way?
  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: NoSuchMethod shutdown error

2007-08-16 Thread Matthew Kerle
no worries. I hadn't seen how to remove that dependency before, which is 
why I didn't mention it in my reply. the APR just gives tomcat 
comparable file reading performance as httpd, but unless you're running 
slashdot or hea.net on your tomcat  then not having it isn't a big issue 
and your distro will be more portable as a result.


glad I could help!

Dan Armbrust wrote:

That was the next thing I looked into after I solved this bug.  I
"fixed" it by commenting out the  line in
the server.xml file.

My take on the native APR stuff (which is likely completely wrong
since it consists of what I learned in about a 2 minute skim of some
documentation) was that it was really only going to help performance
when interfacing with apache, or possibly, in the way it handles HTTP
connections.  My app doesn't interface with apache, and it doesn't get
loaded by HTTP connections anyway - plus we distribute to customers
using all sorts of different hardware and software combinations.  So
the whole native thing is really a non starter for my application.

Thanks for the note, however.  That was going to be my next question,
had I not found out how to disable the warnings.

Dan

--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

Matthew Kerle wrote:
> Most of the sysadmin's I've worked with really don't like the idea of
> having to rip open a war and update some weird config file just to do a
> deploy. the alternative is I know all the passwords and build a war for
> each target, which is a crap solution.

They're all crap solutions when nobody wants to do their job. Either the
deployment folks have to do some work (horrors!) or the developers have
to (oh, no!). The solution you're looking for is simply not recommended
by this crowd.

You CAN do this:

1. Set up a GlobalNamingResource and ResourceParams in your server.xml
   file.
   http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html
2. Use a  in your  in your META-INF/context.xml
   file.

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Resource%20Links

Another option is to have a context.xml file /outside/ of the WAR file.
This requires alternate configuration -- details can be found in the
archives for just about every week since the release of TC 5.5 ('cause
someone always asks before searching).

> We should just be able to configure a datasource for a particular
> context in the target instance, and then forever after all deployments
> are database transparent. Am i missing something?

The only thing you're missing is that this is no longer recommended
procedure, which is why everyone is telling you to do it differently.
Feel free to do it your own way, but don't complain when we tell you
it's not a recommended / supported configuration. Sure, Tomcat will do
it, but if you're having problems, your free tech-support provided by
this forum might just refuse to help.

> I can't understand why it would be better to target a war file for a
> database, than have the configuration live in the instance and the war
> file is database-agnostic. makes change migration a *lot* easier.

See the option above about using an outside-the-WAR file context.xml
configuration file.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxIYt9CaO5/Lv0PARArMNAKCZ/YLaoqADeT3OWZRkFdj0ycku0gCfc/bj
M8Tiwu8RsSsOK0b+i9PLjaE=
=x7NG
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Len,

Len Popp wrote:
> How do you use a build.properties file to define a JNDI resource? Or
> do you create JDBC connections a different way?

Search-and-replace, baby. That's how I have my configuration working.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxIZO9CaO5/Lv0PARAhS0AKCjyREf9bOvh8H9hG8Ak3lHRT6LMQCfQfn7
uGUMtdZZ9VXfPG8jhhz4MFw=
=MBaD
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat benchmark

2007-08-16 Thread Andrew Hole
Compare performance...

On 8/16/07, Matthew Kerle <[EMAIL PROTECTED]> wrote:
>
> I assume you've already Googled what you're looking for and not found
> anything? What are you after exactly, performance or feature comparison?
> please be more specific...
>
> I assume you're after more than this:
> http://en.wikipedia.org/wiki/Comparison_of_application_servers
>
> Andrew Hole wrote:
> > Someone have a case study wich compare Tomcat with others application
> > servers?
> >
> > Thanks a lot
> > Andrew
> >
> >
>
> --
> Matthew Kerle IT Consultant Canberra, Australia Mobile: +61404 096 863
> Email : [EMAIL PROTECTED] Web : http://threebrightlights.blogspot.com/
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Installing APR on Fedora

2007-08-16 Thread Ole Ersoy

Hi Rainer,

Thanks again for that great fix.  When I fired up Tomcat, I still get this 
message:
Aug 16, 2007 9:53:05 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Native library which allows optimal performance in 
production environments was not found on the java.library.path: 
/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/lib/i386:/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib

I read in a post that adding /lib and /usr/lib/ to the classpath would take 
care of it, but I must be missing something else as well.  Any ideas?

Thanks again,
- Ole





Rainer Jung wrote:

Hi Ole,

when you tried against your installed APR most likely the dev rpm, which 
includes the necessary header files for compiltions where not installed.


When you tried against a BUILD directory, most likely the APR library 
need for linking was not there.


Whichever way you choose, you need a full APR. I guess it would be 
easiest to install the dev RPMs for apr and apr-util and then use the 
installed files for configuring tcnative.


Now after you installed the additional dev packages (those are *not* the 
src packages), you might want to check, where those packages installed 
their contents to, because you need to give a path to the --with-apr 
flag. You can check package install pathes for rpm with


rpm -q --filesbypkg PACKAGENAME

If your packages choose the default system instalation pathes, you 
should be able to build without the with-apr flag. If the RPMs choose a 
special installation dir, but are build nicely, you will have shell 
scripts apr-1-config as part of one of the RPMs and you can give 
with-apr the path to this file as parameter, which will tell configure 
about the pathes of libs and headers. Lastly if you don't have the 
config script, but libs and headers are in lib/ and include/ below some 
dir, this dir will be a code value for with-apr.


HTH.

Rainer

Ole Ersoy wrote:

Hi Hassan,

I did the following:

rm -dfr tomcat-native-1.1.10-src/ tar xvfz tomcat-native.tar.gz
cd tomcat-native-1.1.10-src/jni/native
./configure --prefix=/usr/local/apr 
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/ && make && make install


And I still get:

le/rpmbuild/BUILD/apr-1.2.8/libapr-1.la -luuid -lcrypt -lpthread -ldl )
/usr/bin/ld: cannot find -lapr-1
collect2: ld returned 1 exit status
libtool: install: error: relink `libtcnative-1.la' with the above 
command before installing it

make: *** [install] Error 1

Thoughts?

Thanks again,
- Ole



Hassan Schroeder wrote:

On 8/15/07, Ole Ersoy <[EMAIL PROTECTED]> wrote:

I have a lot more progress now!  I get the following (The only 
important part is the bottom i think):


[EMAIL PROTECTED] native]# ./configure 
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/

...
libtool: install: error: relink `libtcnative-1.la' with the above 
command before installing it

make: *** [install] Error 1

Any idea what this means?


I'd suggest re-running this with a specific prefix to avoid potential
conflict with anything currently installed, e.g.

./configure --prefix=/usr/local/apr
--with-apr=/home/ole/rpmbuild/BUILD/apr-1.2.8/

FWIW,


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Hassan Schroeder
On 8/16/07, Christopher Schultz <[EMAIL PROTECTED]> wrote:

> They're all crap solutions when nobody wants to do their job.

heh -- indeed.

And how about we add the "it depends" corollary -- they're all
crap solutions for /some/ specific environment(s)  :-)

-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

I disagree with many of your assertions.

Matthew Kerle wrote:
> it's doable, some of my teammates use that method, but it's a pain in
> the butt because you basically have to create 3 WARs per release (one
> for each target). considering a struts/hibernate/spring/xFire
> application is about 30mb in 3rd party jars, that's a lot of space. ok
> HD space is cheap, but it's still no excuse for poor procedure.

I'm guessing that you don't deploy all 3 WARs onto the same machine.
What's the difference between 3 different WARs and 1 WAR in 3 places?
Don't complain about disk space when the argument is 1) flawed (disk
space doesn't matter) and 2) moot (deployments to different servers).

> To do it you would basically create different build targets in your ant
> script, with each one using custom props from your build.props file, eg
> - so you would have targets dev/test/prod/all, running all would build
> wars for dev, test & prod. you use a  tag to replace a
> pre-formatted pattern like ##db_user##, ##db_pwd## etc in your
> deployment descriptor with the target details. it's a crappy hack for
> bad programmers.

I completely disagree. We have complex configurations that need to
change for each environment (many properties files, etc.). Trying to
create one properties file to rule them all is impossible, and shoving
all that configuration into a (static) deployment descriptor on the
target server is kludgy and error prone, since the developers don't have
control over the server configuration.

Your choices are to have separate file sets for each environment or to
do this search-and-replace trick. I favor both, because some
configuration is best done by the programmers (properties files
including file locations, URLs, etc.) and other stuff (data source
names, passwords, etc.) are better done by server admins.

We don't deliver a WAR file to our deployment team; we give them a cvs
tag to use as the new version. It's as simple as:

$ pushd
$ cd $APP
$ ant tomcat-stop
$ ant install-clean
$ popd
$ rm -rf $APP
$ cvs checkout -r ${RELEASE_TAG} ${APP}
$ cd ${APP}
$ ant install
$ ant tomcat-start

You may find that complicated, but it's all that's required for us to
deploy our applications into ANY environment. Wanna upgrade Tomcat? No
problem:

# cd /where/you/want/tomcat/to/live
# tar xzf apache-tomcat-version.tar.gz
# (fix 'tomcat' symlink)
# (restart apps at your convenience)

No effing around with Tomcat server configuration. In fact, deploying
our production applications doesn't require root access, so out
deployment team can't really break anything.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxIkd9CaO5/Lv0PARAilKAJ93UnlpIeG53wx0iltxo+CrDwFgTQCgg9jj
2w7a/xXTVt0zgI3hKICoL2o=
=lXKw
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Hassan Schroeder
On 8/16/07, Len Popp <[EMAIL PROTECTED]> wrote:
> I don't get it. Are you assuming that the programmer would put the
> JDBC server info in a build.properties file that is used at compile
> time? That doesn't work unless the programmer knows all the servers
> the app will eventually be deployed on - which isn't always the case
> for me.

Interesting -- I've never been in a situation where I *didn't*
know all the gory deployment details. :-)

But the question of who *maintains* the build.properties file
is completely orthogonal to the discussion of whether it's an
appropriate methodology, I'd say.

-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JDBC connection issue

2007-08-16 Thread Hehl, Thomas
I am testing our webapp under tomcat 6 after being under tomcat 5.5.

 

I have moved the following file from 5.5. into 6. I have placed it in the
conf directory:

 



 



 



 

This works under 5.5, but under 6.0, I get "Cannot create JDBC driver of
class '' for connect URL 'null'

 

And

 

Could not obtain connection metadata.

 

I've googled, and most seem to feel that these errors are caused by an issue
in the context definition.

 

I've looked through the docs and find nothing that got changed between 5.5
and 6.0 so I'm puzzled and trying here. Anyone?

 

Thanks.

 

Thom Hehl
Sr. eJuror Architect

* Office (859) 277-8800 x 144

* [EMAIL PROTECTED]   
ACS, Inc.

Government Solutions

1733 Harrodsburg Road
Lexington, KY 40504-3617

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message and notify
sender via e-mail at [EMAIL PROTECTED]
  or by telephone at 859-277-8800 ext. 144.
Thank you.

 



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Len,

Len Popp wrote:
> I don't get it. Are you assuming that the programmer would put the
> JDBC server info in a build.properties file that is used at compile
> time?

Well, you have to get creative. For instance, all our devs (and
deployment folks) have a file, ~/.ant.properties, which gets loaded into
the ant environment before anything else does. That allows a user to
override just about anything for their own instance.

You can put the production creds into this file and simply build the WAR
right there on the target box (or somewhere that has the same setup).

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxImW9CaO5/Lv0PARAnIwAKC0EjmE6M2tMzhydDnHAfPgPUh6lgCghatU
U5obR/rb9pA6ZCdro2Z1JdI=
=iPmi
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread David Smith
As far as I'm aware, there is no difference between a  
element in context.xml and a  element in a 
... block.  Well... other 
than the need to use a  to make it available to an 
individual webapp.  Did you try it and get a failure?


--David


Matthew Kerle wrote:

now that sounds good! the only thing is I don't see how that maps to a 
DataSource declaration, the  element in 
 doesn't seem to allow the full range of 
properties that you need to define a database connection, eg - 
username/password/driverClassName/url etc...


Where would you define these?

David Smith wrote:

In my experience, a resource is usually only relevant to one webapp.  
There's no need to put it in server.xml as a GlobalNamingResource 
unless you want that resource available in all your webapps.  Moving 
the resource to the  block of a context.xml file also makes 
it so resources can come and go with deployment of an individual 
webapp without restarting tomcat and disrupting all the webapps.


Developers could define their Resources in the 
 ...  block of 
server.xml and then add a  element to the context.xml 
file.  That'll get you out of having database specific information in 
the  element.  See this page for further details on that:


http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

--David





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle

Hi Chris

I apologise for coming across a bit harsh there, don't mean to offend! 
I'll take it a bit easier...;-p


Either of the methods you recommended looks good, the only trouble is 
that the doco is a bit... terse on the subject of setting up a JNDI 
datasource outside the war file, and it's not as straightforward or easy 
to find as compared to the method for placing the context.xml inside the 
deployment war, which is well documented.


If I can make an observation, if people have been hitting the lists with 
this issue since the release of 5.5, then maybe the doco needs updating? 
a simple full code example on the JNDI resources howto page on both the 
ways you listed would probably kill most of those questions, and make 
life easier for the rest of us! How do you go about submitting an update 
to the documentation? I assume there's a short list of committers...


To be honest I hadn't looked deeply into the jndi setup since 5.0, when 
we moved to 5.5 I tried to get the external-context.xml working, but 
everytime we deployed a war without a context .xml tomcat would delete 
the existing one, or overwrite it. the project didn't have the scope to 
get a good solution and I wasn't in charge of building deploys so it 
never happened. I'll try and dig through the archives to find a good 
example of that which works so we can update our procedure.


cheers!

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

Matthew Kerle wrote:
  

Most of the sysadmin's I've worked with really don't like the idea of
having to rip open a war and update some weird config file just to do a
deploy. the alternative is I know all the passwords and build a war for
each target, which is a crap solution.



They're all crap solutions when nobody wants to do their job. Either the
deployment folks have to do some work (horrors!) or the developers have
to (oh, no!). The solution you're looking for is simply not recommended
by this crowd.

You CAN do this:

1. Set up a GlobalNamingResource and ResourceParams in your server.xml
   file.
   http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html
2. Use a  in your  in your META-INF/context.xml
   file.

http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Resource%20Links

Another option is to have a context.xml file /outside/ of the WAR file.
This requires alternate configuration -- details can be found in the
archives for just about every week since the release of TC 5.5 ('cause
someone always asks before searching).

  

We should just be able to configure a datasource for a particular
context in the target instance, and then forever after all deployments
are database transparent. Am i missing something?



The only thing you're missing is that this is no longer recommended
procedure, which is why everyone is telling you to do it differently.
Feel free to do it your own way, but don't complain when we tell you
it's not a recommended / supported configuration. Sure, Tomcat will do
it, but if you're having problems, your free tech-support provided by
this forum might just refuse to help.

  

I can't understand why it would be better to target a war file for a
database, than have the configuration live in the instance and the war
file is database-agnostic. makes change migration a *lot* easier.



See the option above about using an outside-the-WAR file context.xml
configuration file.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxIYt9CaO5/Lv0PARArMNAKCZ/YLaoqADeT3OWZRkFdj0ycku0gCfc/bj
M8Tiwu8RsSsOK0b+i9PLjaE=
=x7NG
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JDBC connection issue

2007-08-16 Thread Hehl, Thomas
Hmmm. I'm thinking I'm beginning to get a whiff of the issue.

Before, we would run multiple webapps and each had their own context file
that matched the webapps. Like for the one below, we had one called mo.xml.
We'd put all these in the CATALINA_HOME/conf/Catalina/localhost and it all
worked great.

With 6, I've dropped mo.xml into the conf directory directly since that
seemed to be what the docs recommended. Now, I'm thinking, I need to
integrate all this into context.xml.

Is this what you're suggesting?

BTW, I made sure the JDBC jar files are all in CATALINA_HOME/lib.

Thanks.

-Original Message-
From: Mark Shifman [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 16, 2007 1:31 PM
To: Tomcat Users List
Subject: Re: JDBC connection issue

I just upgraded from 5.5 to 6.0 without any problems.  My webapp was 
deployed as a war file
with the config.xml in the META-INF (the exact config for 5.5). The 
deployment does the
correct thing with the config.xml.

Make sure your jdbc library is in the CATALINA_HOME/lib dir.

I also was playing around with using realms for the manager and found I 
had to
put the manager's config.xml in the META-INF dir for things to work. I tried
moving the config.xml to conf/Catalina/localhost and ... ... the manager 
was undeployed.

mas





Hehl, Thomas wrote:
> I am testing our webapp under tomcat 6 after being under tomcat 5.5.
>
>  
>
> I have moved the following file from 5.5. into 6. I have placed it in the
> conf directory:
>
>  
>
>  crossContext="true">
>
>  
>
>  maxActive="20" 
>
>  
>
> maxIdle="-1" maxWait="1000" 
>
>  
>
> username="informix"  password="xxx" 
>
>  
>
> driverClassName="com.informix.jdbc.IfxDriver" 
>
>
url="jdbc:informix-sqli://vaninfmx1:7101/jur_feds:INFORMIXSERVER=gs_jms9"/>
>
>  
>
> 
>
>  
>
> This works under 5.5, but under 6.0, I get "Cannot create JDBC driver of
> class '' for connect URL 'null'
>
>  
>
> And
>
>  
>
> Could not obtain connection metadata.
>
>  
>
> I've googled, and most seem to feel that these errors are caused by an
issue
> in the context definition.
>
>  
>
> I've looked through the docs and find nothing that got changed between 5.5
> and 6.0 so I'm puzzled and trying here. Anyone?
>
>  
>
> Thanks.
>
>  
>
> Thom Hehl
> Sr. eJuror Architect
>
> * Office (859) 277-8800 x 144
>
> * [EMAIL PROTECTED]   
> ACS, Inc.
>
> Government Solutions
>
> 1733 Harrodsburg Road
> Lexington, KY 40504-3617
>
> This e-mail message, including any attachments, is for the sole use of the
> intended recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or distribution is
> prohibited. If you are not the intended recipient, please contact the
sender
> by reply e-mail and destroy all copies of the original message and notify
> sender via e-mail at [EMAIL PROTECTED]
>   or by telephone at 859-277-8800 ext.
144.
> Thank you.
>
>  
>
>
>   

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5. 12

2007-08-16 Thread Hehl, Thomas
Hmm. Sounds like, yeah, this is what I need to do too.

-Original Message-
From: Matthew Kerle [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 16, 2007 1:37 PM
To: Tomcat Users List
Subject: Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

Hi Chris

I apologise for coming across a bit harsh there, don't mean to offend! 
I'll take it a bit easier...;-p

Either of the methods you recommended looks good, the only trouble is 
that the doco is a bit... terse on the subject of setting up a JNDI 
datasource outside the war file, and it's not as straightforward or easy 
to find as compared to the method for placing the context.xml inside the 
deployment war, which is well documented.

If I can make an observation, if people have been hitting the lists with 
this issue since the release of 5.5, then maybe the doco needs updating? 
a simple full code example on the JNDI resources howto page on both the 
ways you listed would probably kill most of those questions, and make 
life easier for the rest of us! How do you go about submitting an update 
to the documentation? I assume there's a short list of committers...

To be honest I hadn't looked deeply into the jndi setup since 5.0, when 
we moved to 5.5 I tried to get the external-context.xml working, but 
everytime we deployed a war without a context .xml tomcat would delete 
the existing one, or overwrite it. the project didn't have the scope to 
get a good solution and I wasn't in charge of building deploys so it 
never happened. I'll try and dig through the archives to find a good 
example of that which works so we can update our procedure.

cheers!

Christopher Schultz wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Matt,
>
> Matthew Kerle wrote:
>   
>> Most of the sysadmin's I've worked with really don't like the idea of
>> having to rip open a war and update some weird config file just to do a
>> deploy. the alternative is I know all the passwords and build a war for
>> each target, which is a crap solution.
>> 
>
> They're all crap solutions when nobody wants to do their job. Either the
> deployment folks have to do some work (horrors!) or the developers have
> to (oh, no!). The solution you're looking for is simply not recommended
> by this crowd.
>
> You CAN do this:
>
> 1. Set up a GlobalNamingResource and ResourceParams in your server.xml
>file.
>http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html
> 2. Use a  in your  in your META-INF/context.xml
>file.
>
>
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html#Resource%20Links
>
> Another option is to have a context.xml file /outside/ of the WAR file.
> This requires alternate configuration -- details can be found in the
> archives for just about every week since the release of TC 5.5 ('cause
> someone always asks before searching).
>
>   
>> We should just be able to configure a datasource for a particular
>> context in the target instance, and then forever after all deployments
>> are database transparent. Am i missing something?
>> 
>
> The only thing you're missing is that this is no longer recommended
> procedure, which is why everyone is telling you to do it differently.
> Feel free to do it your own way, but don't complain when we tell you
> it's not a recommended / supported configuration. Sure, Tomcat will do
> it, but if you're having problems, your free tech-support provided by
> this forum might just refuse to help.
>
>   
>> I can't understand why it would be better to target a war file for a
>> database, than have the configuration live in the instance and the war
>> file is database-agnostic. makes change migration a *lot* easier.
>> 
>
> See the option above about using an outside-the-WAR file context.xml
> configuration file.
>
> - -chris
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFGxIYt9CaO5/Lv0PARArMNAKCZ/YLaoqADeT3OWZRkFdj0ycku0gCfc/bj
> M8Tiwu8RsSsOK0b+i9PLjaE=
> =x7NG
> -END PGP SIGNATURE-
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>   

-- 
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle

no I didn't...:-(

I was going off the globalresources config reference page, wher it lists 
the attributes of a  element as being:


**snip**
The valid attriutes for a  element are as follows:

Attribute   Description
auth   

Specify whether the web Application code signs on to the corresponding 
resource manager programatically, or whether the Container will sign on 
to the resource manager on behalf of the application. The value of this 
attribute must be Application or Container. This attribute is required 
if the web application will use a  element in the web 
application deployment descriptor, but is optional if the application 
uses a  instead.

description

Optional, human-readable description of this resource.
name   

The name of the resource to be created, relative to the java:comp/env 
context.
scope  

Specify whether connections obtained through this resource manager can 
be shared. The value of this attribute must be Shareable or Unshareable. 
By default, connections are assumed to be shareable.
type   

The fully qualified Java class name expected by the web application when 
it performs a lookup for this resource.

**snip**

...and I took this to mean that these were the only valid attributes, as 
the provided example only references these attributes. I guess then you 
can add the username/password/driverClass/url attributes and they'll be 
picked up fine? If that's they case then my mistake, but the doco isn't 
very clear on that...


ps - apologies if the above table has disintegrated getting converted to 
plain-text...


David Smith wrote:
As far as I'm aware, there is no difference between a  
element in context.xml and a  element in a 
... block.  Well... 
other than the need to use a  to make it available 
to an individual webapp.  Did you try it and get a failure?


--David


Matthew Kerle wrote:

now that sounds good! the only thing is I don't see how that maps to 
a DataSource declaration, the  element in 
 doesn't seem to allow the full range of 
properties that you need to define a database connection, eg - 
username/password/driverClassName/url etc...


Where would you define these?

David Smith wrote:

In my experience, a resource is usually only relevant to one 
webapp.  There's no need to put it in server.xml as a 
GlobalNamingResource unless you want that resource available in all 
your webapps.  Moving the resource to the  block of a 
context.xml file also makes it so resources can come and go with 
deployment of an individual webapp without restarting tomcat and 
disrupting all the webapps.


Developers could define their Resources in the 
 ...  block of 
server.xml and then add a  element to the context.xml 
file.  That'll get you out of having database specific information 
in the  element.  See this page for further details 
on that:


http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

--David





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC connection issue

2007-08-16 Thread Mark Shifman
I just upgraded from 5.5 to 6.0 without any problems.  My webapp was 
deployed as a war file
with the config.xml in the META-INF (the exact config for 5.5). The 
deployment does the

correct thing with the config.xml.

Make sure your jdbc library is in the CATALINA_HOME/lib dir.

I also was playing around with using realms for the manager and found I 
had to

put the manager's config.xml in the META-INF dir for things to work. I tried
moving the config.xml to conf/Catalina/localhost and ... ... the manager 
was undeployed.


mas





Hehl, Thomas wrote:

I am testing our webapp under tomcat 6 after being under tomcat 5.5.

 


I have moved the following file from 5.5. into 6. I have placed it in the
conf directory:

 




 


maxActive="20" 

 

maxIdle="-1" maxWait="1000" 

 

username="informix"  password="xxx" 

 

driverClassName="com.informix.jdbc.IfxDriver" 


url="jdbc:informix-sqli://vaninfmx1:7101/jur_feds:INFORMIXSERVER=gs_jms9"/>

 




 


This works under 5.5, but under 6.0, I get "Cannot create JDBC driver of
class '' for connect URL 'null'

 


And

 


Could not obtain connection metadata.

 


I've googled, and most seem to feel that these errors are caused by an issue
in the context definition.

 


I've looked through the docs and find nothing that got changed between 5.5
and 6.0 so I'm puzzled and trying here. Anyone?

 


Thanks.

 


Thom Hehl
Sr. eJuror Architect

* Office (859) 277-8800 x 144

* [EMAIL PROTECTED]   
ACS, Inc.


Government Solutions

1733 Harrodsburg Road
Lexington, KY 40504-3617

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message and notify
sender via e-mail at [EMAIL PROTECTED]
  or by telephone at 859-277-8800 ext. 144.
Thank you.

 



  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC connection issue

2007-08-16 Thread Gregor Schneider
I'm not sure about Tomcat 6, but in Tomcat 5.x there's no such thing
as $CATALIN_HOME/lib. YOur JDBC-drivers should either be bundled with
your web-app (if that's the only one using them) or, if used both from
Tomcat and your webapp(s) to $CATALINA_HOME/common/lib

Coming to the context:

- Create a file called "context.xml" in your META-INF-directory of your web-app
- define your context in there
- pack your war
- deploy
- feel happy and read
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

Cheers

Gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread David Smith
I see.  Some of the tomcat docs are probably out of date, depending on 
someone pointing out the flaw or contributing updates.


Tomcat uses reflection to configure the pool using bean setter methods.  
That makes the full set of attributes dependant on the implementation 
used -- in this case DBCP.  If you'd like the full set of database pool 
parameters available in the default tomcat db pool, just take a look at:


http://commons.apache.org/dbcp/api-1.2.2/org/apache/commons/dbcp/BasicDataSource.html

--David

Matthew Kerle wrote:


no I didn't...:-(

I was going off the globalresources config reference page, wher it 
lists the attributes of a  element as being:


**snip**
The valid attriutes for a  element are as follows:

Attribute   Description
auth  
Specify whether the web Application code signs on to the corresponding 
resource manager programatically, or whether the Container will sign 
on to the resource manager on behalf of the application. The value of 
this attribute must be Application or Container. This attribute is 
required if the web application will use a  element in 
the web application deployment descriptor, but is optional if the 
application uses a  instead.

description

Optional, human-readable description of this resource.
name  
The name of the resource to be created, relative to the java:comp/env 
context.
scope 
Specify whether connections obtained through this resource manager can 
be shared. The value of this attribute must be Shareable or 
Unshareable. By default, connections are assumed to be shareable.
type  
The fully qualified Java class name expected by the web application 
when it performs a lookup for this resource.

**snip**

...and I took this to mean that these were the only valid attributes, 
as the provided example only references these attributes. I guess then 
you can add the username/password/driverClass/url attributes and 
they'll be picked up fine? If that's they case then my mistake, but 
the doco isn't very clear on that...


ps - apologies if the above table has disintegrated getting converted 
to plain-text...


David Smith wrote:

As far as I'm aware, there is no difference between a /> element in context.xml and a  element in a 
... block.  Well... 
other than the need to use a  to make it available 
to an individual webapp.  Did you try it and get a failure?


--David


Matthew Kerle wrote:

now that sounds good! the only thing is I don't see how that maps to 
a DataSource declaration, the  element in 
 doesn't seem to allow the full range of 
properties that you need to define a database connection, eg - 
username/password/driverClassName/url etc...


Where would you define these?

David Smith wrote:

In my experience, a resource is usually only relevant to one 
webapp.  There's no need to put it in server.xml as a 
GlobalNamingResource unless you want that resource available in all 
your webapps.  Moving the resource to the  block of a 
context.xml file also makes it so resources can come and go with 
deployment of an individual webapp without restarting tomcat and 
disrupting all the webapps.


Developers could define their Resources in the 
 ...  block of 
server.xml and then add a  element to the context.xml 
file.  That'll get you out of having database specific information 
in the  element.  See this page for further details 
on that:


http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

--David






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: utf-8 encoding problem

2007-08-16 Thread Joseph Shraibman

Mark Thomas wrote:


   request.setCharacterEncoding("UTF-8");


Is this always safe?  For responses I can (and do) check the 
accept-charset request paramater, but I can't figure out how to tell 
what the request encoding should be.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC connection issue

2007-08-16 Thread David Smith

Right ... tomcat 6's version of common/lib/ is simply lib/

Location of the driver jars is not entirely as simple as either in your 
webapp or on the container's lib directory.  Like the Highlander (good 
movie if you haven't seen it), there can be only one.  If another webapp 
is using it and it's in either common/lib/ or lib/ depending on your 
tomcat version, you can't have a copy in your webapp's WEB-INF/lib folder.


--David

Gregor Schneider wrote:


I'm not sure about Tomcat 6, but in Tomcat 5.x there's no such thing
as $CATALIN_HOME/lib. YOur JDBC-drivers should either be bundled with
your web-app (if that's the only one using them) or, if used both from
Tomcat and your webapp(s) to $CATALINA_HOME/common/lib

Coming to the context:

- Create a file called "context.xml" in your META-INF-directory of your web-app
- define your context in there
- pack your war
- deploy
- feel happy and read
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html

Cheers

Gregor
 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle

Hi Chris

It seems like you guys have a pretty good setup going, better than the 
one at my (current) company anyway. I didn't realise that your 
environment doesn't have dependencies on statically linked war files 
like ours does. The developer makes a release and creates the three wars 
for deployment at the same time, which then have to be kept in synch. I 
have a lot of issues with this process as it's very error-prone, and I 
think some of my attitude towards this process crept into my previous 
emails, which wasn't appropriate. my bad.


Unfortunately not all of us are lucky enough for the prod server to have 
access to the version control repository...;-p


Also, our situation is a bit different where we consult to the client, 
our two networks are totally separated so there's no way that we can do 
fresh builds from version control (Subversion rocks!) to deployement 
targets directly. We need to build the wars in our office, then submit 
them to the client for testing and promotion. We have very little 
control over the promotion process, and more than once we've had serious 
bugs resulting from the wrong war going into the wrong target due to a 
mistake by the clients sysadmin. Thus my attitude towards configuration 
being external to the app as much as possible, I like to build a 
stand-alone war that gets as much of  their info as possible from the 
container/database.



responses inline.

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

I disagree with many of your assertions.
  

well put.

I'm guessing that you don't deploy all 3 WARs onto the same machine.
What's the difference between 3 different WARs and 1 WAR in 3 places?
Don't complain about disk space when the argument is 1) flawed (disk
space doesn't matter) and 2) moot (deployments to different servers).
  
fair point, HD space isn't an issue. it's the process used to deploy the 
war to the server, and ensuring that the same  release is delivered 
consistently across all targets. so long as the code can be deployed 
consistely & transparent of the target that's the main thing as I see it.

I completely disagree. We have complex configurations that need to
change for each environment (many properties files, etc.). Trying to
create one properties file to rule them all is impossible, and shoving
all that configuration into a (static) deployment descriptor on the
target server is kludgy and error prone, since the developers don't have
control over the server configuration.
  
sorry, I should have been more specific, I was just referring to 
database targeting, not the complete environment. there's a lot of 
things that ant  is excellent for.

We don't deliver a WAR file to our deployment team; we give them a cvs
tag to use as the new version. It's as simple as:

$ pushd
$ cd $APP
$ ant tomcat-stop
$ ant install-clean
$ popd
$ rm -rf $APP
$ cvs checkout -r ${RELEASE_TAG} ${APP}
$ cd ${APP}
$ ant install
$ ant tomcat-start

You may find that complicated, but it's all that's required for us to
deploy our applications into ANY environment. 

nice. fresh checkout from cvs tag straight into deployment. is good!

Wanna upgrade Tomcat? No
problem:

# cd /where/you/want/tomcat/to/live
# tar xzf apache-tomcat-version.tar.gz
# (fix 'tomcat' symlink)
# (restart apps at your convenience)

No effing around with Tomcat server configuration. In fact, deploying
our production applications doesn't require root access, so out
deployment team can't really break anything.
  

nice.

- -chris


--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Matthew Kerle
much better, thank you!  I think I'm gonna have to put aside some time 
to brush up on tomcat 5.5/6 jndi datasourcing as I'm obviously out of date.


cheers!

David Smith wrote:
I see.  Some of the tomcat docs are probably out of date, depending on 
someone pointing out the flaw or contributing updates.


Tomcat uses reflection to configure the pool using bean setter 
methods.  That makes the full set of attributes dependant on the 
implementation used -- in this case DBCP.  If you'd like the full set 
of database pool parameters available in the default tomcat db pool, 
just take a look at:


http://commons.apache.org/dbcp/api-1.2.2/org/apache/commons/dbcp/BasicDataSource.html 



--David

--
Matthew Kerle
IT Consultant
Canberra, Australia

Mobile: +61404 096 863
Email : [EMAIL PROTECTED]
Web : http://threebrightlights.blogspot.com/


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: JDBC connection issue

2007-08-16 Thread Hehl, Thomas
OK, I was trying to go away from this approach because Tomcat 6 didn't ship
with a conf/Catalina/localhost directory, but apparently, this is still the
way to do things. So I created this directory, put the xml files that synced
with my webapp in there and everything's back to working peachy keen.

Shouldn't have messed with something that worked :(.

-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 16, 2007 2:26 PM
To: Tomcat Users List
Subject: Re: JDBC connection issue

Right ... tomcat 6's version of common/lib/ is simply lib/

Location of the driver jars is not entirely as simple as either in your 
webapp or on the container's lib directory.  Like the Highlander (good 
movie if you haven't seen it), there can be only one.  If another webapp 
is using it and it's in either common/lib/ or lib/ depending on your 
tomcat version, you can't have a copy in your webapp's WEB-INF/lib folder.

--David

Gregor Schneider wrote:

>I'm not sure about Tomcat 6, but in Tomcat 5.x there's no such thing
>as $CATALIN_HOME/lib. YOur JDBC-drivers should either be bundled with
>your web-app (if that's the only one using them) or, if used both from
>Tomcat and your webapp(s) to $CATALINA_HOME/common/lib
>
>Coming to the context:
>
>- Create a file called "context.xml" in your META-INF-directory of your
web-app
>- define your context in there
>- pack your war
>- deploy
>- feel happy and read
>http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
>
>Cheers
>
>Gregor
>  
>


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC connection issue

2007-08-16 Thread Gregor Schneider
I see, so things quite changed from 5 to 6, however:

When it comes to a Tomcat 5.x, it still goes that you put your jar
(i.e. a jdbc-driver)

EITHER

in $CATALINA_HOME/lib (when used from Tomcat AND other webapps)

OR

in $CATALINA_HOME/webapps/yourwebapp/WEB-INF/lib (when used by a
specific web-app only)

When reading http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html,
one thing jumped into my eyes:


When a request to load a class from the web application's WebappX
class loader is processed, this class loader will look in the local
repositories first, instead of delegating before looking.


That's the big difference, before the classloader was delegating, and
then you could run into problems, i.e. there was a jdbc-driver both in
common/lib, one in WEB-INF/lib, and both having different versions -
the one from common/lib always got loaded, so that problem seems to be
fixed now.

However, with the new classloading-model in Tomcat 6 and the comments
from the docs above, it shouldn't matter whether you have them both in
$CATALINA_HOME/lib and webapps/your_app/WEB-INF/lib since the one from
your webapp gets loaded anyways, right?

Cheers

Gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Installing APR on Fedora

2007-08-16 Thread Rainer Jung

Where do you put tcnative.so?

And: if you do ldd PATH_TO_TCNATIVE/tcnative.so: are there any 
dependencies shown, which do not lie in /lib or /usr/lib, or which ldd 
can not resolve? If yes: which libraries, and which path resp. which 
libraries without path? Maybe just post the result of the ldd command.


Ole Ersoy wrote:

Hi Rainer,

Thanks again for that great fix.  When I fired up Tomcat, I still get 
this message:

Aug 16, 2007 9:53:05 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Native library which allows optimal performance 
in production environments was not found on the java.library.path: 
/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/lib/i386:/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib 



I read in a post that adding /lib and /usr/lib/ to the classpath would 
take care of it, but I must be missing something else as well.  Any ideas?


Thanks again,
- Ole


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JNDI Resource for HOST

2007-08-16 Thread Roland Carlsson

Hi!

How can I solve the problem to point JNDI-Resources to different values 
for the same webapplication that is deployed in serveral hosts on a 
server without having to rewrite the context.xml in the webapp for each 
deployment?


 with  using jndi-resource  points to 
resource1 defined in GlobalNamingResources with value "2"
 with  using jndi-resource  points to 
resource3 defined in GlobalNamingResources with value "4"


As far I can read in the documentation I can't define JNDI-resources for 
a host. Only all-context via default-context for only one context in the 
webapp context.xml-file. I hope that I'm wrong since this is something 
that would greatly reduce configuration issues between updates of my 
webapp.


Right now we are running the application in one server per host but new 
hardware could run all traffic in a single server. But then we need to 
find a way to configure it.


Thans in advance
Roland



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC connection issue

2007-08-16 Thread David Smith
I just checked the docs and the order in which classloaders are searched 
hasn't changed from 5.5 -> 6.0.  Still have to be careful a specific 
class is only found once in the classloader tree from the perspective of 
the webapp.


--David

Gregor Schneider wrote:


I see, so things quite changed from 5 to 6, however:

When it comes to a Tomcat 5.x, it still goes that you put your jar
(i.e. a jdbc-driver)

EITHER

in $CATALINA_HOME/lib (when used from Tomcat AND other webapps)

OR

in $CATALINA_HOME/webapps/yourwebapp/WEB-INF/lib (when used by a
specific web-app only)

When reading http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html,
one thing jumped into my eyes:


When a request to load a class from the web application's WebappX
class loader is processed, this class loader will look in the local
repositories first, instead of delegating before looking.


That's the big difference, before the classloader was delegating, and
then you could run into problems, i.e. there was a jdbc-driver both in
common/lib, one in WEB-INF/lib, and both having different versions -
the one from common/lib always got loaded, so that problem seems to be
fixed now.

However, with the new classloading-model in Tomcat 6 and the comments
from the docs above, it shouldn't matter whether you have them both in
$CATALINA_HOME/lib and webapps/your_app/WEB-INF/lib since the one from
your webapp gets loaded anyways, right?

Cheers

Gregor
 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JDBC driver of class '' for connect URL 'null' in Tomcat 5.5.12

2007-08-16 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matt,

Matthew Kerle wrote:
> the doco is a bit... terse on the subject of setting up a JNDI
> datasource outside the war file, and it's not as straightforward or easy
> to find as compared to the method for placing the context.xml inside the
> deployment war, which is well documented.

I agree the documentation is terse and/or missing. If you implement any
of these strategies, consider submitting an update to the documentation
to help others in the future.

It's easy to deploy using a context.xml file that is /not/ inside a WAR
file:

Start with the context.xml file that you would have put into your WAR
file. Add the "docBase" element to the  element to configure
the location of the WAR file. Put your WAR file somewhere outside of the
auto-deploying webapps directory. Put the context.xml file into
$CATALINA_HOME/conf/[enginename]/[hostname]/[appname].xml.

> How do you go about submitting an update
> to the documentation? I assume there's a short list of committers...

You can certainly post to this list. Several (of not all) Tomcat devs
lurk on this list. Just mark your post clearly and see what happens.

> every time we deployed a war without a context .xml tomcat would delete
> the existing one, or overwrite it.

You mean the context.xml file, not the WAR, right? When you step outside
of the standard (read: recommended) configurations, then you will have
to fight Tomcat to get things working properly. That's just the price
you pay: your deployment will be complicated if you want to do things
differently.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxK6b9CaO5/Lv0PARAvLxAKCz5TsLIFE+yNgwRcqJSP2h0i2TcgCgh1c/
T35dIRLVMDSMAkR7Jyc30ak=
=VEsi
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



comet read & httpsession timeout

2007-08-16 Thread Peter Warren
A comet read event doesn't update the last accessed time of an
HttpSession -- which means comet read events will never prevent an
http session (not the comet session) from timing out and the
connection getting closed.

Is that by design?  If so, can anyone offer me suggestions on how to
handle long-lived comet connections that may outlive the http session
timeout?

I had been hoping to periodically send a comet read event to update
the access time of the http session.  But, given that comet reads
don't affect access time of the http session, it seems my best option
is to periodically close the comet connection and open a new one.  Or
is there a way for me to programmatically update the http session
access time (I couldn't find one in the HttpSession docs)?  Any other
thoughts?

Thanks,
Peter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: comet read & httpsession timeout

2007-08-16 Thread Filip Hanik - Dev Lists

Peter Warren wrote:

A comet read event doesn't update the last accessed time of an
HttpSession -- which means comet read events will never prevent an
http session (not the comet session) from timing out and the
connection getting closed.

Is that by design?  If so, can anyone offer me suggestions on how to
handle long-lived comet connections that may outlive the http session
timeout?
  
session.setMaxInactiveInterval on the BEGIN method.(set to very large or 
unlimited)
session.invalidate on ERROR or END (only if comet is the only thing 
doing stuff with the session, otherwise see below)

I had been hoping to periodically send a comet read event to update
the access time of the http session.  But, given that comet reads
don't affect access time of the http session, it seems my best option
is to periodically close the comet connection and open a new one.  Or
is there a way for me to programmatically update the http session
access time (I couldn't find one in the HttpSession docs)?  Any other
thoughts?
  
a regular HTTP request to anything but the Comet URL will update your 
last access time,
so if you have other servlets/jsp etc under the same session, those will 
update your last access time.
when it comes to "comet session" data, you're probably better off 
managing that yourself


Filip


Thanks,
Peter

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Installing APR on Fedora

2007-08-16 Thread Filip Hanik - Dev Lists

Rainer Jung wrote:

Where do you put tcnative.so?
more specifically, is LD_LIBRARY_PATH pointing to the directory of the 
.so file?


Filip


And: if you do ldd PATH_TO_TCNATIVE/tcnative.so: are there any 
dependencies shown, which do not lie in /lib or /usr/lib, or which ldd 
can not resolve? If yes: which libraries, and which path resp. which 
libraries without path? Maybe just post the result of the ldd command.


Ole Ersoy wrote:

Hi Rainer,

Thanks again for that great fix.  When I fired up Tomcat, I still get 
this message:
Aug 16, 2007 9:53:05 AM org.apache.catalina.core.AprLifecycleListener 
init
INFO: The Apache Tomcat Native library which allows optimal 
performance in production environments was not found on the 
java.library.path: 
/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/lib/i386/client:/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/lib/i386:/usr/lib/jvm/java-1.6.0-sun-1.6.0.1/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib 



I read in a post that adding /lib and /usr/lib/ to the classpath 
would take care of it, but I must be missing something else as well.  
Any ideas?


Thanks again,
- Ole


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Has getParameterNames been updated to use Generics?

2007-08-16 Thread Brian Munroe
This is more of a Servlet API question, but pertains to Tomcat
nonetheless.  I am using Tomcat 5.5.23 with JDK 1.6.

I am having a problem with Generics and request.getParameterNames().
I keep getting a unchecked cast warning (just a warning, but still).

I was going to just use the @SuppressWarnings annotation, since I
pretty much can guarantee that the method will always return an
Enumeration of Strings, right?

Just making sure I would be following the standard idiom until it gets fixed.

thanks

-- brian

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [SOLVED]Tomcat native library Not found in Solaris 9

2007-08-16 Thread Lakshmi Venkataraman
 
Hi Rainer,
Thanks for your suggestion!  Using the specs file as suggested below did
not work.
Also, gcc -dumpspecs > /path/myspecs and then changing the *libgcc rule
did not 
work either.   
What finally worked was 
export CC="gcc -static-libgcc"
But then I had to recompile OpenSSL, APR and then Tomcat native in that
order with the
above value for CC to completely remove the dependency on libgcc_s.so.

So now I have libssl.so, libcrypto.so, libapr-1.so and libtcnative-1.so 
without the dependency on libgcc_s.so.


Thanks
Lakshmi

-Original Message-
From: Rainer Jung [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 02, 2007 2:20 AM
To: Tomcat Users List
Subject: Re: [NOT SOLVED]Tomcat native library Not found in Solaris 9

Hi,

first of all: this is a gcc question. If you search for a high quality
answer, you should contact the gcc commmunity.

My personal way to do this (and there is definitely more than one wait
to do it):

export CC="gcc -specs=/path/to/my/specs"

Contents of file /path/to/my/specs:

*libgcc:
-lgcc -lgcc_eh

Now whenever you use a build system, that respects the CC env variable
(e.g. most configure based systems), libgcc should get compiled in
statically.

Regards,

Rainer

Lakshmi Venkataraman wrote:
> Please give me some tips for compiling libtcnative on Solaris 9 
> without the dynamic dependence on libgcc_s.1.so.  We ship tomcat with 
> our product.  On customer installations, we cannot assume that 
> libgcc_s will be found in some standard location.
> 
> I have searched a lot on the web. I am also trying to compile gcc with

> --disable-shared option.
> I am running into some issues while trying to compile gcc. 
> 1) How to modify Tomcat native's configure script to link libgcc 
> statically?
> 2) What are the prerequisites before doing step 1)?
> 
> We are using Tomcat 5.5.23. I am using tcnative-1.1.8-src with 
> OpenSSL-0.9.8b.
> 
> --Thanks
> Lakshmi

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >