You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stefan Deitmer <sd...@gmx.de> on 2008/12/03 23:44:47 UTC
Unable to connect to DB using DataSource
Hello list.
I am trying to use a JDBC DataSource to connect to a PostgreSQL server
from within an Axis WebService running in Tomcat.
What confuses me is that I managed to get this to work on one server,
but now am failing miserably to do so on a second server.
The first server is a Debian Lenny with Tomcat 5.5 and Axis 1.4.1,
running in a Xen DomU on a 64 bit AMD machine.
The second server is also running Lenny with the same Tomcat and Axis
versions, but in a VirtualBox VM on a 32 bit Intel machine.
I have compared the whole directory tree of /var/lib/tomcat5.5, also
/usr/share/java, /etc/default/tomcat5.5 and the startup scripts in
/etc/init.d/tomcat5.5.
Everything is identical between the two servers, and still, #1 works, #2
doesn't.
The error message tells me that it can't find the postgres JDBC driver.
However, there is a symbolic link in /var/lib/tomcat5.5/share/lib
pointing to the driver in /usr/share/java. Also, I tried to open a
connection "directly", that is, using DriverManager.getConnection(),
it works, so it seems to be able to find the driver.
This is the configuration of the DataSource (in
/var/lib/tomcat5.5/conf/server.xml):
<Context path="/axis2" reloadable="true" cachingAllowed="false">
<Resource name="jdbc/pigaiadb" auth="Container"
type="javax.sql.DataSource"
maxActive="100" maxIdle="10" maxWait="1000"
removeAbandoned="true" removeAbandonedTimeout="60"
username="user" password="password"
driverClassName="org.postgresql.Driver"
validationQuery="select 1"
url="jdbc:postgresql://localhost/database" />
</Context>
This is how I access the DataSource in the Axis WebService's LifeCycle
object startup routine:
public void startUp(ConfigurationContext configctx, AxisService
service) {
Context initCtx = null;
Context envCtx = null;
DataSource ds = null;
try {
initCtx = new InitialContext();
} catch (NamingException e) {
LOG.error("InitContext Exception : " + e.getMessage());
}
try {
envCtx = (Context) initCtx.lookup("java:comp/env");
} catch (NamingException e) {
LOG.error("envContext Exception : " + e.getMessage());
}
try {
ds = (DataSource) envCtx.lookup("jdbc/pigaiadb");
} catch (NamingException e) {
LOG.error("DataSource Exception : " + e.getMessage());
}
try {
service.addParameter(new Parameter(Constants.DATASOURCE, ds));
} catch (AxisFault e) {
LOG.error("Failed to add datasource parameter to context: "
+ e.getMessage());
}
}
And this is how I try to get the connection from the DataSource:
try {
conn = ((DataSource)
serviceContext.getAxisService().getParameterValue(Constants.DATASOURCE)).getConnection();
} catch (SQLException e) {
LOG.error("SQLException while trying to get connection : "
+ e.getMessage());
}
... which results in the following error message:
SQLException while trying to get connection : Cannot load JDBC
driver class 'org.postgresql.Driver'
and this stack trace:
java.lang.ClassNotFoundException: org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1130)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
...
Replacing above code with the following works without errors:
try
{
Class.forName("org.postgresql.Driver");
conn =
DriverManager.getConnection("jdbc:postgresql://localhost/database",
"user", "password");
}catch (Exception e) {
LOG.error("SQLException while trying to get connection: "
+ e.getMessage());
}
This is my first project with Tomcat, Axis, JDBC and PostgreSQL, and
also the first time I'm seriously using Java in a very long time,
so please have some patience with me if I'm missing something essential
here. I would greatly appreciate some pointers as to how I
could nail down this problem. How comes Class.forName works when I call
it directly, but not when the DataSource class calls it internally?
Thanks a lot in advance
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Unable to connect to DB using DataSource
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Stefan,
I'm no expert with Axis WebService, but I do have a question about your
use of the javax.sql.DataSource object:
Stefan Deitmer wrote:
> This is how I access the DataSource in the Axis WebService's LifeCycle
> object startup routine:
>
> public void startUp(ConfigurationContext configctx, AxisService
> service) {
...
> service.addParameter(new Parameter(Constants.DATASOURCE, ds));
Is it customary to push a DataSource into the service's "parameters"?
Since the DataSource is always available via JNDI, why not simply grab
it from the JNDI context whenever you need it?
Going through JNDI has the added benefit of always getting you the right
object. If you were to reconfigure (or replace, really) the DataSource
in the JNDI context, your updates wouldn't be available to the web service.
> SQLException while trying to get connection : Cannot load JDBC driver
> class 'org.postgresql.Driver'
I suspect you are just missing the PostgreSQL driver jar file. Can you
find it in any of the (hopefully) obvious places? I would start by
looking in /usr/share/tomcat5.5 and its subdirs.
> Replacing above code with the following works without errors:
>
> try
> {
> Class.forName("org.postgresql.Driver");
> conn =
> DriverManager.getConnection("jdbc:postgresql://localhost/database",
> "user", "password");
> }catch (Exception e) {
> LOG.error("SQLException while trying to get connection: "
> + e.getMessage());
> }
Sounds like the driver JAR file is packaged with your webapp (that is,
in yourapp/WEB-INF/lib/postgresql.jar). If you want to use Tomcat's
connection pooling (and you probably /do/), then you need to MOVE that
JAR file from your webapp's lib directory into Tomcat's libraries
directory. For Tomcat 5.5, you should probably put it into common/lib
under your Tomcat's real installation directory (maybe
/usr/share/tomcat5.5/common/lib).
> This is my first project with Tomcat, Axis, JDBC and PostgreSQL, and
> also the first time I'm seriously using Java in a very long time,
> so please have some patience with me if I'm missing something essential
> here.
You provided a perfect amount of information, actually. Thanks for
providing all the info you did!
> How comes Class.forName works when I call
> it directly, but not when the DataSource class calls it internally?
When using the DataSource, you are attempting to use Tomcat's connection
pool. Tomcat needs to be able to load the driver from a JAR file
/before/ consulting your webapp's libraries. When you use the
DriverManager, you are bypassing all that and loading the driver
"normally" through your webapp's classloader.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkk4UwYACgkQ9CaO5/Lv0PArlQCgkDShHM1KPolqhie10rXy5T7l
ulsAn1HGPq3TL1ElwW6lWsafU4eFD409
=1tU5
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Unable to connect to DB using DataSource
Posted by BEN HMIDA aymen <ay...@tunisiana.com>.
Hi,
There's something confusing in your post but i think you 've forgotten to specify the port number userd by postgres
-----Message d'origine-----
De : Stefan Deitmer [mailto:sdeitmer@gmx.de]
Envoyé : jeudi 4 décembre 2008 08:35
À : Tomcat Users List
Objet : Re: Unable to connect to DB using DataSource
André Warnier schrieb:
> Stefan Deitmer wrote:
>
> Hi.
> You can totally disregard this, because I am really not competent.
> But just because I saw this in your post :
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> did you compare the line
> TOMCAT_SECURITY=...
> in /etc/default/tomcat5.5
> between your systems ?
> and maybe the files in /etc/tomcat5.5/policy.d ?
>
TOMCAT_SECURITY is NO on both systems, and the contents of
/etc/tomcat5.5/policy.d are identical.
The line you cited from the stack trace made me think the same thing,
but as the security manager is off on both systems, I guess it can't be
the cause of my problems.
Thank you though!
Regards
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Unable to connect to DB using DataSource
Posted by Stefan Deitmer <sd...@gmx.de>.
André Warnier schrieb:
> Stefan Deitmer wrote:
>> André Warnier schrieb:
> [...]
> Ok, then another probably silly suggestion, but you might as well
> upturn this stone too.
> Apart from the directories you named as already compared, have you
> compared the /usr/share/tomcat5.5 ?
> That is where the Debian distributions usually install the base of the
> Tomcat 5.5 software (CATALINA_HOME). /var/lib/tomcat5.5 is
> CATALINA_BASE (where this Tomcat instance actually runs).
André, as I suspected earlier today, you were on the right track.
I put a link to postgresql.jar into /usr/share/tomcat5.5/common/lib, and
it works now.
Thank you so much! Life is good again :)
Cheers
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: access to all sessions
Posted by Pieter Temmerman <pt...@sadiel.es>.
LambaProbe's (http://www.lambdaprobe.org) features overview says :
"Ability to expire selected sessions". Not sure if this is what you're
looking for?
Cheers.
On Thu, 2008-12-04 at 12:09 -0700, Timothy J Schumacher wrote:
> Hi Leon,
>
> Thanks for the info. So, if I simply wanted to tell TC to invalidate
> all sessions is there something easier I could do?
>
> Tim
>
> Leon Rosenberg wrote:
> > Hello Tim,
> >
> > there is no easy and direct way to do it. What you can do is to create
> > a SessionListener
> > (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html),
> > register it as listener in the web.xml and store references to the
> > sessions upon creation somewhere (read map).
> > But beware, you have to be cautious a) not to create a memory leak by
> > not letting tomcat to remove outdated sessions and b) synchronize
> > accesses to your map and sessions without creating dead locks (since
> > 1.4 doesn't have all the fancy concurrency stuff).
> >
> > regards
> > Leon
> >
> > On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher
> > <Ti...@colorado.edu> wrote:
> >
> >> Hi,
> >>
> >> I have TC 5.0.12 and java 1.4.1_04. Unfortunately, I am stuck using these
> >> versions for now...
> >>
> >> I am trying to figure out how to access/manipulate all the sessions for my
> >> web app. I guess I want something similar to the manager application, but I
> >> don't want to have to run the manager application. Does anyone know of a
> >> good reference to learn more about how this works? I looked a little bit at
> >> the docs but it was not clear to me how to access this data.
> >>
> >> Thanks!
> >> Tim
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: access to all sessions
Posted by Timothy J Schumacher <Ti...@Colorado.EDU>.
Hi Leon,
How bad of an idea is it to set privileged=true in my context? Wouldn't
this give me access to the things I want (and much more that I probably
don't want access to)? Our environment is such that maybe this isn't
totally out of the question, we run TC in a piece of hardware to serve
content to the attached touchscreen. There is only ever one webapp
running, ROOT, and that is really all that will ever be running.
Tim
Leon Rosenberg wrote:
> It depends on your definition of easier...
> you could provide your own session manager with your own session
> implementation, which supports such a mechanism or patch the existing
> StandartSession.java. I don't know whether you'd call it easy :-)
> Leon
>
>
>
> On Thu, Dec 4, 2008 at 8:09 PM, Timothy J Schumacher
> <Ti...@colorado.edu> wrote:
>
>> Hi Leon,
>>
>> Thanks for the info. So, if I simply wanted to tell TC to invalidate all
>> sessions is there something easier I could do?
>>
>> Tim
>>
>> Leon Rosenberg wrote:
>>
>>> Hello Tim,
>>>
>>> there is no easy and direct way to do it. What you can do is to create
>>> a SessionListener
>>>
>>> (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html),
>>> register it as listener in the web.xml and store references to the
>>> sessions upon creation somewhere (read map).
>>> But beware, you have to be cautious a) not to create a memory leak by
>>> not letting tomcat to remove outdated sessions and b) synchronize
>>> accesses to your map and sessions without creating dead locks (since
>>> 1.4 doesn't have all the fancy concurrency stuff).
>>>
>>> regards
>>> Leon
>>>
>>> On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher
>>> <Ti...@colorado.edu> wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> I have TC 5.0.12 and java 1.4.1_04. Unfortunately, I am stuck using
>>>> these
>>>> versions for now...
>>>>
>>>> I am trying to figure out how to access/manipulate all the sessions for
>>>> my
>>>> web app. I guess I want something similar to the manager application,
>>>> but I
>>>> don't want to have to run the manager application. Does anyone know of a
>>>> good reference to learn more about how this works? I looked a little bit
>>>> at
>>>> the docs but it was not clear to me how to access this data.
>>>>
>>>> Thanks!
>>>> Tim
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: access to all sessions
Posted by Leon Rosenberg <ro...@googlemail.com>.
It depends on your definition of easier...
you could provide your own session manager with your own session
implementation, which supports such a mechanism or patch the existing
StandartSession.java. I don't know whether you'd call it easy :-)
Leon
On Thu, Dec 4, 2008 at 8:09 PM, Timothy J Schumacher
<Ti...@colorado.edu> wrote:
> Hi Leon,
>
> Thanks for the info. So, if I simply wanted to tell TC to invalidate all
> sessions is there something easier I could do?
>
> Tim
>
> Leon Rosenberg wrote:
>>
>> Hello Tim,
>>
>> there is no easy and direct way to do it. What you can do is to create
>> a SessionListener
>>
>> (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html),
>> register it as listener in the web.xml and store references to the
>> sessions upon creation somewhere (read map).
>> But beware, you have to be cautious a) not to create a memory leak by
>> not letting tomcat to remove outdated sessions and b) synchronize
>> accesses to your map and sessions without creating dead locks (since
>> 1.4 doesn't have all the fancy concurrency stuff).
>>
>> regards
>> Leon
>>
>> On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher
>> <Ti...@colorado.edu> wrote:
>>
>>>
>>> Hi,
>>>
>>> I have TC 5.0.12 and java 1.4.1_04. Unfortunately, I am stuck using
>>> these
>>> versions for now...
>>>
>>> I am trying to figure out how to access/manipulate all the sessions for
>>> my
>>> web app. I guess I want something similar to the manager application,
>>> but I
>>> don't want to have to run the manager application. Does anyone know of a
>>> good reference to learn more about how this works? I looked a little bit
>>> at
>>> the docs but it was not clear to me how to access this data.
>>>
>>> Thanks!
>>> Tim
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: access to all sessions
Posted by Timothy J Schumacher <Ti...@Colorado.EDU>.
Hi Leon,
Thanks for the info. So, if I simply wanted to tell TC to invalidate
all sessions is there something easier I could do?
Tim
Leon Rosenberg wrote:
> Hello Tim,
>
> there is no easy and direct way to do it. What you can do is to create
> a SessionListener
> (http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html),
> register it as listener in the web.xml and store references to the
> sessions upon creation somewhere (read map).
> But beware, you have to be cautious a) not to create a memory leak by
> not letting tomcat to remove outdated sessions and b) synchronize
> accesses to your map and sessions without creating dead locks (since
> 1.4 doesn't have all the fancy concurrency stuff).
>
> regards
> Leon
>
> On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher
> <Ti...@colorado.edu> wrote:
>
>> Hi,
>>
>> I have TC 5.0.12 and java 1.4.1_04. Unfortunately, I am stuck using these
>> versions for now...
>>
>> I am trying to figure out how to access/manipulate all the sessions for my
>> web app. I guess I want something similar to the manager application, but I
>> don't want to have to run the manager application. Does anyone know of a
>> good reference to learn more about how this works? I looked a little bit at
>> the docs but it was not clear to me how to access this data.
>>
>> Thanks!
>> Tim
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: multiple copies of jar files
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Timothy J Schumacher [mailto:Tim.Schumacher@Colorado.EDU]
> Subject: multiple copies of jar files
>
> TC 5.0.12
> java version "1.4.1_04"
Both sadly outdated and unsupported.
> $CATALINA_HOME/server/lib/catalina.jar
> $CATALINA_HOME/shared/lib/catalina.jar
That's probably not good; catalina.jar should only be in server/lib. The shared/lib directory is empty on a default Tomcat, and should be used only for classes that must be shared across multiple webapps.
> I am under the impression that having multiple copies of the same jar
> file is not ever a good thing!
Usually not. In this particular case, it won't hurt Tomcat, and the classes loaded out of shared will not conflict with ones in server because they're in different branches of the classloader tree:
Bootstrap
|
System
|
Common
/ \
Catalina Shared
/ \
Webapp1 Webapp2 ...
(See http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html for more detail.)
It looks like someone thought putting catalina.jar into shared/lib would give webapps access to Tomcat's internal classes - but it won't really, since they use different classloaders.
> If an application wants to use a class from catalina.jar,
Applications should not be using classes from catalina.jar; that's scary.
> does that mean catalina.jar needs to be deleted from
> server/lib and placed in shared/lib?
It would have to go into common/lib, but it's a really, really bad idea to build a webapp around Tomcat-specific class files.
- 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
multiple copies of jar files
Posted by Timothy J Schumacher <Ti...@Colorado.EDU>.
Hi All,
TC 5.0.12
java version "1.4.1_04"
I have inherited a project that has multiple copies of some jar files
under $CATALINA_HOME. In particular the one I noticed first was
$CATALINA_HOME/server/lib/catalina.jar
$CATALINA_HOME/shared/lib/catalina.jar
I am under the impression that having multiple copies of the same jar
file is not ever a good thing!
There are some others but I am curious - do these really belong in
server or shared? Does anyone know where these are supposed to live?
I also saw from the tomcat website this:
"Therefore, from the perspective of a web application, class or resource
loading looks in the following repositories, in this order:
* Bootstrap classes of your JVM
* System class loader classses (described above)
* //WEB-INF/classes/ of your web application
* //WEB-INF/lib/*.jar/ of your web application
* /$CATALINA_HOME/common/classes/
* /$CATALINA_HOME/common/endorsed/*.jar/
* /$CATALINA_HOME/common/i18n/*.jar/
* /$CATALINA_HOME/common/lib/*.jar/
* /$CATALINA_BASE/shared/classes/
* /$CATALINA_BASE/shared/lib/*.jar/
"
If an application wants to use a class from catalina.jar, does that mean
catalina.jar needs to be deleted from server/lib and placed in
shared/lib? Or is that not even possible by design?
Thanks again!
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: access to all sessions
Posted by Leon Rosenberg <ro...@googlemail.com>.
Hello Tim,
there is no easy and direct way to do it. What you can do is to create
a SessionListener
(http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSessionListener.html),
register it as listener in the web.xml and store references to the
sessions upon creation somewhere (read map).
But beware, you have to be cautious a) not to create a memory leak by
not letting tomcat to remove outdated sessions and b) synchronize
accesses to your map and sessions without creating dead locks (since
1.4 doesn't have all the fancy concurrency stuff).
regards
Leon
On Thu, Dec 4, 2008 at 7:32 PM, Timothy J Schumacher
<Ti...@colorado.edu> wrote:
> Hi,
>
> I have TC 5.0.12 and java 1.4.1_04. Unfortunately, I am stuck using these
> versions for now...
>
> I am trying to figure out how to access/manipulate all the sessions for my
> web app. I guess I want something similar to the manager application, but I
> don't want to have to run the manager application. Does anyone know of a
> good reference to learn more about how this works? I looked a little bit at
> the docs but it was not clear to me how to access this data.
>
> Thanks!
> Tim
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
access to all sessions
Posted by Timothy J Schumacher <Ti...@Colorado.EDU>.
Hi,
I have TC 5.0.12 and java 1.4.1_04. Unfortunately, I am stuck using
these versions for now...
I am trying to figure out how to access/manipulate all the sessions for
my web app. I guess I want something similar to the manager
application, but I don't want to have to run the manager application.
Does anyone know of a good reference to learn more about how this
works? I looked a little bit at the docs but it was not clear to me how
to access this data.
Thanks!
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Unable to connect to DB using DataSource
Posted by André Warnier <aw...@ice-sa.com>.
Stefan Deitmer wrote:
> André Warnier schrieb:
[...]
Ok, then another probably silly suggestion, but you might as well upturn
this stone too.
Apart from the directories you named as already compared, have you
compared the /usr/share/tomcat5.5 ?
That is where the Debian distributions usually install the base of the
Tomcat 5.5 software (CATALINA_HOME). /var/lib/tomcat5.5 is
CATALINA_BASE (where this Tomcat instance actually runs).
As many lights on this list never tire to point out, packages for
specific OS'es put things a bit all over the place, with soft links in
even more places, which makes it difficult sometimes to figure out where
things really are and what points to what. The Debian Tomcat packager
seems to have even more imagination than most.
You could of course remove the Debian package, and install a "real"
Tomcat from the Tomcat site. You would then probably get more help from
this list (for reasons I do not discuss nor contradict). The
inconvenient is that you would lose the facilities of the Debian package
manager for configuration, updating, resolving dependencies etc..
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Unable to connect to DB using DataSource
Posted by Stefan Deitmer <sd...@gmx.de>.
André Warnier schrieb:
> Stefan Deitmer wrote:
>
> Hi.
> You can totally disregard this, because I am really not competent.
> But just because I saw this in your post :
>
> at java.security.AccessController.doPrivileged(Native Method)
>
> did you compare the line
> TOMCAT_SECURITY=...
> in /etc/default/tomcat5.5
> between your systems ?
> and maybe the files in /etc/tomcat5.5/policy.d ?
>
TOMCAT_SECURITY is NO on both systems, and the contents of
/etc/tomcat5.5/policy.d are identical.
The line you cited from the stack trace made me think the same thing,
but as the security manager is off on both systems, I guess it can't be
the cause of my problems.
Thank you though!
Regards
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Unable to connect to DB using DataSource
Posted by André Warnier <aw...@ice-sa.com>.
Stefan Deitmer wrote:
Hi.
You can totally disregard this, because I am really not competent.
But just because I saw this in your post :
at java.security.AccessController.doPrivileged(Native Method)
did you compare the line
TOMCAT_SECURITY=...
in /etc/default/tomcat5.5
between your systems ?
and maybe the files in /etc/tomcat5.5/policy.d ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org