Re: Automatically compressing localhost_access_log after rotation

2017-08-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Martin,

On 8/4/17 5:08 AM, Martin Knoblauch wrote:
> On Thu, Aug 3, 2017 at 7:16 PM, Christopher Schultz < 
> ch...@christopherschultz.net> wrote:
> 
>> -BEGIN PGP SIGNED MESSAGE- Hash: SHA256
>> 
>> Martin,
>> 
>> On 8/3/17 5:47 AM, Martin Knoblauch wrote:
>>> is there a way to compress the localhost_access_log.#.txt
>>> file automatically after rotation?
>> 
>> Not really. The file is rotated *during* log events, and stalling
>> to compress a log file is probably not a great solution.
>> 
>> 
> Hmm. Smart way would be to rotate the log, continue logging to the
> new file and compress the old one "in the background". That way
> stalling would not be an issue.

Sure. But that requires more code, of course, and therefore more
complexity.

>> Alternatively/preferably is there a way to put the access
>> logging
>>> under "log4j"?
>> 
>> Also not really, but if you are willing to write code, you can do
>> it. The AccessLogValve handles its own logging to a file, but if
>> you were to subclass AccessLogValve and override the "open"
>> method and assign a value to the AccessLogValve.writer member
>> that writes to a log4j logger, then I think you could probably do
>> this.
>> 
> 
> Writing my own class is clearly an option, but I wanted to first
> check the already available  options.
> 
> 
>> I believe that log4j will stall your access log during the 
>> compression, though, so you might want to think about whether or
>> not you want to implement it this way.
>> 
>> 
> Need to check how they are doing it. We use rolling with
> compression, but not on a high volume log like the access log.

You'd have to check to see how log4j actually does things, but I think
compression might happen in-line with the logging thread. I'm sure if
varies greatly depending upon your log4j version.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZhO6hAAoJEBzwKT+lPKRY9OgP/iG+YKDbbG3w7SaKyvOSMlzK
Y9yxQqgK0fpGO7XgMXKM0IuPh8G5EWwiNPUc5k0AbQNjCkNcTmTISzj8TUTu43HO
eyPlVOWjZRfdvetL99AxhkEDaw1j7HdsL5fi+zDi440t8sS4z4RETeT5a8DE2Vti
v80ER+EdAMJeydvOxMMGgk8nHal379aW95m1JHJQppC8V6wcbWnYr7TGVUjl+gDR
SL9fiiymrgLYvC1WhSblKQaOEpzyfhoFm4IOTwG/M5jh/coPsFj7KGdpxels69MM
B4dLdKwbECZbVJ2348rScrxjMevjRLkVlq38zw2kchk6gav9DjfF1i1nMd8piOoD
FgpXgfjn7elq9C2jaKgGodfBdc/cw04ysoZgTRss71vfcL69WW/yQ6rHMUJH0XsM
fqDmZWfXzwBBH6I4fGZuiH+Z+bzdsrSYBgWcJxlGtDE3Vf07oCljvb3W4GCXVdzq
u0qdB+YWyU0daWEErdGl4AlwCmE21HSzzwz/4RdvMJHgxgMwTs2KfF6/KCP2S1PX
Hpv5dGBSb8OWOZ8Y6I6N2Qo1VSME9WfGh4mU8X/r2rMPeBjRoOwVnG6OYPtCYSnl
TKyPpGTHf/m30A6k3uGucYaSocyNvqmP9MqCfeHEAyG/eY3ig/BY1HW65Oel5vAM
FzNKelDMwl4zqyYwDIr+
=5o3t
-END PGP SIGNATURE-

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



Re: SSL is not working

2017-08-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

M.,

On 8/4/17 12:16 PM, M. Manna wrote:
> Have you imported the signed server certificate into the server
> keystore with all the root+intermediate certificates? in other
> words, does the "chain-of-trust" exist in server keystore?
> 
> You just need to add the root and intermediate CA certs to trust
> store - any server certs signed by them is by default, trusted.

No, you definitely don't want to mess around with any trust stores.

Here are the instructions I always follow when using Java keystores
(which are in fact so awful that even Java is giving up on them[1]),
copied directly from my corporate wiki page on the subject (which I
wrote because I can never remember all the steps):

== Create a New Server Key & Certificate with Java's Keytool

Make sure to use Java's keytool with a Java version 1.6 or better.

 $ keytool -genkey -keyalg RSA -sigalg SHA256withRSA -keysize 4096
- -alias ${HOSTNAME} -keystore ${HOSTNAME}.jks

== Generate a CSR to send to a CA using Java's Keytool

 $ keytool -certreq -sigalg SHA256withRSA -keystore ${HOSTNAME}.jks

If you have more than one certificate in there, you'll need to use the
"-alias" option.

== Import a Signed Certificate into your Keystore

You'll need to import the root and intermediate certificates from the
CA first:

 $ keytool -import -alias [Authority.CA] -trustcacerts -file
[authority's CA cert] -keystore ${HOSTNAME}.jks
 $ keytool -import -alias [Authority.intermediate] -trustcacerts -file
[authority's intermediate cert] -keystore ${HOSTNAME}.jks
 $ keytool -import -alias ${HOSTNAME} -file ${HOSTNAME}.crt -keystore
${HOSTNAME}.jks

Note that the order of import matters. If you do this in the opposite
order, I think your server catches fire instantly. Java keystores are
*just that bad*.

Hope that helps,
- -chris

[1] http://openjdk.java.net/jeps/229

> On 4 August 2017 at 17:09, Hameed, Amir 
> wrote:
> 
>> Hi, I am trying to configure Tomcat 8.0.36 with SSL and running
>> into some issues. The JDK version I am using is 1.8.0_64. I used
>> the following process to implement SSL:
>> 
>> 1.   Generated a java key store using the following command: 
>> ${JAVA_HOME}/bin/keytool -genkey -alias [alias-name] -keyalg RSA
>> -keysize 2048 \ -keystore [key-store-path]/keystore.jks -dname
>> "CN=[common-name],OU=[org-unit], O=[company-name], L=[city],
>> ST=[state], C=US"
>> 
>> 
>> 2.   Generated CSR using the following command: 
>> ${JAVA_HOME}/bin/keytool -certreq -alias [alias-name] -file 
>> [key-store-path]/[csr-file-name] \ -keystore
>> [key-store-path]/keystore.jks
>> 
>> 
>> 3.   Requested certificate from COMODO.
>> 
>> 4.   Imported all Trusted certificates from COMODO into the
>> key store using command. There were a total of three trusted
>> certificates that we received from COMODO: 
>> ${JAVA_HOME}/bin/keytool -import -trustcacerts -alias
>> [alias-name] -file [ssl-cert-file] -keystore
>> [key-store-path]/keystore.jks -v
>> 
>> 
>> 5.   Modified Tomcat's server.xml file as shown below:
>> 
>> > 
>> maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
>> 
>> clientAuth="false" sslProtocol="TLS"
>> 
>> keystoreFile="[key-store-path]/keystore.jks"
>> 
>> keystoreType="JKS" keystorePass="[key-store-password]" />
>> 
>> 
>> 
>> 6.   Restarted Tomcat.
>> 
>> 7.   Accessed the Tomcat homepage from the browser using
>> https and the browser complained about page being insecure. When
>> I looked at the certificate from the browser, I see that the
>> Certificate Path tab of the certificate shows that the trusted
>> chain is incomplete and does not show the trusted certificates
>> that I had imported into the key store.
>> 
>> What am I missing here? Any help will be appreciated.
>> 
>> 
>> Thank you, Amir
>> 
>> 
> 
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZhO37AAoJEBzwKT+lPKRYXFMP/jfiWrKQR5dTzarkJdJa39oN
to4WNYH6wfdONcRhQUHggVAid4qPjs567XjGWfRfnZvaxNhQu52rQN7+tbsFwt7i
wTeURIYK0c/xiO6fvUSvc9A5QkXvMUu2vrPy4V6btMxZSmvktxpTMG0iALbUeobv
Jr42EzE6WZ1Lgj6NoGyJIBkCebfu6HRySOWHIi3rQKBSab3sVYf65mryn6zGw8pq
ZMR8daqsrUdrt9f3ZCqCZjWNHk96fTdh2OUvKIFm58ux0bhj+s5LDpBq4LYTDww1
OxFLOlmxqZ1iy0UmnvNCeEagrMveg1XVRYEbH4jBHsW3nCktzUPa62iLE9I25CnN
iBdoGbHD9gal0PdA6+tbw4aZFvEFzqnLp4LSSwQ2Jm+6vb8SpS0/g6a5T0jrR+0j
GQ9bvfZA4MtmrS4+MZOhEBiv0RGmeoaRv/UDIdsOZdzVGfQkqH5vDqoIEZhRH9Wb
7BC5Sw7TyDM5ylT1vjIxucoaPVFc+uWLFZbUMA57tqlfYlxX6oc3ZhnvEZhP49+0
ridFkN1BY7X42flXnoztbc8B0iRj/jFymnHXQcfpL5Vnc48OSdSPktDVnfm8Q9ZF
jZJVzLfn3Og5+FhmBZH+mwAz5nxFN8naEuaSmpUGx0MVcqHBXHHGFd7E7axtUA+e
twkhpNDyccC7mPAVv3ke
=F7Z0
-END PGP SIGNATURE-

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



Re: Small question on mod_jk load balancing methon "Next"

2017-08-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Martin,

On 8/4/17 4:53 AM, Martin Knoblauch wrote:
> Hi,
> 
> just need some clarification on the mod_jk load blanacing method
> "Next". The documentation states:
> 
> "If method is set to N[ext] the balancer will again use the number
> of sessions to find the best worker. All remarks concerning the
> Session method apply as well. The difference to the Session method
> is how the session count is handled in the sliding time window. The
> Next method does not divide by 2, instead it subtracts the current
> minimum number. This should effectively result in a round-robin
> session balancing, thus the name Next. Under high load, the two
> session balancing methods will result in a similar distribution,
> but Next will be better if you need to distribute small numbers of
> sessions. "
> 
> What exactly is the "current minimum number"? How is the minimum
> taken?
>> From all workers in the balancer set, or only the ACTive ones?

I don't know for sure, but just in case this is a language issue, I
believe it means it will subtract the "lowest number of sessions
amongst all active workers". So if you had workers 1, 2, and 3 with
45, 50, and 55 sessions respectively, it will subtract the value 45
from all worker session counts to determine the priority for which
node will get the next session.

> I know, I should look it up in the code :-)

The mod_jk code is some of the most difficult to read (within the
Tomcat project) for a number of reasons.

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZhOv+AAoJEBzwKT+lPKRYN2UQAKUFGQTSP4FKAGQym14SfBhe
ubtSXYyy8AWcEFax6VNJ61PKs6HDLzZWGrZU2A5T0q49/odTPXEOtFDls71quxvj
T++Nnq7fQrZPWT7x4agOzlnna6lz4FXZBGXoOBemQ86NDuU2tG2Q4J4V+2ZMErK8
kDPXhQ4UoVXTEUuIFfCSOXsPKg4SoIwJb0F/icrypFLtTIvd/De4DRZgNXbhf/CZ
9SRjDIniJ01xUcaUK+qyyD/KX91Gp80LVp5p1ma6fzXlVf2rQe7CLR7OLLUxjHFc
3ggWc+u6jipI9JiDNsuq/YkIUIIMGhKok4d/MaE9ydZEI9u3TZqtOzPwWiFZDY8j
n2ws38v7T8GHKhwRUsOEYlq/F9PaB410OgxMVLU0DO5Swdn1V5M2g6fMYTyMJTsa
wE7Ur4dh8R5Yrlhh9lYaRtt+9QpQBPpkYFPbY1F6PFOs0+zWwkEEQdjn3b2HPiVm
ot66WRSa5mXoEhJNIUeezxrQC4BugFte+bGcoTEkei7hPZp4msgV8zt2kMvSp0c7
hK9I0lZlnNeb3DosiFkWMABSwkLrSrLYiJb+AdC8gAhGcwFRsseRYh3gSP+yaEr2
0VV5iWYuaIhCkq1h/uVMnqId4PJjOAgB/NYD4AE2bXwbTR/qGpjMZDsWefnU6AM/
7TnD5f8GbgGpUun0C/pg
=Saq3
-END PGP SIGNATURE-

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



Re: Small question on mod_jk load balancing methon "Next"

2017-08-04 Thread Rainer Jung

Hi Martin,

Am 04.08.2017 um 10:53 schrieb Martin Knoblauch:

Hi,

 just need some clarification on the mod_jk load blanacing method "Next".
The documentation states:

"If method is set to N[ext] the balancer will again use the number of
sessions to find the best worker. All remarks concerning the Session method
apply as well. The difference to the Session method is how the session
count is handled in the sliding time window. The Next method does not
divide by 2, instead it subtracts the current minimum number. This should
effectively result in a round-robin session balancing, thus the name Next.
Under high load, the two session balancing methods will result in a similar
distribution, but Next will be better if you need to distribute small
numbers of sessions. "

 What exactly is the "current minimum number"? How is the minimum taken?
From all workers in the balancer set, or only the ACTive ones? I know, I
should look it up in the code :-)


I looked up the code I wrote 6 years ago.

First: when using the session base lb methods, mod_jk needs to estimate 
session counts. No lb method of mod_jk contacts the backends to get real 
data, instead mod_jk uses the request info it sees to estimate the 
backend situation.


