Java Mailing List Archive

http://www.junlu.com/

Home » users-digest.tomcat »

users Digest 22 Jul 2010 06:15:02 -0000 Issue 9724

users-digest-help

2010-07-22


Author LoginPost Reply

users Digest 22 Jul 2010 06:15:02 -0000 Issue 9724

Topics (messages 214920 through 214932):

How to map web app with different root paths?
 214920 by: john.ranaudo.thomsonreuters.com
 214921 by: Christopher Schultz
 214922 by: Caldarale, Charles R
 214923 by: Christopher Schultz
 214924 by: André Warnier
 214925 by: john.ranaudo.thomsonreuters.com

Tuning garbage collection
 214926 by: laredotornado
 214930 by: Caldarale, Charles R

Deploying Web Application using Tomcat Manager
 214927 by: Fidelis Mnyanyi

Problems starting Tomcat on windows 7 64bit.
 214928 by: sharkanana
 214929 by: Caldarale, Charles R

Fire off asynch task in Tomcat.
 214931 by: Eric P
 214932 by: Padam J Singh

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: users@(protected)
To unsubscribe, e-mail: users-digest-unsubscribe@(protected)
For additional commands, e-mail: users-digest-help@(protected)

----------------------------------------------------------------------


Attachment: users_214920.ezm (zipped)
Our application has a Context Root of "DealsWeb". I need to be able to
map a different root path to this web application. For example:



This:

http://server.com/NASApp/DealSearch/DoSomethingServlet
<http://server.com/NASApp/DealSearch/DoSomethingServlet>



Needs to map to this:

http://server.com/DealsWeb/DoSomethingServlet
<http://server.com/DealsWeb/DoSomethingServlet>



I know how to use path mappings in one application but not across.



Thank you.



John


Attachment: users_214921.ezm (zipped)
Attachment: users_214922.ezm (zipped)
> From: john.ranaudo@(protected)
> [mailto:john.ranaudo@(protected)]
> Subject: How to map web app with different root paths?
>
> This:
> http://server.com/NASApp/DealSearch/DoSomethingServlet
> <http://server.com/NASApp/DealSearch/DoSomethingServlet>
>
> Needs to map to this:
> http://server.com/DealsWeb/DoSomethingServlet
> <http://server.com/DealsWeb/DoSomethingServlet>

Use the URL rewrite filter under either a dummy NASApp webapp or the ROOT webapp to forward or redirect the request to the desired URL.

http://www.tuckey.org/urlrewrite/

- 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.



Attachment: users_214923.ezm (zipped)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John,

