Re: Different webapp paths on different hosts

2013-01-25 Thread Casper Wandahl Schmidt

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 25-01-2013 06:38, bxqdev skrev:



On 1/24/2013 11:52 AM, Casper Wandahl Schmidt wrote:

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 24-01-2013 02:32, Christopher Schultz skrev:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:

i need to map a custom paths, like /path1 and /path2, (not root
/ path), of the same webapp to a custom domains.

as i said i need this mapping: ${samewebapp}/path1 is mapped to
http://path1.com/ ${samewebapp}/path2 is mapped to
http://path2.com/

NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2

What is ${samewebpp}/path1? Is that a piece of a webapp?

Do you care if the same webapp is deployed twice (which is probably
going to be required)?
Actually the OP is not really clear in describing anything. I'm 
wondering if path1 in http://path1.com equals path1 in the

/path1 part or not.


actually the path names and domain names should be able to be different



Anyway I would say a context.xml file in conf/catalina/path1 (the 
hostname)/path1.xml (the context name) should do the trick?
Place the webapp outside the appbase of the hosts and then point the 
docbase to the webapp (or just drop the .war with two

different names in the appbases of the two hosts) :)


i want to have one instance of webapp,
which has two paths,
and each of the paths serves the root of different domains

once again:
* one webapp
* has 2 different paths: /path1 and /path2
* served on 2 domains
* when user goes to http://path1.com/ - {webapp}/path1 is served as 
root path
* when user goes to http://path2.com/ - {webapp}/path2 is served as 
root path


is it possible?
To me it doesn't make sense to say that the webapp has two different 
paths, /path1 and path2, and then say the webapp is to be served as root 
from two different hosts. I guess it's simply a case of bad terminology :)


Anyway. What you are trying to do is make the same webapp answer both 
domain1.com/ and domain2.com/ right? If so you can simply deploy the 
webapp as ROOT. The webapp will then answer on all domains pointing to 
the server. If this is not what you want, you can set up a virtual host 
in server.xml with an appbase outside the webapps folder (eg. 
$CATALINA_BASE (or is it HOME?)$\domain1 and then use the Alias 
element to specify the second domain as an alias for the first (which 
you set as an attribute in the Host element).




- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Different webapp paths on different hosts

2013-01-25 Thread Konstantin Kolinko
2013/1/25 bxqdev bxq...@themailbay.com:

 Anyway I would say a context.xml file in conf/catalina/path1 (the
 hostname)/path1.xml (the context name) should do the trick?
 Place the webapp outside the appbase of the hosts and then point the
 docbase to the webapp (or just drop the .war with two
 different names in the appbases of the two hosts) :)


 i want to have one instance of webapp,
 which has two paths,
 and each of the paths serves the root of different domains

 once again:
 * one webapp
 * has 2 different paths: /path1 and /path2
 * served on 2 domains
 * when user goes to http://path1.com/ - {webapp}/path1 is served as root
 path
 * when user goes to http://path2.com/ - {webapp}/path2 is served as root
 path

 is it possible?


Two different instances of the same webapp at different hosts - easy.
E.g. the manager webapp is deployed in such way to the virtual hosts.

One instance mapped to different paths - impossible. What value should
be returned by javax.servlet.ServletContext.getContextPath() ?

Thought it is possible to apply urlrewriting, either at HTTPD or at Tomcat.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Load properties file from Tomcat directory

2013-01-25 Thread Konstantin Kolinko
2013/1/25 Justin Rosenberg rosenbe...@crlcorp.com:
 Is there a to load a properties file that is dropped in the
 ${catalina.base}/lib directory?



 When I try the following it returns null:

 MyClass.class.getResourceAsStream(PROPERTY_FILE_NAME)

You should beware of the difference between  Class.getResource() and
ClassLoader.getResource().


 I realize I can do the following, but I don't want the code to be server
 specific:

 props.load(new File(System.getProperty(catalina.base) + /lib/ +
 PROPERTY_FILE_NAME).toURL().openStream());


You can make the path configurable with an init-param in your context.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Comet problem - HTTP method GET is not supported by this URL

