Offtopic: Re: Closed war class loading.

2004-04-19 Thread Julio César Aguilar


Jacob Kjome wrote:

Upgrade to Tomcat-5.  It explodes war files by default...even on a Tomcat
manager deploy.  I would still rethink using a technology that violates the J2EE
by requriing access to the file sytem in order to work properly.
Just a claryfing note:
Velocity is not intended to be exclusively used within a ServletContainer, it 
can be used in any java application. So, it comes with a FileResourceLoader, a 
JarResourceLoader and a ClasspathResourceLoader (recommended to be used with 
Tomcat).

Owen: Why don't you try your hand at changing your velocity configuration in 
velocity.properties to use one of the other loaders with a packed war?
http://jakarta.apache.org/velocity/developer-guide.html

---
Julio César Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: shared/lib again...

2004-04-19 Thread Julio César Aguilar
Sorry about not being clear enough last time.

Let's see...

The original problem was with a Filter, which was started at deployment.
   Then to my opinion this is due to Filter initialization (not run-time 
usage) as implemented in Tomcat.
That was my first thought when you brought up the question about the moment of 
the CNFE happening but I tried with classes needed at runtime (Velocity classes, 
for example) and could not find those either. Using my code or your servlet.


   Stop, now I've messed up. :-) Your code can not find some jars in 
question, but mine does??
No. Your code does not find things if I put in my application.
But it does find classes in jars in shared/lib within a test (almost empty) 
application living in CATALINA_HOME/webapps.

I know it does not seem important but I have no other clues by now.

---
Julio César Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA


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


Re: shared/lib again...

2004-04-16 Thread Julio César Aguilar
I've done several tests in Windows and this is what I found.
To remember my settings
No CATALINA_BASE defined. Tests done with CATALINA_HOME/shared/lib.

1. As being told, I can find jars put in CATALINA_HOME/common/lib.

2.
   What exactly the moment when CNFE is thrown? You said that the 
applications is not even start due to CNFE, so that classes are needed 
during deployment or while normal application functioning?
The original problem was with a Filter, which was started at deployment.

If I place the jar that contains the Filter class in WEB-INF/lib then the
application starts, but looking for classes needed after deployment (during a
normal run) I can't find them if the corresponding jars are in shared/lib.
3. Something I had not mentioned about my application (I did not thought it was 
relevant) is that it lives outside the CATALINA_HOME directory, is referred to 
by a context.xml file in CATALINA_HOME/conf/Catalina/localhost.

Using a test application in CATALINA_HOME/webapps and compiling the 
IsThereThisClass servlet provided by Veniamin I can finally find the classes 
within shared/lib.

So, could this be the cause of my problem?

---
Julio César Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA








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


Re: shared/lib again...

2004-04-15 Thread Julio César Aguilar
Thanks to Veniamin and Yoav:

Veniamin Fichin wrote:
   If you use multiple instance Tomcat's feature, this may be the case. 
In Windows I'm using a single instance of tomcat, there's no CATALINA_BASE so it 
should be the same as CATALINA_HOME if I understand correctly.

In Linux I'm using a single binary of tomcat and have the jar in 
CATALINA_BASE/shared/lib.

   Alternatively you can place your .jar in $CATALINA_HOME/common/lib .
I wanted to be able to deploy my application as a regular user who owns 
CATALINA_BASE and has not write access to CATALINA_HOME.

Thanks anyway.
---
Julio César Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


shared/lib again...

2004-04-14 Thread Julio César Aguilar
I've read the ClassLoading part of Tomcat documentation and searched this list 
but I've still found no clue to my recent problem:

Tomcat 5.0.19
JDK 1.4.2_03
Windows XP
I have several applications running with a common jar of my own in each 
WEB-INF/lib and everthing works.
If I move that jar to %CATALINA_HOME%/shared/lib the applications wont start 
reporting a CNFE about a class in the previously mentioned jar.

I can reproduce the problem in Linux (same version of Tomcat and JDK) placing 
the jar in CATALINA_BASE/shared/lib or CATALINA_HOME/shared/lib.

Is there something that has to be done to be able to share a jar through 
applications?

Thanks for any help.
---
Julio César Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Relative directory addressing to parent directory

2004-04-14 Thread Julio César Aguilar
In my knowledge:

For tomcat to be able to serve the images, that images directory hast to live 
inside a web application (or be a web application by itself).

If you choose to do the later, then you could use a path like 
/images/myimage.jpg to display those images.

---
Julio César Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JDBC/DBCP problems

2004-01-28 Thread Julio César Aguilar

Tomcat version is 4.1.29 on Windows XP.  I'm attempting to connect to
SQL Server.  The JDBC driver JARs are in CATALINA_HOME\common\lib, and
since everything works fine if I manually load the driver via
Class.forName(), I don't think my problem is related to my driver files
location.  When attempting to use getConnection(), however, I get the
dreaded Cannot create JDBC driver of class '' for connect URL 'null',
cause: No suitable driver error.  The highlights of my configuration
are below.
Two comments:

1. You don't mention a ResourceLink. When you define a Resource as global, you 
need to use a ResourceLink in the definition of the context of the application. 
In your case, something like

ResourceLink global=jdbc/mydb name=jdbc/mydb type=javax.sql.DataSource /

inside the Context tag of the server.xml COULD work.

2. I'm saying COULD in the previous comment because I had the same problem and 
could not solve it with Tomcat 4.1.29.
Using 5.0.16 or 5.0.18 everything works fine.

I have something like:


server.xml

GlobalNamingResources
Resource name=GlobalDataSource auth=Container type=javax.sql.DataSource
description=The database. /
ResourceParams name=GlobalDataSource
...
/ResourceParams
/GlobalNamingResources
---
Catalina/host/myapp.xml
---
Context ...
ResourceLink global=GlobalDataSource name=jdbc/mydb 
type=javax.sql.DataSource /
/Context

Note that there's no need of using a resource-ref in web.xml.

---
Julio César Aguilar Cabrera
[EMAIL PROTECTED]
Proyecto SIGC3, LANIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]