(Let's try this again.)

On 7/21/2010 11:13 AM, john.ranaudo@(protected):
> > Our application has a Context Root of "DealsWeb". I need to be able to
> > map a different root path to this web application.
I feel like we just covered this in the last 24 hours or so. I can't
seem to find the thread, though.

> > For example:
> >
> > This:
> >
> > http://server.com/NASApp/DealSearch/DoSomethingServlet
> >
> > Needs to map to this:
> >
> > http://server.com/DealsWeb/DoSomethingServlet
> >
> > I know how to use path mappings in one application but not across.
How do you do it in a single application? If you use <servlet-mapping>,
then you're right: you can't map across webapps.

You can set up a fictional context, say, NASApp, that contains nothing
but redirects to the real app. You can use
http://www.tuckey.org/urlrewrite/ to map URL spaces from one to another.

Maybe something like this:

<rule>
<from>/DealSearch/(.*)</from>
<to type="redirect">/DealsWeb/$1</to>
</rule>

Note that the "NASApp" isn't mentioned because it's the context name. If
you have multiple contexts to map in this way, you could set up one
webapp/context for each of them, as above, or you could deploy a ROOT
webapp that intercepts them all. In that case, you'd need:

<rule>
<from>/NASApp/DealSearch/(.*)</from>
<to type="redirect">/DealsWeb/$1</to>
</rule>
<rule>
<from>/SomeOtherName/DealSearch/(.*)</from>
<to type="redirect">/DealsWeb/$1</to>
</rule>

etc.

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

iEYEARECAAYFAkxHPQ8ACgkQ9CaO5/Lv0PAUPwCgtZ17sNvrNvucm/sSGZg1exhj
rm4AoJVFu5qIvgy8kHaLwpYRzW+PiywT
=Q/kD
-----END PGP SIGNATURE-----


Attachment: users_214924.ezm (zipped)
Apart from the answers already provided by Chuck and Christopher, I wonder if a FAQ about
"proxying", "URL abstraction", "forwarding", "redirecting" etc.. and their differences
would not be useful ?
This kind of question seems to come so often that it would save time in the end if there
was just a link to point to.

Quick and dirty :

- a "redirect" is when the server sends a HTTP response to the browser saying "sorry, the
URL you requested is wrong, but the right one is *here* (with the correct URL).
The browser then (without even informing the user) immediately makes a new request to this
new URL.
Hint : the browser's URL bar, in that case, will show the new URL.
Advantage : the browser will also discard the old URL from its cache and history, and
cache the new one instead. The user may even notice, and request the correct URL right
away the next time.
Inconvenient : there is more traffic, because there is one request/response exchange for
nothing (original request -> 302 response from server -> new request from browser ->
server response to "correct" request)

- a "forward" (and also the concept of "URL abstraction") is when the server silently
rewrites the URL requested by the user, so that it will be processed by a different webapp
(or return a different static document) than the one that would appear to be implied by
the original request URL.
Hint : none, because the browser will think that the response comes for his original
request URL.
Advantage : there is no extra network traffic, and it is faster (at least for the client),
because it all remains internal to the server.
Inconvenient : the browser (and user) remain "stupid", in the sense that they will
continue to use the original URL, thinking it is correct.
(This may actually not be an inconvenient, if this is what the server admin wants)

- a "proxy" is when the server receives a request for a URL which appears "local", but
then silently behind the scene calls another server to provide the response.
The original server then reads the response from the background server and returns it to
the client as if it had made it up himself.
Advantages/Inconvenients : a bit vast to discuss here, but this is the basic mechanism for
something like load-balancing : a front-end server (with a single access point for the
clients) receives all requests, and intelligently distributes them to a number of
background servers, in function of the load, the type of request, or whatever.
The client keeps thinking that the responses come from the front-end server, so it keeps
talking to the front-end.



Attachment: users_214925.ezm (zipped)
Should be posted for sure in a FAQ.

Thanks all for the links. I think that should cover it.

-----Original Message-----
From: André Warnier [mailto:aw@(protected)]
Sent: Wednesday, July 21, 2010 3:04 PM
To: Tomcat Users List
Subject: Re: How to map web app with different root paths?

Apart from the answers already provided by Chuck and Christopher, I wonder if a FAQ about "proxying", "URL abstraction", "forwarding", "redirecting" etc.. and their differences would not be useful ?
This kind of question seems to come so often that it would save time in the end if there was just a link to point to.

Quick and dirty :

- a "redirect" is when the server sends a HTTP response to the browser saying "sorry, the URL you requested is wrong, but the right one is *here* (with the correct URL).
The browser then (without even informing the user) immediately makes a new request to this new URL.
Hint : the browser's URL bar, in that case, will show the new URL.
Advantage : the browser will also discard the old URL from its cache and history, and cache the new one instead. The user may even notice, and request the correct URL right away the next time.
Inconvenient : there is more traffic, because there is one request/response exchange for nothing (original request -> 302 response from server -> new request from browser -> server response to "correct" request)

- a "forward" (and also the concept of "URL abstraction") is when the server silently rewrites the URL requested by the user, so that it will be processed by a different webapp (or return a different static document) than the one that would appear to be implied by the original request URL.
Hint : none, because the browser will think that the response comes for his original request URL.
Advantage : there is no extra network traffic, and it is faster (at least for the client), because it all remains internal to the server.
Inconvenient : the browser (and user) remain "stupid", in the sense that they will continue to use the original URL, thinking it is correct.
(This may actually not be an inconvenient, if this is what the server admin wants)

- a "proxy" is when the server receives a request for a URL which appears "local", but then silently behind the scene calls another server to provide the response.
The original server then reads the response from the background server and returns it to the client as if it had made it up himself.
Advantages/Inconvenients : a bit vast to discuss here, but this is the basic mechanism for something like load-balancing : a front-end server (with a single access point for the
clients) receives all requests, and intelligently distributes them to a number of background servers, in function of the load, the type of request, or whatever.
The client keeps thinking that the responses come from the front-end server, so it keeps talking to the front-end.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)



Attachment: users_214926.ezm (zipped)