For session based methods, mod_jk counts requests, that do not include a 
session id assuming that those are exactly the ones that create new 
sessions. Of course:


a) a session id can be outdated, meaning mod_jk would not count the 
request as session creating but in fact it would create a new one. One 
can at least configure mod_jk to be aware of login pages which will 
always create a new session (see 
http://tomcat.apache.org/connectors-doc/reference/uriworkermap.html and 
http://tomcat.apache.org/connectors-doc/reference/apache.html and there 
look for "sticky_ignore").


b) a request without a session ID might not actually create a session, 
depending on app details. There are additional config options to teach 
mod_jk which URIs do not create sessions (see 
http://tomcat.apache.org/connectors-doc/reference/uriworkermap.html and 
http://tomcat.apache.org/connectors-doc/reference/apache.html and there 
look for "stateless").


c) sessions time out in backends and users can log out. mod_jk does not 
track that. One can remove the session cookie during the logout, so that 
the "new" requests from that user will be counted by the mod_jk session 
counter.


Because of these problems I typically recommend to stick to the default 
lb method (request counting, not session counting). But sometimes apps 
have resource usage dominated by sessions and then a "session" based lb 
method can help, especially if you find a configuration which keeps the 
effect of a)-c) above small.


Since all counting methods, not only session based ones, would count 
stuff since the last restart of mod_jk, but the current backend load 
situation depends much more on stuff that happened recently, we try to 
get rid of past counts by reducing the counters regularly. By default 
this happens once per minute and is done in a way that the counters are 
divided by 2 once per minute. That way old counter increases contribute 
less and less to the current counter value. For the session based method 
this would mean we assume half of the counted sessions die after one 
minute, 50% of the rest during the next minute etc. Note that the 
counters are integers, so e.g. a counter value of 1 will after division 
by 2 result in a new value 0. Most often that is no problem, because on 
a loaded system numbers are big and rounding down doesn't change a lot.


The next request without session id will be send to the worker with the 
smallest such "session" counter.


The "Next" message varies that procedure by not dividing by 2 every 
minute, but instead subtracting the minimum value of the backend 
counters. Assume after the first minute, your 4 backends have "session" 
counters 2, 3, 3 and 2. Then the minimum is 2, so after the minute we 
correct the values to 0, 1, 1 and 0. Then we add for the next minute new 
sessions to that counter and again subtract the new minimum etc.


When would that be helpful? It was for an application with really huge 
sessions but small session numbers. There was a risk that if for a 
minute only 0 or one sessions were created on the backends, after 
dividing by 2 all workers were again 0.


You can actually track the counters via the status worker, were they are 
exposed as column "V" (load balancer value).


Regards,

Rainer

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



Re: This is weird: can't bind to 443

2017-08-04 Thread Igal @ Lucee.org

Chris,

On 8/4/2017 2:39 PM, Christopher Schultz wrote:

Yes, they are available on YouTube. For some reason, nobody has
bothered to link them to the ASF's YouTube channel... they are a
"playlist" for ApacheCon 2017 - Miami:
https://www.youtube.com/playlist?list=PLbzoR-pLrL6pLDCyPxByWQwYTL-JrF5Rp

All of the Tomcat-related ones are already linked from the "TomcatCon
2017" section of our Presentations page:
http://tomcat.apache.org/presentations.html

The ApacheCon YouTube playlist has a bunch of non-Tomcat-related
videos as well, of course.




Well noted on all points.

Thank you for the information and the links!

Igal Sapir
Lucee Core Developer
Lucee.org 






Re: This is weird: can't bind to 443

2017-08-04 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Igal,

On 8/3/17 3:11 PM, Igal @ Lucee.org wrote:
> Hi Chris,
> 
> On 8/3/2017 11:39 AM, Christopher Schultz wrote:
>> On 8/3/17 2:22 PM, Igal @ Lucee.org wrote:
>>> Was it priced? What would have been the cost for doing that?
>> The cost was $3000/room/day (as quoted to me by Shane Curcuru --
>> I asked because I was curious at the time).
> Thanks for the info.
> 
>> TomcatCon had one day of recordings care of our sponsor, Comcast.
>> Other parts of the conference had recordings as well.
> 
> Are those recordings available?  I'm specifically interested in
> the Tomcat ones.

Yes, they are available on YouTube. For some reason, nobody has
bothered to link them to the ASF's YouTube channel... they are a
"playlist" for ApacheCon 2017 - Miami:
https://www.youtube.com/playlist?list=PLbzoR-pLrL6pLDCyPxByWQwYTL-JrF5Rp

All of the Tomcat-related ones are already linked from the "TomcatCon
2017" section of our Presentations page:
http://tomcat.apache.org/presentations.html

The ApacheCon YouTube playlist has a bunch of non-Tomcat-related
videos as well, of course.

>> They do, but don't always want to pay for every single room for
>> every single day.
> 
> That makes sense.  I wonder what kind of exposure they get though.
> Can they put their name in the intro or outro of the videos?  A
> link to their site?

All sponsorships are handled at the ApacheCon level, and usually end
up being names+logos on all of the signs, etc. at the conference. Plus
obviously listed on all conference-related web pages, etc. (e.g.
http://events.linuxfoundation.org/events/apachecon-north-america and
scroll toward the bottom of the page).

>>> Alternatively, the MoSKito webinar that you just announced is
>>> very exciting.  Perhaps more webinars can be set up.
>> We just need people to author them and perform. :)
>> 
>> Contributions welcome!
> 
> Sure, but those people need to have certain skills and expertise
> in Tomcat or very related technologies.

Like Lucee, for instance? Leon's talk, which is quite Tomcat-related,
is about a third-party product.

> I, for example, can do one for rapid web application development
> with Lucee, which allows a much faster development than JSP or JSF
> for example.  I'm not sure if the Tomcat channel is the best for
> that (though we do use Tomcat as the servlet container).

You can always make a proposal. The worst case would be "we" decide
that it's too much of an advertisement for a company/product/service
and that you are welcome to promote your own webinar, but we won't do
it for you.

> For Tomcat- expert advice I usually refer to you or to Mark ;)

Don't confuse my verbosity with deep knowledge. I am one of the least
knowledgeable of the (active) Tomcat committers, at least in terms of
the underlying technology. But I know how to configure it, and I'm
fairly good at explaining things, and I type quickly. :)

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJZhOmvAAoJEBzwKT+lPKRYZF8QAIDy4p/9iKttoRQ5stBSFfow
b3zKrJOCoFET8Ums6F6Vm6wHtunCfT52UHwZSGX1oKn5AL3xO+tPxQuMGCMLJeuM
fzwaRfdg47bodJCJUiLdHs/VQ7ulfYOq/cTuJjAkXjl6Ljls/7kP69KVrILLMN1O
5oyM4FuVcy1lpUz43DLB8hmzr+jArThjDygq1veHOgNcTI0Xi/es68c/6/9MwZy/
FmDFU2MH1mokwzXw8wufkATRpczmbtkXxPKD+E1V4ESwoH2M8hxNnJH3W5bbx3MK
zvKLpk0KA1TJPmLdOglKoqYUrmhf7ywQtY6uFCXyebuweiVUJrBF80o0c/DdP0hY
uU8ZA5dYsNQnha6pWB3XeWb/iMLqj1e/v0dL3suhSD8CctcjWEijw7xxYQJ+5E6h
X5jVBIs/2rOHG642xXkoeV82ffCZ8OK1u3LzmQKjoK9Nz3GFO70D2zgLYd3b8JeB
OCFO1t626gdjCCSBPWxI243jgiLUGQH1szzgKxkXJ0Ec5JUwQfVxFQfUptJoexz9
xtGSox0sYeDD3J8VSPxqLo1XdP5SM7hEMUbHsto+cShrmhVPTw/sXK2B5cZoQgbv
oD/FN1uMj+8ny5WmjiPesmrYobPTAndrhloPJmBHNbNbqFcbpqb2WJVgx4xLnUKa
vzagcWXOfs3fiM+yZ8Zb
=Dimd
-END PGP SIGNATURE-

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



Re: Getting user role membership without context

2017-08-04 Thread Alex O'Ree
Rehashing this. "Works" was working with the out of the box
tomcat-users.xml file. When incorporating a JNDI/Ldap setup, I'm not
getting the expected result.

Server.xml setup
Realm
- UserLockOutRealm
-- JDNIRealm
-- UserRoleRealm (paraphrasing here, this is the default xml file thing)

Consider the following ldap setup (MS active directory)
-LdapUserBob, memberOf=GroupAdmins,GroupNotRelevant objectclass=user
-GroupAdmins, objectclass=group
-GroupUsers, objectclass=group
-GroupNotRelevant, objectclass=group

In the war/WEB-INF/web.xml, i have the user constraint setup with
mappings from the ldap groups to application roles.
Everything works as expected when logging in as LdapUserBob. The
mapped roles resolve in this context and the application requires the
mapped role GroupAdmins. LdapUserBob can get in, no one else can
though (expected)

Using my hack job reflection solution and stepping through the code, I
can get a user object from the realm representing LdapUserBob and the
user object has exactly one role attached to it, GroupNotRelevant. I'm
a bit unclear as to why only the non relevant group is added to the
user role. When calling isUserInRole from the servlet context, it's
returning false. I'm assuming there's something wrong with the JNDI
realm configuration but since it works correctly under normal
circumstances and not using the reflection solution, I'm a bit puzzled
and am unsure how to proceed.


On Wed, Jul 19, 2017 at 11:20 AM, Alex O'Ree  wrote:
> Got it to work! Thanks Mark!
>
> On Wed, Jul 19, 2017 at 10:40 AM, Mark Thomas  wrote:
>> On 19/07/17 15:34, Alex O'Ree wrote:
>>> Context.findChild and findChildren returns an instance of "Container".
>>> It looks like StandardWrapper extends Container, so I should be able
>>> to type cast it. The question is, is it always going to be an instance
>>> of StandardWrapper?
>>
>> For a Context, it should always be an instance of Wrapper so as long as
>> you cast to Wrapper, you should be fine.
>>
>> In a default Tomcat install it will always be StandardWrapper but better
>> to use the interface here since it has the method you need.
>>
>> Mark
>>
>>
>>>
>>> On Tue, Jul 18, 2017 at 6:40 PM, Mark Thomas  wrote:
 On 18/07/17 23:21, Alex O'Ree wrote:
> Nice, any idea which method I need to call?

 You already have the Context so you want

 Context.findChildren()

 for a list of all the Wrappers (and it is the wrapper object you need) or

 Context.findChild(String)

 for a specific Wrapper if you know the name. The name should be the name
 used in web.xml to define the Servlet.

 Mark


>
> On Jul 18, 2017 3:54 PM, "Mark Thomas"  wrote:
>
>> On 18/07/17 17:41, Alex O'Ree wrote:
>>> Alright, quick update on this.
>>>
>>> At this point, I have servlet context and a username running off the
>>> main tomcat http threads (quartz job)
>>>
 StandardContext tomcat;load from reflection from ApplicationContext
>> from ServletContext as ApplicationContextFacade
 Realm realm = tomcat.getRealm()
>>>
>>> At this point, realm is a LockoutRealm that contains two child realms,
>>> the JNDI Realm and the standard UserDatabaseRealm
>>>
 Principal user = realm.authenticate(username);
>>>
>>> At this point, the user object is populated and appears to have the
>>> roles attached to it (they are listed in the to String method).
>>>
 realm.hasRole(new StandardWrapper(), user, role);
>>>
>>> This part returns false, if and only if the ldap membership matches
>>> exactly. Mapped roles via servlet/security-role-ref/role-link and
>>> role-name do not appear to be effect.
>>>
>>> I think this may have something to do with the Principal object not
>>> having a login context. Normally, this is available via a servlet, but
>>> this it is not.
>>>
>>> I think the root cause might be this line.
>>> https://github.com/apache/tomcat/blob/TOMCAT_7_0_42/
>> java/org/apache/catalina/realm/RealmBase.java#L933
>>>
>>> Which probably does the translation from the LDAP defined group or
>>> role into what the application is expecting. Am I on the right path
>>> here?
>>
>> Yes. If you check auth outside of a Servlet, the role mappings for the
>> Servlet won't apply. If you know which servlet to use for the role
>> mappings you can get that from the Context (Wrappers represent Servlets
>> and are children of the Context).
>>
>> Mark
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


 -
 To 

Re: DeltaManager implementation

2017-08-04 Thread christopher
We are still having an issue with some users losing session information.
I want to use synchronous updates for the DeltaManager.
To enable this should the channelSendOptions be set to 6? That isn't
clear to me from reading the documentation.
Thanks,
-Chris 


On Thu, Jul 27, 2017, at 12:37 PM, christop...@baus.net wrote:
>>> Or does the DeltaManager replicate to all nodes?
>> 
>> It does, but the issue is one of timing. The main problematic area is>> the 
>> user agent being directed to another node before the session data>> has 
>> replicated. This can be avoided by configuring sync replication
>> (which slows things down since the response does not complete
>> until the>> replication has completed).
>> 
> 
> I figured out our issue today. Our servers are multi-honed and the
> multi-cast routing was slightly different on different nodes, so they> 
> weren't discovering each other.  Explicitly specifying the
> interface to> bind to in the Membership configuration solved the issue.
> 
> -> To 
> unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 



