Re: Context.xml: how to reference parameters inside the same file

2011-01-13 Thread Konstantin Kolinko
> On 1/13/2011 7:27 AM, durbans wrote:
>> awarnier wrote:
>>>
>>> Since this is XML, could you not also reference "entities" defined in a
>>> separate file ?

+1.

>>
>> How ?
>
> http://lmgtfy.com/?q=creating+xml+entities
>

A Tomcat-related example exists here:
http://wiki.apache.org/tomcat/FAQ/Password

It is up to you to read XML spec and adjust it to your needs.

Best regards,
Konstantin Kolinko

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



Re: Tomcat 6.0 GZIP Compression not working for large js files

2011-01-13 Thread Konstantin Kolinko
2011/1/13 Ran Berenfeld :
> Hello
> I'm using tomcat 6 for a deployed website (http://www.ichess.co.il)
> and since the beginning, GZIP compression did not work for part of the
> files.
> the amazing thing is that the website have several javascript files, some
> quite small
> and some large, and the HTTP headers (for example when viewed using Firefox
> "Live HTTP Headers" plugin) clearly shows that the compression works only
> for the small
> js file, and not for the large file.

Maybe those are sent by "sendfile" and thus avoid being compressed.
There is certain size threshold (48 Kb, set by sendfileSize parameter
on DefaultServlet)

Try to set useSendfile="false" on your Connector.

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



Re: No response buffering in Tomcat 7.0.6?

2011-01-13 Thread Konstantin Kolinko
2011/1/14 Mark Thomas :
> On 13/01/2011 21:41, verlag.preis...@t-online.de wrote:
>> Does anybody know why Tomcat uses chunked encoding instead of content-length 
>> header (output buffering)?
>
> Chunked encoding does not mean that the output is unbuffered. If a
> client declares support for HTTP/1.1 then web servers are free to use
> chunked encoding for the response if they choose.
>
> I suspect what you are seeing is a side-effect of the fix for
> http://issues.apache.org/bugzilla/show_bug.cgi?id=50496 but I haven't
> checked through the code.
>

Confirming this issue. I added it to Bugzilla:
https://issues.apache.org/bugzilla/show_bug.cgi?id=50582

Best regards,
Konstantin Kolinko

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



Re: tomcat won't start via remote ssh command

2011-01-13 Thread James Chase




Obviously there is something about the SSH shell I don't fully 
understand in terms of why the tomcat server doesn't background itself 
over SSH but does when executed from the bash shell. Perhaps 
backgrounding isn't the right term for what is happening.



Actually, my mistake was using the '-t' option in my ssh command:

ssh -t -p 222 user@tomcatserver 'perl 
/usr/local/sites/domain.com/domain-restart.pl'


Once I *removed* the '-t' option, I no longer needed 'nohup' in my 
script. For anyone curious here is the man ssh on -t:


-t  Force pseudo-tty allocation.  This can be used to execute arbi-
 trary screen-based programs on a remote machine, which can be
 very useful, e.g., when implementing menu services.  Multiple -t
 options force tty allocation, even if ssh has no local tty.




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



Re: tomcat won't start via remote ssh command

2011-01-13 Thread James Chase



man nohup?

You were right -- nohup solved the issue. I did also notice that the 
environment variables were quite different so thanks to the user who 
suggested I try doing a "ssh user@server env" command. I experimented 
with doing "source /etc/profile" as the first ssh command, but the real 
issue was the nohup.


Obviously there is something about the SSH shell I don't fully 
understand in terms of why the tomcat server doesn't background itself 
over SSH but does when executed from the bash shell. Perhaps 
backgrounding isn't the right term for what is happening.


Thanks for the help everyone.


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



RE: Dedicated thread for Tomcat Manager

2011-01-13 Thread Caldarale, Charles R
> From: Alec Swan [mailto:alecs...@gmail.com] 
> Subject: Dedicated thread for Tomcat Manager

> Is there a way to assign a dedicated thread to Tomcat Manager so
> that it will never be used to process any other client requests?

Not directly - threads are associated with a  or , not a 
webapp.  You could define an additional  on a unique port that you 
use to access the manager webapp.  Or you could use a JMX tool instead, such as 
JConsole.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: Dedicated thread for Tomcat Manager

2011-01-13 Thread Mark Thomas
On 13/01/2011 23:05, Alec Swan wrote:
> Hello,
> 
> Our webapp gets periodically hammered by our client applications causing
> Tomcat to run out of threads. This prevents us from being able to use Tomcat
> Manager and check the server status.
> 
> Is there a way to assign a dedicated thread to Tomcat Manager so that it
> will never be used to process any other client requests?

The short answer is no.

The longer answer is take a look at the SemaphoreValve. You should be
able to subclass that and override controlConcurrency. Something along
the lines of limit all users from non-admin IPs to 390 concurrent
requests and have 400 threads on the connector.

Just be aware I'm not sure how widely used (and hence tested) that valve
is. On the other hand Remy wrote it so the chances of it failing are
pretty slim.

Mark



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



Dedicated thread for Tomcat Manager

2011-01-13 Thread Alec Swan
Hello,

Our webapp gets periodically hammered by our client applications causing
Tomcat to run out of threads. This prevents us from being able to use Tomcat
Manager and check the server status.

Is there a way to assign a dedicated thread to Tomcat Manager so that it
will never be used to process any other client requests?

Thanks


Re: No response buffering in Tomcat 7.0.6?

2011-01-13 Thread Mark Thomas
On 13/01/2011 21:41, verlag.preis...@t-online.de wrote:
> Does anybody know why Tomcat uses chunked encoding instead of content-length 
> header (output buffering)?

Chunked encoding does not mean that the output is unbuffered. If a
client declares support for HTTP/1.1 then web servers are free to use
chunked encoding for the response if they choose.

I suspect what you are seeing is a side-effect of the fix for
http://issues.apache.org/bugzilla/show_bug.cgi?id=50496 but I haven't
checked through the code.

Mark



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



No response buffering in Tomcat 7.0.6?

2011-01-13 Thread verlag.preis...@t-online.de
Good afternoon,