Hi,

I'm using Tomcat 6.0.26, Java 1.6 and wondering what tools/strategies you
use to tune your garbage collection parameters?

Further, does anyone know how to read entries in the garbage collection log?
Entries in my log look like

Desired survivor size 10944512 bytes, new threshold 1 (max 15)
[PSYoungGen: 129311K->3232K(136512K)] 558882K->434085K(585920K), 0.0090900
secs]

Thanks, - Dave
--
Sent from the Tomcat - User mailing list archive at Nabble.com.



Attachment: users_214930.ezm (zipped)
> From: laredotornado [mailto:laredotornado@(protected)]
> Subject: Tuning garbage collection
>
> I'm using Tomcat 6.0.26, Java 1.6 and wondering what
> tools/strategies you use to tune your garbage collection
> parameters?

Usually, just give the JVM as big a heap as will fit on your system with inducing paging, and let the GC algorithms figure out what to do with it. Second-guessing the GC usually ends up degrading performance, unless you're willing to do a lot of experimentation using the workloads you actually have. If you really want to play with it (and have a lot of spare time), start here:
http://java.sun.com/javase/technologies/hotspot/gc/index.jsp

In particular, look at this one:
http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html

Optimizing your webapps (and data base) almost always provides greater benefit that fiddling with GC settings.

> Further, does anyone know how to read entries in the garbage
> collection log?

See the above reference.

> Desired survivor size 10944512 bytes, new threshold 1 (max 15)

That says the survivor space is just under 11 MB, and objects will be moved to the survivor space after just one collection.

> [PSYoungGen: 129311K->3232K(136512K)] 558882K->434085K(585920K),

The young generation usage was 129 MB before the GC, 3 MB after, and the young gen could use up as much as 136 MB. The total heap usage was 558 MB, shrunk to 434 MB by the GC, and could reach a maximum of 585 MB.

> 0.0090900 secs]

The minor GC took just over 9 milliseconds.

- 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.



Attachment: users_214927.ezm (zipped)
Hi,

I'm using Tomcat 5.5.20 running on Windows 2008 Server.
I'm trying to use Tomcat Manager to undeploy and deploy web application without having to restart Tomcat.

I'm getting the following issues:

First issue, when undeploying web application, after first click on Undeploy button, the manager deletes war files only and leaves the application folder. If you click Undeploy button for the second time is when it deletes the application folder. My web application is under <TOMCAT_HOME>/webapps, the default.
I have tried to add antiJARLocking="true" and antiResourceLocking="true" to the context file under <TOMCAT_HOME>/conf/context.xml, but didn't solve my problem.

<Context antiJARLocking="true" antiResourceLocking="true">
......
</Context>

Second issue, when deploying application (remotely) using Tomcat Manager, it deploys WAR file on the default location <TOMCAT_HOME>/webapps , but doesn't create an application folder until I restart Tomcat.
I have tried to configure the host with unpackWARs=true and autoDeploy=true but didn't solve my problem either.

<Host name="localhost" debug="0" appBase="webapps"
              unpackWARs="true" autoDeploy="true">
    <Context path="" docBase="ROOT" debug="0"/>
    <Context path="/orders" docBase="/home/ian/orders" debug="0"
              reloadable="true" crossContext="true">
    </Context>
</Host>

Any help would be very much appreciated

Thanks,

Fidelis Mnyanyi

Attachment: users_214928.ezm (zipped)

I've run tomcat so many times before on every one of my computers with no
problem, but I just went to do it today on my desktop and am getting an
error immediately on the start of the server.

I have set catalina_home, classpath, java_home, jre_home, added jdk to path.

I have tried many different versions of tomcat and all give the same
problem.

Any ideas?

Here is the debug:

Jul 21, 2010 10:50:09 PM com.sun.org.apache.commons.digester.Digester
startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException:
org.apache.catalina.core.AprLifecycleListener
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass (URLClassLoader.java:190)
 at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:307)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:248)
 at
com.sun.org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
 at com.sun.org.apache.commons.digester.Rule.begin(Rule.java:200)
 at
com.sun.org.apache.commons.digester.Digester.startElement(Digester.java:1273)
 at