Re: SSL is not working

2017-08-04 Thread M. Manna
My bad - you can ignore my previous email - i was thinking about some other
scenario.

If the message says "Trusted Chain is Incomplete" - that means that your
browser's certificate store doesn't have the updated information regarding
root+intermediate CA certs. If you have import all the certificates
correctly to your server keystore this shouldn't be happening.
Check this post to see if you find any missing steps -
https://www.digicert.com/util/repair-intermediate-ssl-certificate-errors-using-digicert-utility-for-microsoft-servers.htm
.

Regards,

On 4 August 2017 at 17:38, M. Manna  wrote:

> if you are testing locally (i.e. on localhost) you might want to check if
> the root and intermediate CA exists. Or just import it
> 1. Find out where your jdk is - say JDK_PATH
> 2. keep a backup copy somewhere for JDK_PATH\jre\lib\security\cacerts
> 2. run the following command for each root/intermediate CA cert
> keytool -import -trustcacerts -keystore JDK_PATH\jre\lib\security\cacerts
> -storepass changeit -noprompt -file CA_FILE_LOCATION
>
> Restart your tomcat. and check.
>
>
>
> On 4 August 2017 at 17:23, Hameed, Amir  wrote:
>
>> Thank you for your reply. Please see my answers below:
>>
>> Have you imported the signed server certificate into the server keystore
>> with all the root+intermediate certificates? in other words, does the
>> "chain-of-trust" exist in server keystore?
>> >> Yes, I have imported all trusted certificates (COMODORSAAddTrustCA.crt
>> + AddTrustExternalCARoot.crt + 
>> COMODORSAOrganizationValidationSecureServerCA.crt)
>> into the server key store along with the signed server certificate.
>>
>> You just need to add the root and intermediate CA certs to trust store -
>> any server certs signed by them is by default, trusted.
>> >> I am new to Tomcat. Where can I find the trust store and is it
>> separate from the server key store?
>>
>> Thanks
>> -Original Message-
>> From: M. Manna [mailto:manme...@gmail.com]
>> Sent: Friday, August 4, 2017 12:16 PM
>> To: Tomcat Users List 
>> Subject: Re: SSL is not working
>>
>> Have you imported the signed server certificate into the server keystore
>> with all the root+intermediate certificates? in other words, does the
>> "chain-of-trust" exist in server keystore?
>>
>> You just need to add the root and intermediate CA certs to trust store -
>> any server certs signed by them is by default, trusted.
>>
>>
>> On 4 August 2017 at 17:09, Hameed, Amir  wrote:
>>
>> > Hi,
>> > I am trying to configure Tomcat 8.0.36 with SSL and running into some
>> > issues. The JDK version I am using is 1.8.0_64. I used the following
>> > process to implement SSL:
>> >
>> > 1.   Generated a java key store using the following command:
>> > ${JAVA_HOME}/bin/keytool -genkey -alias [alias-name] -keyalg RSA
>> > -keysize
>> > 2048 \
>> > -keystore [key-store-path]/keystore.jks -dname
>> > "CN=[common-name],OU=[org-unit], O=[company-name], L=[city],
>> ST=[state], C=US"
>> >
>> >
>> > 2.   Generated CSR using the following command:
>> > ${JAVA_HOME}/bin/keytool -certreq -alias [alias-name] -file
>> > [key-store-path]/[csr-file-name] \ -keystore
>> > [key-store-path]/keystore.jks
>> >
>> >
>> > 3.   Requested certificate from COMODO.
>> >
>> > 4.   Imported all Trusted certificates from COMODO into the key
>> store
>> > using command. There were a total of three trusted certificates that
>> > we received from COMODO:
>> > ${JAVA_HOME}/bin/keytool -import -trustcacerts -alias [alias-name]
>> > -file [ssl-cert-file] -keystore [key-store-path]/keystore.jks -v
>> >
>> >
>> > 5.   Modified Tomcat's server.xml file as shown below:
>> >
>> > > >
>> >maxThreads="150" SSLEnabled="true" scheme="https"
>> > secure="true"
>> >
>> >clientAuth="false" sslProtocol="TLS"
>> >
>> >keystoreFile="[key-store-path]/keystore.jks"
>> >
>> >keystoreType="JKS" keystorePass="[key-store-password]"
>> > />
>> >
>> >
>> >
>> > 6.   Restarted Tomcat.
>> >
>> > 7.   Accessed the Tomcat homepage from the browser using https and
>> the
>> > browser complained about page being insecure. When I looked at the
>> > certificate from the browser, I see that the Certificate Path tab of
>> > the certificate shows that the trusted chain is incomplete and does
>> > not show the trusted certificates that I had imported into the key
>> store.
>> >
>> > What am I missing here? Any help will be appreciated.
>> >
>> >
>> > Thank you,
>> > Amir
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>
>>
>


Re: SSL is not working

2017-08-04 Thread Chaitanya Sabbineni
Hi,

please try to import the certificate into the browser.

Truststore and keystore or not different it depends on the name you give.
example: tomcat_keystore.keystore or tomcat_trust.keystore and need to
provide the respective path and the password in the keystore.

please make sure that same alias name has to used through out the process.

please make sure if your keystore contains any private key entries using
keytool -list - v command. If you had imported proper ssl cert with proper
alias name then ideally you should have private key entry over here.

Thanks


On Fri, 4 Aug 2017 9:53 pm Hameed, Amir,  wrote:

> Thank you for your reply. Please see my answers below:
>
> Have you imported the signed server certificate into the server keystore
> with all the root+intermediate certificates? in other words, does the
> "chain-of-trust" exist in server keystore?
> >> Yes, I have imported all trusted certificates (COMODORSAAddTrustCA.crt
> + AddTrustExternalCARoot.crt +
> COMODORSAOrganizationValidationSecureServerCA.crt) into the server key
> store along with the signed server certificate.
>
> You just need to add the root and intermediate CA certs to trust store -
> any server certs signed by them is by default, trusted.
> >> I am new to Tomcat. Where can I find the trust store and is it separate
> from the server key store?
>
> Thanks
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 4, 2017 12:16 PM
> To: Tomcat Users List 
> Subject: Re: SSL is not working
>
> Have you imported the signed server certificate into the server keystore
> with all the root+intermediate certificates? in other words, does the
> "chain-of-trust" exist in server keystore?
>
> You just need to add the root and intermediate CA certs to trust store -
> any server certs signed by them is by default, trusted.
>
>
> On 4 August 2017 at 17:09, Hameed, Amir  wrote:
>
> > Hi,
> > I am trying to configure Tomcat 8.0.36 with SSL and running into some
> > issues. The JDK version I am using is 1.8.0_64. I used the following
> > process to implement SSL:
> >
> > 1.   Generated a java key store using the following command:
> > ${JAVA_HOME}/bin/keytool -genkey -alias [alias-name] -keyalg RSA
> > -keysize
> > 2048 \
> > -keystore [key-store-path]/keystore.jks -dname
> > "CN=[common-name],OU=[org-unit], O=[company-name], L=[city], ST=[state],
> C=US"
> >
> >
> > 2.   Generated CSR using the following command:
> > ${JAVA_HOME}/bin/keytool -certreq -alias [alias-name] -file
> > [key-store-path]/[csr-file-name] \ -keystore
> > [key-store-path]/keystore.jks
> >
> >
> > 3.   Requested certificate from COMODO.
> >
> > 4.   Imported all Trusted certificates from COMODO into the key store
> > using command. There were a total of three trusted certificates that
> > we received from COMODO:
> > ${JAVA_HOME}/bin/keytool -import -trustcacerts -alias [alias-name]
> > -file [ssl-cert-file] -keystore [key-store-path]/keystore.jks -v
> >
> >
> > 5.   Modified Tomcat's server.xml file as shown below:
> >
> >  >
> >maxThreads="150" SSLEnabled="true" scheme="https"
> > secure="true"
> >
> >clientAuth="false" sslProtocol="TLS"
> >
> >keystoreFile="[key-store-path]/keystore.jks"
> >
> >keystoreType="JKS" keystorePass="[key-store-password]"
> > />
> >
> >
> >
> > 6.   Restarted Tomcat.
> >
> > 7.   Accessed the Tomcat homepage from the browser using https and
> the
> > browser complained about page being insecure. When I looked at the
> > certificate from the browser, I see that the Certificate Path tab of
> > the certificate shows that the trusted chain is incomplete and does
> > not show the trusted certificates that I had imported into the key store.
> >
> > What am I missing here? Any help will be appreciated.
> >
> >
> > Thank you,
> > Amir
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: SSL is not working

2017-08-04 Thread M. Manna
if you are testing locally (i.e. on localhost) you might want to check if
the root and intermediate CA exists. Or just import it
1. Find out where your jdk is - say JDK_PATH
2. keep a backup copy somewhere for JDK_PATH\jre\lib\security\cacerts
2. run the following command for each root/intermediate CA cert
keytool -import -trustcacerts -keystore JDK_PATH\jre\lib\security\cacerts
-storepass changeit -noprompt -file CA_FILE_LOCATION

Restart your tomcat. and check.



On 4 August 2017 at 17:23, Hameed, Amir  wrote:

> Thank you for your reply. Please see my answers below:
>
> Have you imported the signed server certificate into the server keystore
> with all the root+intermediate certificates? in other words, does the
> "chain-of-trust" exist in server keystore?
> >> Yes, I have imported all trusted certificates (COMODORSAAddTrustCA.crt
> + AddTrustExternalCARoot.crt + 
> COMODORSAOrganizationValidationSecureServerCA.crt)
> into the server key store along with the signed server certificate.
>
> You just need to add the root and intermediate CA certs to trust store -
> any server certs signed by them is by default, trusted.
> >> I am new to Tomcat. Where can I find the trust store and is it separate
> from the server key store?
>
> Thanks
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 4, 2017 12:16 PM
> To: Tomcat Users List 
> Subject: Re: SSL is not working
>
> Have you imported the signed server certificate into the server keystore
> with all the root+intermediate certificates? in other words, does the
> "chain-of-trust" exist in server keystore?
>
> You just need to add the root and intermediate CA certs to trust store -
> any server certs signed by them is by default, trusted.
>
>
> On 4 August 2017 at 17:09, Hameed, Amir  wrote:
>
> > Hi,
> > I am trying to configure Tomcat 8.0.36 with SSL and running into some
> > issues. The JDK version I am using is 1.8.0_64. I used the following
> > process to implement SSL:
> >
> > 1.   Generated a java key store using the following command:
> > ${JAVA_HOME}/bin/keytool -genkey -alias [alias-name] -keyalg RSA
> > -keysize
> > 2048 \
> > -keystore [key-store-path]/keystore.jks -dname
> > "CN=[common-name],OU=[org-unit], O=[company-name], L=[city],
> ST=[state], C=US"
> >
> >
> > 2.   Generated CSR using the following command:
> > ${JAVA_HOME}/bin/keytool -certreq -alias [alias-name] -file
> > [key-store-path]/[csr-file-name] \ -keystore
> > [key-store-path]/keystore.jks
> >
> >
> > 3.   Requested certificate from COMODO.
> >
> > 4.   Imported all Trusted certificates from COMODO into the key store
> > using command. There were a total of three trusted certificates that
> > we received from COMODO:
> > ${JAVA_HOME}/bin/keytool -import -trustcacerts -alias [alias-name]
> > -file [ssl-cert-file] -keystore [key-store-path]/keystore.jks -v
> >
> >
> > 5.   Modified Tomcat's server.xml file as shown below:
> >
> >  >
> >maxThreads="150" SSLEnabled="true" scheme="https"
> > secure="true"
> >
> >clientAuth="false" sslProtocol="TLS"
> >
> >keystoreFile="[key-store-path]/keystore.jks"
> >
> >keystoreType="JKS" keystorePass="[key-store-password]"
> > />
> >
> >
> >
> > 6.   Restarted Tomcat.
> >
> > 7.   Accessed the Tomcat homepage from the browser using https and
> the
> > browser complained about page being insecure. When I looked at the
> > certificate from the browser, I see that the Certificate Path tab of
> > the certificate shows that the trusted chain is incomplete and does
> > not show the trusted certificates that I had imported into the key store.
> >
> > What am I missing here? Any help will be appreciated.
> >
> >
> > Thank you,
> > Amir
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


RE: SSL is not working

2017-08-04 Thread Hameed, Amir
Thank you for your reply. Please see my answers below:

Have you imported the signed server certificate into the server keystore with 
all the root+intermediate certificates? in other words, does the 
"chain-of-trust" exist in server keystore?
>> Yes, I have imported all trusted certificates (COMODORSAAddTrustCA.crt + 
>> AddTrustExternalCARoot.crt + 
>> COMODORSAOrganizationValidationSecureServerCA.crt) into the server key store 
>> along with the signed server certificate.

You just need to add the root and intermediate CA certs to trust store - any 
server certs signed by them is by default, trusted.
>> I am new to Tomcat. Where can I find the trust store and is it separate from 
>> the server key store?

Thanks
-Original Message-
From: M. Manna [mailto:manme...@gmail.com] 
Sent: Friday, August 4, 2017 12:16 PM
To: Tomcat Users List 
Subject: Re: SSL is not working