some weeks ago, I posted a question about the ISAPI redirector using chunked 
encoding for 304 responses (Topic:
Tomcat Jakarta 1.2.31 ISAPI Reconnector incorrectly sending Content body with 
HTTP 304 Status) which created invalid responses. These issues were fixed in 
Tomcat 7.0.6 and not yet released Tomcat Connectors 1.2.32 (thanks to the 
Tomcat devs, see https://issues.apache.org/bugzilla/show_bug.cgi?id=50363 and 
https://issues.apache.org/bugzilla/show_bug.cgi?id=50413).


However, when I tried the new Tomcat 7.0.6 these days, I got again a strange 
issue regarding 304 responses with ISAPI redirector.

It seems that Tomcat 7.0.6 doesn't use a output buffer any more. Consider this 
simple jsp:

<%= "hello!" %>

Running the jsp in Tomcat 7.0.5, the request and response look like this:

GET /simple.jsp HTTP/1.1
Host: localhost
Keep-Alive: 115
Connection: keep-alive

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=0AFC2875C06A962DF8A02DE6A780F721; Path=/; HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Content-Length: 6
Date: Thu, 13 Jan 2011 21:16:23 GMT

hello!

(note the Content-Lengh header, which indicates that the output has been 
buffered).
However, running in Tomcat 7.0.6, the response look like this:

GET /simple.jsp HTTP/1.1
Host: localhost
Keep-Alive: 115
Connection: keep-alive

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=2C176DBAC054D5BBF3D99FBE5C026915; Path=/; HttpOnly
Content-Type: text/html;charset=ISO-8859-1
Transfer-Encoding: chunked
Date: Thu, 13 Jan 2011 21:23:19 GMT

6
hello!
0

i.e. chunked encoding is applied to the response, although it should easily fit 
into the output buffer.

Now, the same is used for "304 Not Modified" responses when accessing static 
content. Normally, when the DefaultServlet returns a 304 status because the 
requestet resource has not modified, it writes a content-length: 0 header, but 
it is removed by the Tomcat HTTP connector (according to Tim Whittington's 
description). However the ISAPI redirector did not remove the header, and the 
response looked like this:

HTTP/1.1 304 Not Modified
ETag: W/"13614-1291405552000"
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Thu, 13 Jan 2011 21:27:06 GMT
Content-Length: 0

This was still a valid response. But with Tomcat 7.0.6, using the ISAPI 
redirector with chunked encoding support enabled, I get the following response:

HTTP/1.1 304 Not Modified
Transfer-Encoding: chunked
ETag: W/"13614-1291405552000"
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Thu, 13 Jan 2011 21:27:06 GMT

0

which is invalid. The issue is fixed for the next version of the ISAPI 
redirector (1.2.32), but it is not released yet, so I can't use the new version.
Disabling chunked encoding would solve the invalid response symptom, but I 
would like to continue using use chunked encoding.

Does anybody know why Tomcat uses chunked encoding instead of content-length 
header (output buffering)?


Thanks,
Konstantin Preisser



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



Re: Tomcat 6.0 GZIP Compression not working for large js files

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ran,

On 1/13/2011 3:04 PM, Ran Berenfeld wrote:
> I'm using tomcat 6 for a deployed website (http://www.ichess.co.il)
> and since the beginning, GZIP compression did not work for part of the
> files.

:(

What specific version of Tomcat 6?

> the amazing thing is that the website have several javascript files, some
> quite small
> and some large, and the HTTP headers (for example when viewed using Firefox
> "Live HTTP Headers" plugin) clearly shows that the compression works only
> for the small
> js file, and not for the large file.

So it /does/ work for the small files? Good.

> I tried "playing" with the  at server.xml many times, and nothing
> works.
> Finally, I just added an external Gzip Tomcat Filter (and that solved the
> problem...)
> 
> Here's the relevant part of my server.xml :
> 
> compression="1400"

Can you confirm that .js files smaller than 1400 bytes are not
compressed? Just trying to triple-check your configuration.

> compressableMimeType="text/html,text/css,text/javascript"

Can you confirm that all your files' MIME types are text/javascript?

> URIEncoding="UTF-8"
> threadPriority="10"/>

Is there a reason you changed the priority of the threads? Presumably,
your request processing threads represent nearly all of the threads
running in the JVM. If they're all at MAX_PRIORITY, you're not really
gaining anything.

What else can you tell us about these "large" Javascript files? Are they
static files loaded directly from the disk, or are they
dynamically-generated? Are you sure that thee content-type is being set
correctly for these files?

Are you using Tomcat standalone or do you have something in front, such
as Apache httpd? Just making sure that Tomcat is doing the compression
for you.

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

iEYEARECAAYFAk0vbssACgkQ9CaO5/Lv0PBwkwCdEjaYdMO+kOrHO+rHiQFZSoL1
V3AAmQH3uvGKmMIRwJoubx2mUshv34dE
=5o35
-END PGP SIGNATURE-

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



Tomcat 6.0 GZIP Compression not working for large js files

2011-01-13 Thread Ran Berenfeld
Hello
I'm using tomcat 6 for a deployed website (http://www.ichess.co.il)
and since the beginning, GZIP compression did not work for part of the
files.
the amazing thing is that the website have several javascript files, some
quite small
and some large, and the HTTP headers (for example when viewed using Firefox
"Live HTTP Headers" plugin) clearly shows that the compression works only
for the small
js file, and not for the large file.
I tried "playing" with the  at server.xml many times, and nothing
works.
Finally, I just added an external Gzip Tomcat Filter (and that solved the
problem...)

Here's the relevant part of my server.xml :

   

If anyone encountered this issue, please share :)
Is there an open Tomcat ticket for it ? I couldn't find one

thanks
Ran


-- 
רן ברנפלד
מנהל
אתר השחמט הישראלי
*http://www.ichess.co.il*


RE: vhost - servlets not available

2011-01-13 Thread Caldarale, Charles R
> From: Johannes Stein [mailto:johannes.st...@googlemail.com] 
> Subject: Re: vhost - servlets not available

> Is it regular that i will need a ROOT-directory in my app-base?

Yes - you always need to have a default webapp to handle requests that do not 
match other webapp paths.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: vhost - servlets not available

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johannes,

On 1/13/2011 2:55 PM, Johannes Stein wrote:
> i got it working... i changed the host-entry and set the correct
> CATALINA_HOME and CATALINA_BASE.
> Both were not set correctly.

That'll get you.

> Now i set the following in server.xml:
> 
> for localhost
> appBase="webapps/localhost/"
> 
> for srv2.tudom.de
> appBase="webapps/tudom/"

Though that will work, it may be surprising for a Tomcat admin, who
expects that the "localhost" vhost will point to "webapps" and not a
directory within it. Looking at your filesystem, I would expect webapps
deployed as /localhost and /tudor instead of what's really going on. Of
course, one should always read the server.xml, but it will certainly be
surprising to someone new.

> after that i saw in the localhost directory that i will need a ROOT
> directory in webapps/tudom.

Yes: you should have a ROOT webapp for each of your vhosts unless you
don't care to serve anything at the root (/) level.

> There (webapps/tudom/ROOT/) i deployed my files. Dont know why, but its 
> working.
> Is it regular that i will need a ROOT-directory in my app-base?

Unless you want to deploy to http://srv2.tudom.de/tudom/index.html,
you'll need to have your webapp called ROOT: those are the rules.

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

iEYEARECAAYFAk0vWhAACgkQ9CaO5/Lv0PDZvwCgkF4o8sBMbebTbyhoUFFP0mND
ztEAn1zpXz/b6IO6N7SwQoywi08YIwnA
=TgI6
-END PGP SIGNATURE-

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



Re: vhost - servlets not available

2011-01-13 Thread Johannes Stein
Hey Christopher,

i got it working... i changed the host-entry and set the correct
CATALINA_HOME and CATALINA_BASE.
Both were not set correctly.

Now i set the following in server.xml:

for localhost
appBase="webapps/localhost/"

for srv2.tudom.de
appBase="webapps/tudom/"

after that i saw in the localhost directory that i will need a ROOT
directory in webapps/tudom.
There (webapps/tudom/ROOT/) i deployed my files. Dont know why, but its working.
Is it regular that i will need a ROOT-directory in my app-base?

Thank you for your great help!

2011/1/13 Christopher Schultz :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Johannes,
>
> On 1/13/2011 2:20 PM, Johannes Stein wrote:
>> Now $CATALINA_HOME is setted to "/usr/share/tomcat6".
>
> Was that set to something else, earlier? /usr/share/tomcat6 looks like
> the CATALINA_HOME for a package-managed version of Tomcat. If that's the
> case, stuff could be anywhere.
>
> Do you have a "webapps" directory anywhere? Your default  is set
> to appBase="webapps" and your /other/  is set to appBase="tudom".
> Since these settings aren't fully-qualified, they will be relative to
> the CATALINA_BASE setting (which is the same as CATALINA_HOME in a
> standard install, but might be different depending on how your package
> manager has laid things out).
>
>> There i can find  "bin,  lib,  webapps".
>
> Okay, that's a start. Here's what's in my CATALINA_HOME:
>
> - -rw-r--r-- 1 root root 37950 Mar  9  2010 LICENSE
> - -rw-r--r-- 1 root root   557 Mar  9  2010 NOTICE
> - -rw-r--r-- 1 root root  8669 Mar  9  2010 RELEASE-NOTES
> - -rw-r--r-- 1 root root  6670 Mar  9  2010 RUNNING.txt
> drwxr-xr-x 2 root root  4096 Mar 19  2010 bin
> drwxr-xr-x 2 root root  4096 Mar  9  2010 conf
> drwxr-xr-x 2 root root  4096 Mar 19  2010 lib
> drwxr-xr-x 2 root root  4096 Mar  9  2010 logs
> drwxr-xr-x 2 root root  4096 Mar 19  2010 temp
> drwxr-xr-x 7 root root  4096 Mar  9  2010 webapps
> drwxr-xr-x 2 root root  4096 Mar  9  2010 work
>
> Here's what's in my CATALINA_BASE:
>
> drwx-- 3 cschultz cschultz 4096 Jan  7 14:49 conf
> drwxr-xr-x 2 cschultz cschultz 4096 Jan 13 08:56 logs
> drwxr-xr-x 2 cschultz cschultz 4096 Jan  7 14:49 temp
> drwxr-xr-x 3 cschultz cschultz 4096 Jan  7 14:49 webapps
> drwxr-xr-x 3 cschultz cschultz 4096 Jan  7 14:49 work
>
>> But now srv2.tudom.de is not resolvable.
>
> Works for me:
>
> $ host srv2.tudom.de
> srv2.tudom.de           A       109.239.60.41
>
> Did you mean that you can't reach your webapps?
>
> I suspect that your webapp isn't placed into the correct location. You
> said that you can get to it, somehow. Is there a URL that responds with
> a 200 response that Tomcat serves? If so, what is it?
>
> (By the way, offering someone you don't know shell access on your server
> is a really bad idea.)
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk0vU0IACgkQ9CaO5/Lv0PDZIACeP2oeRJMnYvhiBJKZasz4QmM7
> soIAn01l5h/23WfEUHp4yyLtIjjxvp19
> =p78x
> -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: Does tomcat come with JAX-RS?

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tony,

On 1/13/2011 12:18 PM, Tony Anecito wrote:
> Does Tomcat come with JAX-RS?

$ ls lib/
catalina-ant.jar
catalina-ha.jar
catalina-tribes.jar
catalina.jar
ecj-3.6.jar
el-api.jar
jasper-el.jar
jasper.jar
jsp-api.jar
servlet-api.jar
tomcat-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar
tomcat-util.jar

Looks like it doesn't.

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

iEYEARECAAYFAk0vV7gACgkQ9CaO5/Lv0PAGKACfVv0fJjnROjPoJTUIt0MjKcQE
YGAAnjAd6MtJnFvQK9oPvf6t7ghBig0/
=pxYo
-END PGP SIGNATURE-

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



Re: FIPS mode OpenSSL under Tomcat 6.0

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

On 1/13/2011 11:45 AM, Chris Beckey wrote:
> Unfortunately this is a non-negotiable issue with the client, I have to run
> in FIPS mode.

Gotcha. Can you run in JSSE FIPS mode until Tomcat supports the
configuration directly?

> Yes, I would be willing to test the addition of a FIPS mode switch to
> Tomcat.

Great. Add yourself to the CC list of the bugzilla enhancement I added
so you can get updates.

> The other option is for myself to make the change.  It has been a
> while since I touched JNI so it would probably be much faster for you to
> make the change.

Heh... you are under the mistaken impression that I'm a great JNI
master. Seriously, though, it ought to be pretty simple: add a flag for
FIPS mode, then make sure the SSLContext knows about it.

> What I found on running JSSE are the following links:

According to markt, JSSE FIPS mode can be configured independently of
Tomcat, so there's nothing in the Tomcat configuration that needs
improvement for that. Only using APR FIPS mode will require such
changes. Please confirm that via comment in bugzilla.

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

iEYEARECAAYFAk0vVNwACgkQ9CaO5/Lv0PBN3QCgoLWTTfG/Vnw6C4COQ4RXo0zO
LzEAnRHUYnOu86OpiA+cGbvhZLkJqoE8
=sAFz
-END PGP SIGNATURE-

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



Re: reverse proxy rule configuration

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lava,

On 1/13/2011 1:35 PM, Lava Saleem wrote:
> Thanks for the feedback, what I have is a apache tomcat that is set
> to default I haven't changed any configuration.

Okay. Default Tomcat configuration does not involve Apache httpd. Tomcat
does not do proxying of any kind AFAIK. What I'm saying is that you need
to configure Apache httpd (or some other web server) to do what you want
it to do.

> somebody told me to set up a reverse proxy rule in the tomcat apache
> to avoid the same origin policy violation

You want to do forward-proxying, not reverse-proxying (though you might
have to do both) in order to fix your problem. Tomcat cannot do this
with simple configuration: you will need to use a web server like Apache
httpd or write a whole bunch of your own code to do proxying through Tomcat.

> I'm not sure if that will solve the same origin policy issue, do you
> think that will solve it?

Yes, it probably will solve your problems. The real question is why you
have the problem to begin with.

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

iEYEARECAAYFAk0vU9QACgkQ9CaO5/Lv0PAAKwCfdSxWEvOAsT6TOKjp631XDc6Y
lK8An0bDsaBNzfVADWUCRctwqwuZRzgn
=JHMF
-END PGP SIGNATURE-

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



Re: vhost - servlets not available

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johannes,

On 1/13/2011 2:20 PM, Johannes Stein wrote:
> Now $CATALINA_HOME is setted to "/usr/share/tomcat6".

Was that set to something else, earlier? /usr/share/tomcat6 looks like
the CATALINA_HOME for a package-managed version of Tomcat. If that's the
case, stuff could be anywhere.

Do you have a "webapps" directory anywhere? Your default  is set
to appBase="webapps" and your /other/  is set to appBase="tudom".
Since these settings aren't fully-qualified, they will be relative to
the CATALINA_BASE setting (which is the same as CATALINA_HOME in a
standard install, but might be different depending on how your package
manager has laid things out).

> There i can find  "bin,  lib,  webapps".

Okay, that's a start. Here's what's in my CATALINA_HOME:

- -rw-r--r-- 1 root root 37950 Mar  9  2010 LICENSE
- -rw-r--r-- 1 root root   557 Mar  9  2010 NOTICE
- -rw-r--r-- 1 root root  8669 Mar  9  2010 RELEASE-NOTES
- -rw-r--r-- 1 root root  6670 Mar  9  2010 RUNNING.txt
drwxr-xr-x 2 root root  4096 Mar 19  2010 bin
drwxr-xr-x 2 root root  4096 Mar  9  2010 conf
drwxr-xr-x 2 root root  4096 Mar 19  2010 lib
drwxr-xr-x 2 root root  4096 Mar  9  2010 logs
drwxr-xr-x 2 root root  4096 Mar 19  2010 temp
drwxr-xr-x 7 root root  4096 Mar  9  2010 webapps
drwxr-xr-x 2 root root  4096 Mar  9  2010 work

Here's what's in my CATALINA_BASE:

drwx-- 3 cschultz cschultz 4096 Jan  7 14:49 conf
drwxr-xr-x 2 cschultz cschultz 4096 Jan 13 08:56 logs
drwxr-xr-x 2 cschultz cschultz 4096 Jan  7 14:49 temp
drwxr-xr-x 3 cschultz cschultz 4096 Jan  7 14:49 webapps
drwxr-xr-x 3 cschultz cschultz 4096 Jan  7 14:49 work

> But now srv2.tudom.de is not resolvable.

Works for me:

$ host srv2.tudom.de
srv2.tudom.de   A   109.239.60.41

Did you mean that you can't reach your webapps?

I suspect that your webapp isn't placed into the correct location. You
said that you can get to it, somehow. Is there a URL that responds with
a 200 response that Tomcat serves? If so, what is it?

(By the way, offering someone you don't know shell access on your server
is a really bad idea.)

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

iEYEARECAAYFAk0vU0IACgkQ9CaO5/Lv0PDZIACeP2oeRJMnYvhiBJKZasz4QmM7
soIAn01l5h/23WfEUHp4yyLtIjjxvp19
=p78x
-END PGP SIGNATURE-

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



Re: tomcat won't start via remote ssh command

2011-01-13 Thread Robin Capone

Have you compared the output from the 'env' command
run on the Tomcat server and run remotely from the system
you're ssh'ing from ( ssh [tomcat server] env )?



On 1/13/2011 2:01 PM, George Sexton wrote:

You can troubleshoot scripts by adding -x to the first line.

For example, the first line in unix shell scripts is usually:

#/bin/sh

Change that to

#/bin/sh -x

That turns on echo so you can see each statement executed.

You may have to edit multiple scripts if one calls another.

George Sexton
MH Software, Inc.
303 438-9585
www.mhsoftware.com


-Original Message-
From: james [mailto:ja...@wintercastle.net]
Sent: Wednesday, January 12, 2011 7:35 PM
To: users@tomcat.apache.org
Subject: tomcat won't start via remote ssh command

Hi Guys,

I created a simple (i thought) script to restart a tomcat server when
our
alerting system sees the site as down (almost always a memory issue
that a
reboot of the tomcat server fixes).

The script runs and works fine when executed as the user on the local
server. When run via ssh, it will shut down the tomcat server, and
appear
to start it -- but does not. I'm not a tomcat expert at all and I
haven't
been able to figure out how to get more information. I'm guessing that
there is some environment information that is missing over the ssh
terminal
that is causing it not to start, but I don't have any hints and the
output
is the same as when it works.

The SSH command I run that doesn't work is below. Since even this
command
does not work, I won't bother complicating the issue with the details
of my
script:

$ ssh -t -p 222 u...@tomcatserver.domain.com
'/usr/local/sites/domain.com/domain-tomcat1-
production/tomcat/bin/startup.sh
'
Using CATALINA_BASE:
/usr/local/sites/domain.com/domain-tomcat1-production/tomcat
Using CATALINA_HOME:
/usr/local/sites/domain.com/domain-tomcat1-production/tomcat
Using CATALINA_TMPDIR:
/usr/local/sites/domain.com/domain-tomcat1-production/tomcat/temp
Using JRE_HOME:   /usr
Connection to tomcatserver.domain.com closed.

Any help would be very much appreciated if you have experience with
this.
James




-
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: vhost - servlets not available

2011-01-13 Thread Johannes Stein
Sorry for my stupidity.
Now $CATALINA_HOME is setted to "/usr/share/tomcat6".
There i can find  "bin,  lib,  webapps". But now srv2.tudom.de is not
resolvable.
Any ideas?


2011/1/13 Johannes Stein :
> When i am entering the $CATALINA_HOME directory in the shell with cd
> $CATALINA_HOME
> There is nothing else then there is nothing. cd $CATALINA_HOME/bin
> redirects me into the bin folder.
>
> 2011/1/13 Johannes Stein :
>> 2011/1/13 Christopher Schultz :
>>> -BEGIN PGP SIGNED MESSAGE-
>>> Hash: SHA1
>>>
>>> Johannes,
>>>
>>> On 1/13/2011 11:34 AM, Johannes Stein wrote:
 

 
     >>>               type="org.apache.catalina.UserDatabase"
               description="User database that can be updated and saved"
               factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
               pathname="conf/tomcat-users.xml" />
   
>>>
>>> I hope this is a copy/paste error: the above is not well-formed.
>>>
   
     >>>                connectionTimeout="2"
                URIEncoding="UTF-8"
                redirectPort="8443" />
>>>
>>> NB: If you aren't using SSL, you should remove "redirectPort". It will
>>> only confuse you in the future.
>>>
     
       >>>             unpackWARs="true" autoDeploy="true"
             xmlValidation="false" xmlNamespaceAware="false">
       

       >>
>>> What files/directories are currently under $CATALINA_HOME/tudom?
>>
>> It seems that there is nothing. I can find a folder localhost, but
>> there isnt a folder named tudom.
>> The path is /etc/tomcat6/Catalina... ist this correct?
>>
        unpackWARs="true" autoDeploy="true"
        xmlValidation="false" xmlNamespaceAware="false">
       srv2.tudom.de
>>>
>>>  is not necessary, here: the hostname is already "srv2.tudom.de".
>>>
         
     
   
 
>>>
>>> - -chris
>>> -BEGIN PGP SIGNATURE-
>>> Version: GnuPG v1.4.10 (MingW32)
>>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>>
>>> iEYEARECAAYFAk0vKncACgkQ9CaO5/Lv0PCYAACdHdKAt5zbbx0eCQldoTE5bnp8
>>> ykkAniPaFOtWeJxdDS3LJI0kpBj9ieSB
>>> =VdAE
>>> -END PGP SIGNATURE-
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>
>> If you wish i can grant you for some minutes access into the shell.
>>
>

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



RE: tomcat won't start via remote ssh command

2011-01-13 Thread George Sexton
You can troubleshoot scripts by adding -x to the first line.

For example, the first line in unix shell scripts is usually:

#/bin/sh

Change that to 

#/bin/sh -x

That turns on echo so you can see each statement executed.

You may have to edit multiple scripts if one calls another.

George Sexton
MH Software, Inc.
303 438-9585
www.mhsoftware.com

> -Original Message-
> From: james [mailto:ja...@wintercastle.net]
> Sent: Wednesday, January 12, 2011 7:35 PM
> To: users@tomcat.apache.org
> Subject: tomcat won't start via remote ssh command
> 
> Hi Guys,
> 
> I created a simple (i thought) script to restart a tomcat server when
> our
> alerting system sees the site as down (almost always a memory issue
> that a
> reboot of the tomcat server fixes).
> 
> The script runs and works fine when executed as the user on the local
> server. When run via ssh, it will shut down the tomcat server, and
> appear
> to start it -- but does not. I'm not a tomcat expert at all and I
> haven't
> been able to figure out how to get more information. I'm guessing that
> there is some environment information that is missing over the ssh
> terminal
> that is causing it not to start, but I don't have any hints and the
> output
> is the same as when it works.
> 
> The SSH command I run that doesn't work is below. Since even this
> command
> does not work, I won't bother complicating the issue with the details
> of my
> script:
> 
> $ ssh -t -p 222 u...@tomcatserver.domain.com
> '/usr/local/sites/domain.com/domain-tomcat1-
> production/tomcat/bin/startup.sh
> '
> Using CATALINA_BASE:
> /usr/local/sites/domain.com/domain-tomcat1-production/tomcat
> Using CATALINA_HOME:
> /usr/local/sites/domain.com/domain-tomcat1-production/tomcat
> Using CATALINA_TMPDIR:
> /usr/local/sites/domain.com/domain-tomcat1-production/tomcat/temp
> Using JRE_HOME:   /usr
> Connection to tomcatserver.domain.com closed.
> 
> Any help would be very much appreciated if you have experience with
> this.
> James
> 



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



Re: vhost - servlets not available

2011-01-13 Thread Johannes Stein
When i am entering the $CATALINA_HOME directory in the shell with cd
$CATALINA_HOME
There is nothing else then there is nothing. cd $CATALINA_HOME/bin
redirects me into the bin folder.

2011/1/13 Johannes Stein :
> 2011/1/13 Christopher Schultz :
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Johannes,
>>
>> On 1/13/2011 11:34 AM, Johannes Stein wrote:
>>> 
>>>
>>> 
>>>     >>               type="org.apache.catalina.UserDatabase"
>>>               description="User database that can be updated and saved"
>>>               factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>>>               pathname="conf/tomcat-users.xml" />
>>>   
>>
>> I hope this is a copy/paste error: the above is not well-formed.
>>
>>>   
>>>     >>                connectionTimeout="2"
>>>                URIEncoding="UTF-8"
>>>                redirectPort="8443" />
>>
>> NB: If you aren't using SSL, you should remove "redirectPort". It will
>> only confuse you in the future.
>>
>>>     
>>>       >>             unpackWARs="true" autoDeploy="true"
>>>             xmlValidation="false" xmlNamespaceAware="false">
>>>       
>>>
>>>       >
>> What files/directories are currently under $CATALINA_HOME/tudom?
>
> It seems that there is nothing. I can find a folder localhost, but
> there isnt a folder named tudom.
> The path is /etc/tomcat6/Catalina... ist this correct?
>
>>>        unpackWARs="true" autoDeploy="true"
>>>        xmlValidation="false" xmlNamespaceAware="false">
>>>       srv2.tudom.de
>>
>>  is not necessary, here: the hostname is already "srv2.tudom.de".
>>
>>>         
>>>     
>>>   
>>> 
>>
>> - -chris
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG v1.4.10 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAk0vKncACgkQ9CaO5/Lv0PCYAACdHdKAt5zbbx0eCQldoTE5bnp8
>> ykkAniPaFOtWeJxdDS3LJI0kpBj9ieSB
>> =VdAE
>> -END PGP SIGNATURE-
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>
> If you wish i can grant you for some minutes access into the shell.
>

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



Re: reverse proxy rule configuration

2011-01-13 Thread Lava Saleem
Chris,
Thanks for the feedback, what I have is a apache tomcat that is set to
default I haven't changed any configuration,I have uploaded  html webpage
that has embedded java script, the web page suppose to send json data to
another server and return json data back, the problem is the other server is
not responding, somebody told me to set up a reverse proxy rule in the
tomcat apache to avoid the same origin policy violation, to be honest I
don't know how to set up reverse proxy rule and I'm not sure if that will
solve the same origin policy issue, do you  think that will solve it?


On Thu, Jan 13, 2011 at 11:43 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Lava,
>
> On 1/13/2011 11:32 AM, Lava Saleem wrote:
> > I have read the following website and to be honest I'm a bit confused
> > about configuring a rule?
>
> One opint of confusion may be that the configuration for a reverse proxy
> must be at the /web server/ level, and not in Tomcat. The configuration
> examples shown in the document you're reading are for Apache httpd (the
> web server) not for Apache Tomcat (the application server).
>
> Are you running Apache httpd? If not, you're reading the wrong HOWTO.
>
> > I'm not quite sure if this is the
> > right thing to do to avoid violating same origin policy
>
> One could argue that subverting the same-origin policy isn't a good
> thing to do :)
>
> > I know both boxes (apache and the other server) are in the same
> > domain, if you have further information please send me your feedback
> > http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html
>
> Some examples of your environment would make it easier to understand
> what you're trying to do, and help us help you.
>
> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk0vK6oACgkQ9CaO5/Lv0PCZfACdGDqS4IpEMimj2hNn6Q5Y8N3x
> HhoAoKZ3OKr63B2XssBehkPSF94Le/zm
> =6WUi
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: vhost - servlets not available