org.apache.catalina.util.CatalinaDigester.startElement (CatalinaDigester.java:105)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement (AbstractSAXParser.java:501)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement (AbstractXMLDocumentParser.java:179)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement (XMLDocumentFragmentScannerImpl.java:1343)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:511)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:808)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737)
 at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:119)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205)
 at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 at com.sun.org.apache.commons.digester.Digester.parse(Digester.java:1548)
 at org.apache.catalina.startup.Catalina.load (Catalina.java:526)
 at org.apache.catalina.startup.Catalina.load (Catalina.java:563)
 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.apache.catalina.startup.Bootstrap.load (Bootstrap.java:264)
 at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:401)
Jul 21, 2010 10:50:09 PM org.apache.catalina.startup.Catalina load
WARNING: Catalina.start:
java.lang.ClassNotFoundException:
org.apache.catalina.core.AprLifecycleListener
 at
com.sun.org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
 at
com.sun.org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
 at
com.sun.org.apache.commons.digester.Digester.startElement(Digester.java:1276)
 at
org.apache.catalina.util.CatalinaDigester.startElement (CatalinaDigester.java:105)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement (AbstractSAXParser.java:501)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement (AbstractXMLDocumentParser.java:179)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement (XMLDocumentFragmentScannerImpl.java:1343)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:511)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:808)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737)
 at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:119)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205)
 at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 at com.sun.org.apache.commons.digester.Digester.parse(Digester.java:1548)
 at org.apache.catalina.startup.Catalina.load (Catalina.java:526)
 at org.apache.catalina.startup.Catalina.load (Catalina.java:563)
 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.apache.catalina.startup.Bootstrap.load (Bootstrap.java:264)
 at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:401)
Caused by: java.lang.ClassNotFoundException:
org.apache.catalina.core.AprLifecycleListener
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass (URLClassLoader.java:190)
 at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:307)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:248)
 at
com.sun.org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
 at com.sun.org.apache.commons.digester.Rule.begin(Rule.java:200)
 at
com.sun.org.apache.commons.digester.Digester.startElement(Digester.java:1273)
 ... 21 more
Jul 21, 2010 10:50:09 PM com.sun.org.apache.commons.digester.Digester
startElement
SEVERE: Begin event threw exception
java.lang.ClassNotFoundException:
org.apache.catalina.core.AprLifecycleListener
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass (URLClassLoader.java:190)
 at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:307)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:248)
 at
com.sun.org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
 at com.sun.org.apache.commons.digester.Rule.begin(Rule.java:200)
 at
com.sun.org.apache.commons.digester.Digester.startElement(Digester.java:1273)
 at
org.apache.catalina.util.CatalinaDigester.startElement (CatalinaDigester.java:105)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement (AbstractSAXParser.java:501)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement (AbstractXMLDocumentParser.java:179)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement (XMLDocumentFragmentScannerImpl.java:1343)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:511)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:808)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737)
 at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:119)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205)
 at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 at com.sun.org.apache.commons.digester.Digester.parse(Digester.java:1548)
 at org.apache.catalina.startup.Catalina.load (Catalina.java:526)
 at org.apache.catalina.startup.Catalina.start (Catalina.java:583)
 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.apache.catalina.startup.Bootstrap.start (Bootstrap.java:301)
 at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:402)
Jul 21, 2010 10:50:09 PM org.apache.catalina.startup.Catalina load
WARNING: Catalina.start:
java.lang.ClassNotFoundException:
org.apache.catalina.core.AprLifecycleListener
 at
com.sun.org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
 at
com.sun.org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
 at
com.sun.org.apache.commons.digester.Digester.startElement(Digester.java:1276)
 at
org.apache.catalina.util.CatalinaDigester.startElement (CatalinaDigester.java:105)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement (AbstractSAXParser.java:501)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement (AbstractXMLDocumentParser.java:179)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement (XMLDocumentFragmentScannerImpl.java:1343)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next (XMLDocumentScannerImpl.java:648)
 at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument (XMLDocumentFragmentScannerImpl.java:511)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:808)
 at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse (XML11Configuration.java:737)
 at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse (XMLParser.java:119)
 at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse (AbstractSAXParser.java:1205)
 at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
 at com.sun.org.apache.commons.digester.Digester.parse(Digester.java:1548)
 at org.apache.catalina.startup.Catalina.load (Catalina.java:526)
 at org.apache.catalina.startup.Catalina.start (Catalina.java:583)
 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.apache.catalina.startup.Bootstrap.start (Bootstrap.java:301)
 at org.apache.catalina.startup.Bootstrap.main (Bootstrap.java:402)