2013-01-25 Thread Konstantin Kolinko
2013/1/22 Andrew Winter andrewcwin...@gmail.com:
 I am trying to implement a Comet process.
 Tomcat 6.0.36
 Red Hat Enterprise Linux Server release 6.2 (Santiago)
 Java 7u11 (32 bit)

 I have implemented CometProcessor.  I am using the NIO connector.
 When I try the servlet I get: HTTP method GET is not supported by this URL
 Am I doing something wrong?

 Thanks!

 Code snippet:

 public class ConsolidatedActionCenterPush extends HttpServlet  implements
 CometProcessor,CAC{

   private static MessageSender messageSender = null;

static ??

   private static final Integer TIMEOUT = 600 * 1000;

   @Override
   public void destroy() {
 messageSender.stop();
 messageSender = null;

This would break if there is more than 1 instance of your servlet.

   }


What filters do you have in the request processing chain for this
servlet? Do they support Comet? (I do not remember whether it is
important for Comet. Just guessing).

You can use new Exception().printStackTrace() to check what valves
and filters are active for you.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat6+webapps+log4j

2013-01-25 Thread Konstantin Kolinko
2013/1/24 Tiago Sousa tiago-a-so...@ext.ptinovacao.pt:
 Hello to all.

 I have tomcat 6

Which version?
Did you install it from a zip file downloaded from tomcat.apache.org?

 using JULI for logging (logging.properties in conf dir) plus
 several webapps using its own log4j.properties.

 I need to centralized all the logs so i thought to put a global/shared
 log4j.properties in $CATALINA_BASE\lib so that tomcat and each webapp can be
 controlled through this file.

OK, but make sure that all jars are in their proper places. Sometimes
people read the doc incorrectly.

http://tomcat.apache.org/tomcat-6.0-doc/logging.html


 The problem i'm facing is that no logs are produced.

 At this time i'm trying to configure just TOMCAT, no webapps, to log through
 log4j but still no logs are produced. I've folowed the tutorial in Apache
 logging webpage with the standard log4j.properties. No logs in
 $CATALINA_BASE\logs.


Which tutorial did you follow?

Did you configure them to be written to ${catalina.base}/logs ?
Maybe it tries to write them elsewhere?

Is the file readable?

 Can you help me saying what mistakes i am doing in this basic configuration
 (tomcat and no apps)?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Fw: Can not understand how maxThreads of Connectors works

2013-01-25 Thread Hermes Flying
I am using the correct server.xml.
In the version 5.5.36 the maxThreads of 0 has no effect due to this code in 
org.apache.tomcat.util.net.PoolTcpEndpoint


 public void setMaxThreads(int maxThreads) {
    if( maxThreads  0)
        tp.setMaxThreads(maxThreads);
    }

So what I observe is correct. I.e. with 0 there is no error and also my web 
application works fine since it defaults to 200 threads.
Will check this out in Tomcat 6






 From: Christopher Schultz ch...@christopherschultz.net
To: Tomcat Users List users@tomcat.apache.org 
Sent: Thursday, January 24, 2013 9:09 PM
Subject: Re: Fw: Can not understand how maxThreads of Connectors works
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

André,

On 1/24/13 12:14 PM, André Warnier wrote:
 Now, considering this, there are a number of possibilities : - the
 documentation is totally wrong - there is a bug in Tomcat - your
 Tomcat server is not using this server.xml - or, it being rather
 unlikely that processing 0 requests is what a normal user would
 want, the Tomcat developers have coded this so that an obviously
 nonsensical value of 0 would result in the default (of 200) being
 applied.

That last one is not true: the code will happily accept maxThreads=0
but then will throw an exception when the connector tries to actually
start its Executor.

I suspect Hermes is editing some unrelated server.xml file: his
observations seem totally in-line with that hypothesis.

Hermes, try modifying your server.xml file to be syntactically
incorrect. For example, put a !-- into the middle of the file and
try to start Tomcat. If it still starts, you are editing the wrong file.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEBhv8ACgkQ9CaO5/Lv0PDUWgCfWY/BUyhl4rQkZUC19SNB2P72
sckAn2dZwfEd7uVZz6eg0HuPmuZC81j6
=YVBj
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: Loading a DeSerialized Class to WebabbClassLoader Question

2013-01-25 Thread Peter Lavin

Hi again Chris, comments below

On 01/24/2013 07:05 PM, Christopher Schultz wrote:

What if you try this:

ClassLoader contextClassLoader =
Thread.currentThread().getContextClassLoader();

FileClassLoader cl = new FileClassLoader(contextClassLoader);

Class?  spClass = cl.arrayToClass(null, byArray, True);

Thread.currentThread().setContextClassLoader(cl);

Tomcat changes the context ClassLoader all the time, and you'll want
your ClassLoaders to remember previously-loaded classes, so this isn't
a great solution in general.

That's why I suggested that you use a loader configured in
context.xml: that will let you define your own ClassLoader where you
can call arrayToClass at any point and not have to set the context
ClassLoader all the time.

If you've got something working and you're happy, then there's nothing
left to do. If it were me, I'd use a custom Loader for my webapp and
use Java's ObjectInputStream.


This failed in much the same way as before. Like you say :-) what I have 
is working and will suffice for the time being, thanks for your help. I 
will look in to using context.xml later maybe.


regards
Peter





--
with best regards,
Peter Lavin,
PhD Candidate,
CAG - Computer Architecture  Grid Research Group,
Lloyd Institute, 005,
Trinity College Dublin, Ireland.
+353 1 8961536

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat6+webapps+log4j

2013-01-25 Thread Tiago Sousa

Hi.

Thanks for your reply.
My answers follows below.


Em 25/01/2013 08:59, Konstantin Kolinko escreveu:

2013/1/24 Tiago Sousa tiago-a-so...@ext.ptinovacao.pt:

Hello to all.

I have tomcat 6

Which version?

I'm using tomcat 6.0.16.

Did you install it from a zip file downloaded from tomcat.apache.org?

Yes, i installed using a zip file downloaded from tomcat.apache.org.


using JULI for logging (logging.properties in conf dir) plus
several webapps using its own log4j.properties.

I need to centralized all the logs so i thought to put a global/shared
log4j.properties in $CATALINA_BASE\lib so that tomcat and each webapp can be
controlled through this file.
OK, but make sure that all jars are in their proper places. Sometimes
people read the doc incorrectly.

http://tomcat.apache.org/tomcat-6.0-doc/logging.html

Ok, i think i've done it, namely:

 * Put|log4j.jar|and|tomcat-juli-adapters.jar|from extras
   into|$CATALINA_HOME/lib|.
 * Replace|$CATALINA_HOME/bin/tomcat-juli.jar|with|tomcat-juli.jar|from
   extras.


The problem i'm facing is that no logs are produced. At this time i'm 
trying to configure just TOMCAT, no webapps, to log through log4j but 
still no logs are produced. I've folowed the tutorial in Apache logging 
webpage with the standard log4j.properties. No logs in $CATALINA_BASE\logs.

Which tutorial did you follow?

The one you mentioned: http://tomcat.apache.org/tomcat-6.0-doc/logging.html