2011-01-13 Thread Johannes Stein
2011/1/13 Christopher Schultz :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Johannes,
>
> On 1/13/2011 11:34 AM, Johannes Stein wrote:
>> 
>>
>> 
>>     >               type="org.apache.catalina.UserDatabase"
>>               description="User database that can be updated and saved"
>>               factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>>               pathname="conf/tomcat-users.xml" />
>>   
>
> I hope this is a copy/paste error: the above is not well-formed.
>
>>   
>>     >                connectionTimeout="2"
>>                URIEncoding="UTF-8"
>>                redirectPort="8443" />
>
> NB: If you aren't using SSL, you should remove "redirectPort". It will
> only confuse you in the future.
>
>>     
>>       >             unpackWARs="true" autoDeploy="true"
>>             xmlValidation="false" xmlNamespaceAware="false">
>>       
>>
>>       
> What files/directories are currently under $CATALINA_HOME/tudom?

It seems that there is nothing. I can find a folder localhost, but
there isnt a folder named tudom.
The path is /etc/tomcat6/Catalina... ist this correct?

>>        unpackWARs="true" autoDeploy="true"
>>        xmlValidation="false" xmlNamespaceAware="false">
>>       srv2.tudom.de
>
>  is not necessary, here: the hostname is already "srv2.tudom.de".
>
>>         
>>     
>>   
>> 
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk0vKncACgkQ9CaO5/Lv0PCYAACdHdKAt5zbbx0eCQldoTE5bnp8
> ykkAniPaFOtWeJxdDS3LJI0kpBj9ieSB
> =VdAE
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