Caused by: java.lang.ClassNotFoundException:
org.apache.catalina.core.AprLifecycleListener
 at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass (URLClassLoader.java:190)
 at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:307)
 at java.lang.ClassLoader.loadClass (ClassLoader.java:248)
 at
com.sun.org.apache.commons.digester.ObjectCreateRule.begin(ObjectCreateRule.java:252)
 at com.sun.org.apache.commons.digester.Rule.begin(Rule.java:200)
 at
com.sun.org.apache.commons.digester.Digester.startElement(Digester.java:1273)
 ... 21 more
Jul 21, 2010 10:50:09 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 0 ms
--
Sent from the Tomcat - User mailing list archive at Nabble.com.



Attachment: users_214929.ezm (zipped)
> From: sharkanana [mailto:sharkanana@(protected)]
> Subject: Problems starting Tomcat on windows 7 64bit.
>
> I have tried many different versions of tomcat and
> all give the same problem.

So tell us the exact version of *one* Tomcat you tried that has the problem, along with the JRE or JDK version you're using, how you installed Tomcat, and how you're starting it.

Just as a guess, it looks like you might be using a server.xml that doesn't come from the version of Tomcat you're trying to run. Try a fresh download and a clean installation and see if that works.

- 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.



Attachment: users_214931.ezm (zipped)
Hi all,

In my Tomcat app I'm looking for a good (or commonly used) method for firing off an asynchronous task. For example, a
user registers for an account, and an a task to send a verification email to the user is triggered w/o delaying the
response to the user (i.e., task happens in the background).

I'm somewhat aware that JMS could be used for this and is part of most J2E environments, but I'd like to see if there's
some way to pull this off w/vanilla Tomcat.

I had a couple ideas that would probably work, but I'd like to see how others have solved this problem.

One idea would be to insert a record into a database table that signifies an email should be sent to the user. This
table could be regularly checked by a scheduled job (e.g., a TimerTask) that runs every minute in the background.

Another (maybe not so good) idea would be to leverage perhaps a session or request attribute listener that would check
for a certain attribute being added to a session or requests. Then if a 'send email' attribute comes through, the
listener could process an email.  This seems like a bad idea though as I believe the listener event class would be
triggered incessantly any time attributes are added/removed when in fact I'm only actually interested in the 'send
email' attribute.

Anyway, I'm open to all ideas and appreciate you indulging me this far.

Eric P.


Attachment: users_214932.ezm (zipped)
Eric,

You can use a simple Consumer/Producer pattern here.

See the java.util.Queue classes. What I have done in a similar situation
is create a single Queue, multiple consumer threads all blocking on the
same queue. A user action puts something in the queue, and one of the
thread comes out of the blocked state to de-queue it and process the
request (which in your case would be sending the email).

Padam

On 22/07/10 10:28 AM, Eric P wrote:
> Hi all,
>
> In my Tomcat app I'm looking for a good (or commonly used) method for
> firing off an asynchronous task. For example, a user registers for an
> account, and an a task to send a verification email to the user is
> triggered w/o delaying the response to the user (i.e., task happens in
> the background).
>
> I'm somewhat aware that JMS could be used for this and is part of most
> J2E environments, but I'd like to see if there's some way to pull this
> off w/vanilla Tomcat.
>
> I had a couple ideas that would probably work, but I'd like to see how
> others have solved this problem.
>
> One idea would be to insert a record into a database table that
> signifies an email should be sent to the user. This table could be
> regularly checked by a scheduled job (e.g., a TimerTask) that runs
> every minute in the background.
>
> Another (maybe not so good) idea would be to leverage perhaps a
> session or request attribute listener that would check for a certain
> attribute being added to a session or requests. Then if a 'send
> email' attribute comes through, the listener could process an email.  
> This seems like a bad idea though as I believe the listener event
> class would be triggered incessantly any time attributes are
> added/removed when in fact I'm only actually interested in the 'send
> email' attribute.
>
> Anyway, I'm open to all ideas and appreciate you indulging me this far.
>
> Eric P.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@(protected)
> For additional commands, e-mail: users-help@(protected)
>
>

©2008 junlu.com - Jax Systems, LLC, U.S.A.