Did you configure them to be written to ${catalina.base}/logs ?
Maybe it tries to write them elsewhere?
It is configured in its standard version ( 
http://tomcat.apache.org/tomcat-6.0-doc/logging.html), which i am using.


Is the file readable?

There is no file, tomcat does not create one and that is my problem.


Can you help me saying what mistakes i am doing in this basic configuration
(tomcat and no apps)?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


thanks again.

Tiago



Re: Fw: Can not understand how maxThreads of Connectors works

2013-01-25 Thread André Warnier

Hermes Flying wrote:

I am using the correct server.xml.
In the version 5.5.36 the maxThreads of 0 has no effect due to this code in 
org.apache.tomcat.util.net.PoolTcpEndpoint


 public void setMaxThreads(int maxThreads) {
if( maxThreads  0)
tp.setMaxThreads(maxThreads);
}

So what I observe is correct. I.e. with 0 there is no error and also my web 
application works fine since it defaults to 200 threads.
Will check this out in Tomcat 6



On Jan 16, you wrote this :

Hermes Flying wrote:
 Hi,
 I am using Tomcat 6 (I think it is version 33 but will double check)
 And JVM is Java 6 from IBM
 Do you need exact versions?


And you haven't provided any other version number since then.

So why are you quoting Tomcat 5.5.36 code above ?
Do you actually enjoy confusing people on this list and causing them to uselessly spend 
time answering your questions and trying to reproduce the symptoms which you indicate ?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Fw: Can not understand how maxThreads of Connectors works

2013-01-25 Thread Mark Thomas
 On Jan 16, you wrote this :
 
 Hermes Flying wrote:
 Hi,
 I am using Tomcat 6 (I think it is version 33 but will double check)
 And JVM is Java 6 from IBM
 Do you need exact versions?

 
 And you haven't provided any other version number since then.
 
 So why are you quoting Tomcat 5.5.36 code above ?
 Do you actually enjoy confusing people on this list and causing them to
 uselessly spend time answering your questions and trying to reproduce
 the symptoms which you indicate ?

+1

The behaviour in 6.0.x is significantly different to that of 5.5.x.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Unexpected poller error

2013-01-25 Thread Vishal-sh Sharma
Hi Chris,

Thanks for prompt reply. I am no java developer so gave me good lead.

I compared the Poll.java in  tomcat source ( 7.0.35 src ) with 
tomcat-native-1.1.24-src

diff apache-tomcat-7.0.35-src/java/org/apache/tomcat/jni/Poll.java   
tomcat-native-1.1.24-src/jni/java/org/apache/tomcat/jni/Poll.java

23c23
  * @version $Id: Poll.java 1349932 2012-06-13 15:59:02Z markt $
---
  * @version $Revision: 1144906 $, $Date: 2011-07-10 19:12:19 +0200 (Sun, 10 
 Jul 2011) $
76,77c76,80
  * Add a socket to a pollset with the default timeout.
  * @param pollset The pollset to which to add the socket
---
  * Add a socket or to a pollset
  * If you set client_data in the descriptor, that value
  * will be returned in the client_data field whenever this
  * descriptor is signaled in apr_pollset_poll().
  * @param pollset The pollset to which to add the descriptor
83,92d85

 /**
  * Add a socket to a pollset with a specific timeout.
  * @param pollset The pollset to which to add the socket
  * @param sock The sockets to add
  * @param reqevents requested events
  * @param timeout requested timeout in microseconds (-1 for infinite)
  */
 public static native int addWithTimeout(long pollset, long sock,
 int reqevents, long timeout);



Looks like that in latest version of  native library , the addWithTimeout 
function is missing.
The C counterpart indeed is present in the native library.

Does it make sense to copy the Poll.java from the tomcat src to native library 
and build the native library??

Thanks,
Vishal







From: Christopher Schultz [ch...@christopherschultz.net]
Sent: Thursday, January 24, 2013 7:00 PM
To: Tomcat Users List
Subject: Re: Unexpected poller error

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Vishal,

On 1/24/13 8:47 AM, Vishal-sh Sharma wrote:
 I get the following error in catalina.log when i connect the
 tomcat server over http. However https works fine.

 24-Jan-2013 13:06:48.505 SEVERE [http-apr-11831-Poller-0]
 org.apache.tomcat.util.net.AprEndpoint$Poller.run Unexpected poller
 error java.lang.NoSuchMethodError:
 org.apache.tomcat.jni.Poll.addWithTimeout(JJIJ)I at
 org.apache.tomcat.util.net.AprEndpoint$Poller.run(AprEndpoint.java:1287)

That

method certainly is defined in Poll.java:91 in Tomcat 7.0.x trunk:

public static native int addWithTimeout(long pollset, long sock,
int reqevents, long timeout);

native/src/poll.c has it, too:

TCN_IMPLEMENT_CALL(jint, Poll, addWithTimeout)(TCN_STDARGS, jlong pollset,
   jlong socket, jint
reqevents,
   jlong socket_timeout)

Since you aren't getting a linkage error of some kind, this seems to
be a Java-related problem (and not a native problem). If the method
was missing from the native library, you'd get UnsatisfiedLinkError.

Are you sure you have a clean Tomcat install?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEBhLoACgkQ9CaO5/Lv0PC+4ACfcp2sNSbR82N81AKQIFgBT5E5
jmYAoIcK7r49ZrK98Bqns3LNdG9SKSy3
=sa47
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and delete this e-mail. Any unauthorized copying, 
disclosure or distribution of the material in this e-mail is strictly forbidden.

Please refer to http://www.db.com/en/content/eu_disclosures.htm for additional 
EU corporate and regulatory disclosures.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Comet problem - HTTP method GET is not supported by this URL

2013-01-25 Thread Andrew Winter
 I am trying to implement a Comet process.
  Tomcat 6.0.36
  Red Hat Enterprise Linux Server release 6.2 (Santiago)
  Java 7u11 (32 bit)
 
  I have implemented CometProcessor.  I am using the NIO connector.
  When I try the servlet I get: HTTP method GET is not supported by this
 URL
  Am I doing something wrong?
 
  Thanks!
 
  Code snippet:
 
  public class ConsolidatedActionCenterPush extends HttpServlet  implements
  CometProcessor,CAC{
 
private static MessageSender messageSender = null;

 static ??


private static final Integer TIMEOUT = 600 * 1000;
 
@Override
public void destroy() {
  messageSender.stop();
  messageSender = null;

 This would break if there is more than 1 instance of your servlet.


Thank you for drawing my attention to this potential issue.  Perhaps I need
to verify an assumption of mine: I am thinking that since I am not using a
distributed environment there will only be one instance of this servlet.
 If you want the long story: This is an intranet application and this piece
is used for sending messages to the users. As such there are other threads
that use the static methods to add messages.  In the past when I had the
clients polling on an interval it would not have mattered if an instance
came or went. I will reconsider what I have done here.


 What filters do you have in the request processing chain for this
 servlet? Do they support Comet? (I do not remember whether it is
 important for Comet. Just guessing).

 You can use new Exception().printStackTrace() to check what valves
 and filters are active for you.


Thank you so much!  Looking at my stack trace I saw something that made me
suspicious.  The invoker servlet.  I needed this as we have an mountain of
servlets that have always been called via the package name in the URL.
 Once I removed this the Comet functionality worked!  So I guess I will be
mapping a lot of servlets in the days to come, but it works so cool.


Re: Different webapp paths on different hosts

2013-01-25 Thread Shanti Suresh
On Fri, Jan 25, 2013 at 3:29 AM, Konstantin Kolinko
knst.koli...@gmail.comwrote:

 2013/1/25 bxqdev bxq...@themailbay.com:
 
  Anyway I would say a context.xml file in conf/catalina/path1 (the
  hostname)/path1.xml (the context name) should do the trick?
  Place the webapp outside the appbase of the hosts and then point the
  docbase to the webapp (or just drop the .war with two
  different names in the appbases of the two hosts) :)
 


When we do this method, a separate web-application is spawned for each
context.  The common web-application and also all it's jars are not
shared.  You would need to adjust PermGen - basically hike it up
appropriately.  We have a similar situation.  We used this approach of
putting webapp outside appbase and pointing docbase to it for each context
within individual context.xml files.  The reason we did this was because we
have another default webapp serving as the root context.  This is a
solution we would like to avoid.

I would like to seek advice on how we might use a non-default webapp
serving multiple contexts, but yet have a single copy of the application's
classes and it's libraries being loaded into PermGen.


 
  i want to have one instance of webapp,
  which has two paths,
  and each of the paths serves the root of different domains
 
  once again:
  * one webapp
  * has 2 different paths: /path1 and /path2
  * served on 2 domains
  * when user goes to http://path1.com/ - {webapp}/path1 is served as
 root
  path
  * when user goes to http://path2.com/ - {webapp}/path2 is served as
 root
  path
 
  is it possible?
 

 Two different instances of the same webapp at different hosts - easy.
 E.g. the manager webapp is deployed in such way to the virtual hosts.


Sorry, I'm not understanding what you propose.  Would this method also
share the application and all classes among the different contexts?

One instance mapped to different paths - impossible. What value should
 be returned by javax.servlet.ServletContext.getContextPath() ?




 Thought it is possible to apply urlrewriting, either at HTTPD or at Tomcat.


I have wanted to try this way out but haven't gotten around to it.  I
believe this method would share a single copy of the non-default web
application, am I correct?

Thanks!

   -Shanti


Re: Fw: Can not understand how maxThreads of Connectors works

2013-01-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hermes,

On 1/25/13 4:16 AM, Hermes Flying wrote:
 I am using the correct server.xml. In the version 5.5.36 the 
 maxThreads of 0 has no effect due to this code in 
 org.apache.tomcat.util.net.PoolTcpEndpoint

You said you were using Tomcat 6. Now you say you are using Tomcat
5.5.36. This is why I asked (long ago) to give us exact versions.

 So what I observe is correct. I.e. with 0 there is no error and
 also my web application works fine since it defaults to 200
 threads. Will check this out in Tomcat 6

Maybe then we'll finally be on the same page.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC3kIACgkQ9CaO5/Lv0PBZUQCfWTYi3fmEi45N+wWGCVqz+yGf
4ZUAn1CdzM0CexovENDj3YJBhYCa1JIG
=Gc1n
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Unexpected poller error

2013-01-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Vishal,

On 1/25/13 6:11 AM, Vishal-sh Sharma wrote:
 Thanks for prompt reply. I am no java developer so gave me good 
 lead.
 
 I compared the Poll.java in  tomcat source ( 7.0.35 src ) with 
 tomcat-native-1.1.24-src
 
 diff apache-tomcat-7.0.35-src/java/org/apache/tomcat/jni/Poll.java 
 tomcat-native-1.1.24-src/jni/java/org/apache/tomcat/jni/Poll.java

That's not a valid comparison, unfortunately. For some reason, Java code
remains tucked-away in the tcnative project but it is no longer used (or
shouldn't be). Tomcat includes in its standard distribution everything
you need to use tcnative.

Did you manually compile the Java portion of tcnative? If so, please
remove whatever JAR file you produced from that procedure and re-run
your tests.

 Looks like that in latest version of  native library , the 
 addWithTimeout function is missing. The C counterpart indeed
 is present in the native library.
 
 Does it make sense to copy the Poll.java from the tomcat src to 
 native library and build the native library??

No, you should simply ignore all the Java code in the tcnative
distribution.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC3tcACgkQ9CaO5/Lv0PDiZACfQIeeJflrmyB3/oJVwAtN9lA+
grUAn2LP8TrFL7iAIh0ftldIilaIZCFT
=JdKl
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat6+webapps+log4j

2013-01-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Tiago,

On 1/25/13 4:45 AM, Tiago Sousa wrote:
 Em 25/01/2013 08:59, Konstantin Kolinko escreveu:
 2013/1/24 Tiago Sousa tiago-a-so...@ext.ptinovacao.pt:
 Hello to all.
 
 I have tomcat 6
 Which version?
 I'm using tomcat 6.0.16.
 Did you install it from a zip file downloaded from
 tomcat.apache.org?
 Yes, i installed using a zip file downloaded from
 tomcat.apache.org.
 
 using JULI for logging (logging.properties in conf dir) plus 
 several webapps using its own log4j.properties.
 
 I need to centralized all the logs so i thought to put a
 global/shared log4j.properties in $CATALINA_BASE\lib so that
 tomcat and each webapp can be controlled through this file. OK,
 but make sure that all jars are in their proper places.
 Sometimes people read the doc incorrectly.
 
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html
 Ok, i think i've done it, namely:
 
 * Put|log4j.jar|and|tomcat-juli-adapters.jar|from extras 
 into|$CATALINA_HOME/lib|. *
 Replace|$CATALINA_HOME/bin/tomcat-juli.jar|with|tomcat-juli.jar|from

 
extras.
 
 
 The problem i'm facing is that no logs are produced. At this time
 i'm trying to configure just TOMCAT, no webapps, to log through
 log4j but still no logs are produced. I've folowed the tutorial in
 Apache logging webpage with the standard log4j.properties. No logs
 in $CATALINA_BASE\logs.
 Which tutorial did you follow?
 The one you mentioned:
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html
 
 Did you configure them to be written to ${catalina.base}/logs
 ? Maybe it tries to write them elsewhere?
 It is configured in its standard version ( 
 http://tomcat.apache.org/tomcat-6.0-doc/logging.html), which i am
 using.
 
 Is the file readable?
 There is no file, tomcat does not create one and that is my
 problem.

I think Konstantin meant is the config file readable or perhaps is
the logs/ directory writable. Of course, all permissions must be
relative to the effective uid running Tomcat.

Check catalina.out. If you don't have a log4j.properties file (or
similar) available, I believe you'll get a message on stdout saying
You haven't configured log4j properly and you won't get any further
log messages anywhere.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC330ACgkQ9CaO5/Lv0PBrVQCfb9A0KMGRe0aoqRSeYrHT1WNx
0lwAn3ed8h09a7fv7Vg4jCgerDUrPFD1
=G3j0
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Fw: Can not understand how maxThreads of Connectors works

2013-01-25 Thread Hermes Flying
Hi,
I actually deploy in 2 servers one in 6 and one in 5. I noticed the same 
behavior described (that was not believed).
I did not aim in taking anyone's time.
All I wanted to do is verify the functionality using really small values.
In a previous mail it was written by someone that he tested this in 6 and he 
said the browser stuck.
I did not notice that.





 From: Christopher Schultz ch...@christopherschultz.net
To: Tomcat Users List users@tomcat.apache.org 
Sent: Friday, January 25, 2013 9:34 PM
Subject: Re: Fw: Can not understand how maxThreads of Connectors works
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Hermes,

On 1/25/13 4:16 AM, Hermes Flying wrote:
 I am using the correct server.xml. In the version 5.5.36 the 
 maxThreads of 0 has no effect due to this code in 
 org.apache.tomcat.util.net.PoolTcpEndpoint

You said you were using Tomcat 6. Now you say you are using Tomcat
5.5.36. This is why I asked (long ago) to give us exact versions.

 So what I observe is correct. I.e. with 0 there is no error and
 also my web application works fine since it defaults to 200
 threads. Will check this out in Tomcat 6

Maybe then we'll finally be on the same page.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC3kIACgkQ9CaO5/Lv0PBZUQCfWTYi3fmEi45N+wWGCVqz+yGf
4ZUAn1CdzM0CexovENDj3YJBhYCa1JIG
=Gc1n
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Re: Fw: Can not understand how maxThreads of Connectors works

2013-01-25 Thread Mark Thomas
On 25/01/2013 19:58, Hermes Flying wrote:
 Hi, I actually deploy in 2 servers one in 6 and one in 5. I noticed
 the same behavior described (that was not believed). I did not aim
 in taking anyone's time. All I wanted to do is verify the
 functionality using really small values. In a previous mail it was
 written by someone that he tested this in 6 and he said the browser
 stuck. I did not notice that.

Exact Tomcat version. Exact connector configuration...

This is getting tiresome.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Different webapp paths on different hosts

2013-01-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Dude,

On 1/25/13 12:38 AM, bxqdev wrote:
 i want to have one instance of webapp,

No problem.

 which has two paths,

Problem: one context = one path = one instance

If you want two separate paths, you need two separate contexts.

 and each of the paths serves the root of different domains

That just doesn't make any sense. The root of a domain is, by
definition, / (contextPath=), so there aren't any other paths to
consider.

 once again: * one webapp * has 2 different paths: /path1 and
 /path2 * served on 2 domains * when user goes to
 http://path1.com/ - {webapp}/path1 is served as root path * when
 user goes to http://path2.com/ - {webapp}/path2 is served as root
 path
 
 is it possible?

What you are saying is nonsensical (specifically, the part where you
say that you want /path1 to be mapped to root.

If you want two virtual hosts, then define two virtual hosts. If you
want an app on each host configured as ROOT, then make your two
virtual hosts have two separate appBase directories (which should be a
requirement in the first place of two virtual hosts) and toss a copy
of your WAR file in each appBase, both named ROOT.war (cApITaLS matter).

You can't deploy a single copy (in memory) of your webapp and expect
to get all your requirements above met. If you want to have a single
WAR file on the disk and deploy it multiple times, you *can* do that
but I'm not sure why anyone would want to.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC85cACgkQ9CaO5/Lv0PCsDACfYWSxsHAgIoFRDWPNGd+O3FvN
mtsAnji32K1aEfpIZPv0gRQWgvoV4Hnc
=RC5B
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



jsp:getProperty not working

2013-01-25 Thread Benin Technologies

Hi,

I'm new to Tomcat/JSP

I have a JSP page that instantiates a bean, then it access the bean 
through a scriptlet, it works fine. But when I replace the scriptlet by 
a jsp:getProperty.. tag, it doesn't work


Take my code below :
%= employee.getFirstName() % IS WORKING, it displays the employee's 
firstname
jsp:getProperty name=employee property=firstName /  IS NOT 
WORKING, displays nothing


any idea why ?



jsp:useBean id=employee class=org.company.beans.EmployeeBean 
scope=request /

htmlbody
%
VectorEmployeeBean v =(VectorEmployeeBean)request.getAttribute(list);
Iterator i = v.iterator();
int j = 0;
while (i.hasNext()) {
employee = (EmployeeBean)i.next();
%

%= employee.getFirstName() %  
  WORKS
jsp:getProperty name=employee property=firstName / DOESN'T 
WORK !! WHY ?


%
}
%
/body/html


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: jsp:getProperty not working

2013-01-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

To whom it may concern,

On 1/25/13 6:56 PM, Benin Technologies wrote:
 I'm new to Tomcat/JSP
 
 I have a JSP page that instantiates a bean, then it access the
 bean through a scriptlet, it works fine. But when I replace the
 scriptlet by a jsp:getProperty.. tag, it doesn't work
 
 Take my code below : %= employee.getFirstName() % IS WORKING, it
 displays the employee's firstname jsp:getProperty name=employee
 property=firstName /  IS NOT WORKING, displays nothing
 
 any idea why ?

Can you give us the interface for EmployeeBean? Perhaps firstName
isn't a proper Java Beans property and so it can't be properly
detected, while EmployeeBean.getFirstName works just fine.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEDLRsACgkQ9CaO5/Lv0PC8awCfTPG1cu31z0RwYeolkR+TbHy6
/TQAniNRX2HjsPZhHyZ3EcH+2zjHHeBF
=FOIU
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: jsp:getProperty not working

2013-01-25 Thread Benin Technologies

thanks for your reply

below my EmployeeBean source code

package org.company.beans;

public class EmployeeBean {
private int id;
private StringfirstName,
lastName,
email,
department;

public EmployeeBean(int id) {
this.id = id;
firstName = ;
lastName = ;
email = ;
department = ;
}

public EmployeeBean() {
this(0);
}

public int getId() {
return id;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return firstName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return lastName;
}

public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}

public void setDepartment(String department) {
this.department = department;
}
public String getDepartment() {
return department;
}
}

Le 26/01/2013 02:10, Christopher Schultz a écrit :

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

To whom it may concern,

On 1/25/13 6:56 PM, Benin Technologies wrote:

I'm new to Tomcat/JSP

I have a JSP page that instantiates a bean, then it access the
bean through a scriptlet, it works fine. But when I replace the
scriptlet by ajsp:getProperty.. tag, it doesn't work

Take my code below :%= employee.getFirstName() %  IS WORKING, it
displays the employee's firstnamejsp:getProperty name=employee
property=firstName /   IS NOT WORKING, displays nothing

any idea why ?

Can you give us the interface for EmployeeBean? Perhaps firstName
isn't a proper Java Beans property and so it can't be properly
detected, while EmployeeBean.getFirstName works just fine.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEDLRsACgkQ9CaO5/Lv0PC8awCfTPG1cu31z0RwYeolkR+TbHy6
/TQAniNRX2HjsPZhHyZ3EcH+2zjHHeBF
=FOIU
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Best way to log requests from a servlet and to a database?

2013-01-25 Thread Hassan Schroeder
On Fri, Jan 25, 2013 at 6:00 PM, Brian Braun brianbr...@gmail.com wrote:

 What I need is to be able to accept as much HTTP requests as possible, to
 log every one of them as fast as possible (not syncronously), and to make
 everything fast and with a very low usage of RAM when MySQL gets slow and
 inserts need to queue. I think I need some kind of queue to buffer the
 entries when the speed of http request is higher than the speed of
 insertions in the database log.

 3- Using some kind of any other framework that specializes in this?

http://aws.amazon.com/sqs/

Let us know how that works out if you try it  :-)

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Best way to log requests from a servlet and to a database?

2013-01-25 Thread Brian Braun
Hi Hassan,

I forgot to mention that I am already using Amazon's cloud (EC2+load
balancer) so I love to see a suggestion that mentions it! I will definitely
check your advice. The problem is that it costs money to use it, and I
would love to just use some kind of framework that uses my own RAM to host
a buffer/queue. However, creating my own queue would not escalate to
hundreds or thousands of requests per second, so considering that I was
already considering some kind of queue service and actually I thought about
Amazon's. but I did it while sleeping so I forgot to mention it in my
list  :-)
Thanks again for your suggestion!