If you wish i can grant you for some minutes access into the shell.

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



Re: app throws java.lang.NoClassDefFoundError sometimes, and sometimes it doesnt

2011-01-13 Thread Sam Zilverberg
We copy using cp...
I'll try some of the ideas you guys mentioned and reply sometime next week
after I have some results.
Thanks for the great ideas !

-Sam


Does tomcat come with JAX-RS?

2011-01-13 Thread Tony Anecito
Hi All,

Does Tomcat come with JAX-RS?

Thanks,
-Tony


  

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



Re: Tomcat JMX connection - Authentication failed.

2011-01-13 Thread Ziggy
Given that Jconsole can connect to the Tomcat JMX without any user
credentials (locally), i am guessing that i dont need to supply these
credentials but how do i connect to the JMX server without supplying the
port number? (by specifying the port number it means i am allowing remote
authentication meaning i have to provide the login credentials).


On Thu, Jan 13, 2011 at 4:06 PM, Pid  wrote:

> On 1/13/11 3:15 PM, Ziggy wrote:
> > Aha... i didnt realise that i needed to supply the credentials from the
> > client. I thought Tomcat would get those from the password files. Ok im
> off
> > to the documentation now. :)
>
> It could do, but you'd have to point the client at those files and read
> their contents too.
>
>
>
> >>>try {
> >>>url = new
> >>> JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi");
> >>>jmxc = JMXConnectorFactory.connect(url,null);
>
> Map environment = new HashMap();
> String[] pair = new String[] { "username", "password" };
> environment.put(JMXConnector.CREDENTIALS, pair);
>
> jmxc = JMXConnectorFactory.connect(url, environment);
>
>
> From my own efforts:
>
>  https://github.com/pidster/Tomcat-CLI
>
>
> p
>
>
>
> >>>mbsc = jmxc.getMBeanServerConnection();
> >>>} catch (MalformedURLException e) {
> >>>throw new Exception(methodName + ":" + e);
> >>>} catch (IOException e) {
> >>>throw new Exception(methodName + ":" + "Failed to
> >>> connect to the Tomcat Server " + e);
> >>>}
>


Re: Deploying new Applications

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jamie,

Technically speaking, this is a discussion best left to the user list.
I'm cross-posting. Please consider subscribing to the user list and
continuing the discussion there.

On 1/13/2011 7:27 AM, Jamie wrote:
> This works, but is not persistent. i.e. when tomcat is restarted the
> display name is taken from the context.xml file.
> Is there any way for Tomcat to set a persistent display name?

There have been some discussions about having the manager webapp persist
changes to files so they stick across Tomcat restarts. You may want to
re-post on the user list with a better subject line to see if you can
help with those (slow-going, as I understand) efforts.

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

iEYEARECAAYFAk0vLLgACgkQ9CaO5/Lv0PDYCwCgpWVsZ2Xt9VfNPI33bY3jkNXr
voIAn1Za8uVJMsge8HwE6HTub+VEIr7f
=7+G5
-END PGP SIGNATURE-

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



Re: FIPS mode OpenSSL under Tomcat 6.0

2011-01-13 Thread Chris Beckey
Thanks for your help Chris.

Unfortunately this is a non-negotiable issue with the client, I have to run
in FIPS mode.

Yes, I would be willing to test the addition of a FIPS mode switch to
Tomcat.  The other option is for myself to make the change.  It has been a
while since I touched JNI so it would probably be much faster for you to
make the change.

What I found on running JSSE are the following links:
http://www.coderanch.com/t/497494/Tomcat/FIPS-compliant-Tomcat-JSSE#2240590
-and-
http://download.oracle.com/javase/6/docs/technotes/guides/security/enhancements.htmlwhere
the following quote comes from
"*FIPS 140 compliance for SunJSSE*

   - The SunJSSE provider now supports an experimental FIPS 140 compliant
   mode. When enabled and used in combination with the SunPKCS11 provider and
   an appropriate FIPS 140 certified PKCS#11 token, SunJSSE is FIPS 140
   compliant. For details, see the JSSE Reference
Guide
   ."


On 1/7/2011 4:24 PM, Chris Beckey wrote:
> I need to run a FIPS 140-2 certified SSL/TLS implementation under
> Tomcat 6.0.20.  I have OpenSSL configured and running but I cannot
> find a way to set FIPS mode in OpenSSL.

I don't think there's any way to configure OpenSSL via Tomcat other than
to specify the ciphers that OpenSSL will use for SSL.

> From the OpenSSL
> documentation it should be as simple as making a call to
> FIPS_mode_set(), probably from within the AprLifecycleListener but I
> can't find a configuration option nor any indication that
> FIPS_mode_set() method is visible in the tcnative library or JNI
> wrapper.

I can't find the string "fips" (case-insensitive) anywhere in the
tomcat-native code, so it must not be exposed.

> Question is, has anyone run OpenSSL under Tomcat in FIPS
> mode? Any help would be appreciated.

If you know the ciphers allowed by FIPS, you can just specify them in
your  configuration. Is that acceptable, or do you absolutely
need to have FIPS mode set? (I understand these things are sometimes
non-negotiable).

It doesn't look like it would be a big deal to add some code to allow
FIPS mode via the APR connector with OpenSSL. Would you be willing to
test some of that code?


Re: reverse proxy rule configuration

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lava,

On 1/13/2011 11:32 AM, Lava Saleem wrote:
> I have read the following website and to be honest I'm a bit confused
> about configuring a rule?

One opint of confusion may be that the configuration for a reverse proxy
must be at the /web server/ level, and not in Tomcat. The configuration
examples shown in the document you're reading are for Apache httpd (the
web server) not for Apache Tomcat (the application server).

Are you running Apache httpd? If not, you're reading the wrong HOWTO.

> I'm not quite sure if this is the
> right thing to do to avoid violating same origin policy

One could argue that subverting the same-origin policy isn't a good
thing to do :)

> I know both boxes (apache and the other server) are in the same
> domain, if you have further information please send me your feedback 
> http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html

Some examples of your environment would make it easier to understand
what you're trying to do, and help us help you.

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

iEYEARECAAYFAk0vK6oACgkQ9CaO5/Lv0PCZfACdGDqS4IpEMimj2hNn6Q5Y8N3x
HhoAoKZ3OKr63B2XssBehkPSF94Le/zm
=6WUi
-END PGP SIGNATURE-

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



Re: tomcat won't start via remote ssh command

2011-01-13 Thread James Chase



Using JRE_HOME:   /usr

Looks like you haven't set JAVA_HOME or JRE_HOME properly.  At least one of 
those must be set to a JDK or JRE (respectively) location.
However it starts on the local host with the save java environment 
variables and uses the same JRE_HOME. This was one of the things I 
tried, setting the environment variables in setenv.sh however it still 
failed.


In reponse to the other user, nothing in the logs that I know of 
(tomcat.log -- are there others I should check specific to tomcat?), and 
I do know of nohup but it shouldn't close the tomcat server when I close 
my shell?? Unless I misunderstand something about SSH. I will however 
test the nohup idea tonight.

  - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


-
To unsubscribe, e-mail: users-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: vhost - servlets not available

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johannes,

On 1/13/2011 11:34 AM, Johannes Stein wrote:
> 
> 
> 
>type="org.apache.catalina.UserDatabase"
>   description="User database that can be updated and saved"
>   factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>   pathname="conf/tomcat-users.xml" />
>   

I hope this is a copy/paste error: the above is not well-formed.

>   
> connectionTimeout="2"
>URIEncoding="UTF-8"
>redirectPort="8443" />

NB: If you aren't using SSL, you should remove "redirectPort". It will
only confuse you in the future.

> 
>unpackWARs="true" autoDeploy="true"
> xmlValidation="false" xmlNamespaceAware="false">
>   
> 
>   unpackWARs="true" autoDeploy="true"
>xmlValidation="false" xmlNamespaceAware="false">
>   srv2.tudom.de

 is not necessary, here: the hostname is already "srv2.tudom.de".

> 
> 
>   
> 

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

iEYEARECAAYFAk0vKncACgkQ9CaO5/Lv0PCYAACdHdKAt5zbbx0eCQldoTE5bnp8
ykkAniPaFOtWeJxdDS3LJI0kpBj9ieSB
=VdAE
-END PGP SIGNATURE-

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



Re: Context.xml: how to reference parameters inside the same file

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Durbans,