Have you imported the signed server certificate into the server keystore with 
all the root+intermediate certificates? in other words, does the 
"chain-of-trust" exist in server keystore?

You just need to add the root and intermediate CA certs to trust store - any 
server certs signed by them is by default, trusted.


On 4 August 2017 at 17:09, Hameed, Amir  wrote:

> Hi,
> I am trying to configure Tomcat 8.0.36 with SSL and running into some 
> issues. The JDK version I am using is 1.8.0_64. I used the following 
> process to implement SSL:
>
> 1.   Generated a java key store using the following command:
> ${JAVA_HOME}/bin/keytool -genkey -alias [alias-name] -keyalg RSA 
> -keysize
> 2048 \
> -keystore [key-store-path]/keystore.jks -dname 
> "CN=[common-name],OU=[org-unit], O=[company-name], L=[city], ST=[state], C=US"
>
>
> 2.   Generated CSR using the following command:
> ${JAVA_HOME}/bin/keytool -certreq -alias [alias-name] -file 
> [key-store-path]/[csr-file-name] \ -keystore 
> [key-store-path]/keystore.jks
>
>
> 3.   Requested certificate from COMODO.
>
> 4.   Imported all Trusted certificates from COMODO into the key store
> using command. There were a total of three trusted certificates that 
> we received from COMODO:
> ${JAVA_HOME}/bin/keytool -import -trustcacerts -alias [alias-name] 
> -file [ssl-cert-file] -keystore [key-store-path]/keystore.jks -v
>
>
> 5.   Modified Tomcat's server.xml file as shown below:
>
> 
>maxThreads="150" SSLEnabled="true" scheme="https"
> secure="true"
>
>clientAuth="false" sslProtocol="TLS"
>
>keystoreFile="[key-store-path]/keystore.jks"
>
>keystoreType="JKS" keystorePass="[key-store-password]" 
> />
>
>
>
> 6.   Restarted Tomcat.
>
> 7.   Accessed the Tomcat homepage from the browser using https and the
> browser complained about page being insecure. When I looked at the 
> certificate from the browser, I see that the Certificate Path tab of 
> the certificate shows that the trusted chain is incomplete and does 
> not show the trusted certificates that I had imported into the key store.
>
> What am I missing here? Any help will be appreciated.
>
>
> Thank you,
> Amir
>
>

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



Re: SSL is not working

2017-08-04 Thread M. Manna
Have you imported the signed server certificate into the server keystore
with all the root+intermediate certificates? in other words, does the
"chain-of-trust" exist in server keystore?

You just need to add the root and intermediate CA certs to trust store -
any server certs signed by them is by default, trusted.


On 4 August 2017 at 17:09, Hameed, Amir  wrote:

> Hi,
> I am trying to configure Tomcat 8.0.36 with SSL and running into some
> issues. The JDK version I am using is 1.8.0_64. I used the following
> process to implement SSL:
>
> 1.   Generated a java key store using the following command:
> ${JAVA_HOME}/bin/keytool -genkey -alias [alias-name] -keyalg RSA -keysize
> 2048 \
> -keystore [key-store-path]/keystore.jks -dname 
> "CN=[common-name],OU=[org-unit],
> O=[company-name], L=[city], ST=[state], C=US"
>
>
> 2.   Generated CSR using the following command:
> ${JAVA_HOME}/bin/keytool -certreq -alias [alias-name] -file
> [key-store-path]/[csr-file-name] \
> -keystore [key-store-path]/keystore.jks
>
>
> 3.   Requested certificate from COMODO.
>
> 4.   Imported all Trusted certificates from COMODO into the key store
> using command. There were a total of three trusted certificates that we
> received from COMODO:
> ${JAVA_HOME}/bin/keytool -import -trustcacerts -alias [alias-name] -file
> [ssl-cert-file] -keystore [key-store-path]/keystore.jks -v
>
>
> 5.   Modified Tomcat's server.xml file as shown below:
>
> 
>maxThreads="150" SSLEnabled="true" scheme="https"
> secure="true"
>
>clientAuth="false" sslProtocol="TLS"
>
>keystoreFile="[key-store-path]/keystore.jks"
>
>keystoreType="JKS" keystorePass="[key-store-password]" />
>
>
>
> 6.   Restarted Tomcat.
>
> 7.   Accessed the Tomcat homepage from the browser using https and the
> browser complained about page being insecure. When I looked at the
> certificate from the browser, I see that the Certificate Path tab of the
> certificate shows that the trusted chain is incomplete and does not show
> the trusted certificates that I had imported into the key store.
>
> What am I missing here? Any help will be appreciated.
>
>
> Thank you,
> Amir
>
>


SSL is not working

2017-08-04 Thread Hameed, Amir
Hi,
I am trying to configure Tomcat 8.0.36 with SSL and running into some issues. 
The JDK version I am using is 1.8.0_64. I used the following process to 
implement SSL:

1.   Generated a java key store using the following command:
${JAVA_HOME}/bin/keytool -genkey -alias [alias-name] -keyalg RSA -keysize 2048 \
-keystore [key-store-path]/keystore.jks -dname "CN=[common-name],OU=[org-unit], 
O=[company-name], L=[city], ST=[state], C=US"


2.   Generated CSR using the following command:
${JAVA_HOME}/bin/keytool -certreq -alias [alias-name] -file 
[key-store-path]/[csr-file-name] \
-keystore [key-store-path]/keystore.jks


3.   Requested certificate from COMODO.

4.   Imported all Trusted certificates from COMODO into the key store using 
command. There were a total of three trusted certificates that we received from 
COMODO:
${JAVA_HOME}/bin/keytool -import -trustcacerts -alias [alias-name] -file 
[ssl-cert-file] -keystore [key-store-path]/keystore.jks -v


5.   Modified Tomcat's server.xml file as shown below:





6.   Restarted Tomcat.

7.   Accessed the Tomcat homepage from the browser using https and the 
browser complained about page being insecure. When I looked at the certificate 
from the browser, I see that the Certificate Path tab of the certificate shows 
that the trusted chain is incomplete and does not show the trusted certificates 
that I had imported into the key store.

What am I missing here? Any help will be appreciated.


Thank you,
Amir



Re: Automatically compressing localhost_access_log after rotation

2017-08-04 Thread Mark H. Wood
On 8/3/17 5:47 AM, Martin Knoblauch wrote:
> is there a way to compress the localhost_access_log.#.txt file 
> automatically after rotation?

There is, but maybe not one built into Tomcat.  I have a daily cron
job to run a script which looks for older logs and ZIPs them:

LOGDIR=/var/log/tomcat-7

ZIP_OPTS='-9mou'

# localhost
for LOG in $(find ${LOGDIR} -mtime +7 -name localhost.-??-??.log | sort); do
  YEAR=$(echo ${LOG} | cut -d. -f2 | cut -d- -f1)
  zip ${ZIP_OPTS} /var/biglogs/tomcat/localhost.log.${YEAR}.zip ${LOG}
done

I have a bunch of these blocks in the script, so I ought to make one
into a function and just call it N times with various arguments, but
this works for me.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu


signature.asc
Description: PGP signature


RE: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread S Abirami
Hi Thomas,

Thanks for the response.
It worked for me.

Regards,
Abirami.S

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org]
Sent: Friday, August 04, 2017 3:30 PM
To: users >> Tomcat Users List
Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner 
upgrade from 8.0.x to 8.0.x

On 04/08/17 10:49, S Abirami wrote:



> but the method call of = Tomcat.addwebapp(contextpath,docpath); itself 
> triggering this exception.
> So whatever I need to do before addwebapp.

From the Javadoc:
This is equivalent to adding a web application to Tomcat's webapps directory. 
The equivalent of the default web.xml will be applied to the web application 
and any WEB-INF/web.xml and META-INF/context.xml packaged with the application 
will be processed normally. Normal web fragment and 
javax.servlet.ServletContainerInitializer processing will be applied.

It looks like you either want:
To specify more config in META-INF/context.xml

which is exactly what you'd do if running on a standard Tomact instance or use:

addWebapp(Host, String, String, LifecycleListener)

which will give you more control over the configuration because you can provide 
the LifecycleListener or you want one of the addContext() methods which won't 
do anything automatically and requires you to set everything programmatically.

Mark