On Fri, Jan 25, 2013 at 9:32 PM, Hassan Schroeder 
hassan.schroe...@gmail.com wrote:

 On Fri, Jan 25, 2013 at 6:00 PM, Brian Braun brianbr...@gmail.com wrote:

  What I need is to be able to accept as much HTTP requests as possible, to
  log every one of them as fast as possible (not syncronously), and to make
  everything fast and with a very low usage of RAM when MySQL gets slow and
  inserts need to queue. I think I need some kind of queue to buffer the
  entries when the speed of http request is higher than the speed of
  insertions in the database log.

  3- Using some kind of any other framework that specializes in this?

 http://aws.amazon.com/sqs/

 Let us know how that works out if you try it  :-)

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 http://about.me/hassanschroeder
 twitter: @hassan

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Best way to log requests from a servlet and to a database?

2013-01-25 Thread Brian Braun
OK, Amazon's solution would be too expensive to use as a first option. I
would like to use it but just after a first queue is full. This first queue
would be something running in my own host, using RAM to host the buffer.
Any ideas on how to create this?

On Fri, Jan 25, 2013 at 9:44 PM, Brian Braun brianbr...@gmail.com wrote:

 Hi Hassan,

 I forgot to mention that I am already using Amazon's cloud (EC2+load
 balancer) so I love to see a suggestion that mentions it! I will definitely
 check your advice. The problem is that it costs money to use it, and I
 would love to just use some kind of framework that uses my own RAM to host
 a buffer/queue. However, creating my own queue would not escalate to
 hundreds or thousands of requests per second, so considering that I was
 already considering some kind of queue service and actually I thought about
 Amazon's. but I did it while sleeping so I forgot to mention it in my
 list  :-)
 Thanks again for your suggestion!



 On Fri, Jan 25, 2013 at 9:32 PM, Hassan Schroeder 
 hassan.schroe...@gmail.com wrote:

 On Fri, Jan 25, 2013 at 6:00 PM, Brian Braun brianbr...@gmail.com
 wrote:

  What I need is to be able to accept as much HTTP requests as possible,
 to
  log every one of them as fast as possible (not syncronously), and to
 make
  everything fast and with a very low usage of RAM when MySQL gets slow
 and
  inserts need to queue. I think I need some kind of queue to buffer the
  entries when the speed of http request is higher than the speed of
  insertions in the database log.

  3- Using some kind of any other framework that specializes in this?

 http://aws.amazon.com/sqs/

 Let us know how that works out if you try it  :-)

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 http://about.me/hassanschroeder
 twitter: @hassan

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org