On 1/13/2011 7:27 AM, durbans wrote:
> awarnier wrote:
>>
>> Since this is XML, could you not also reference "entities" defined in a
>> separate file ?
> 
> How ?

http://lmgtfy.com/?q=creating+xml+entities

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

iEYEARECAAYFAk0vKfUACgkQ9CaO5/Lv0PBtjQCghFknWgiVXvHTIJEhisVrQGwt
380AoJZ+emoo+TNV+aOW1PhOImGdFMYN
=R2FY
-END PGP SIGNATURE-

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



Re: tomcat won't start via remote ssh command

2011-01-13 Thread James Chase



Tomcat version?

Did you know there's some memory leak detection and prevention in
recent versions of 6.0?

Apache Tomcat Version 6.0.18

If you have a memory leak, why not fix it rather than ignoring it?
I'm not the programmer, just the administrator. Others have chosen to 
ignore it for whatever reason


p

-
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: vhost - servlets not available

2011-01-13 Thread Johannes Stein
Enclosed the server.xml, hope this helps!





  


  





  


  
  


  
srv2.tudom.de



  



2011/1/13 Caldarale, Charles R :
>> From: Johannes Stein [mailto:johannes.st...@googlemail.com]
>> Subject: Re: vhost - servlets not available
>
>> But it isnt still reachable. Do you have any idea?
>
> Post your complete server.xml, with comments removed and passwords 
> obfuscated.  There's a strong possibility you've broken it.
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
> MATERIAL and is thus for use only by the intended recipient. If you received 
> this in error, please contact the sender and delete the e-mail and its 
> attachments from all computers.
>
>
> -
> To unsubscribe, e-mail: users-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: Context.xml: how to reference parameters inside the same file

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 1/13/2011 6:47 AM, André Warnier wrote:
> Konstantin Kolinko wrote:
>> 2011/1/13 durbans :
>>> Is it possible ?
>>>
>>
>> No, not possible.
>>
>> You can reference any system properties, though (as mentioned in [1]).
>> E.g. ${catalina.base}  or ${java.io.tmpdir}
>>
>> [1] http://tomcat.apache.org/tomcat-6.0-doc/config/index.html
>>
> Since this is XML, could you not also reference "entities" defined in a
> separate file ?

Or even the same file. :)

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

iEYEARECAAYFAk0vKYsACgkQ9CaO5/Lv0PC/PQCfYfkw9eVor/8pVSFS+ecekn4F
KnYAn2UTzJCIYw38TcrzmBIW9n3z3Yuq
=PHTq
-END PGP SIGNATURE-

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



reverse proxy rule configuration

2011-01-13 Thread Lava Saleem
Hi everyone,
I have a web page  html embedded with java script  deployed in the apache,
this webpage is suppose to retrieve data from different server, for some
reason this is not happening cause Iam violating java script same origin
policy and I have been told that what I need to do is set up a reverse proxy
rule to avoid that, I have read the following website and to be honest I'm a
bit confused about configuring a rule ? I'm not quite sure if this is the
right thing to do to avoid violating same origin policy, I know both boxes
(apache and the other server) are in the same domain, if you have further
information please send me your feedback
 http://tomcat.apache.org/connectors-doc/generic_howto/proxy.html


Thank you

Lava


RE: vhost - servlets not available

2011-01-13 Thread Caldarale, Charles R
> From: Johannes Stein [mailto:johannes.st...@googlemail.com] 
> Subject: Re: vhost - servlets not available

> But it isnt still reachable. Do you have any idea?

Post your complete server.xml, with comments removed and passwords obfuscated.  
There's a strong possibility you've broken it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



Re: vhost - servlets not available

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johannes,

On 1/13/2011 10:44 AM, Johannes Stein wrote:
> 2011/1/13 Christopher Schultz :
>> What is your default host? It's specified in the  "defaultHost"
>> attribute.
> 
> As default host is set:
> 
> 

Okay, that can certainly cause problems if you introduce a new vhost and
don't use it properly. I'm not saying that's the problem, here... just
mentioning that if all you did was introduce another vhost, that's the
only thing I can think of.

>> Aren't those the same URL?
> 
> Oh, i made a mistake. When im changing the url-pattern in the
> servlet-mapping to /StartService the
> servlet will be avaible.
> If i use the default config of gwt which sets:
> /tudom.start.Start/StartService the Servlet
> will not be available.
> 
>> What is the full URL that GWT is trying to access -- including server
>> name? I suspect that the introduction of the VHOST has exposed a flaw in
>> the URL building in your GWT interface's URLs.
> 
> The files are on the same hast. I call directly the same vhost.
> Try it by yourself: http://srv2.tudom.de/Start.html

Here's the conversation as my web browser sees it (beware: it's long):

http://srv2.tudom.de/Start.html

GET /Start.html HTTP/1.1
Host: srv2.tudom.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
Etag: W/"7758-1293708879000"
Last-Modified: Thu, 30 Dec 2010 11:34:39 GMT
Content-Type: text/html
Content-Length: 7758
Date: Thu, 13 Jan 2011 16:03:41 GMT
- --
http://srv2.tudom.de/style.css

GET /style.css HTTP/1.1
Host: srv2.tudom.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C)
Accept: text/css,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://srv2.tudom.de/Start.html

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
Etag: W/"8475-1294758302000"
Last-Modified: Tue, 11 Jan 2011 15:05:02 GMT
Content-Type: text/css
Content-Length: 8475
Date: Thu, 13 Jan 2011 16:03:41 GMT
- --
http://srv2.tudom.de/tudom.start.Start/tudom.start.Start.nocache.js

GET /tudom.start.Start/tudom.start.Start.nocache.js HTTP/1.1
Host: srv2.tudom.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C)
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://srv2.tudom.de/Start.html

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
Etag: W/"5833-1294928014000"
Last-Modified: Thu, 13 Jan 2011 14:13:34 GMT
Content-Type: text/javascript
Content-Length: 5833
Date: Thu, 13 Jan 2011 16:03:41 GMT
- --
http://srv2.tudom.de/tudom.start.Start/E42B631CEC5C735AF15B86EBDC85.cache.html

GET /tudom.start.Start/E42B631CEC5C735AF15B86EBDC85.cache.html HTTP/1.1
Host: srv2.tudom.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://srv2.tudom.de/Start.html

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
Etag: W/"101720-1294928014000"
Last-Modified: Thu, 13 Jan 2011 14:13:34 GMT
Content-Type: text/html
Content-Length: 101720
Date: Thu, 13 Jan 2011 16:03:42 GMT
- --
http://srv2.tudom.de/tudom.start.Start/gwt/standard/standard.css

GET /tudom.start.Start/gwt/standard/standard.css HTTP/1.1
Host: srv2.tudom.de
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729; .NET4.0C)
Accept: text/css,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive
Referer: http://srv2.tudom.de/Start.html

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
Etag: W/"26804-128810065"
Last-Modified: Tue, 26 Oct 2010 13:44:10 GMT
Content-Type: text/css
Content-Length: 26804
Date: Thu, 13 Jan 2011 16:03:42 GMT
- -

RE: app throws java.lang.NoClassDefFoundError sometimes, and sometimes it doesnt

2011-01-13 Thread Caldarale, Charles R
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
> Subject: Re: app throws java.lang.NoClassDefFoundError sometimes, and 
> sometimes it doesnt

> I can think of a few ways around this:

> 1. Upgrade. It's possible issues with auto-deploy and/or manager have
> been resolved. Read the ChangeLog.
> 2. Only use the manager webapp to deploy your apps.
> 3. Disable auto-deploy AND only use the manager webapp to deploy your
> webapps. This will prevent mid-copy deployments.
> 4. Stop Tomcat before deploying, which will solve everything :)

Or copy the .war file with a different extension, then rename the file once it 
is completely transferred.

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



Re: Tomcat JMX connection - Authentication failed.

2011-01-13 Thread Pid
On 1/13/11 3:15 PM, Ziggy wrote:
> Aha... i didnt realise that i needed to supply the credentials from the
> client. I thought Tomcat would get those from the password files. Ok im off
> to the documentation now. :)

It could do, but you'd have to point the client at those files and read
their contents too.



