Sorry, I don't see how I did not see it:
arg0.getServletContext().getContextPath()
On 25 May 2011 10:53, Mateu Yabar wrote:
> Hi to all,
>
> I've created a ServletContextListener, which needs to use get the current
> context path (as defined in web.
Hi to all,
I've created a ServletContextListener, which needs to use get the current
context path (as defined in web.xml):
public class UpdateExecutionStartContextListener implements
javax.servlet.ServletContextListener{
@Override
public void contextInitialized(ServletContextEvent
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> From: mitch...@intertrust.com
> To: users@tomcat.apache.org
> Date: Thu, 29 Jul 2010 20:58:52 -0700
> Subject: RE: JNDI not available from ServletContextListener
>
> I
kind of
> deployment problem.
Do you mind explaining what the problem was, in case we come across it
again?
p
> Thanks, case closed,
> --Steve
>
> From: Steve Mitchell
> Sent: Thursday, July 29, 2010 5:49 PM
> To: 'users@tomcat.apache.org'
> Subject: JNDI not a
From: Steve Mitchell
Sent: Thursday, July 29, 2010 5:49 PM
To: 'users@tomcat.apache.org'
Subject: JNDI not available from ServletContextListener
Can anybody reproduce the bug I'm getting in Tomcat 6.0.29, or is it just me?
I'm trying to access a DataSource via JNDI from a
Can anybody reproduce the bug I'm getting in Tomcat 6.0.29, or is it just me?
I'm trying to access a DataSource via JNDI from a ServletContextListener. I
find that my InitialContext has no bindings at all in the
ServletContextListener.contextInitialized() method. It makes no
.jsp, etc.) is messed up, or the time is set wrong on the
> server.
> If you don't want automatic reloading to happen at all, remove
> reloadable=true from the element.
> --
> Len
>
>
--
View this message in context:
http://www.nabble.com/ServletContextListener-Que
]> wrote:
>
> The original formatting was all screwed up. My apologies.
>
>
>
> I'm seeing an issue when using a ServletContextListener on Tomcat 6.0.13.
> Tomcat is triggering the contextInitialized method at startup but then
> shortly after fires off the contextDestro
Thanks Martin,
But I'm not sure how spring can be the issue as it hasn't yet been
initialized. It's listener gets called after the ServletContextListener is
initialized.
In my web xml I don't define the spring servlet. I just define the
-on-startup parameter
a.. BEA WebLogic up to 8.1 SP2
b.. IBM WebSphere 5.x
c.. Oracle OC4J 9.0.3
Anyone else?
Martin-
- Original Message -
From: "Sparecreative" <[EMAIL PROTECTED]>
To:
Sent: Saturday, March 29, 2008 9:30 PM
Subject: Re: ServletContextListener Query
The original formatting was all screwed up. My apologies.
I'm seeing an issue when using a ServletContextListener on Tomcat 6.0.13.
Tomcat is triggering the contextInitialized method at startup but then
shortly after fires off the contextDestroyed method, followed by the
contextInitialized
I'm seeing an issue when using a ServletContextListener on Tomcat 6.0.13.
Tomcat is triggering the contextInitialized method at startup but then
shortly after fires off the contextDestroyed method, followed by the
contextInitialized again. Is this normal behaviour or have I screwed
somethi
-Original Message-
From: lightbulb432 [mailto:[EMAIL PROTECTED]
Sent: Saturday, June 09, 2007 10:30 AM
To: users@tomcat.apache.org
Subject: ServletContextListener
>Can requests potentially arrive at a servlet before the
ServletContextListener's contextInitialized method has
&g
lightbulb432 wrote:
Can requests potentially arrive at a servlet before the
ServletContextListener's contextInitialized method has completed? I ask
because the method occurs as a notification once the servlet context is
ready to accept requests. Is there a chance, then, that a request could
begin
an be used to serve this
function?
--
View this message in context:
http://www.nabble.com/ServletContextListener-tf3894944.html#a11042104
Sent from the Tomcat - User mailing list archive at Nabble.com.
-
To start a new topic, e-m
on a Debian Linux.
I have a context defined and want all of its logging to be in its own logfile.
The first thing I tried is to modify the file logging.properties, in the conf
directory of my Tomcat installation, adding a handler for my new context.
This looked good until I added a ServletCont
.
This looked good until I added a ServletContextListener. Now what is logged
during the execution of the method contextInitialized, is written to
catalina_.log (the logfile defined in the Tomcat startup script).
I'd like that to be logged in the same logfile as the rest of the conte
t spring context. But it didn't help either
[Loaded org.apache.log4j.spi.NullWriter from
file:/home/vasya/prj/trunk/WEB-INF/lib/jakarta-log4j.jar]
- Error configuring application listener of class
enCode.util.spring.WebApplicationContextSupport
java.lang.NoClassDefFoundError: javax/servlet/S
> From: Vasiliy Keretsman [mailto:[EMAIL PROTECTED]
> Subject: Re: java.lang.NoClassDefFoundError:
> javax/servlet/ServletContextListener
>
> I manually added servlet-api.jar to CLASSPATH at first and Tomcat
> started without errors.
You've got something else going
That makes no sense at all, since there are no javax.* classes in
tools.jar. The only thing that Tomcat might use out of tools.jar is the
javac classes, and then only if you configure it to use javac instead of
the default compiler.
I know it looks strange.
I manually added servlet-api.jar to C
> From: Vasiliy Keretsman [mailto:[EMAIL PROTECTED]
> Subject: Re: java.lang.NoClassDefFoundError:
> javax/servlet/ServletContextListener
>
> Linux version of catalina/bin/setclasspath.sh in 5.5.15,17,20 hides
> the following classpath setting under condition. With tools.jar
Hi!
The problem was solved.
Linux version of catalina/bin/setclasspath.sh in 5.5.15,17,20 hides
the following classpath setting under condition. With tools.jar in
classpath it works.
if [ "$1" = "debug" -o "$1" = "javac" ] ; then
CLASSPATH="$JAVA_HOME"/lib/tools.jar
fi
Btw, setclasspath.bat d
Martin, Chuck
Thanks for reply.
1. servlet-api.jat is only in tomcat/common/lib
2. cut from web.xml
Can we see the web.xml listener element configuration for
ServletContextListener and any listener's deriving from ServletContextLis
Vasily-
Can we see the web.xml listener element configuration for
ServletContextListener and any listener's deriving from ServletContextListener
have you verified your $CATALINA_HOME/commons/lib/servlet-api.jar is the same
as the OS specific distro jar?
Anyone else?
M-
This e-mail communic
> From: Vasiliy Keretsman [mailto:[EMAIL PROTECTED]
> Subject: java.lang.NoClassDefFoundError:
> javax/servlet/ServletContextListener
>
> - Error configuring application listener of class
> myapp.util.WebApplicationContextSupport
> java.lang.NoClassDefFoun
Hi!
I've got the following problem during Tomcat 5.5.20 startup
- Error configuring application listener of class
myapp.util.WebApplicationContextSupport
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener
servlet-api.jar is in common/lib.
I've never had such pr
the tld files
and it should be loaded automatically.
So I tried to put a customized ServletContextListener in a tld file packed
in a jar file and it is not loaded either.
And tomcat 5.5.20 seams not to be compatible with eclipse wtp 1.5.1 well, I
would really like they could work things out.
So does
Also for you information ...the auto-commit of HSQLDB is off by default.
-Original Message-
From: Awaneesh Shatmanyu [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 21, 2006 8:15 PM
To: Tomcat Users List
Subject: RE: HSQLDB and Tomcat ServletContextListener
Hi Feris,
I am
,
Awaneesh Shatmanyu
-Original Message-
From: Feris Thia [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 21, 2006 7:55 PM
To: Tomcat Users List
Subject: HSQLDB and Tomcat ServletContextListener
Dear All,
I'm using HSQLDB as embedded in-process mode for my web application. I
mport javax.servlet.ServletContextEvent;
import java.nio.channels.ClosedByInterruptException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Random;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class ContextStartUp implements ServletContextLis
bhaskar wrote:
===
>
> Does it mean that it will solve my problem if I move from Tomcat 5.0.x to
> Tomcat 5.5 ?
Probably.
It it is a bug there is a much greater chance of it getting fixed in
5.5.x than 5.0.x.
Mark
; From: bhaskar [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 08, 2006 10:48 AM
> To: users@tomcat.apache.org
> Subject: JNDI context in ServletContextListener
>
> Hi,
> I am using tomcat 5.0.18. Our application is doing the JNDI
> lookup in the listener. During tomcat start
Hi,
I am using tomcat 5.0.18. Our application is doing the JNDI lookup in the
listener. During tomcat startup when i try to get the db connection, i get
following error:
Name OracleDev not bound to this context
This is not consistent but it happens quite often.
In the tomcat-user list, i found
Hi,
I am using Tomcat-5.5.8 on Cygwin. I have written my own ContextListener
class (called ApplicationStart) that implements ServletContextListener.
The class is compiled and is present in my WEB-INF/classes folder in the
proper package. When I start Tomcat, I get the following error
[EMAIL PROTECTED] wrote:
One reason a filter would be better is you can fully
construct the URL dynamically, including the method and all
that. Could you possibly map it to just the initial entry
point of your app so that it doesn't fire with each request?
Yeah I thought about that... unfor
Frank,
> > Martin, I can't get a HttpServletRequest from Filter.init.
> > I can get a ServletContext... but I can also get that from a
> > ServletContextListener. So I can throw away this silly Filter now.
>
> One reason a filter would be better is you can fully
&g
> Subject: Re: ServletContextListener - how to detect http path of web
> application?
We have a similar sounding problem. We want a ContextListener to be
able to determine the http path and the port, in order to advertise
webapps via ZeroConf MDNS (Rendezvous, Bonjour, whatever th
et that from a
> ServletContextListener.
> So I can throw away this silly Filter now.
One reason a filter would be better is you can fully construct the URL
dynamically, including the method and all that. Could you possibly map it
to just the initial entry point of your app so that it doesn't fire wi
Frank, your solution (using the ServletContext) does work. Thanks.
Martin, I can't get a HttpServletRequest from Filter.init.
I can get a ServletContext... but I can also get that from a
ServletContextListener.
So I can throw away this silly Filter now.
Cheers everyone.
-Original Me
Iain-
Unless of course you only make this assignment in the init method
Thanks,
Martin-
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Wednesday, December 21, 2005 12:17 PM
Subject: RE: ServletContextListener - how to detect http path of web
application?
Thanks, I mig
solution :-)
Iain
-Original Message-
From: Frank W. Zammetti [mailto:[EMAIL PROTECTED]
Sent: 21 December 2005 17:00
To: Tomcat Users List
Cc: Tomcat Users List
Subject: Re: ServletContextListener - how to detect http path of web
application?
Tim is right, you can't do it directly. You *
Tim is right, you can't do it directly. You *might* be able to construct
it in a roundabout way though...
Let's assumg you know the method, http vs. https, and its always one or
the other. Let's also assume that the element in web.xml
names the application context (i.e., if the URL is http://my
Thanks Tim.
-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: 21 December 2005 11:23
To: Tomcat Users List
Subject: Re: ServletContextListener - how to detect http path of web
application?
There is no way to detect the contextPath on servletInit. It can only be
done
There is no way to detect the contextPath on servletInit. It can only be done
after the first request. (Using HttpServletRequest.getContextPath())
-Tim
[EMAIL PROTECTED] wrote:
Hi,
Apols for a newbie question, I didn't have much luck with the archives
or in Google.
In my ServletContextListe
Hi,
Apols for a newbie question, I didn't have much luck with the archives
or in Google.
In my ServletContextListener.contextInitialized method, I need to detect
the public http path of my web app.
i.e. http://servername/approot/
How can I do this?
event.getServletContext().getResource("/") give
er [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 28, 2005 11:28 AM
> To: 'Tomcat Users List'
> Subject: RE: reading file in ServletContextListener
>
> would work, but where "/" is (without the getRealPath part)
> is "the directory from which To
ve, 'context' would be obtained:
ServletContext context = servletContextEvent.getServletContext();
> -Original Message-
> From: Werner van Mook [mailto:[EMAIL PROTECTED]
> Sent: Sunday, November 27, 2005 4:32 PM
> To: Tomcat Users List
> Subject: Re: reading file
t in WEB-INF/classes (or in a .jar file in WEB-INF/lib.)
I have a .properties file in WEB-INF/classes that gets read from a
ServletContextListener by way of a Factory that does this:
Properties props = new Properties();
ClassLoader cl = UniSessionFactory.class.getCla
trying to start.
And see there we have a chicken and egg problem.
The web app needs the file to start.
The file is not there if there is no web app.
On Nov 27, 2005, at 11:06 PM, Wendy Smoak wrote:
On 11/27/05, Werner van Mook <[EMAIL PROTECTED]> wrote:
In my class which implements Servl
On 11/27/05, Werner van Mook <[EMAIL PROTECTED]> wrote:
> In my class which implements ServletContextListener I try to read a
> file.
> it looks like :
> parser.parse("friends.xml");
>
> When I start tomcat 5.5.12 I get a FileNotFound Exception on the
>
Hi,
In my class which implements ServletContextListener I try to read a
file.
it looks like :
parser.parse("friends.xml");
When I start tomcat 5.5.12 I get a FileNotFound Exception on the
friends.xml file.
The file is in the root of my web-app.
I also tried "/friends.x
51 matches
Mail list logo