Re: Different webapp paths on different hosts

2013-01-25 Thread bxqdev



On 1/25/2013 12:11 PM, Casper Wandahl Schmidt wrote:

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 25-01-2013 06:38, bxqdev skrev:



On 1/24/2013 11:52 AM, Casper Wandahl Schmidt wrote:

See inline

Med venlig hilsen/Kind regards
Casper W. Schmidt

Den 24-01-2013 02:32, Christopher Schultz skrev:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

BBQ,

On 1/23/13 12:09 AM, bxqdev wrote:

i need to map a custom paths, like /path1 and /path2, (not root
/ path), of the same webapp to a custom domains.

as i said i need this mapping: ${samewebapp}/path1 is mapped to
http://path1.com/ ${samewebapp}/path2 is mapped to
http://path2.com/

NOT this: ${samewebapp}/path1 is mapped to http://path1.com/path1
${samewebapp}/path2 is mapped to http://path2.com/path2

What is ${samewebpp}/path1? Is that a piece of a webapp?

Do you care if the same webapp is deployed twice (which is probably
going to be required)?

Actually the OP is not really clear in describing anything. I'm wondering if path1 in 
http://path1.com equals path1 in the
/path1 part or not.


actually the path names and domain names should be able to be different



Anyway I would say a context.xml file in conf/catalina/path1 (the 
hostname)/path1.xml (the context name) should do the trick?
Place the webapp outside the appbase of the hosts and then point the docbase to 
the webapp (or just drop the .war with two
different names in the appbases of the two hosts) :)