>>>try {
>>>url = new
>>> JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi");
>>>jmxc = JMXConnectorFactory.connect(url,null);

Map environment = new HashMap();
String[] pair = new String[] { "username", "password" };
environment.put(JMXConnector.CREDENTIALS, pair);

jmxc = JMXConnectorFactory.connect(url, environment);


From my own efforts:

 https://github.com/pidster/Tomcat-CLI


p



>>>mbsc = jmxc.getMBeanServerConnection();
>>>} catch (MalformedURLException e) {
>>>throw new Exception(methodName + ":" + e);
>>>} catch (IOException e) {
>>>throw new Exception(methodName + ":" + "Failed to
>>> connect to the Tomcat Server " + e);
>>>}


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: vhost - servlets not available

2011-01-13 Thread Johannes Stein
Firebug says that the call is going to: /tudom.start.Start/StartService
And thats correct. Its also mapped correctly


  StartService
tudom.start.server.StartServiceImpl


  StartService
  /tudom.start.Start/StartService
  

But it isnt still reachable. Do you have any idea?


2011/1/13 Johannes Stein :
> 2011/1/13 Christopher Schultz :
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> Johannes,
>>
>> On 1/13/2011 10:01 AM, Johannes Stein wrote:
>>> i deployed a gwt-application in tomcat 6.0.18 without any problems. I
>>> pointed a url to the ip-adress and deployed the application unter
>>> webapps/myfolder, so that the app was reachable unter 
>>> http://mydomain/myfolder.
>>> It worked fine.
>>
>> Thanks for using the standard deployment mechanism! So many people want
>> to edit server.xml for some reason.
>>
>> BTW, 6.0.18 is really quite ancient. You should seriously consider
>> upgrading. 6.0.30 was released today... seems like an auspicious occasion.
>>
>>> But since im using a vhost in tomcat i got a problem.
>>> Every time when gwt tries a callback i get the message: "Requested
>>> resource not found". I did not make any changes in the web.xml.
>>> I added the host like the following in the server.xml:
>>> ...
>>> 
>>>       >>        unpackWARs="true" autoDeploy="true"
>>>        xmlValidation="false" xmlNamespaceAware="false">
>>>         
>>>          
>>>     
>>
>> What is your default host? It's specified in the  "defaultHost"
>> attribute.
>>
>
> As default host is set:
>
> 
>
>
>>> The code is deployed into the folder tudom. The .html works fine, but
>>> my callbacks dont work.
>>>
>>> A snippet from my web.xml:
>>> 
>>>         StartService
>>>         tudom.start.server.StartServiceImpl
>>>   
>>>   
>>>         StartService
>>>         /tudom.start.Start/StartService
>>>   
>>>
>>> When im changing the URL-Pattern to
>>> /tudom.start.Start/StartService
>>>
>>> the Servlet gets reachable, but this doesnt interest GWT, cause it
>>> still tries to load /tudom.start.Start/StartService.
>>
>> Aren't those the same URL?
>
> Oh, i made a mistake. When im changing the url-pattern in the
> servlet-mapping to /StartService the
> servlet will be avaible.
> If i use the default config of gwt which sets:
> /tudom.start.Start/StartService the Servlet
> will not be available.
>
>>
>> What is the full URL that GWT is trying to access -- including server
>> name? I suspect that the introduction of the VHOST has exposed a flaw in
>> the URL building in your GWT interface's URLs.
>>
>> Are you trying to call one VHOST from a page hosted by another VHOST?
>> Are there any  elements in your web page that might be affecting
>> things?
>
> The files are on the same hast. I call directly the same vhost.
> Try it by yourself: http://srv2.tudom.de/Start.html
>
>>
>> It might be helpful to use a protocol sniffer like firebug,
>> LiveHTTPHeaders, iehttpheader, fiddler, etc. to see what URL your GWT
>> app is really trying to hit.
>
> I just downloaded it and will try it. But do you have any idea?
>
>>
>> - -chris
>> -BEGIN PGP SIGNATURE-
>> Version: GnuPG v1.4.10 (MingW32)
>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>>
>> iEYEARECAAYFAk0vG/4ACgkQ9CaO5/Lv0PDpbQCeLJ7PVFJcV7qPzzCFO5oYv04v
>> 4e0AnAnYUlftZps6btkg50xliMbK+n0U
>> =yQgm
>> -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: app throws java.lang.NoClassDefFoundError sometimes, and sometimes it doesnt

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sam,

On 1/13/2011 8:47 AM, Sam Zilverberg wrote:
> I'm running a wicket app on tomcat 6.0.20.

Upgrade!

> Once in a while I need to redeploy it (after fixing some stuff, adding
> features and so on).
> This is how I redeploy:
> 1.Use tomcat manager to undeploy the running app.
> 2.Deploy the new app by copying the new WAR file to a library inside tomcat.

Do you do this on the server using a "cp" (or COPY) command? Or, do you
use Tomcat's manager app to deploy the updated webapp?

> Everything seems fine but when I use the app I sometimes get a java.lang.
> NoClassDefFoundError.
> The class can be just about any class in the project and its libs.
> Sometimes its a Hibernate related class, sometimes its a Wicket related
> class and
> sometimes its a class from my app.
> Redeploying once (or a couple of times) solves the problem.
>
> This is very inconsistent and bothering.
> After deploying I never know if the app is going to be ok or if one of its
> pages will keep throwing internal errors on account of the
> NoClassDefFoundError.
> 
> Did any one ever encounter this kind of problem?

I've heard about this happening with large .WAR files because something
like the following happens:

1. WAR file starts copying, whether a huge, local file or a
moderately-sized remote file via the manager interface the point is
that this takes some time
2. Tomcat scans the webapps folder for .war files that have been changed
since it's last auto-deploy cycle and finds the new webapp
3. Tomcat attempts to auto-deploy the webapp, but the war file is not
complete, so Bad Things Happen
4. WAR file completes copying

:(

I can think of a few ways around this:

1. Upgrade. It's possible issues with auto-deploy and/or manager have
been resolved. Read the ChangeLog.
2. Only use the manager webapp to deploy your apps.
3. Disable auto-deploy AND only use the manager webapp to deploy your
webapps. This will prevent mid-copy deployments.
4. Stop Tomcat before deploying, which will solve everything :)

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

iEYEARECAAYFAk0vHqoACgkQ9CaO5/Lv0PDAdACeNQp/L6ZVaHl7zGv/jeDTwB/M
uvwAoK4rB5OVlq4PzbhVqQbnEQOac699
=KsuS
-END PGP SIGNATURE-

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



Re: vhost - servlets not available

2011-01-13 Thread Johannes Stein
2011/1/13 Christopher Schultz :
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Johannes,
>
> On 1/13/2011 10:01 AM, Johannes Stein wrote:
>> i deployed a gwt-application in tomcat 6.0.18 without any problems. I
>> pointed a url to the ip-adress and deployed the application unter
>> webapps/myfolder, so that the app was reachable unter 
>> http://mydomain/myfolder.
>> It worked fine.
>
> Thanks for using the standard deployment mechanism! So many people want
> to edit server.xml for some reason.
>
> BTW, 6.0.18 is really quite ancient. You should seriously consider
> upgrading. 6.0.30 was released today... seems like an auspicious occasion.
>
>> But since im using a vhost in tomcat i got a problem.
>> Every time when gwt tries a callback i get the message: "Requested
>> resource not found". I did not make any changes in the web.xml.
>> I added the host like the following in the server.xml:
>> ...
>> 
>>       >        unpackWARs="true" autoDeploy="true"
>>        xmlValidation="false" xmlNamespaceAware="false">
>>         
>>          
>>     
>
> What is your default host? It's specified in the  "defaultHost"
> attribute.
>

As default host is set:




>> The code is deployed into the folder tudom. The .html works fine, but
>> my callbacks dont work.
>>
>> A snippet from my web.xml:
>> 
>>         StartService
>>         tudom.start.server.StartServiceImpl
>>   
>>   
>>         StartService
>>         /tudom.start.Start/StartService
>>   
>>
>> When im changing the URL-Pattern to
>> /tudom.start.Start/StartService
>>
>> the Servlet gets reachable, but this doesnt interest GWT, cause it
>> still tries to load /tudom.start.Start/StartService.
>
> Aren't those the same URL?

Oh, i made a mistake. When im changing the url-pattern in the
servlet-mapping to /StartService the
servlet will be avaible.
If i use the default config of gwt which sets:
/tudom.start.Start/StartService the Servlet
will not be available.

>
> What is the full URL that GWT is trying to access -- including server
> name? I suspect that the introduction of the VHOST has exposed a flaw in
> the URL building in your GWT interface's URLs.
>
> Are you trying to call one VHOST from a page hosted by another VHOST?
> Are there any  elements in your web page that might be affecting
> things?

The files are on the same hast. I call directly the same vhost.
Try it by yourself: http://srv2.tudom.de/Start.html

>
> It might be helpful to use a protocol sniffer like firebug,
> LiveHTTPHeaders, iehttpheader, fiddler, etc. to see what URL your GWT
> app is really trying to hit.

I just downloaded it and will try it. But do you have any idea?

>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk0vG/4ACgkQ9CaO5/Lv0PDpbQCeLJ7PVFJcV7qPzzCFO5oYv04v
> 4e0AnAnYUlftZps6btkg50xliMbK+n0U
> =yQgm
> -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: vhost - servlets not available

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Johannes,

On 1/13/2011 10:01 AM, Johannes Stein wrote:
> i deployed a gwt-application in tomcat 6.0.18 without any problems. I
> pointed a url to the ip-adress and deployed the application unter
> webapps/myfolder, so that the app was reachable unter 
> http://mydomain/myfolder.
> It worked fine.

Thanks for using the standard deployment mechanism! So many people want
to edit server.xml for some reason.

BTW, 6.0.18 is really quite ancient. You should seriously consider
upgrading. 6.0.30 was released today... seems like an auspicious occasion.

> But since im using a vhost in tomcat i got a problem.
> Every time when gwt tries a callback i get the message: "Requested
> resource not found". I did not make any changes in the web.xml.
> I added the host like the following in the server.xml:
> ...
> 
>   unpackWARs="true" autoDeploy="true"
>xmlValidation="false" xmlNamespaceAware="false">
> 
>  
> 

What is your default host? It's specified in the  "defaultHost"
attribute.

> The code is deployed into the folder tudom. The .html works fine, but
> my callbacks dont work.
> 
> A snippet from my web.xml:
> 
> StartService
> tudom.start.server.StartServiceImpl
>   
>   
> StartService
> /tudom.start.Start/StartService
>   
> 
> When im changing the URL-Pattern to
> /tudom.start.Start/StartService
> 
> the Servlet gets reachable, but this doesnt interest GWT, cause it
> still tries to load /tudom.start.Start/StartService.

Aren't those the same URL?

What is the full URL that GWT is trying to access -- including server
name? I suspect that the introduction of the VHOST has exposed a flaw in
the URL building in your GWT interface's URLs.

Are you trying to call one VHOST from a page hosted by another VHOST?
Are there any  elements in your web page that might be affecting
things?

It might be helpful to use a protocol sniffer like firebug,
LiveHTTPHeaders, iehttpheader, fiddler, etc. to see what URL your GWT
app is really trying to hit.

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

iEYEARECAAYFAk0vG/4ACgkQ9CaO5/Lv0PDpbQCeLJ7PVFJcV7qPzzCFO5oYv04v
4e0AnAnYUlftZps6btkg50xliMbK+n0U
=yQgm
-END PGP SIGNATURE-

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



Re: Tomcat JMX connection - Authentication failed.

2011-01-13 Thread André Warnier

Ziggy wrote:

Aha... i didnt realise that i needed to supply the credentials from the
client. I thought Tomcat would get those from the password files. 


Purely from an intellectual curiosity point of view, it would be interesting if you could 
explain what you thought that this server-side password file was for, then.


Granted, it would simplify things a lot.
One would never have to worry about forgetting a password, for example.
:-)



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



Re: Charset configuration on Tomcat 6

2011-01-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Achal,

On 1/13/2011 2:27 AM, Achal Patel wrote:
> Attaching the Web.xml from Tomcat. I have tried everything posted on
> http://tomcat.apache.org/tomcat-6.0-doc/index.html.

This looks like the system-wide web.xml, not the web.xml from your web
application. Have you copied CATALINA_HOME/conf/web.xml into your own
webapp? That's completely unnecessary. Alternatively, have you replaced
CATALINA_HOME/conf/web.xml with the web.xml that is specific to your
webapp? That is confusing at best and dangerous at worst.

> Application is configured to be UNICODE compliant from JSP (having utf-8
> directives), Servlet response (utf-8) and the database jdbc connection
> as well is Unicode compliant (Which works on Weblogic and Websphere
> application servers).

There are still places where character encoding is important. For
instance, you haven't mentioned anything about the request. ;)

> So looking at possible options or any such configuration which I may
> have missed on the Tomcat 6.x.

Mark suggested reading
http://wiki.apache.org/tomcat/FAQ/CharacterEncoding. Have you read it?
Specifically, have you read the answer to Q8: "What can you recommend to
just make everything work? (How to use UTF-8 everywhere)."?

There are 6 steps mentioned, there. Which ones have you done?

- From your messages in this thread, it looks like you have done 1, 3, and
4, while 5 and 6 might not be applicable to your situation. What's left?

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

iEYEARECAAYFAk0vGWEACgkQ9CaO5/Lv0PB7+gCgiLmsvkeYP9PjveZUSfzGuudn
gTAAoJGl/kEOJ09zW8LT2OcLzlg18gnb
=N12Y
-END PGP SIGNATURE-

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



Re: Tomcat JMX connection - Authentication failed.