> 
> Regards,
> Abirami.S
> -Original Message-
> From: S Abirami
> Sent: Friday, August 04, 2017 3:08 PM
> To: Tomcat Users List
> Subject: RE: Embedded Tomcat throws FileNotFoundException for 
> TldScanner upgrade from 8.0.x to 8.0.x
> 
> Hi
> 
> I tried that also .Still it's giving the same error msg. Please help me to 
> solve the issue.
> 
> Regards,
> Abirami.S
> 
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 2:24 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
> TldScanner upgrade from 8.0.x to 8.0.x
> 
> So if you don't want to scan jar, do you still need that Jar scanner in the 
> context? All you have done in the code above, is disabled the jar scanner.
> 
> Do you want to try without adding the jarscanner to the context? Or 
> try the
> following:
> 
> JarScanner jsc = new JarScanner() {
>  public void scan(ServletContext arg0, ClassLoader arg1,
> JarScannerCallback arg2, Set arg3) {
> // DUMMY NOTHING
> }
> };
> context.setJarScanner(jsc);
> 
> 
> On 4 August 2017 at 09:35, S Abirami  wrote:
> 
>> Hi ,
>>
>> It is contextPath is a String which used to mention my Webapp location.
>> Also I don’t want to scan any jar files.
>> I want to disable Jarscanner.
>>
>> Regards,
>> Abirami.S
>>
>> -Original Message-
>> From: M. Manna [mailto:manme...@gmail.com]
>> Sent: Friday, August 04, 2017 1:26 PM
>> To: Tomcat Users List
>> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
>> TldScanner upgrade from 8.0.x to 8.0.x
>>
>> Okay, where are you getting your contextPath from? The code you 
>> posted is
>> below:
>>
>>
>> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
>> StandardJarScanner scanner=new StandardJarScanner(); 
>> scanner.setScanClassPath( false ); scanner.setScanManifest( false ); 
>> context.setJarScanner(scanner);
>>
>> Also, setScanClassPath(false) you sure this is should not be "true"?
>> bootstrap scanner is set to "False" by default so I'm not sure if 
>> this is supposed to work properly.
>>
>> https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html
>>
>> Please update.
>>
>> Regards,
>>
>> On 4 August 2017 at 08:50, S Abirami  wrote:
>>
>>> Hi,
>>>
>>>  I am trying to create EmbeddedTomcat  so no context.xml created.
>>> Tomcat t=new Tomcat();
>>> Everything through object creation.
>>>
>>> Regards,
>>> Abirami.S
>>>
>>> -Original Message-
>>> From: M. Manna [mailto:manme...@gmail.com]
>>> Sent: Friday, August 04, 2017 1:18 PM
>>> To: Tomcat Users List
>>> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
>>> TldScanner upgrade from 8.0.x to 8.0.x
>>>
>>> Hi,
>>>
>>> What is in your context.xml file? You can find it in conf directory.
>>>
>>> Regards,
>>>
>>> On 4 August 2017 at 08:43, S Abirami  wrote:
>>>
 Hi ,

   I am using Embedded tomcat to create webapp. when I am trying 
 to add web app it is throwing the following exception but Server 
 started successfully.
 However,I need to eradicate this exception from the log.

 java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such 
 file or
 directory)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.(ZipFile.java:219)
 at java.util.zip.ZipFile.(ZipFile.java:149)
 at java.util.jar.JarFile.(JarFile.java:166)
 at java.util.jar.JarFile.(JarFile.java:130)
 at org.apache.tomcat.util.scan.JarFileUrlJar.(
 

RE: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread S Abirami
HI Thomas,

Thanks for the response.
It worked for me.

Regards,
Abirami.S

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Friday, August 04, 2017 3:30 PM
To: users >> Tomcat Users List
Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner 
upgrade from 8.0.x to 8.0.x

On 04/08/17 10:49, S Abirami wrote:



> but the method call of = Tomcat.addwebapp(contextpath,docpath); itself 
> triggering this exception.
> So whatever I need to do before addwebapp.

From the Javadoc:
This is equivalent to adding a web application to Tomcat's webapps directory. 
The equivalent of the default web.xml will be applied to the web application 
and any WEB-INF/web.xml and META-INF/context.xml packaged with the application 
will be processed normally. Normal web fragment and 
javax.servlet.ServletContainerInitializer processing will be applied.

It looks like you either want:
To specify more config in META-INF/context.xml

which is exactly what you'd do if running on a standard Tomact instance or use:

addWebapp(Host, String, String, LifecycleListener)

which will give you more control over the configuration because you can provide 
the LifecycleListener or you want one of the addContext() methods which won't 
do anything automatically and requires you to set everything programmatically.

Mark

> 
> Regards,
> Abirami.S
> -Original Message-
> From: S Abirami
> Sent: Friday, August 04, 2017 3:08 PM
> To: Tomcat Users List
> Subject: RE: Embedded Tomcat throws FileNotFoundException for 
> TldScanner upgrade from 8.0.x to 8.0.x
> 
> Hi
> 
> I tried that also .Still it's giving the same error msg. Please help me to 
> solve the issue.
> 
> Regards,
> Abirami.S
> 
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 2:24 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
> TldScanner upgrade from 8.0.x to 8.0.x
> 
> So if you don't want to scan jar, do you still need that Jar scanner in the 
> context? All you have done in the code above, is disabled the jar scanner.
> 
> Do you want to try without adding the jarscanner to the context? Or 
> try the
> following:
> 
> JarScanner jsc = new JarScanner() {
>  public void scan(ServletContext arg0, ClassLoader arg1,
> JarScannerCallback arg2, Set arg3) {
> // DUMMY NOTHING
> }
> };
> context.setJarScanner(jsc);
> 
> 
> On 4 August 2017 at 09:35, S Abirami  wrote:
> 
>> Hi ,
>>
>> It is contextPath is a String which used to mention my Webapp location.
>> Also I don’t want to scan any jar files.
>> I want to disable Jarscanner.
>>
>> Regards,
>> Abirami.S
>>
>> -Original Message-
>> From: M. Manna [mailto:manme...@gmail.com]
>> Sent: Friday, August 04, 2017 1:26 PM
>> To: Tomcat Users List
>> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
>> TldScanner upgrade from 8.0.x to 8.0.x
>>
>> Okay, where are you getting your contextPath from? The code you 
>> posted is
>> below:
>>
>>
>> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
>> StandardJarScanner scanner=new StandardJarScanner(); 
>> scanner.setScanClassPath( false ); scanner.setScanManifest( false ); 
>> context.setJarScanner(scanner);
>>
>> Also, setScanClassPath(false) you sure this is should not be "true"?
>> bootstrap scanner is set to "False" by default so I'm not sure if 
>> this is supposed to work properly.
>>
>> https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html
>>
>> Please update.
>>
>> Regards,
>>
>> On 4 August 2017 at 08:50, S Abirami  wrote:
>>
>>> Hi,
>>>
>>>  I am trying to create EmbeddedTomcat  so no context.xml created.
>>> Tomcat t=new Tomcat();
>>> Everything through object creation.
>>>
>>> Regards,
>>> Abirami.S
>>>
>>> -Original Message-
>>> From: M. Manna [mailto:manme...@gmail.com]
>>> Sent: Friday, August 04, 2017 1:18 PM
>>> To: Tomcat Users List
>>> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
>>> TldScanner upgrade from 8.0.x to 8.0.x
>>>
>>> Hi,
>>>
>>> What is in your context.xml file? You can find it in conf directory.
>>>
>>> Regards,
>>>
>>> On 4 August 2017 at 08:43, S Abirami  wrote:
>>>
 Hi ,

   I am using Embedded tomcat to create webapp. when I am trying 
 to add web app it is throwing the following exception but Server 
 started successfully.
 However,I need to eradicate this exception from the log.

 java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such 
 file or
 directory)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.(ZipFile.java:219)
 at java.util.zip.ZipFile.(ZipFile.java:149)
 at java.util.jar.JarFile.(JarFile.java:166)
 at java.util.jar.JarFile.(JarFile.java:130)
 at org.apache.tomcat.util.scan.JarFileUrlJar.(
 

Re: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread M. Manna
Can you please post your entire Tomcat code? I.e. how you are instantiating
Tomcat just before you had the JarScanner code.
Send us the full code don't keep anything.

On 4 August 2017 at 10:49, S Abirami  wrote:

> Hi ,
>
> To be more clear
>
> Context context= Tomcat.addwebapp(contextpath,docpath);
>
> JarScanner jsc = new JarScanner() {
>  public void scan(ServletContext arg0, ClassLoader arg1,
> JarScannerCallback arg2, Set arg3) {
> // DUMMY NOTHING
> }
> };
> context.setJarScanner(jsc);
>
>
>
> but the method call of = Tomcat.addwebapp(contextpath,docpath); itself
> triggering this exception.
> So whatever I need to do before addwebapp.
>
> Regards,
> Abirami.S
> -Original Message-
> From: S Abirami
> Sent: Friday, August 04, 2017 3:08 PM
> To: Tomcat Users List
> Subject: RE: Embedded Tomcat throws FileNotFoundException for TldScanner
> upgrade from 8.0.x to 8.0.x
>
> Hi
>
> I tried that also .Still it's giving the same error msg. Please help me to
> solve the issue.
>
> Regards,
> Abirami.S
>
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 2:24 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner
> upgrade from 8.0.x to 8.0.x
>
> So if you don't want to scan jar, do you still need that Jar scanner in
> the context? All you have done in the code above, is disabled the jar
> scanner.
>
> Do you want to try without adding the jarscanner to the context? Or try the
> following:
>
> JarScanner jsc = new JarScanner() {
>  public void scan(ServletContext arg0, ClassLoader arg1,
> JarScannerCallback arg2, Set arg3) {
> // DUMMY NOTHING
> }
> };
> context.setJarScanner(jsc);
>
>
> On 4 August 2017 at 09:35, S Abirami  wrote:
>
> > Hi ,
> >
> > It is contextPath is a String which used to mention my Webapp location.
> > Also I don’t want to scan any jar files.
> > I want to disable Jarscanner.
> >
> > Regards,
> > Abirami.S
> >
> > -Original Message-
> > From: M. Manna [mailto:manme...@gmail.com]
> > Sent: Friday, August 04, 2017 1:26 PM
> > To: Tomcat Users List
> > Subject: Re: Embedded Tomcat throws FileNotFoundException for
> > TldScanner upgrade from 8.0.x to 8.0.x
> >
> > Okay, where are you getting your contextPath from? The code you posted
> > is
> > below:
> >
> >
> > 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> > StandardJarScanner scanner=new StandardJarScanner();
> > scanner.setScanClassPath( false ); scanner.setScanManifest( false );
> > context.setJarScanner(scanner);
> >
> > Also, setScanClassPath(false) you sure this is should not be "true"?
> > bootstrap scanner is set to "False" by default so I'm not sure if this
> > is supposed to work properly.
> >
> > https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html
> >
> > Please update.
> >
> > Regards,
> >
> > On 4 August 2017 at 08:50, S Abirami  wrote:
> >
> > > Hi,
> > >
> > >  I am trying to create EmbeddedTomcat  so no context.xml created.
> > > Tomcat t=new Tomcat();
> > > Everything through object creation.
> > >
> > > Regards,
> > > Abirami.S
> > >
> > > -Original Message-
> > > From: M. Manna [mailto:manme...@gmail.com]
> > > Sent: Friday, August 04, 2017 1:18 PM
> > > To: Tomcat Users List
> > > Subject: Re: Embedded Tomcat throws FileNotFoundException for
> > > TldScanner upgrade from 8.0.x to 8.0.x
> > >
> > > Hi,
> > >
> > > What is in your context.xml file? You can find it in conf directory.
> > >
> > > Regards,
> > >
> > > On 4 August 2017 at 08:43, S Abirami  wrote:
> > >
> > > > Hi ,
> > > >
> > > >   I am using Embedded tomcat to create webapp. when I am
> > > > trying to add web app it is throwing the following exception but
> > > > Server started successfully.
> > > > However,I need to eradicate this exception from the log.
> > > >
> > > > java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such
> > > > file or
> > > > directory)
> > > > at java.util.zip.ZipFile.open(Native Method)
> > > > at java.util.zip.ZipFile.(ZipFile.java:219)
> > > > at java.util.zip.ZipFile.(ZipFile.java:149)
> > > > at java.util.jar.JarFile.(JarFile.java:166)
> > > > at java.util.jar.JarFile.(JarFile.java:130)
> > > > at org.apache.tomcat.util.scan.JarFileUrlJar.(
> > > > JarFileUrlJar.java:60)
> > > > at org.apache.tomcat.util.scan.JarFactory.newInstance(
> > > > JarFactory.java:49)
> > > > at org.apache.tomcat.util.scan.StandardJarScanner.process(
> > > > StandardJarScanner.java:334)
> > > > at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> > > > StandardJarScanner.java:284)
> > > > at org.apache.jasper.servlet.TldScanner.scanJars(
> > > > TldScanner.java:262)
> > > > at org.apache.jasper.servlet.TldScanner.scan(TldScanner.
> > > java:106)
> > > >

Re: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread Mark Thomas
On 04/08/17 10:49, S Abirami wrote:



> but the method call of = Tomcat.addwebapp(contextpath,docpath); itself 
> triggering this exception.
> So whatever I need to do before addwebapp.

>From the Javadoc:
This is equivalent to adding a web application to Tomcat's webapps
directory. The equivalent of the default web.xml will be applied to the
web application and any WEB-INF/web.xml and META-INF/context.xml
packaged with the application will be processed normally. Normal web
fragment and javax.servlet.ServletContainerInitializer processing will
be applied.

It looks like you either want:
To specify more config in META-INF/context.xml

which is exactly what you'd do if running on a standard Tomact instance
or use:

addWebapp(Host, String, String, LifecycleListener)

which will give you more control over the configuration because you can
provide the LifecycleListener or you want one of the addContext()
methods which won't do anything automatically and requires you to set
everything programmatically.

Mark

> 
> Regards,
> Abirami.S
> -Original Message-
> From: S Abirami 
> Sent: Friday, August 04, 2017 3:08 PM
> To: Tomcat Users List
> Subject: RE: Embedded Tomcat throws FileNotFoundException for TldScanner 
> upgrade from 8.0.x to 8.0.x
> 
> Hi
> 
> I tried that also .Still it's giving the same error msg. Please help me to 
> solve the issue.
> 
> Regards,
> Abirami.S
> 
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 2:24 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner 
> upgrade from 8.0.x to 8.0.x
> 
> So if you don't want to scan jar, do you still need that Jar scanner in the 
> context? All you have done in the code above, is disabled the jar scanner.
> 
> Do you want to try without adding the jarscanner to the context? Or try the
> following:
> 
> JarScanner jsc = new JarScanner() {
>  public void scan(ServletContext arg0, ClassLoader arg1,
> JarScannerCallback arg2, Set arg3) {
> // DUMMY NOTHING
> }
> };
> context.setJarScanner(jsc);
> 
> 
> On 4 August 2017 at 09:35, S Abirami  wrote:
> 
>> Hi ,
>>
>> It is contextPath is a String which used to mention my Webapp location.
>> Also I don’t want to scan any jar files.
>> I want to disable Jarscanner.
>>
>> Regards,
>> Abirami.S
>>
>> -Original Message-
>> From: M. Manna [mailto:manme...@gmail.com]
>> Sent: Friday, August 04, 2017 1:26 PM
>> To: Tomcat Users List
>> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
>> TldScanner upgrade from 8.0.x to 8.0.x
>>
>> Okay, where are you getting your contextPath from? The code you posted 
>> is
>> below:
>>
>>
>> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
>> StandardJarScanner scanner=new StandardJarScanner(); 
>> scanner.setScanClassPath( false ); scanner.setScanManifest( false ); 
>> context.setJarScanner(scanner);
>>
>> Also, setScanClassPath(false) you sure this is should not be "true"?
>> bootstrap scanner is set to "False" by default so I'm not sure if this 
>> is supposed to work properly.
>>
>> https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html
>>
>> Please update.
>>
>> Regards,
>>
>> On 4 August 2017 at 08:50, S Abirami  wrote:
>>
>>> Hi,
>>>
>>>  I am trying to create EmbeddedTomcat  so no context.xml created.
>>> Tomcat t=new Tomcat();
>>> Everything through object creation.
>>>
>>> Regards,
>>> Abirami.S
>>>
>>> -Original Message-
>>> From: M. Manna [mailto:manme...@gmail.com]
>>> Sent: Friday, August 04, 2017 1:18 PM
>>> To: Tomcat Users List
>>> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
>>> TldScanner upgrade from 8.0.x to 8.0.x
>>>
>>> Hi,
>>>
>>> What is in your context.xml file? You can find it in conf directory.
>>>
>>> Regards,
>>>
>>> On 4 August 2017 at 08:43, S Abirami  wrote:
>>>
 Hi ,

   I am using Embedded tomcat to create webapp. when I am 
 trying to add web app it is throwing the following exception but 
 Server started successfully.
 However,I need to eradicate this exception from the log.

 java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such 
 file or
 directory)
 at java.util.zip.ZipFile.open(Native Method)
 at java.util.zip.ZipFile.(ZipFile.java:219)
 at java.util.zip.ZipFile.(ZipFile.java:149)
 at java.util.jar.JarFile.(JarFile.java:166)
 at java.util.jar.JarFile.(JarFile.java:130)
 at org.apache.tomcat.util.scan.JarFileUrlJar.(
 JarFileUrlJar.java:60)
 at org.apache.tomcat.util.scan.JarFactory.newInstance(
 JarFactory.java:49)
 at org.apache.tomcat.util.scan.StandardJarScanner.process(
 StandardJarScanner.java:334)
 at org.apache.tomcat.util.scan.StandardJarScanner.scan(
 StandardJarScanner.java:284)
  

RE: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread S Abirami
Hi ,

To be more clear

Context context= Tomcat.addwebapp(contextpath,docpath);

JarScanner jsc = new JarScanner() {
 public void scan(ServletContext arg0, ClassLoader arg1,
JarScannerCallback arg2, Set arg3) {
// DUMMY NOTHING
}
};
context.setJarScanner(jsc);



but the method call of = Tomcat.addwebapp(contextpath,docpath); itself 
triggering this exception.
So whatever I need to do before addwebapp.