i want to have one instance of webapp,
which has two paths,
and each of the paths serves the root of different domains

once again:
* one webapp
* has 2 different paths: /path1 and /path2
* served on 2 domains
* when user goes to http://path1.com/ - {webapp}/path1 is served as root path
* when user goes to http://path2.com/ - {webapp}/path2 is served as root path

is it possible?

To me it doesn't make sense to say that the webapp has two different paths, 
/path1 and path2, and then say the webapp is to be
served as root from two different hosts. I guess it's simply a case of bad 
terminology :)


it's not. maybe it will make things clear if i change the names of the paths, 
say:

* when user goes to http://app1.com/ - {thesamewebapp}/app1 path is served as 
root path of the domain app1.com
* when user goes to http://app2.com/ - {thesamewebapp}/app2 path is served as 
root path of the domain app2.com



Anyway. What you are trying to do is make the same webapp answer both 
domain1.com/ and domain2.com/ right? If so you can simply
deploy the webapp as ROOT. The webapp will then answer on all domains pointing 
to the server. If this is not what you want, you
can set up a virtual host in server.xml with an appbase outside the webapps 
folder (eg. $CATALINA_BASE (or is it HOME?)$\domain1
and then use the Alias element to specify the second domain as an alias for 
the first (which you set as an attribute in the
Host element).


i know these tricks, but they don't work for my case.





- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEAj0cACgkQ9CaO5/Lv0PCChwCggGZi3v8ylGaj6py+uQ2ZNuq9
0+QAnR5ENaqoollzjpB5dx7KtcT3mquu
=/GYF
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Different webapp paths on different hosts

2013-01-25 Thread bxqdev



On 1/25/2013 12:29 PM, Konstantin Kolinko wrote:

2013/1/25 bxqdev bxq...@themailbay.com:


Anyway I would say a context.xml file in conf/catalina/path1 (the
hostname)/path1.xml (the context name) should do the trick?
Place the webapp outside the appbase of the hosts and then point the
docbase to the webapp (or just drop the .war with two
different names in the appbases of the two hosts) :)