2011-01-13 Thread Ziggy
Aha... i didnt realise that i needed to supply the credentials from the
client. I thought Tomcat would get those from the password files. Ok im off
to the documentation now. :)

On Thu, Jan 13, 2011 at 1:31 PM, André Warnier  wrote:

> Ok, what I was trying to say is this :
>
> By using the jmxremote.password.file etc.. on the JVM which runs Tomcat,
> you let this JVM know which remote user-id's can connect, and what password
> they should use.
>
> Now, from the client side, when you connect, you have to provide such a
> valid user-id and password, to "login" to the server.
>
> If you try the jconsole utility as a client, you will see this on the
> connection box.
>
> I have no idea how you supply these credentials programmatically from
> /your/ client, but that is what you have to find out.
>
>
>
>
>
>
> Ziggy wrote:
>
>> Ok i am stuck now - here is the full configuration
>>
>> $CATALINA_BASE/setenv.sh
>> ---
>>CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
>>
>> -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
>> -Dcom.sun.management.jmxremote.ssl=false
>> -Dcom.sun.management.jmxremote.authenticate=true
>>
>> -Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access"
>>export CATALINA_OPTS
>>
>> $CATALINA_BASE/conf/jmxremote.password
>> ---
>>monitorRole monitorpass
>>controlRole controlpass
>>
>> $CATALINA_BASE/conf/jmxremote.access
>> ---
>>monitorRole readonly
>>controlRole readwrite
>>
>> The client tool i am using to access the Tomcat JMX server is running on
>> the
>> same machine as the Tomcat instance. when i start tomcat i can see that
>> there is something listening at port 18070 but when i try to connect i get
>> the following error
>>
>>Exception in thread "main" java.lang.SecurityException:
>> Authentication failed! Credentials required
>>at
>>
>> com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticationFailure(JMXPluggableAuthenticator.java:193)
>>at
>>
>> com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticate(JMXPluggableAuthenticator.java:145)
>>at
>>
>> sun.management.jmxremote.ConnectorBootstrap$AccessFileCheckerAuthenticator.authenticate(ConnectorBootstrap.java:185)
>>at
>>
>> javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:213)
>>
>>
>> I connect using the following bit of code
>>
>>
>>try {
>>url = new
>> JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi");
>>jmxc = JMXConnectorFactory.connect(url,null);
>>mbsc = jmxc.getMBeanServerConnection();
>>} catch (MalformedURLException e) {
>>throw new Exception(methodName + ":" + e);
>>} catch (IOException e) {
>>throw new Exception(methodName + ":" + "Failed to
>> connect to the Tomcat Server " + e);
>>}
>>
>> It works fine if i set com.sun.management.jmxremote.authenticate=true to
>> false. Other than that it just fails. The client tool is running on the
>> same
>> machine as the tomcat instance so there should not be any issues with the
>> firewall. Any clues
>>
>> On Thu, Jan 13, 2011 at 1:20 PM, André Warnier  wrote:
>>
>>  Ziggy wrote:
>>>
>>>  Tomcat JMX connection - Authentication failed.

 I am having some problems setting up Tomcat for JMX. I added the
 following
 properties to CATALINA_OPTS

 CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070


 -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
 -Dcom.sun
 .management.jmxremote.ssl=false"

 And have added the jmxremote.password file in to the conf directory. I
 wrote
 a client tool that connects to the JMX server running on port 18070.
 When
 i
 run the client program i get the following error.

 Exception in thread "main" java.lang.SecurityException: Authentication
 failed! Credentials required
   at

  ...
>>>
>>> Ok, so how does your client provide a username and password to the
>>> server's
>>> JMX interface, when it connects ?
>>>
>>>
>>>
>>>  If i change the CATALINA_OPTS properties to

 CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070


 -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
 -Dcom.sun
 .management.jmxremote.ssl=false
 -Dcom.sun.management.jmxremote.authenticate=false"

 Then it works fine.

  Of course, since then there is no authentication required.
>>>
>>>
>>>
>>>  I think what i am confused of is what is classed as
>>>
>>>  remote access. I am running the client program away from the Tomcat
 instance
 but both Tomcat an

vhost - servlets not available

2011-01-13 Thread Johannes Stein
Hey,
i deployed a gwt-application in tomcat 6.0.18 without any problems. I
pointed a url to the ip-adress and deployed the application unter
webapps/myfolder, so that the app was reachable unter http://mydomain/myfolder.
It worked fine.
But since im using a vhost in tomcat i got a problem.
Every time when gwt tries a callback i get the message: "Requested
resource not found". I did not make any changes in the web.xml.
I added the host like the following in the server.xml:
...

  

 

The code is deployed into the folder tudom. The .html works fine, but
my callbacks dont work.

A snippet from my web.xml:

StartService
tudom.start.server.StartServiceImpl
  
  
StartService
/tudom.start.Start/StartService
  

When im changing the URL-Pattern to
/tudom.start.Start/StartService

the Servlet gets reachable, but this doesnt interest GWT, cause it
still tries to load /tudom.start.Start/StartService.

Could everyone help me? Im now searching some hours and cant find
anything. Hope you can help me.
Greetings

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



Re: app throws java.lang.NoClassDefFoundError sometimes, and sometimes it doesnt

2011-01-13 Thread André Warnier

user080701 wrote:

How to unsubscribe this email ?


Scroll to the end (all thr way down there), and follow the instructions.

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



Re: app throws java.lang.NoClassDefFoundError sometimes, and sometimes it doesnt

2011-01-13 Thread user080701

How to unsubscribe this email ?

--
From: "Sam Zilverberg" 
Sent: Thursday, January 13, 2011 9:47 PM
To: "tomcat" 
Subject: app throws java.lang.NoClassDefFoundError sometimes, and sometimes 
it doesnt



Hi,

I'm running a wicket app on tomcat 6.0.20.
Once in a while I need to redeploy it (after fixing some stuff, adding
features and so on).
This is how I redeploy:
1.Use tomcat manager to undeploy the running app.
2.Deploy the new app by copying the new WAR file to a library inside 
tomcat.


Everything seems fine but when I use the app I sometimes get a java.lang.
NoClassDefFoundError.
The class can be just about any class in the project and its libs.
Sometimes its a Hibernate related class, sometimes its a Wicket related
class and
sometimes its a class from my app.
Redeploying once (or a couple of times) solves the problem.

This is very inconsistent and bothering.
After deploying I never know if the app is going to be ok or if one of its
pages will keep throwing internal errors on account of the
NoClassDefFoundError.

Did any one ever encounter this kind of problem?
Do you have any ideas on what is causing this or what I can do to diagnose
this problem?
I'm clueless at the moment :(

Thanks
-Sam



__ Information from ESET NOD32 Antivirus, version of virus 
signature database 5783 (20110113) __


The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




__ Information from ESET NOD32 Antivirus, version of virus signature 
database 5783 (20110113) __

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




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



[ANN] Apache Tomcat 6.0.30 released

2011-01-13 Thread jean-frederic clere

The Apache Tomcat team announces the immediate availability of Apache
Tomcat 6.0.30 stable. This release includes bug-fixes over Apache
Tomcat 6.0.29.

Note that is version has 4 zip binaries: a generic one and three
bundled with Tomcat native binaries for different CPU architectures.

Apache Tomcat 6.0 includes new features over Apache Tomcat 5.5,
including support for the new Servlet 2.5 and JSP 2.1 specifications, a
refactored clustering implementation, advanced IO features, and
improvements in memory usage.

Please refer to the change log for the list of changes:
http://tomcat.apache.org/tomcat-6.0-doc/changelog.html

Downloads:
http://tomcat.apache.org/download-60.cgi

Migration guide from Apache Tomcat 5.5.x:
http://tomcat.apache.org/migration.html

Thank you,

-- The Apache Tomcat Team

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



app throws java.lang.NoClassDefFoundError sometimes, and sometimes it doesnt

2011-01-13 Thread Sam Zilverberg
Hi,

I'm running a wicket app on tomcat 6.0.20.
Once in a while I need to redeploy it (after fixing some stuff, adding
features and so on).
This is how I redeploy:
1.Use tomcat manager to undeploy the running app.
2.Deploy the new app by copying the new WAR file to a library inside tomcat.

Everything seems fine but when I use the app I sometimes get a java.lang.
NoClassDefFoundError.
The class can be just about any class in the project and its libs.
Sometimes its a Hibernate related class, sometimes its a Wicket related
class and
sometimes its a class from my app.
Redeploying once (or a couple of times) solves the problem.

This is very inconsistent and bothering.
After deploying I never know if the app is going to be ok or if one of its
pages will keep throwing internal errors on account of the
NoClassDefFoundError.

Did any one ever encounter this kind of problem?
Do you have any ideas on what is causing this or what I can do to diagnose
this problem?
I'm clueless at the moment :(

Thanks
-Sam


Re: Tomcat JMX connection - Authentication failed.

2011-01-13 Thread André Warnier

Ok, what I was trying to say is this :

By using the jmxremote.password.file etc.. on the JVM which runs Tomcat, you let this JVM 
know which remote user-id's can connect, and what password they should use.


Now, from the client side, when you connect, you have to provide such a valid user-id and 
password, to "login" to the server.


If you try the jconsole utility as a client, you will see this on the 
connection box.

I have no idea how you supply these credentials programmatically from /your/ client, but 
that is what you have to find out.






Ziggy wrote:

Ok i am stuck now - here is the full configuration

$CATALINA_BASE/setenv.sh
---
CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access"
export CATALINA_OPTS

$CATALINA_BASE/conf/jmxremote.password
---
monitorRole monitorpass
controlRole controlpass

$CATALINA_BASE/conf/jmxremote.access
---
monitorRole readonly
controlRole readwrite

The client tool i am using to access the Tomcat JMX server is running on the
same machine as the Tomcat instance. when i start tomcat i can see that
there is something listening at port 18070 but when i try to connect i get
the following error

Exception in thread "main" java.lang.SecurityException:
Authentication failed! Credentials required
at
com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticationFailure(JMXPluggableAuthenticator.java:193)
at
com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticate(JMXPluggableAuthenticator.java:145)
at
sun.management.jmxremote.ConnectorBootstrap$AccessFileCheckerAuthenticator.authenticate(ConnectorBootstrap.java:185)
at
javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:213)


I connect using the following bit of code