Regards,
Abirami.S
-Original Message-
From: S Abirami 
Sent: Friday, August 04, 2017 3:08 PM
To: Tomcat Users List
Subject: RE: Embedded Tomcat throws FileNotFoundException for TldScanner 
upgrade from 8.0.x to 8.0.x

Hi

I tried that also .Still it's giving the same error msg. Please help me to 
solve the issue.

Regards,
Abirami.S

-Original Message-
From: M. Manna [mailto:manme...@gmail.com]
Sent: Friday, August 04, 2017 2:24 PM
To: Tomcat Users List
Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner 
upgrade from 8.0.x to 8.0.x

So if you don't want to scan jar, do you still need that Jar scanner in the 
context? All you have done in the code above, is disabled the jar scanner.

Do you want to try without adding the jarscanner to the context? Or try the
following:

JarScanner jsc = new JarScanner() {
 public void scan(ServletContext arg0, ClassLoader arg1,
JarScannerCallback arg2, Set arg3) {
// DUMMY NOTHING
}
};
context.setJarScanner(jsc);


On 4 August 2017 at 09:35, S Abirami  wrote:

> Hi ,
>
> It is contextPath is a String which used to mention my Webapp location.
> Also I don’t want to scan any jar files.
> I want to disable Jarscanner.
>
> Regards,
> Abirami.S
>
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 1:26 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
> TldScanner upgrade from 8.0.x to 8.0.x
>
> Okay, where are you getting your contextPath from? The code you posted 
> is
> below:
>
>
> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> StandardJarScanner scanner=new StandardJarScanner(); 
> scanner.setScanClassPath( false ); scanner.setScanManifest( false ); 
> context.setJarScanner(scanner);
>
> Also, setScanClassPath(false) you sure this is should not be "true"?
> bootstrap scanner is set to "False" by default so I'm not sure if this 
> is supposed to work properly.
>
> https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html
>
> Please update.
>
> Regards,
>
> On 4 August 2017 at 08:50, S Abirami  wrote:
>
> > Hi,
> >
> >  I am trying to create EmbeddedTomcat  so no context.xml created.
> > Tomcat t=new Tomcat();
> > Everything through object creation.
> >
> > Regards,
> > Abirami.S
> >
> > -Original Message-
> > From: M. Manna [mailto:manme...@gmail.com]
> > Sent: Friday, August 04, 2017 1:18 PM
> > To: Tomcat Users List
> > Subject: Re: Embedded Tomcat throws FileNotFoundException for 
> > TldScanner upgrade from 8.0.x to 8.0.x
> >
> > Hi,
> >
> > What is in your context.xml file? You can find it in conf directory.
> >
> > Regards,
> >
> > On 4 August 2017 at 08:43, S Abirami  wrote:
> >
> > > Hi ,
> > >
> > >   I am using Embedded tomcat to create webapp. when I am 
> > > trying to add web app it is throwing the following exception but 
> > > Server started successfully.
> > > However,I need to eradicate this exception from the log.
> > >
> > > java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such 
> > > file or
> > > directory)
> > > at java.util.zip.ZipFile.open(Native Method)
> > > at java.util.zip.ZipFile.(ZipFile.java:219)
> > > at java.util.zip.ZipFile.(ZipFile.java:149)
> > > at java.util.jar.JarFile.(JarFile.java:166)
> > > at java.util.jar.JarFile.(JarFile.java:130)
> > > at org.apache.tomcat.util.scan.JarFileUrlJar.(
> > > JarFileUrlJar.java:60)
> > > at org.apache.tomcat.util.scan.JarFactory.newInstance(
> > > JarFactory.java:49)
> > > at org.apache.tomcat.util.scan.StandardJarScanner.process(
> > > StandardJarScanner.java:334)
> > > at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> > > StandardJarScanner.java:284)
> > > at org.apache.jasper.servlet.TldScanner.scanJars(
> > > TldScanner.java:262)
> > > at org.apache.jasper.servlet.TldScanner.scan(TldScanner.
> > java:106)
> > > at org.apache.jasper.servlet.JasperInitializer.onStartup(
> > > JasperInitializer.java:101)
> > > at org.apache.catalina.core.StandardContext.startInternal(
> > > StandardContext.java:5303)
> > > at org.apache.catalina.util.LifecycleBase.start(
> > > LifecycleBase.java:145)
> > > at
> > > org.apache.catalina.core.ContainerBase.addChildInternal(
> > > ContainerBase.java:753)
> > > at org.apache.catalina.core.ContainerBase.addChild(
> > > ContainerBase.java:729)
> > >   

RE: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread S Abirami
Hi

I tried that also .Still it's giving the same error msg. Please help me to 
solve the issue.

Regards,
Abirami.S

-Original Message-
From: M. Manna [mailto:manme...@gmail.com] 
Sent: Friday, August 04, 2017 2:24 PM
To: Tomcat Users List
Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner 
upgrade from 8.0.x to 8.0.x

So if you don't want to scan jar, do you still need that Jar scanner in the 
context? All you have done in the code above, is disabled the jar scanner.

Do you want to try without adding the jarscanner to the context? Or try the
following:

JarScanner jsc = new JarScanner() {
 public void scan(ServletContext arg0, ClassLoader arg1,
JarScannerCallback arg2, Set arg3) {
// DUMMY NOTHING
}
};
context.setJarScanner(jsc);


On 4 August 2017 at 09:35, S Abirami  wrote:

> Hi ,
>
> It is contextPath is a String which used to mention my Webapp location.
> Also I don’t want to scan any jar files.
> I want to disable Jarscanner.
>
> Regards,
> Abirami.S
>
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 1:26 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
> TldScanner upgrade from 8.0.x to 8.0.x
>
> Okay, where are you getting your contextPath from? The code you posted 
> is
> below:
>
>
> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> StandardJarScanner scanner=new StandardJarScanner(); 
> scanner.setScanClassPath( false ); scanner.setScanManifest( false ); 
> context.setJarScanner(scanner);
>
> Also, setScanClassPath(false) you sure this is should not be "true"?
> bootstrap scanner is set to "False" by default so I'm not sure if this 
> is supposed to work properly.
>
> https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html
>
> Please update.
>
> Regards,
>
> On 4 August 2017 at 08:50, S Abirami  wrote:
>
> > Hi,
> >
> >  I am trying to create EmbeddedTomcat  so no context.xml created.
> > Tomcat t=new Tomcat();
> > Everything through object creation.
> >
> > Regards,
> > Abirami.S
> >
> > -Original Message-
> > From: M. Manna [mailto:manme...@gmail.com]
> > Sent: Friday, August 04, 2017 1:18 PM
> > To: Tomcat Users List
> > Subject: Re: Embedded Tomcat throws FileNotFoundException for 
> > TldScanner upgrade from 8.0.x to 8.0.x
> >
> > Hi,
> >
> > What is in your context.xml file? You can find it in conf directory.
> >
> > Regards,
> >
> > On 4 August 2017 at 08:43, S Abirami  wrote:
> >
> > > Hi ,
> > >
> > >   I am using Embedded tomcat to create webapp. when I am 
> > > trying to add web app it is throwing the following exception but 
> > > Server started successfully.
> > > However,I need to eradicate this exception from the log.
> > >
> > > java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such 
> > > file or
> > > directory)
> > > at java.util.zip.ZipFile.open(Native Method)
> > > at java.util.zip.ZipFile.(ZipFile.java:219)
> > > at java.util.zip.ZipFile.(ZipFile.java:149)
> > > at java.util.jar.JarFile.(JarFile.java:166)
> > > at java.util.jar.JarFile.(JarFile.java:130)
> > > at org.apache.tomcat.util.scan.JarFileUrlJar.(
> > > JarFileUrlJar.java:60)
> > > at org.apache.tomcat.util.scan.JarFactory.newInstance(
> > > JarFactory.java:49)
> > > at org.apache.tomcat.util.scan.StandardJarScanner.process(
> > > StandardJarScanner.java:334)
> > > at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> > > StandardJarScanner.java:284)
> > > at org.apache.jasper.servlet.TldScanner.scanJars(
> > > TldScanner.java:262)
> > > at org.apache.jasper.servlet.TldScanner.scan(TldScanner.
> > java:106)
> > > at org.apache.jasper.servlet.JasperInitializer.onStartup(
> > > JasperInitializer.java:101)
> > > at org.apache.catalina.core.StandardContext.startInternal(
> > > StandardContext.java:5303)
> > > at org.apache.catalina.util.LifecycleBase.start(
> > > LifecycleBase.java:145)
> > > at 
> > > org.apache.catalina.core.ContainerBase.addChildInternal(
> > > ContainerBase.java:753)
> > > at org.apache.catalina.core.ContainerBase.addChild(
> > > ContainerBase.java:729)
> > > at org.apache.catalina.core.StandardHost.addChild(
> > > StandardHost.java:717)
> > >
> > >
> > > The above exception I am getting nearly for 10 jars in that some 
> > > of the jars already have with version in name  (Eg: 
> > > jide-grids-3.3.jar) I tried to disable the scan by following steps but 
> > > none worked out.
> > >
> > > 1)tomcat.util.scan.StandardJarScanFilter.jarsToSkip = sonic_*.jar
> in
> > > conf/exclusion.list
> > >
> > > 2) ContextConfig contextConfig = new ContextConfig() {
> > > private boolean invoked = false;
> > >
> > > @Override
> > > public void lifecycleEvent(LifecycleEvent 

Re: Automatically compressing localhost_access_log after rotation

2017-08-04 Thread Martin Knoblauch
On Thu, Aug 3, 2017 at 9:43 PM, Leon Rosenberg 
wrote:

> On Thu, Aug 3, 2017 at 8:16 PM, Christopher Schultz <
> ch...@christopherschultz.net> wrote:
>
> > -BEGIN PGP SIGNED MESSAGE-
> > Hash: SHA256
> >
> > Martin,
> >
> > On 8/3/17 5:47 AM, Martin Knoblauch wrote:
> > > is there a way to compress the localhost_access_log.#.txt file
> > > automatically after rotation?
> >
> > Not really. The file is rotated *during* log events, and stalling to
> > compress a log file is probably not a great solution.
> >
> > > Alternatively/preferably is there a way to put the access logging
> > > under "log4j"?
> >
> > Also not really, but if you are willing to write code, you can do it.
> > The AccessLogValve handles its own logging to a file, but if you were
> > to subclass AccessLogValve and override the "open" method and assign a
> > value to the AccessLogValve.writer member that writes to a log4j
> > logger, then I think you could probably do this.
> >
> > I believe that log4j will stall your access log during the
> > compression, though, so you might want to think about whether or not
> > you want to implement it this way.
> >
> > I think at least logback is performing file operations asynchronously to
> log events so maybe using slf4j over logback would be a more reliable way.
>
> regards
> Leon
>

Hi Leon,

 thanks for the hint. Will look into it.

Cheers
Martin

-- 
--
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www: http://www.knobisoft.de


Re: Automatically compressing localhost_access_log after rotation

2017-08-04 Thread Martin Knoblauch
On Thu, Aug 3, 2017 at 7:16 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Martin,
>
> On 8/3/17 5:47 AM, Martin Knoblauch wrote:
> > is there a way to compress the localhost_access_log.#.txt file
> > automatically after rotation?
>
> Not really. The file is rotated *during* log events, and stalling to
> compress a log file is probably not a great solution.
>
>
 Hmm. Smart way would be to rotate the log, continue logging to the new
file and compress the old one "in the background". That way stalling would
not be an issue.

> Alternatively/preferably is there a way to put the access logging
> > under "log4j"?
>
> Also not really, but if you are willing to write code, you can do it.
> The AccessLogValve handles its own logging to a file, but if you were
> to subclass AccessLogValve and override the "open" method and assign a
> value to the AccessLogValve.writer member that writes to a log4j
> logger, then I think you could probably do this.
>

Writing my own class is clearly an option, but I wanted to first check the
already available  options.


> I believe that log4j will stall your access log during the
> compression, though, so you might want to think about whether or not
> you want to implement it this way.
>
>
Need to check how they are doing it. We use rolling with compression, but
not on a high volume log like the access log.


> What is your operating system? If it were me, I think I'd write a cron
> job to check the directory for uncompressed, rotated log files and
> compress them in a separate process.
>
>
Linux. Sure, we can deploy Cron to do the compression. It just adds another
external process to an already complex setup. But I guess nothing in life
is free :-)


> > I am on Tomcat 7.0.62 (no, do not tell me to update. I know. I want
> > to. But I am not allowed to. So, do not tell me. Please :-)
>
> You should upgrade :)
>

I told you not to tell me :-)

Thanks
Martin


-- 
--
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www: http://www.knobisoft.de


Re: The GET request encounters 400 Bad Request from a URL with Chinese words on Tomcat 8.0.43

2017-08-04 Thread Bruce Huang
Mark Thomas  於 2017年8月1日 週二 下午7:37寫道:

> On 01/08/17 03:26, Bruce Huang wrote:
> > Hi all,
> >
> > We have placed a file named 檔名.txt into
> > the \apache-tomcat-8.0.43\webapps\Apps folder. And our client app can
> > retrieve the file by an HTTP GET request from the URL, for example,
> > http://192.168.1.1/Apps/檔名.txt (The 檔名 are two Chinese words)
> >
> > When it was on tomcat v8.0.23, everything works fine. However, after we
> > have migrated to the v8.0.43, the client app will receive response with
> > HTTP 400 Bad Request. The code that our client app used as below. Looks
> > like that it didn't encode the URL path and only translate the whitespace
> > to %20.
> >
> > Is there any solution that we can configure the tomcat 8.0.43 to
> make this
> > case works as usual(On tomcat v8.0.23), since there are lots of client
> > app deployed?
>
> Sorry, no. This is part of the fix for CVE-2016-6816.
>
> Options have since been added to allow some illegal characters through
> but they will not be sufficient to allow the full range of UTF-8 bytes.
>
> The fix was added to 8.0.39 so any version up to 8.0.38 should work for
> you.
>
> You might be able to put a more lenient reverse proxy in front of Tomcat
> which will accept these characters and then pass the request (correctly
> encoded) to Tomcat. However that depends on finding a suitable reverse
> proxy.
>
> Mark
>

Hi Mark,

Thanks for the reply. We will try to stay with the version 8.0.38 before we
migrate all our app clients.

For those who search for this, the configuration property is  tomcat.
util.http.parser.HttpParser. requestTargetAllow



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

André Warnier (tomcat)  於 2017年8月1日 週二 下午8:10寫道:

> On 01.08.2017 04:26, Bruce Huang wrote:
> > Hi all,
> >
> > We have placed a file named 檔名.txt into
> > the \apache-tomcat-8.0.43\webapps\Apps folder. And our client app can
> > retrieve the file by an HTTP GET request from the URL, for example,
> > http://192.168.1.1/Apps/檔名.txt (The 檔名 are two Chinese words)
>
> This is one of those cases where it can get very confusing very quickly,
> because of the
> multiple opportunities for things to get encoded/decoded or not, and to be
> /seen/ as
> encoded/decoded or not. (Such as : are we really seeing the above URL as
> you meant to send
> it, or are we seeing some other form, as encoded by the email systems
> in-between ?)
>
> Strictly speaking, according to the relevant Internet HTTP RFCs (and which
> ones are
> relevant can be yet another confusing matter), you MAY NOT include the
> above Chinese
> characters directly in a URL string. The set of characters/bytes allowed
> in a URL string
> is very restrictive, and in any case does not include even the individual
> bytes which
> would result from encoding the above Unicode characters as UTF-8.
> (See : https://tools.ietf.org/html/rfc3986#section-2)
>
> Before you send out this URL from the client, you would have to :
> - encode the above Chinese characters as a UTF-8 byte sequence. This would
> probably result
> in 3 bytes or more per character, so let's say 6 bytes in total.
> - then, for each of the 6 bytes, you would have to check if they are
> within the range of
> bytes allowed in a URL, and if not, /that/ byte should be encoded/escaped
> as a "%xy"
> 3-character ASCII byte sequence. (There are many existing functions to do
> that).
>
> Then on the server side receiving this URL, the opposite transformation
> should take place :
> - the first step would be to "%-decode" the URL string, to restore the
> original bytes
> which the client wanted to send. To my knowledge, all HTTP servers do that.
>
> - then, the server and the application would have to /assume/ that URLs
> received from your
> clients are always Unicode, UTF-8 encoded.  That is (still) not the
> default in HTTP (the
> default is still ISO-8859-1). (And there is no mechanism in the current
> RFCs, that allow
> either client or server to indicate, in the request itself, what character
> set the request
> URL really is written in, or should be).
> But you can force Tomcat to assume this, see :
> http://tomcat.apache.org/tomcat-8.0-doc/config/http.html#Common_Attributes
> --> URIEncoding
> (and there is also "useBodyEncodingForURI", but that does not apply in
> your particular case)
> - the next step would thus be for the application (e.g. the default
> servlet), to /assume/
> that this URL is Unicode/UTF-8, and decode this into a corresponding
> internal Unicode string.
> - and then comes the step of looking for the corresponding file in the
> filesystem, by the
> name you got from the previous step. And depending on the OS and the
> filesystem, this may
> be character-set-agnostic or not, and 

Re: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread M. Manna
So if you don't want to scan jar, do you still need that Jar scanner in the
context? All you have done in the code above, is disabled the jar scanner.

Do you want to try without adding the jarscanner to the context? Or try the
following:

JarScanner jsc = new JarScanner() {
 public void scan(ServletContext arg0, ClassLoader arg1,
JarScannerCallback arg2, Set arg3) {
// DUMMY NOTHING
}
};
context.setJarScanner(jsc);


On 4 August 2017 at 09:35, S Abirami  wrote:

> Hi ,
>
> It is contextPath is a String which used to mention my Webapp location.
> Also I don’t want to scan any jar files.
> I want to disable Jarscanner.
>
> Regards,
> Abirami.S
>
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 1:26 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner
> upgrade from 8.0.x to 8.0.x
>
> Okay, where are you getting your contextPath from? The code you posted is
> below:
>
>
> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> StandardJarScanner scanner=new StandardJarScanner();
> scanner.setScanClassPath( false ); scanner.setScanManifest( false );
> context.setJarScanner(scanner);
>
> Also, setScanClassPath(false) you sure this is should not be "true"?
> bootstrap scanner is set to "False" by default so I'm not sure if this is
> supposed to work properly.
>
> https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html
>
> Please update.
>
> Regards,
>
> On 4 August 2017 at 08:50, S Abirami  wrote:
>
> > Hi,
> >
> >  I am trying to create EmbeddedTomcat  so no context.xml created.
> > Tomcat t=new Tomcat();
> > Everything through object creation.
> >
> > Regards,
> > Abirami.S
> >
> > -Original Message-
> > From: M. Manna [mailto:manme...@gmail.com]
> > Sent: Friday, August 04, 2017 1:18 PM
> > To: Tomcat Users List
> > Subject: Re: Embedded Tomcat throws FileNotFoundException for
> > TldScanner upgrade from 8.0.x to 8.0.x
> >
> > Hi,
> >
> > What is in your context.xml file? You can find it in conf directory.
> >
> > Regards,
> >
> > On 4 August 2017 at 08:43, S Abirami  wrote:
> >
> > > Hi ,
> > >
> > >   I am using Embedded tomcat to create webapp. when I am trying
> > > to add web app it is throwing the following exception but Server
> > > started successfully.
> > > However,I need to eradicate this exception from the log.
> > >
> > > java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such file
> > > or
> > > directory)
> > > at java.util.zip.ZipFile.open(Native Method)
> > > at java.util.zip.ZipFile.(ZipFile.java:219)
> > > at java.util.zip.ZipFile.(ZipFile.java:149)
> > > at java.util.jar.JarFile.(JarFile.java:166)
> > > at java.util.jar.JarFile.(JarFile.java:130)
> > > at org.apache.tomcat.util.scan.JarFileUrlJar.(
> > > JarFileUrlJar.java:60)
> > > at org.apache.tomcat.util.scan.JarFactory.newInstance(
> > > JarFactory.java:49)
> > > at org.apache.tomcat.util.scan.StandardJarScanner.process(
> > > StandardJarScanner.java:334)
> > > at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> > > StandardJarScanner.java:284)
> > > at org.apache.jasper.servlet.TldScanner.scanJars(
> > > TldScanner.java:262)
> > > at org.apache.jasper.servlet.TldScanner.scan(TldScanner.
> > java:106)
> > > at org.apache.jasper.servlet.JasperInitializer.onStartup(
> > > JasperInitializer.java:101)
> > > at org.apache.catalina.core.StandardContext.startInternal(
> > > StandardContext.java:5303)
> > > at org.apache.catalina.util.LifecycleBase.start(
> > > LifecycleBase.java:145)
> > > at org.apache.catalina.core.ContainerBase.addChildInternal(
> > > ContainerBase.java:753)
> > > at org.apache.catalina.core.ContainerBase.addChild(
> > > ContainerBase.java:729)
> > > at org.apache.catalina.core.StandardHost.addChild(
> > > StandardHost.java:717)
> > >
> > >
> > > The above exception I am getting nearly for 10 jars in that some of
> > > the jars already have with version in name  (Eg: jide-grids-3.3.jar)
> > > I tried to disable the scan by following steps but none worked out.
> > >
> > > 1)tomcat.util.scan.StandardJarScanFilter.jarsToSkip = sonic_*.jar
> in
> > > conf/exclusion.list
> > >
> > > 2) ContextConfig contextConfig = new ContextConfig() {
> > > private boolean invoked = false;
> > >
> > > @Override
> > > public void lifecycleEvent(LifecycleEvent event) {
> > > if (!invoked) {
> > > StandardJarScanner scanner = new
> > StandardJarScanner();
> > > scanner.setScanClassPath(false);
> > > scanner.setScanManifest(false);
> > > ((Context) event.getLifecycle()).
> > > setJarScanner(scanner);
> > > invoked = true;
> 

Small question on mod_jk load balancing methon "Next"

2017-08-04 Thread Martin Knoblauch
Hi,

 just need some clarification on the mod_jk load blanacing method "Next".
The documentation states:

"If method is set to N[ext] the balancer will again use the number of
sessions to find the best worker. All remarks concerning the Session method
apply as well. The difference to the Session method is how the session
count is handled in the sliding time window. The Next method does not
divide by 2, instead it subtracts the current minimum number. This should
effectively result in a round-robin session balancing, thus the name Next.
Under high load, the two session balancing methods will result in a similar
distribution, but Next will be better if you need to distribute small
numbers of sessions. "

 What exactly is the "current minimum number"? How is the minimum taken?
>From all workers in the balancer set, or only the ACTive ones? I know, I
should look it up in the code :-)

Thanks in advance
Martin
-- 
--
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www: http://www.knobisoft.de


RE: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread S Abirami
Hi ,

It is contextPath is a String which used to mention my Webapp location.
Also I don’t want to scan any jar files.
I want to disable Jarscanner.

Regards,
Abirami.S

-Original Message-
From: M. Manna [mailto:manme...@gmail.com] 
Sent: Friday, August 04, 2017 1:26 PM
To: Tomcat Users List
Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner 
upgrade from 8.0.x to 8.0.x

Okay, where are you getting your contextPath from? The code you posted is
below:


3)Context context= Tomcat.addwebapp(contextpath,docpath);
StandardJarScanner scanner=new StandardJarScanner(); scanner.setScanClassPath( 
false ); scanner.setScanManifest( false ); context.setJarScanner(scanner);

Also, setScanClassPath(false) you sure this is should not be "true"?
bootstrap scanner is set to "False" by default so I'm not sure if this is 
supposed to work properly.

https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html

Please update.

Regards,

On 4 August 2017 at 08:50, S Abirami  wrote:

> Hi,
>
>  I am trying to create EmbeddedTomcat  so no context.xml created.
> Tomcat t=new Tomcat();
> Everything through object creation.
>
> Regards,
> Abirami.S
>
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 1:18 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for 
> TldScanner upgrade from 8.0.x to 8.0.x
>
> Hi,
>
> What is in your context.xml file? You can find it in conf directory.
>
> Regards,
>
> On 4 August 2017 at 08:43, S Abirami  wrote:
>
> > Hi ,
> >
> >   I am using Embedded tomcat to create webapp. when I am trying 
> > to add web app it is throwing the following exception but Server 
> > started successfully.
> > However,I need to eradicate this exception from the log.
> >
> > java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such file 
> > or
> > directory)
> > at java.util.zip.ZipFile.open(Native Method)
> > at java.util.zip.ZipFile.(ZipFile.java:219)
> > at java.util.zip.ZipFile.(ZipFile.java:149)
> > at java.util.jar.JarFile.(JarFile.java:166)
> > at java.util.jar.JarFile.(JarFile.java:130)
> > at org.apache.tomcat.util.scan.JarFileUrlJar.(
> > JarFileUrlJar.java:60)
> > at org.apache.tomcat.util.scan.JarFactory.newInstance(
> > JarFactory.java:49)
> > at org.apache.tomcat.util.scan.StandardJarScanner.process(
> > StandardJarScanner.java:334)
> > at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> > StandardJarScanner.java:284)
> > at org.apache.jasper.servlet.TldScanner.scanJars(
> > TldScanner.java:262)
> > at org.apache.jasper.servlet.TldScanner.scan(TldScanner.
> java:106)
> > at org.apache.jasper.servlet.JasperInitializer.onStartup(
> > JasperInitializer.java:101)
> > at org.apache.catalina.core.StandardContext.startInternal(
> > StandardContext.java:5303)
> > at org.apache.catalina.util.LifecycleBase.start(
> > LifecycleBase.java:145)
> > at org.apache.catalina.core.ContainerBase.addChildInternal(
> > ContainerBase.java:753)
> > at org.apache.catalina.core.ContainerBase.addChild(
> > ContainerBase.java:729)
> > at org.apache.catalina.core.StandardHost.addChild(
> > StandardHost.java:717)
> >
> >
> > The above exception I am getting nearly for 10 jars in that some of 
> > the jars already have with version in name  (Eg: jide-grids-3.3.jar) 
> > I tried to disable the scan by following steps but none worked out.
> >
> > 1)tomcat.util.scan.StandardJarScanFilter.jarsToSkip = sonic_*.jarin
> > conf/exclusion.list
> >
> > 2) ContextConfig contextConfig = new ContextConfig() {
> > private boolean invoked = false;
> >
> > @Override
> > public void lifecycleEvent(LifecycleEvent event) {
> > if (!invoked) {
> > StandardJarScanner scanner = new
> StandardJarScanner();
> > scanner.setScanClassPath(false);
> > scanner.setScanManifest(false);
> > ((Context) event.getLifecycle()).
> > setJarScanner(scanner);
> > invoked = true;
> > }
> > super.lifecycleEvent(event);
> > }
> > };
> > Tomcat.getServer().addLifecycleListener(contextconfig);
> > Tomcat.addwebapp(contextpath,docpath)
> >
> > 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> > StandardJarScanner scanner=new StandardJarScanner(); 
> > scanner.setScanClassPath( false ); scanner.setScanManifest( false ); 
> > context.setJarScanner(scanner);
> >
> >
> > Please help me here to resolve the problem.
> >
> > Regards,
> > Abirami.S
> >
>