i want to have one instance of webapp,
which has two paths,
and each of the paths serves the root of different domains

once again:
* one webapp
* has 2 different paths: /path1 and /path2
* served on 2 domains
* when user goes to http://path1.com/ - {webapp}/path1 is served as root
path
* when user goes to http://path2.com/ - {webapp}/path2 is served as root
path

is it possible?



Two different instances of the same webapp at different hosts - easy.
E.g. the manager webapp is deployed in such way to the virtual hosts.

One instance mapped to different paths - impossible. What value should
be returned by javax.servlet.ServletContext.getContextPath() ?

Thought it is possible to apply urlrewriting, either at HTTPD or at Tomcat.


looks like url rewriting is the only way. though i was wondering if it's 
possible to do the trick with tomcat configuration.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Different webapp paths on different hosts

2013-01-25 Thread bxqdev



On 1/26/2013 1:05 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Dude,

On 1/25/13 12:38 AM, bxqdev wrote:

i want to have one instance of webapp,


No problem.


which has two paths,


Problem: one context = one path = one instance

If you want two separate paths, you need two separate contexts.


and each of the paths serves the root of different domains


That just doesn't make any sense. The root of a domain is, by
definition, / (contextPath=), so there aren't any other paths to
consider.


looks like the goal is not reachable with plain tomcat configuration.