try {
url = new
JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi");
jmxc = JMXConnectorFactory.connect(url,null);
mbsc = jmxc.getMBeanServerConnection();
} catch (MalformedURLException e) {
throw new Exception(methodName + ":" + e);
} catch (IOException e) {
throw new Exception(methodName + ":" + "Failed to
connect to the Tomcat Server " + e);
}

It works fine if i set com.sun.management.jmxremote.authenticate=true to
false. Other than that it just fails. The client tool is running on the same
machine as the tomcat instance so there should not be any issues with the
firewall. Any clues

On Thu, Jan 13, 2011 at 1:20 PM, André Warnier  wrote:


Ziggy wrote:


Tomcat JMX connection - Authentication failed.

I am having some problems setting up Tomcat for JMX. I added the following
properties to CATALINA_OPTS

CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070

-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun
.management.jmxremote.ssl=false"

And have added the jmxremote.password file in to the conf directory. I
wrote
a client tool that connects to the JMX server running on port 18070. When
i
run the client program i get the following error.

Exception in thread "main" java.lang.SecurityException: Authentication
failed! Credentials required
   at


...

Ok, so how does your client provide a username and password to the server's
JMX interface, when it connects ?




If i change the CATALINA_OPTS properties to

CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070

-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun
.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"

Then it works fine.


Of course, since then there is no authentication required.



 I think what i am confused of is what is classed as


remote access. I am running the client program away from the Tomcat
instance
but both Tomcat and the client tool are on the same machine (i.e.
different
virtual machines but same environemnt). I thought i had to configure the
remote authentication if i access the JMX server remotely from a different
machine.

By remote access do they mean accessing the JMX server from any VM either
locally on the same machine or remotely from a different machine?

 I believe that in this context, "remote" just means "via a TCP/IP

connection".
It does not matter if your client is on the same host or not.  If it
accesses the "server" via TCP/IP, then it counts as remote.

There is another way to connect, limited to local processes running on the
same host, but I forget ho

Re: Tomcat JMX connection - Authentication failed.

2011-01-13 Thread Ziggy
Ok i am stuck now - here is the full configuration

$CATALINA_BASE/setenv.sh
---
CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.access.file=$CATALINA_BASE/conf/jmxremote.access"
export CATALINA_OPTS

$CATALINA_BASE/conf/jmxremote.password
---
monitorRole monitorpass
controlRole controlpass

$CATALINA_BASE/conf/jmxremote.access
---
monitorRole readonly
controlRole readwrite

The client tool i am using to access the Tomcat JMX server is running on the
same machine as the Tomcat instance. when i start tomcat i can see that
there is something listening at port 18070 but when i try to connect i get
the following error

Exception in thread "main" java.lang.SecurityException:
Authentication failed! Credentials required
at
com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticationFailure(JMXPluggableAuthenticator.java:193)
at
com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticate(JMXPluggableAuthenticator.java:145)
at
sun.management.jmxremote.ConnectorBootstrap$AccessFileCheckerAuthenticator.authenticate(ConnectorBootstrap.java:185)
at
javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:213)


I connect using the following bit of code


try {
url = new
JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:18070/jmxrmi");
jmxc = JMXConnectorFactory.connect(url,null);
mbsc = jmxc.getMBeanServerConnection();
} catch (MalformedURLException e) {
throw new Exception(methodName + ":" + e);
} catch (IOException e) {
throw new Exception(methodName + ":" + "Failed to
connect to the Tomcat Server " + e);
}

It works fine if i set com.sun.management.jmxremote.authenticate=true to
false. Other than that it just fails. The client tool is running on the same
machine as the tomcat instance so there should not be any issues with the
firewall. Any clues

On Thu, Jan 13, 2011 at 1:20 PM, André Warnier  wrote:

> Ziggy wrote:
>
>> Tomcat JMX connection - Authentication failed.
>>
>> I am having some problems setting up Tomcat for JMX. I added the following
>> properties to CATALINA_OPTS
>>
>> CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
>>
>> -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
>> -Dcom.sun
>> .management.jmxremote.ssl=false"
>>
>> And have added the jmxremote.password file in to the conf directory. I
>> wrote
>> a client tool that connects to the JMX server running on port 18070. When
>> i
>> run the client program i get the following error.
>>
>> Exception in thread "main" java.lang.SecurityException: Authentication
>> failed! Credentials required
>>at
>>
> ...
>
> Ok, so how does your client provide a username and password to the server's
> JMX interface, when it connects ?
>
>
>
>> If i change the CATALINA_OPTS properties to
>>
>> CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
>>
>> -Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
>> -Dcom.sun
>> .management.jmxremote.ssl=false
>> -Dcom.sun.management.jmxremote.authenticate=false"
>>
>> Then it works fine.
>>
>
> Of course, since then there is no authentication required.
>
>
>
>  I think what i am confused of is what is classed as
>
>> remote access. I am running the client program away from the Tomcat
>> instance
>> but both Tomcat and the client tool are on the same machine (i.e.
>> different
>> virtual machines but same environemnt). I thought i had to configure the
>> remote authentication if i access the JMX server remotely from a different
>> machine.
>>
>> By remote access do they mean accessing the JMX server from any VM either
>> locally on the same machine or remotely from a different machine?
>>
>>  I believe that in this context, "remote" just means "via a TCP/IP
> connection".
> It does not matter if your client is on the same host or not.  If it
> accesses the "server" via TCP/IP, then it counts as remote.
>
> There is another way to connect, limited to local processes running on the
> same host, but I forget how it is called or how it works.
> You can see the distinction pretty clearly by using the "jconsole"
> application, which is included in the JDK.
>
> Note : for the "remote" kind of access, there is another (second) TCP
> connection used, separate from the port which you indicate with the
> jmxremote.port parameter.
> If you are on the same host, it does not matter, but if you really need to
> connect from another host th

Re: Tomcat JMX connection - Authentication failed.

2011-01-13 Thread André Warnier

Ziggy wrote:

Tomcat JMX connection - Authentication failed.

I am having some problems setting up Tomcat for JMX. I added the following
properties to CATALINA_OPTS

CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun
.management.jmxremote.ssl=false"

And have added the jmxremote.password file in to the conf directory. I wrote
a client tool that connects to the JMX server running on port 18070. When i
run the client program i get the following error.

Exception in thread "main" java.lang.SecurityException: Authentication
failed! Credentials required
at

...

Ok, so how does your client provide a username and password to the server's JMX interface, 
when it connects ?




If i change the CATALINA_OPTS properties to

CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun
.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"

Then it works fine.


Of course, since then there is no authentication required.


 I think what i am confused of is what is classed as

remote access. I am running the client program away from the Tomcat instance
but both Tomcat and the client tool are on the same machine (i.e. different
virtual machines but same environemnt). I thought i had to configure the
remote authentication if i access the JMX server remotely from a different
machine.

By remote access do they mean accessing the JMX server from any VM either
locally on the same machine or remotely from a different machine?


I believe that in this context, "remote" just means "via a TCP/IP connection".
It does not matter if your client is on the same host or not.  If it accesses the "server" 
via TCP/IP, then it counts as remote.


There is another way to connect, limited to local processes running on the same host, but 
I forget how it is called or how it works.
You can see the distinction pretty clearly by using the "jconsole" application, which is 
included in the JDK.


Note : for the "remote" kind of access, there is another (second) TCP connection used, 
separate from the port which you indicate with the jmxremote.port parameter.
If you are on the same host, it does not matter, but if you really need to connect from 
another host through a firewall or so, it may.

You may want to have a look here for more info :
http://download.oracle.com/javase/6/docs/technotes/guides/management/agent.html#gdevo
(see the section :  Monitoring Applications through a Firewall)

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



Re: Context.xml: how to reference parameters inside the same file

2011-01-13 Thread durbans


awarnier wrote:
> 
> Since this is XML, could you not also reference "entities" defined in a
> separate file ?
> 

How ?

My problem is that i have a resource:



and I need to get the attributes value in Java code.

I am able to get the  values (context.getInitParameters()) but
not the  values.
-- 
View this message in context: 
http://old.nabble.com/Context.xml%3A-how-to-reference-parameters-inside-the-same-file-tp30660973p30661666.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Tomcat JMX connection - Authentication failed.

2011-01-13 Thread Ziggy
Tomcat JMX connection - Authentication failed.

I am having some problems setting up Tomcat for JMX. I added the following
properties to CATALINA_OPTS

CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun
.management.jmxremote.ssl=false"

And have added the jmxremote.password file in to the conf directory. I wrote
a client tool that connects to the JMX server running on port 18070. When i
run the client program i get the following error.

Exception in thread "main" java.lang.SecurityException: Authentication
failed! Credentials required
at
com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticationFailure(JMXPluggableAuthenticator.java:193)
at
com.sun.jmx.remote.security.JMXPluggableAuthenticator.authenticate(JMXPluggableAuthenticator.java:145)
at
sun.management.jmxremote.ConnectorBootstrap$AccessFileCheckerAuthenticator.authenticate(ConnectorBootstrap.java:185)
at
javax.management.remote.rmi.RMIServerImpl.doNewClient(RMIServerImpl.java:213)
at
javax.management.remote.rmi.RMIServerImpl.newClient(RMIServerImpl.java:180)
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
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
at javax.management.remote.rmi.RMIServerImpl_Stub.newClient(Unknown
Source)
at
javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2312)
at
javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:277)
at
javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at
com.bt.c21sc.c21tkprobe.accessors.C21TkProbeJmxDAO.connect(Unknown Source)
at com.bt.c21sc.c21tkprobe.service.C21TkProbeBD.execute(Unknown
Source)
at com.bt.c21sc.c21tkprobe.C21AppserverProbe.main(Unknown Source)

If i change the CATALINA_OPTS properties to

CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=18070
-Dcom.sun.management.jmxremote.password.file=$CATALINA_BASE/conf/jmxremote.password
-Dcom.sun
.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"

Then it works fine. I think what i am confused of is what is classed as
remote access. I am running the client program away from the Tomcat instance
but both Tomcat and the client tool are on the same machine (i.e. different
virtual machines but same environemnt). I thought i had to configure the
remote authentication if i access the JMX server remotely from a different
machine.

By remote access do they mean accessing the JMX server from any VM either
locally on the same machine or remotely from a different machine?


Re: Context.xml: how to reference parameters inside the same file

2011-01-13 Thread André Warnier

Konstantin Kolinko wrote:

2011/1/13 durbans :

Is it possible ?



No, not possible.

You can reference any system properties, though (as mentioned in [1]).
E.g. ${catalina.base}  or ${java.io.tmpdir}

[1] http://tomcat.apache.org/tomcat-6.0-doc/config/index.html


Since this is XML, could you not also reference "entities" defined in a 
separate file ?

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



Re: Context.xml: how to reference parameters inside the same file

2011-01-13 Thread Konstantin Kolinko
2011/1/13 durbans :
> Is it possible ?
>

No, not possible.

You can reference any system properties, though (as mentioned in [1]).
E.g. ${catalina.base}  or ${java.io.tmpdir}

[1] http://tomcat.apache.org/tomcat-6.0-doc/config/index.html

Best regards,
Konstantin Kolinko

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



Context.xml: how to reference parameters inside the same file

2011-01-13 Thread durbans

I'd like to create a context.xml where I have:

[...]



 [...]



where parameter1, parameter2 and parameter3 use the values of the parameters
tag defined previously.

Is it possible ?

I didn't find any way or syntax to set name1, name2 and name3 as reference .
It seems that it accepts only strings.
-- 
View this message in context: 
http://old.nabble.com/Context.xml%3A-how-to-reference-parameters-inside-the-same-file-tp30660973p30660973.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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