Re: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread M. Manna
Okay, where are you getting your contextPath from? The code you posted is
below:


3)Context context= Tomcat.addwebapp(contextpath,docpath);
StandardJarScanner scanner=new StandardJarScanner();
scanner.setScanClassPath( false );
scanner.setScanManifest( false );
context.setJarScanner(scanner);

Also, setScanClassPath(false) you sure this is should not be "true"?
bootstrap scanner is set to "False" by default so I'm not sure if this is
supposed to work properly.

https://tomcat.apache.org/tomcat-8.0-doc/config/jar-scanner.html

Please update.

Regards,

On 4 August 2017 at 08:50, S Abirami  wrote:

> Hi,
>
>  I am trying to create EmbeddedTomcat  so no context.xml created.
> Tomcat t=new Tomcat();
> Everything through object creation.
>
> Regards,
> Abirami.S
>
> -Original Message-
> From: M. Manna [mailto:manme...@gmail.com]
> Sent: Friday, August 04, 2017 1:18 PM
> To: Tomcat Users List
> Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner
> upgrade from 8.0.x to 8.0.x
>
> Hi,
>
> What is in your context.xml file? You can find it in conf directory.
>
> Regards,
>
> On 4 August 2017 at 08:43, S Abirami  wrote:
>
> > Hi ,
> >
> >   I am using Embedded tomcat to create webapp. when I am trying to
> > add web app it is throwing the following exception but Server started
> > successfully.
> > However,I need to eradicate this exception from the log.
> >
> > java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such file
> > or
> > directory)
> > at java.util.zip.ZipFile.open(Native Method)
> > at java.util.zip.ZipFile.(ZipFile.java:219)
> > at java.util.zip.ZipFile.(ZipFile.java:149)
> > at java.util.jar.JarFile.(JarFile.java:166)
> > at java.util.jar.JarFile.(JarFile.java:130)
> > at org.apache.tomcat.util.scan.JarFileUrlJar.(
> > JarFileUrlJar.java:60)
> > at org.apache.tomcat.util.scan.JarFactory.newInstance(
> > JarFactory.java:49)
> > at org.apache.tomcat.util.scan.StandardJarScanner.process(
> > StandardJarScanner.java:334)
> > at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> > StandardJarScanner.java:284)
> > at org.apache.jasper.servlet.TldScanner.scanJars(
> > TldScanner.java:262)
> > at org.apache.jasper.servlet.TldScanner.scan(TldScanner.
> java:106)
> > at org.apache.jasper.servlet.JasperInitializer.onStartup(
> > JasperInitializer.java:101)
> > at org.apache.catalina.core.StandardContext.startInternal(
> > StandardContext.java:5303)
> > at org.apache.catalina.util.LifecycleBase.start(
> > LifecycleBase.java:145)
> > at org.apache.catalina.core.ContainerBase.addChildInternal(
> > ContainerBase.java:753)
> > at org.apache.catalina.core.ContainerBase.addChild(
> > ContainerBase.java:729)
> > at org.apache.catalina.core.StandardHost.addChild(
> > StandardHost.java:717)
> >
> >
> > The above exception I am getting nearly for 10 jars in that some of
> > the jars already have with version in name  (Eg: jide-grids-3.3.jar) I
> > tried to disable the scan by following steps but none worked out.
> >
> > 1)tomcat.util.scan.StandardJarScanFilter.jarsToSkip = sonic_*.jarin
> > conf/exclusion.list
> >
> > 2) ContextConfig contextConfig = new ContextConfig() {
> > private boolean invoked = false;
> >
> > @Override
> > public void lifecycleEvent(LifecycleEvent event) {
> > if (!invoked) {
> > StandardJarScanner scanner = new
> StandardJarScanner();
> > scanner.setScanClassPath(false);
> > scanner.setScanManifest(false);
> > ((Context) event.getLifecycle()).
> > setJarScanner(scanner);
> > invoked = true;
> > }
> > super.lifecycleEvent(event);
> > }
> > };
> > Tomcat.getServer().addLifecycleListener(contextconfig);
> > Tomcat.addwebapp(contextpath,docpath)
> >
> > 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> > StandardJarScanner scanner=new StandardJarScanner();
> > scanner.setScanClassPath( false ); scanner.setScanManifest( false );
> > context.setJarScanner(scanner);
> >
> >
> > Please help me here to resolve the problem.
> >
> > Regards,
> > Abirami.S
> >
>


RE: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread S Abirami
Hi,

 I am trying to create EmbeddedTomcat  so no context.xml created.
Tomcat t=new Tomcat();
Everything through object creation.

Regards,
Abirami.S

-Original Message-
From: M. Manna [mailto:manme...@gmail.com] 
Sent: Friday, August 04, 2017 1:18 PM
To: Tomcat Users List
Subject: Re: Embedded Tomcat throws FileNotFoundException for TldScanner 
upgrade from 8.0.x to 8.0.x

Hi,

What is in your context.xml file? You can find it in conf directory.

Regards,

On 4 August 2017 at 08:43, S Abirami  wrote:

> Hi ,
>
>   I am using Embedded tomcat to create webapp. when I am trying to 
> add web app it is throwing the following exception but Server started 
> successfully.
> However,I need to eradicate this exception from the log.
>
> java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such file 
> or
> directory)
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.(ZipFile.java:219)
> at java.util.zip.ZipFile.(ZipFile.java:149)
> at java.util.jar.JarFile.(JarFile.java:166)
> at java.util.jar.JarFile.(JarFile.java:130)
> at org.apache.tomcat.util.scan.JarFileUrlJar.(
> JarFileUrlJar.java:60)
> at org.apache.tomcat.util.scan.JarFactory.newInstance(
> JarFactory.java:49)
> at org.apache.tomcat.util.scan.StandardJarScanner.process(
> StandardJarScanner.java:334)
> at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> StandardJarScanner.java:284)
> at org.apache.jasper.servlet.TldScanner.scanJars(
> TldScanner.java:262)
> at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:106)
> at org.apache.jasper.servlet.JasperInitializer.onStartup(
> JasperInitializer.java:101)
> at org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5303)
> at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:145)
> at org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:753)
> at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:729)
> at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:717)
>
>
> The above exception I am getting nearly for 10 jars in that some of 
> the jars already have with version in name  (Eg: jide-grids-3.3.jar) I 
> tried to disable the scan by following steps but none worked out.
>
> 1)tomcat.util.scan.StandardJarScanFilter.jarsToSkip = sonic_*.jarin
> conf/exclusion.list
>
> 2) ContextConfig contextConfig = new ContextConfig() {
> private boolean invoked = false;
>
> @Override
> public void lifecycleEvent(LifecycleEvent event) {
> if (!invoked) {
> StandardJarScanner scanner = new StandardJarScanner();
> scanner.setScanClassPath(false);
> scanner.setScanManifest(false);
> ((Context) event.getLifecycle()).
> setJarScanner(scanner);
> invoked = true;
> }
> super.lifecycleEvent(event);
> }
> };
> Tomcat.getServer().addLifecycleListener(contextconfig);
> Tomcat.addwebapp(contextpath,docpath)
>
> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> StandardJarScanner scanner=new StandardJarScanner(); 
> scanner.setScanClassPath( false ); scanner.setScanManifest( false ); 
> context.setJarScanner(scanner);
>
>
> Please help me here to resolve the problem.
>
> Regards,
> Abirami.S
>


Re: Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread M. Manna
Hi,

What is in your context.xml file? You can find it in conf directory.

Regards,

On 4 August 2017 at 08:43, S Abirami  wrote:

> Hi ,
>
>   I am using Embedded tomcat to create webapp. when I am trying to add
> web app it is throwing the following exception but Server started
> successfully.
> However,I need to eradicate this exception from the log.
>
> java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such file or
> directory)
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.(ZipFile.java:219)
> at java.util.zip.ZipFile.(ZipFile.java:149)
> at java.util.jar.JarFile.(JarFile.java:166)
> at java.util.jar.JarFile.(JarFile.java:130)
> at org.apache.tomcat.util.scan.JarFileUrlJar.(
> JarFileUrlJar.java:60)
> at org.apache.tomcat.util.scan.JarFactory.newInstance(
> JarFactory.java:49)
> at org.apache.tomcat.util.scan.StandardJarScanner.process(
> StandardJarScanner.java:334)
> at org.apache.tomcat.util.scan.StandardJarScanner.scan(
> StandardJarScanner.java:284)
> at org.apache.jasper.servlet.TldScanner.scanJars(
> TldScanner.java:262)
> at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:106)
> at org.apache.jasper.servlet.JasperInitializer.onStartup(
> JasperInitializer.java:101)
> at org.apache.catalina.core.StandardContext.startInternal(
> StandardContext.java:5303)
> at org.apache.catalina.util.LifecycleBase.start(
> LifecycleBase.java:145)
> at org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:753)
> at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:729)
> at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:717)
>
>
> The above exception I am getting nearly for 10 jars in that some of the
> jars already have with version in name  (Eg: jide-grids-3.3.jar)
> I tried to disable the scan by following steps but none worked out.
>
> 1)tomcat.util.scan.StandardJarScanFilter.jarsToSkip = sonic_*.jarin
> conf/exclusion.list
>
> 2) ContextConfig contextConfig = new ContextConfig() {
> private boolean invoked = false;
>
> @Override
> public void lifecycleEvent(LifecycleEvent event) {
> if (!invoked) {
> StandardJarScanner scanner = new StandardJarScanner();
> scanner.setScanClassPath(false);
> scanner.setScanManifest(false);
> ((Context) event.getLifecycle()).
> setJarScanner(scanner);
> invoked = true;
> }
> super.lifecycleEvent(event);
> }
> };
> Tomcat.getServer().addLifecycleListener(contextconfig);
> Tomcat.addwebapp(contextpath,docpath)
>
> 3)Context context= Tomcat.addwebapp(contextpath,docpath);
> StandardJarScanner scanner=new StandardJarScanner();
> scanner.setScanClassPath( false );
> scanner.setScanManifest( false );
> context.setJarScanner(scanner);
>
>
> Please help me here to resolve the problem.
>
> Regards,
> Abirami.S
>


Embedded Tomcat throws FileNotFoundException for TldScanner upgrade from 8.0.x to 8.0.x

2017-08-04 Thread S Abirami
Hi ,

  I am using Embedded tomcat to create webapp. when I am trying to add web 
app it is throwing the following exception but Server started successfully.
However,I need to eradicate this exception from the log.

java.io.FileNotFoundException: /var/lib/jide-grids.jar (No such file or 
directory)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:219)
at java.util.zip.ZipFile.(ZipFile.java:149)
at java.util.jar.JarFile.(JarFile.java:166)
at java.util.jar.JarFile.(JarFile.java:130)
at 
org.apache.tomcat.util.scan.JarFileUrlJar.(JarFileUrlJar.java:60)
at 
org.apache.tomcat.util.scan.JarFactory.newInstance(JarFactory.java:49)
at 
org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:334)
at 
org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:284)
at org.apache.jasper.servlet.TldScanner.scanJars(TldScanner.java:262)
at org.apache.jasper.servlet.TldScanner.scan(TldScanner.java:106)
at 
org.apache.jasper.servlet.JasperInitializer.onStartup(JasperInitializer.java:101)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5303)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)


The above exception I am getting nearly for 10 jars in that some of the jars 
already have with version in name  (Eg: jide-grids-3.3.jar)
I tried to disable the scan by following steps but none worked out.

1)tomcat.util.scan.StandardJarScanFilter.jarsToSkip = sonic_*.jarin 
conf/exclusion.list

2) ContextConfig contextConfig = new ContextConfig() {
private boolean invoked = false;

@Override
public void lifecycleEvent(LifecycleEvent event) {
if (!invoked) {
StandardJarScanner scanner = new StandardJarScanner();
scanner.setScanClassPath(false);
scanner.setScanManifest(false);
((Context) event.getLifecycle()).setJarScanner(scanner);
invoked = true;
}
super.lifecycleEvent(event);
}
};
Tomcat.getServer().addLifecycleListener(contextconfig);
Tomcat.addwebapp(contextpath,docpath)

3)Context context= Tomcat.addwebapp(contextpath,docpath);
StandardJarScanner scanner=new StandardJarScanner();
scanner.setScanClassPath( false );
scanner.setScanManifest( false );
context.setJarScanner(scanner);


Please help me here to resolve the problem.

Regards,
Abirami.S


Re: Tomcat 9 won't start according to Eclipse

2017-08-04 Thread Roparzh Hemon
> The key here is to double-click (not right-click) the server listed in
> the server pane at the bottom center of the IDE.
>

   Absolutely. I finally got it now, thanks for your patience

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