once again: * one webapp * has 2 different paths: /path1 and
/path2 * served on 2 domains * when user goes to
http://path1.com/ - {webapp}/path1 is served as root path * when
user goes to http://path2.com/ - {webapp}/path2 is served as root
path

is it possible?


What you are saying is nonsensical (specifically, the part where you
say that you want /path1 to be mapped to root.

If you want two virtual hosts, then define two virtual hosts. If you
want an app on each host configured as ROOT, then make your two
virtual hosts have two separate appBase directories (which should be a
requirement in the first place of two virtual hosts) and toss a copy
of your WAR file in each appBase, both named ROOT.war (cApITaLS matter).

You can't deploy a single copy (in memory) of your webapp and expect
to get all your requirements above met. If you want to have a single
WAR file on the disk and deploy it multiple times, you *can* do that
but I'm not sure why anyone would want to.


looks like the goal is not reachable with plain tomcat configuration.



- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEC85cACgkQ9CaO5/Lv0PCsDACfYWSxsHAgIoFRDWPNGd+O3FvN
mtsAnji32K1aEfpIZPv0gRQWgvoV4Hnc
=RC5B
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 7.0.34 and ecj 3.7.2/4.2.1

2013-01-25 Thread Ralph Schaer
I started the process of uploading the ecj 4.2.1 artefacts to the maven
central repository.
I followed the description from Ian.
http://ianbrandt.com/2011/10/10/ecj-3-7-1-published-to-maven-central/

According to this documentation
https://docs.sonatype.org/display/Repository/Uploading+3rd-party+Artifacts+to+The+Central+Repository
the process is in the last stage My Bundle is Uploaded. What Next?.
So I have to wait for the sonatype people and see if they approve the
bundle.

The files are in this staging repository:
https://oss.sonatype.org/content/repositories/central_bundles-274/

Ralph

On Mon, Jan 21, 2013 at 11:33 AM, Ralph Schaer ralphsch...@gmail.comwrote:

 You find the ecj jar on this site:
 http://download.eclipse.org/eclipse/downloads/drops4/R-4.2.1-201209141800/

 Section:
 JDT Core Batch Compiler


 Ralph

 On Mon, Jan 21, 2013 at 11:23 AM, Supun Malinga sup...@wso2.com wrote:

 Hi Guys,

 Where can I find the ecj  4.2.1 jar?, except from the tomcat distribution.

 thank you.


 On Fri, Jan 11, 2013 at 1:47 PM, Konstantin Kolinko
 knst.koli...@gmail.comwrote:

  2013/1/11 Ralph Schaer ralphsch...@gmail.com:
   Hi
  
   Tomcat 7.0.34 bumped ecj to version 4.2.1. But the pom file
   of tomcat-embed-jasper still points to version 3.7.2 of ecj.
   Is it safe to use ecj 3.7.2 with Tomcat 7.0.34?
   It's unfortunately not possible to override this, because I haven't
 found
   the 4.2.1 artifact in the central repository.
  
 
  1. Thank you for reporting the issue. I fixed this in svn, but 7.0.35
  has already been tagged several hours ago.
 
  2. Absence of ecj 4.2.1 in central repository is not a stopper. It
  happened before and is expected to happen in the future. You can
  install it locally.
 
  http://markmail.org/message/xyw3bv2flmbhsdt4
  https://bugs.eclipse.org/bugs/show_bug.cgi?id=283745
 
  3. I personally would recommend to go with 4.2.1.
 
  It is known that Eclipse 3.7.2 fails to compile the current Tomcat
  trunk sources (the compiler crashes), 4.2.1 works fine.
 
  There was report by Jess Holle on a crash with 4.2.1, but what causes
  the crash is unknown and I have not observed anything like that.
  http://tomcat.markmail.org/thread/oe5wwu3dm2zcjp4m
 
  Anyway, if you are in doubt, you may try to run precompilation for
  your JSPs with JspC just to make sure that everything compiles nicely.
  (I do not suggest to actually use the compiled classes. I mean just to
  run a compilation to check that they are compilable).
 
  4. The bump of ecj version included a change in one of java classes.
 
  @Override is a compile-time annotation. You should still be able to
  run with 3.7.2.
  http://svn.apache.org/viewvc?view=revisionrevision=1411587
 
  Best regards,
  Konstantin Kolinko
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 


 --
 Supun Malinga