Re: custom classloader missing root
On 11/11/2014 17:20, Ed Rouse wrote: >> -Original Message- >> From: Mark Thomas [mailto:ma...@apache.org] >> Sent: Tuesday, November 11, 2014 12:14 PM >> To: Tomcat Users List >> Subject: Re: custom classloader missing root >> >> On 11/11/2014 17:01, Ed Rouse wrote: >>> I already tried getResources() but it returns null. hence my >>> confusion. As far as I can tell, tomcat is not setting the root or >>> context on my class loader. >> >> That depends on when you call it. > > Since it is the in the context.xml file, I am not calling it, tomcat > is. You said you tried getResources() but it returns null. Again, the result from getResources() in this case depends on when you call it. > Is there another way to do this so I can call it manually from within the > webapp? Nope. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Windows Service won't start
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Konstantin, On 11/11/14 4:15 AM, Konstantin Kolinko wrote: > 2014-11-10 21:04 GMT+03:00 Christopher Schultz >> When a Tomcat Windows Service won't start (with the >> super-helpful "a service-specific error occurred"), where can I >> look for detailed information about what happened? >> >> (Please be kind, I'm not an everyday Windows administrator) >> >> I installed the service myself using a process almost exactly >> like this: >> >> C:\> SET CATALINA_HOME=[path to Tomcat] C:\> SET >> CATALINA_BASE=[path to my catalina.base] C:\> SET >> JAVA_HOME=[path to Java] C:\> %CATALINA_HOME%\bin\service.bat >> install myproject >> >> I can see the Windows Service called "Apache Tomcat 7.0 >> myproject" in the Services management console. Clicking "start" >> results in a short wait and then the error about how the service >> itself had a problem with no details. >> >> - From the CLI, running "net start myproject" yields a similar >> error. >> >> Any suggestions? > > Tomcat version = ? Sorry, Tomcat 7.0.56. We have it running on another server with Tomcat 7.0.55 that works fine. I used the same procedure (i.e. SET CATALINA_... and service.bat install) on both servers. > Run tomcat7w.exe and check that service parameters are as expected > (bootstrap class name, start/stop arguments). It is also possible > to use registry viewer, but using tomcat7w.exe is more convenient. > > Path to log files by one of options there - it shall be Tomcat log > directory. If it is empty then --LogPath has default value, as > documented in I do get the procrun logs for stdout and stderr.. they just both say "starting" with no errors. > http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Command_line_parameters > > > Some old versions of service.bat of Tomcat 7 had a bug that > "service.bat install" had to be run from console window that > itself is run with elevated privileges. > https://issues.apache.org/bugzilla/show_bug.cgi?id=56143 No UAC prompts during installation, plus my version should be high enough. I have a chance to look at the server again on Thursday. I'll check everything folks have posted here. Thanks, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUYuFSAAoJEBzwKT+lPKRYJw4P/j/myrLClaGruB06IgBcU6UY jJx2/Y+posUjq1JxhWGPJCVncnmF2mM9KnVog7cgDyb5Rq1Z6Iq//Qh/Q0qcqLst cdOtMaHARoq7JQlaRACKnX/IfjY54NiBCzkOsjUM1GmQWcq6S82LAd5ugWzbrLcU DXcF7OOmxbOu8k4qd+Weq7FZcQ460gGOSL/rI7+zzFBnopbENWxq+OUwA/eyn6s2 OuWI2OGATO75I0uj6E4C5E6QVgdl0ekLpnc+WMsW/+OpeNTrEMQaq05Kb4IF9hbo HexlnFGWQufC7vZGWLa1xh5CawSsC9Sgnj++pSEypnYwqYNDUK/cWaDNdReyXbwy tQOMewk+zXWgtabEVandMpucIwhkMjXfglbnxEE4fwGuaWQWQ7Q8FvAyULWUA8VO J26Jd2UzK3xZ5TWA3sAodBWGOK5Zwcs4zfYOG9AhGk1s7vpu2yJ04t8XLvutHYxQ kKbAX1QW3qkvBGdgzMxoET4Do4ydFrIVxXlqPFvflyVWLm/KfzCKnIxvtA8N/c1C v5ifDUMF/znK5yOra/D3TH2UYbd0hPjH7YH4oy9W5HyvQsboFOHC2EhXZZqHMIS0 2uA2hbcpm+36mizeyC0/BNnI0lpSAdor15uPAB8OY0a6c9qz3oXY2pEAhYTsooaJ 0TVbCumfYocYO++Nc+3w =eb3e -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: custom classloader missing root
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Ed, On 11/11/14 10:34 AM, Ed Rouse wrote: > I am trying to convert a custom class loader from version 5.5 to > version 8.0.11, running under ubuntu. > > I have the following line in my context.xml file. > > I have tried the delegate as both true and false with no > difference. I'm a bit late to the party, but I'd like to point out that delegate="false" will only do something if your own ClassLoader implements a setDelegate(boolean) method and then actually changes its own behavior. > I have found that the parent loader is java.net.URLClassLoader, not > org.apache.catalina.loader.WebappLoader or > org.apache.catalina.loader.WebappClassLoaderBase as I expected. You asked Tomcat to use your ClassLoader instead of the standard WebappClassLoader. Perhaps you meant for your own ClassLoader to *extend* Tomcat's WebappClassLoader? > My class loader extends > org.apache.catalina.loader.WebappClassLoader. In that case, you'll get setDelegate as well as everything the superclass supports. You can get everything WebappClassLoader can do by calling super.whatever() in IDWMClassLoader.whatever(), or by not overriding anything from the superclass. > In order to add files, as far as I know I need an > org.apache.catalina.WebResourceRoot (probably StandardRoot) and an > org.apache.catalina.Context (probably > org.apache.catalina.core.StandardContext). > > So how do I get, find or create these 2 classes? I think I can > create a new StandardRoot if I have a Context, but what needs to be > done to create a proper context for a web application that is > getting auto-loaded by the tomcat container at startup? > > I am missing some information and have, as yet, not been able to > find any details about how to accomplish this. Perhaps it would be better if you told us what exactly you are trying to accomplish by using your own ClassLoader? Is there something that WebappClassLoader doesn't do for you already? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUYuEAAAoJEBzwKT+lPKRYA68QAMGhXjSWtW4KU6EjEKqMTPfa Mn7iiVI7VImyJXg0kiy3QCPS807PsDyVcdDFqm3lsffPivUSYnZ+jcjA2Xpn1Bb1 VNhaQlr9UkPm23cFoQPFwSEhPsy33k9XkI8B0PaRtHsITMZhU23pNSQGbZ16wCuv aeTxqoUAzToyvlW4Du+5LgjWa4XNj3dBFQoCebICv092D2PSr8cuUTxj5ti7Rhcx +Qu921VDzlOWQ/j0aXdnn2Eds7g5cZsG7bSTUXJMSyFPRT9HaMbxBOH3k8475aPb U17A3xhSXRi0kgMjn+Lny8OSiU/Vv5L51IyKmzV2Cn+ymlqRc0G1q1Q0P/itatpQ rm3a/WYM4XDQt/EYp6BrvQgFb/dDZs9jYBxFvOFQNigh5c60h3yStQlQ9EMLoGqx 9RcvDI+IAqThLqC6aKrpNBAQbGxXOoGgSofX2PqWFC7GZOgqVbUYnE9EG36YzuCQ dc3vPBBbasPvNwHID1NJbDNGmR8rc7ilM4s050sH/5WNlVOyHehA3j3jStrXdDkp F/B04wjKsYS/IoNb/xrPdUHzdrVj9jZudDDbiNTeiU5Jk3tkVEBnBUWJa2KaJ2cj pOV0NZBkbOHbMPNY8VRmcErg45Czy+UARK/CpVOzDtp8JEFbsMbUSBgiVtq7uUcv 5m8PxVl5f84IW6KtOeAz =7Rdm -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: mod_jk on Mac OS X 10.10 (Yosemite)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 William, On 11/11/14 6:41 AM, William Moore wrote: > It turns out this was happening because the upgrade to Yosemite > had deleted all the files in /usr/include. I removed the replaced > the folder /usr/include with a link to > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include > > and then configure and make both worked. I think you probably wanted to reinstall Xcode's command-line utilities instead of the above hack. > Perhaps there is a different way to tell configure and make to use > an additional include folder, but I don’t know how to do that (I > work on Java mostly, not this stuff). You can use the CFLAGS environment variable, like this: $ CFLAGS=-I/path/to/include/files ./configure --options ... It may or may not work... specifying the CC environment variable works for configure and build, but not libtool which ignores the CC setting used during configure. I think that's a problem with the mod_jk build process, but I'm not good enough at configure/make/libtool to know how to fix it. I'll work with Rainer to solve that... he knows a lot more than I do about the Apache toolchain... - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJUYt5ZAAoJEBzwKT+lPKRYKtAQAJV+azXDwGAkxHQKrH+tjP3M mJje+90FnDtBlPM8zwBYg1oP+5nH8Cg79OzJYeuSEQlbpj+1J7Vq0iEojDAj8CTm ejh7eEtcox7ImTuV0gY8DDyujXCG8hJtM8oHNfnaEfobIUM6iK88NSArMHY3BNrL dQo2jhYrxrFVJ/eVfo6WCsHIVLD6fMDDzDGTwsO//FKCnoAKXMJmTPU/ZeBkFgdq Sjanf14qhOFG52R5uOM7iDaxmOw191b1+tlEewrXbR0ZcjRLi/b8HJO36I7i5UzT uPh81xC1SMdeNG7vQCftuiCQAjPyp+p1q2NfDaiX0xBqgE5aJl+9SqWImnADb28r chhxMaGFT5QVEDumjOkeUsA2ZwdXhDR68fMHXz6/+1hoJFIFlFnZhvLrcRwO1Z5A USaJ1QD/AnoKq8SL3ye/tXPO59oqTBcO1VHg1ojADnmuHj/5E0QNzMFHruRVpio4 MEjJn3hhZDRPGuCD5g1JxcA83W5gkUbyZjKHen7YYk8/3CSrnDj51bjz/C7+BRru 5h4iuTjsai+5XmwHoE6pvIt25An3u9sGI5Krrkr5kNnuqMYDrCHP+0oT9OQ+pjti k4I1FznqIoAhxcJ9IbPwGe3/Lw6O6cltBXy7QgcGRLQIwz6fjkQDY63j0puY5DsB EMNIAlw6itpgV3IPnQ5P =+dWW -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trailing dot in hostname causes TLS handshake to fail
I have SNI extension disabled with -Djsse.enableSNIExtension=false and SSLv3 disabled with sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2". This should just be vanilla TLS. Peter On 11/11/14, 10:12 PM, "Konstantin Kolinko" wrote: >2014-11-12 0:03 GMT+03:00 Peter Robbins : >> Hi there, >> I’m running into an issue with fully-qualified domain names and https >> using Tomcat 8 and JDK 8. >> Tomcat version: 8.0.14 >> JDK Version: 1.8.0_25OS: Mac OS X 10.10 >> >> If you include the trailing dot in a request over https, the TLS >>handshake >> will fail. It appears that it tries to fall back to SSLv3, but if you >>have >> SSLv3 disabled, the whole thing just fails. >> >> My SSL Connector looks like this: >> > clientAuth="false" debug="1" disableUploadTimeout="true" >> enableLookups="false" keystoreFile="../keystore.jks" >> keystorePass="password" maxHttpHeaderSize="8192" >>keyAlias="selfsigned" >> port="8443" protocol="org.apache.coyote.http11.Http11Protocol" >> scheme="https" secure="true" >> sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"> >> >> >> https://localhost.:8443 in Chrome 38 returns >> ERR_SSL_VERSION_OR_CIPHER_MISMATCH. >> >> The output from javax.net.debug=all contains this: >> http-bio-8443-exec-5, handling exception: >> javax.net.ssl.SSLProtocolException: Illegal server name, >> type=host_name(0), name=localhost., value=6c:6f:63:61:6c:68:6f:73:74:2e >> >> This looks like it’s being bubbled up from the SNIHostName constructor >>in >> Java 8 >> >>(https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SNIHostName.html >>), >> which explicitly forbids trailing dots in hostnames (valid hostname, >>but >> not a valid SNI hostname). I’m not using SNI, but to make sure I set >> jsse.enableSNIExtension=false. The exception is still thrown, leading me >> to believe that the SNIHostName constructor is being called whether SNI >>is >> enabled or not. >> >> >> Why not just remove the trailing dot? Well, it’s valid to be there, so >>why >> not support it. More importantly, we make use of this to get around TLS >> session caching as discussed here: >> https://developer.apple.com/library/ios/qa/qa1727/_index.html. >> >> >> This issue is not present in Tomcat 7 or using Java 7. I have a small >>PoC >> I can zip up and host somewhere if anyone wants to take a look. >> >> Does anyone know if this looks like a bug in Tomcat 8 or Java 8 and >>where >> I should submit a bug report if it does? > >Read the spec: >http://tools.ietf.org/html/rfc6066#section-3 > >[quote] > "HostName" contains the fully qualified DNS hostname of the server, > as understood by the client. The hostname is represented as a byte > string using ASCII encoding without a trailing dot. >[/quote] > >SNI is a TLS extensions and as such it requires minimum of TLS 1.0 and >cannot be transmitted via SSL 3.0. > >- >To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >For additional commands, e-mail: users-h...@tomcat.apache.org >
Re: Trailing dot in hostname causes TLS handshake to fail
2014-11-12 0:03 GMT+03:00 Peter Robbins : > Hi there, > I’m running into an issue with fully-qualified domain names and https > using Tomcat 8 and JDK 8. > Tomcat version: 8.0.14 > JDK Version: 1.8.0_25OS: Mac OS X 10.10 > > If you include the trailing dot in a request over https, the TLS handshake > will fail. It appears that it tries to fall back to SSLv3, but if you have > SSLv3 disabled, the whole thing just fails. > > My SSL Connector looks like this: > clientAuth="false" debug="1" disableUploadTimeout="true" > enableLookups="false" keystoreFile="../keystore.jks" > keystorePass="password" maxHttpHeaderSize="8192" > keyAlias="selfsigned" > port="8443" protocol="org.apache.coyote.http11.Http11Protocol" > scheme="https" secure="true" > sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2"> > > > https://localhost.:8443 in Chrome 38 returns > ERR_SSL_VERSION_OR_CIPHER_MISMATCH. > > The output from javax.net.debug=all contains this: > http-bio-8443-exec-5, handling exception: > javax.net.ssl.SSLProtocolException: Illegal server name, > type=host_name(0), name=localhost., value=6c:6f:63:61:6c:68:6f:73:74:2e > > This looks like it’s being bubbled up from the SNIHostName constructor in > Java 8 > (https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SNIHostName.html), > which explicitly forbids trailing dots in hostnames (valid hostname, but > not a valid SNI hostname). I’m not using SNI, but to make sure I set > jsse.enableSNIExtension=false. The exception is still thrown, leading me > to believe that the SNIHostName constructor is being called whether SNI is > enabled or not. > > > Why not just remove the trailing dot? Well, it’s valid to be there, so why > not support it. More importantly, we make use of this to get around TLS > session caching as discussed here: > https://developer.apple.com/library/ios/qa/qa1727/_index.html. > > > This issue is not present in Tomcat 7 or using Java 7. I have a small PoC > I can zip up and host somewhere if anyone wants to take a look. > > Does anyone know if this looks like a bug in Tomcat 8 or Java 8 and where > I should submit a bug report if it does? Read the spec: http://tools.ietf.org/html/rfc6066#section-3 [quote] "HostName" contains the fully qualified DNS hostname of the server, as understood by the client. The hostname is represented as a byte string using ASCII encoding without a trailing dot. [/quote] SNI is a TLS extensions and as such it requires minimum of TLS 1.0 and cannot be transmitted via SSL 3.0. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Trailing dot in hostname causes TLS handshake to fail
Hi there, I’m running into an issue with fully-qualified domain names and https using Tomcat 8 and JDK 8. Tomcat version: 8.0.14 JDK Version: 1.8.0_25OS: Mac OS X 10.10 If you include the trailing dot in a request over https, the TLS handshake will fail. It appears that it tries to fall back to SSLv3, but if you have SSLv3 disabled, the whole thing just fails. My SSL Connector looks like this: https://localhost.:8443 in Chrome 38 returns ERR_SSL_VERSION_OR_CIPHER_MISMATCH. The output from javax.net.debug=all contains this: http-bio-8443-exec-5, handling exception: javax.net.ssl.SSLProtocolException: Illegal server name, type=host_name(0), name=localhost., value=6c:6f:63:61:6c:68:6f:73:74:2e This looks like it’s being bubbled up from the SNIHostName constructor in Java 8 (https://docs.oracle.com/javase/8/docs/api/javax/net/ssl/SNIHostName.html), which explicitly forbids trailing dots in hostnames (valid hostname, but not a valid SNI hostname). I’m not using SNI, but to make sure I set jsse.enableSNIExtension=false. The exception is still thrown, leading me to believe that the SNIHostName constructor is being called whether SNI is enabled or not. Why not just remove the trailing dot? Well, it’s valid to be there, so why not support it. More importantly, we make use of this to get around TLS session caching as discussed here: https://developer.apple.com/library/ios/qa/qa1727/_index.html. This issue is not present in Tomcat 7 or using Java 7. I have a small PoC I can zip up and host somewhere if anyone wants to take a look. Does anyone know if this looks like a bug in Tomcat 8 or Java 8 and where I should submit a bug report if it does? Thanks, Peter
Re: Need help with Tomcat SSL setup
2014-11-11 20:10 GMT+03:00 Gadhiraju, Satish : > Hi, I am new to tomcat. I have installed tomcat binaries and created one > stand alone instance. > Tomcat is working fine with http port, I get the message It works. > But when I try to access with https port I am getting page cannot be found. > Below is what I did > > ./keytool -genkey -alias tomcat -keyalg RSA -keystore /apps/tomcat.jks > > Added in server.xml > > maxThreads="150" SSLEnabled="true" scheme="https" secure="true" >clientAuth="false" sslProtocol="TLS" >keystoreFile="/apps/tomcat.jks" > keystoreType="JKS" > keystorePass="changeit" > keyPass="changeit" /> > > > please let me know what is wrong. 1. Did you restart Tomcat after editing its configuration file? 2. What is in Tomcat logs? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Spurious Problem starting Tomcat7 (garbled class names)
On 08.11.2014 17:59, Konstantin Kolinko wrote: 2014-11-06 19:33 GMT+03:00 Matthias Keller : Hi We have a spurious problem which still happened quite a few times but is not really reproducible since it only occurs on every 1000. startup or something. The effect is that tomcat scans all class files but somewhere something goes wrong and it tries to load an invalid class name which is often a combination of two effectively existing class names. It is confimed to occur on 7.0.55 with Java7, however it's likely not to be bound to a single version as we've seen it at different sites lately. example with to garbled classes: (3.class being the first, which must come from SomeClass$3.class and the second one being something awefully beautiful: ConfigEdiAtourtAhpepnltiiccaattiioonn$SAtpaptlei$cIadteinotniCfo^@^@iigeLro.acdlLaissstener.class ) INFO: Starting Servlet Engine: Apache Tomcat/7.0.55 Oct 28, 2014 10:13:15 AM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive /opt/tomcat/webapps/test-admin.war Oct 28, 2014 10:13:22 AM org.apache.catalina.startup.ContextConfig processAnnotationsJndi SEVERE: Unable to process resource element [jndi:/localhost/test-admin/WEB-INF/classes/ch/something/3.class] for annotations java.io.FileNotFoundException: jndi:/localhost/test-admin/WEB-INF/classes/ch/something/3.class at org.apache.naming.resources.DirContextURLConnection.getInputStream(DirContextURLConnection.java:389) at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1994) at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) at org.apache.catalina.startup.ContextConfig.processAnnotationsJndi(ContextConfig.java:1986) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1902) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1298) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876) At that place Tomcat essentially asks you hard drive for the list of files in WEB-INF/classes directory and opens each file that has name ending with ".class". Essentially the directory listing returns some garbage. I do not think that Tomcat code is responsible for that. Is your hardware OK? Is it a local harddrive, or a network one? Thanks for all your input. Given the fact this has happened recently on three totally different systems and OSes (no network drives involved), I'd say it would be strange if there was a hardware defect - and also there is none known on any of the three systems, however this is something I'll further investigate. I'm not very familiar with the syntax here, does the jndi: URL refer to a file in the tomcat's work/localhost/... directory? we have unpackWAR=false, or is the class read directly from the WAR file? Thanks Matt smime.p7s Description: S/MIME Cryptographic Signature
RE: custom classloader missing root
> -Original Message- > From: Mark Thomas [mailto:ma...@apache.org] > Sent: Tuesday, November 11, 2014 12:14 PM > To: Tomcat Users List > Subject: Re: custom classloader missing root > > On 11/11/2014 17:01, Ed Rouse wrote: > > > > > > -Original Message- From: Mark Thomas > [mailto:ma...@apache.org] > > Sent: Tuesday, November 11, 2014 11:49 AM > > To: Tomcat Users List Subject: Re: custom classloader missing root > > > > On 11/11/2014 15:34, Ed Rouse wrote: > >> I am trying to convert a custom class loader from version 5.5 to > >> version 8.0.11, running under ubuntu. I have the following line in > my > >> context.xml file. >> loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader" > >> delegate="false" /> > >> > >> I have tried the delegate as both true and false with no difference. > >> I have found that the parent loader is java.net.URLClassLoader, not > >> org.apache.catalina.loader.WebappLoader or > >> org.apache.catalina.loader.WebappClassLoaderBase as I expected. > > > > Your expectation is incorrect. > > > >> My class loader extends > >> org.apache.catalina.loader.WebappClassLoader. In order to add files, > >> as far as I know I need an org.apache.catalina.WebResourceRoot > >> (probably StandardRoot) and an org.apache.catalina.Context (probably > >> org.apache.catalina.core.StandardContext). > >> > >> So how do I get, find or create these 2 classes? > > > > You don't create them. You don't have access to the Context. Tomcat > > creates them and sets them on your class loader. You then access them > > with getResources() and getResources().getContext(). > > > >> I think I can create a new StandardRoot if I have a Context, but > what > >> needs to be done to create a proper context for a web application > >> that is getting auto-loaded by the tomcat container at startup? > > > > Tomcat does all of this for you. > > > >> I am missing some information and have, as yet, not been able to > find > >> any details about how to accomplish this. > > > > The source code is usually a good place to start. If you can't figure > > out how stuff works from the source fire up a Tomcat instance, attach > > a debugger and step through the code. > > > > Mark > > > > I already tried getResources() but it returns null. hence my > > confusion. As far as I can tell, tomcat is not setting the root or > > context on my class loader. > > That depends on when you call it. Since it is the in the context.xml file, I am not calling it, tomcat is. Is there another way to do this so I can call it manually from within the webapp? > > > > > As for looking through the source, I'm not even sure where to start. > > How about the source for WebappClassLoader and look for where > setResources() is called? > > > Is there a document somewhere that goes through the entire startup > > process of the tomcat container so I will at least have an idea of > > where the tomcat is supposed to be doing this? > > Nothing current but it hasn't changed much since this was written: > http://cp.mcafee.com/d/k-Kr6xASyMy- > ejsK_sTsSztcQsLL6zAsepdETjd7bXNEVujpdETjd7bXNEV73C3qdQPhO- > qekknD3vNGTjMkH8-7NVsSH8-7NVsSzXb2rz3_nV- > UVB_HTbFILnUQsLfTd7fbnhIyyHt57BgY- > F6lK1FJ4SyrKrKr01DRJFVeJ9UxmRcSdysF_qrsvOAZzdJrwsrrFYq5U_dKc2WrZTQTy_NG > TjPBp7M-fbwGtlrrfJmSNf- > 00CS7DTzobZ8QgmrFeGFEwIvJa7RR3UCy1mlaiwhd44qRCrpvdBSUG > > Mark > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: custom classloader missing root
On 11/11/2014 17:01, Ed Rouse wrote: > > > -Original Message- From: Mark Thomas > [mailto:ma...@apache.org] Sent: Tuesday, November 11, 2014 11:49 AM > To: Tomcat Users List Subject: Re: custom classloader missing root > > On 11/11/2014 15:34, Ed Rouse wrote: >> I am trying to convert a custom class loader from version 5.5 to >> version 8.0.11, running under ubuntu. I have the following line in >> my context.xml file. > loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader" >> delegate="false" /> >> >> I have tried the delegate as both true and false with no >> difference. I have found that the parent loader is >> java.net.URLClassLoader, not >> org.apache.catalina.loader.WebappLoader or >> org.apache.catalina.loader.WebappClassLoaderBase as I expected. > > Your expectation is incorrect. > >> My class loader extends >> org.apache.catalina.loader.WebappClassLoader. In order to add >> files, as far as I know I need an >> org.apache.catalina.WebResourceRoot (probably StandardRoot) and an >> org.apache.catalina.Context (probably >> org.apache.catalina.core.StandardContext). >> >> So how do I get, find or create these 2 classes? > > You don't create them. You don't have access to the Context. Tomcat > creates them and sets them on your class loader. You then access them > with getResources() and getResources().getContext(). > >> I think I can create a new StandardRoot if I have a Context, but >> what needs to be done to create a proper context for a web >> application that is getting auto-loaded by the tomcat container at >> startup? > > Tomcat does all of this for you. > >> I am missing some information and have, as yet, not been able to >> find any details about how to accomplish this. > > The source code is usually a good place to start. If you can't figure > out how stuff works from the source fire up a Tomcat instance, attach > a debugger and step through the code. > > Mark > > I already tried getResources() but it returns null. hence my > confusion. As far as I can tell, tomcat is not setting the root or > context on my class loader. That depends on when you call it. > > As for looking through the source, I'm not even sure where to start. How about the source for WebappClassLoader and look for where setResources() is called? > Is there a document somewhere that goes through the entire startup > process of the tomcat container so I will at least have an idea of > where the tomcat is supposed to be doing this? Nothing current but it hasn't changed much since this was written: http://localhost/docs/architecture/startup.html Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Need help with Tomcat SSL setup
Hi, I am new to tomcat. I have installed tomcat binaries and created one stand alone instance. Tomcat is working fine with http port, I get the message It works. But when I try to access with https port I am getting page cannot be found. Below is what I did ./keytool -genkey -alias tomcat -keyalg RSA -keystore /apps/tomcat.jks Added in server.xml please let me know what is wrong. Thanks Satish
RE: custom classloader missing root
-Original Message- From: Mark Thomas [mailto:ma...@apache.org] Sent: Tuesday, November 11, 2014 11:49 AM To: Tomcat Users List Subject: Re: custom classloader missing root On 11/11/2014 15:34, Ed Rouse wrote: > I am trying to convert a custom class loader from version 5.5 to version > 8.0.11, running under ubuntu. > I have the following line in my context.xml file. > loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader" > delegate="false" /> > > I have tried the delegate as both true and false with no difference. I > have found that the parent loader is java.net.URLClassLoader, not > org.apache.catalina.loader.WebappLoader or > org.apache.catalina.loader.WebappClassLoaderBase as I expected. Your expectation is incorrect. > My class loader extends org.apache.catalina.loader.WebappClassLoader. > In order to add files, as far as I know I need an > org.apache.catalina.WebResourceRoot > (probably StandardRoot) and an org.apache.catalina.Context (probably > org.apache.catalina.core.StandardContext). > > So how do I get, find or create these 2 classes? You don't create them. You don't have access to the Context. Tomcat creates them and sets them on your class loader. You then access them with getResources() and getResources().getContext(). > I think I can create a new StandardRoot if I have a Context, but what > needs to be done to create a proper context for a web application that is > getting auto-loaded by the tomcat container at startup? Tomcat does all of this for you. > I am missing some information and have, as yet, not been able to find any > details about how to accomplish this. The source code is usually a good place to start. If you can't figure out how stuff works from the source fire up a Tomcat instance, attach a debugger and step through the code. Mark I already tried getResources() but it returns null. hence my confusion. As far as I can tell, tomcat is not setting the root or context on my class loader. As for looking through the source, I'm not even sure where to start. Is there a document somewhere that goes through the entire startup process of the tomcat container so I will at least have an idea of where the tomcat is supposed to be doing this? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: custom classloader missing root
On 11/11/2014 15:34, Ed Rouse wrote: > I am trying to convert a custom class loader from version 5.5 to version > 8.0.11, running under ubuntu. > I have the following line in my context.xml file. > loaderClass="com.comsquared.idw.catalina.ext.IDWMClassLoader" > delegate="false" /> > > I have tried the delegate as both true and false with no difference. I have > found that the parent loader is java.net.URLClassLoader, not > org.apache.catalina.loader.WebappLoader or > org.apache.catalina.loader.WebappClassLoaderBase as I expected. Your expectation is incorrect. > My class loader extends org.apache.catalina.loader.WebappClassLoader. In > order to add files, as far as I know I need an > org.apache.catalina.WebResourceRoot > (probably StandardRoot) and an org.apache.catalina.Context (probably > org.apache.catalina.core.StandardContext). > > So how do I get, find or create these 2 classes? You don't create them. You don't have access to the Context. Tomcat creates them and sets them on your class loader. You then access them with getResources() and getResources().getContext(). > I think I can create a new StandardRoot if I have a Context, but what needs > to be done to create > a proper context for a web application that is getting auto-loaded by the > tomcat container at startup? Tomcat does all of this for you. > I am missing some information and have, as yet, not been able to find any > details about how to accomplish this. The source code is usually a good place to start. If you can't figure out how stuff works from the source fire up a Tomcat instance, attach a debugger and step through the code. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Windows Service won't start
> -Original Message- > From: David kerber [mailto:dcker...@verizon.net] > Sent: Monday, November 10, 2014 12:23 PM > To: Tomcat Users List > Subject: Re: Windows Service won't start > > On 11/10/2014 1:04 PM, Christopher Schultz wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA256 > > > > All, > > > > When a Tomcat Windows Service won't start (with the super-helpful "a > > service-specific error occurred"), where can I look for detailed > > information about what happened? > > Administrative Tools | Event Viewer is the app. From there, the details > depend on which version of Windows. In Win7 and Server 2008 R2, it's > under Windows Logs | System. > > The list in there can be quite large so it may take some scrolling, but > you're looking for something with a "Level" value of "Error". > > The above may have something if you can't find it in the *_stderr.log or *_stdout.log file in the Tomcat logs directory. I've almost always found the issue in one of those three places when I've had the error. > > > > > (Please be kind, I'm not an everyday Windows administrator) > > > > I installed the service myself using a process almost exactly like this: > > > > C:\> SET CATALINA_HOME=[path to Tomcat] > > C:\> SET CATALINA_BASE=[path to my catalina.base] > > C:\> SET JAVA_HOME=[path to Java] > > C:\> %CATALINA_HOME%\bin\service.bat install myproject > > > > I can see the Windows Service called "Apache Tomcat 7.0 myproject" in > > the Services management console. Clicking "start" results in a short > > wait and then the error about how the service itself had a problem > > with no details. > > > > - From the CLI, running "net start myproject" yields a similar error. > > > > Any suggestions? > > > > Thanks, > > - -chris > > -BEGIN PGP SIGNATURE- > > Version: GnuPG v1 > > Comment: GPGTools - http://gpgtools.org > > > > > iQIcBAEBCAAGBQJUYP5FAAoJEBzwKT+lPKRYopwQAKMxxqY1nXTsJ6uTJAkqy > ydW > > > qegw3W5oNzh9Ai8M5PQlREA0ycCefwagOJbsUwfMrQPFrradtRLAG1YzFoCaf > 18M > > 8K9f2bZLJ0YP07/q8f/cLsINDs5nHxoL8JK3RucH/jmUshtfYL7K6QKl25Segp3t > > > bOv1p47uJBrZNbb0fVcsl1itPrz2CClKe+DKTRsWUbSgM062OM3Okbk97nAyCq > o5 > > > Utu7Tzl5C1iZlF73bSo8F9Wx7p8z57775xv4jBRP3c8XUyQXYMfBzUwGDhvgge+ > z > > > fbwlX6r7v3MjoRkTb39vvxqvkwqf7Ku/+J4o5tCW6oji8eSuKbVZNDOhIsTS8Ue > V > > > lnoYkGE3QxrrreczvHbMY3AwtRdBLoHkv7wCtgmYrUEhuB5l6dGIStZPyrkFEOj > M > > > 3+pcTDE9bueOk8ivHxLCajn35GBfwNWj+LxTez7ggy0zxXY3G5Bzp5hVk1UWTq > Zy > > > dC/R7KpJ/4dPKQqjREEFW6U+G8rKlxXpGJMqEo+/QWVHkQl1EWN46kYRMSY > whfCr > > > V0ZQ9ETWsPRRCr5mXYXnWijqJWXaVDfJph29fjyyQnqQXjDgozwd4u3D0C+qJ > FUg > > > tdODD2HX7+HN/mAIv/5QENDRv4fIkw17gtG2M3Czkw9ZaH+DrF6p1EVX90OX > XLCc > > szyMLbk3uRFJMbg/VXLG > > =ugtJ > > -END PGP SIGNATURE- > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
custom classloader missing root
I am trying to convert a custom class loader from version 5.5 to version 8.0.11, running under ubuntu. I have the following line in my context.xml file. I have tried the delegate as both true and false with no difference. I have found that the parent loader is java.net.URLClassLoader, not org.apache.catalina.loader.WebappLoader or org.apache.catalina.loader.WebappClassLoaderBase as I expected. My class loader extends org.apache.catalina.loader.WebappClassLoader. In order to add files, as far as I know I need an org.apache.catalina.WebResourceRoot (probably StandardRoot) and an org.apache.catalina.Context (probably org.apache.catalina.core.StandardContext). So how do I get, find or create these 2 classes? I think I can create a new StandardRoot if I have a Context, but what needs to be done to create a proper context for a web application that is getting auto-loaded by the tomcat container at startup? I am missing some information and have, as yet, not been able to find any details about how to accomplish this. Thanks.
Re: mod_jk on Mac OS X 10.10 (Yosemite)
Chris It turns out this was happening because the upgrade to Yosemite had deleted all the files in /usr/include. I removed the replaced the folder /usr/include with a link to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include and then configure and make both worked. Perhaps there is a different way to tell configure and make to use an additional include folder, but I don’t know how to do that (I work on Java mostly, not this stuff). Thanks for your help William It’s compiled now so it > On 10 Nov 2014, at 11:45pm, Christopher Schultz > wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > William, > > On 11/10/14 4:26 PM, William Moore wrote: >> The configure command is: >> >> ./configure CFLAGS='-arch x86_64' APXSLDFLAGS='-arch x86_64' >> --with-apxs=/usr/sbin/apxs >> >> I also tried your version, and that gave the same error: >> >> configure: error: could not detect a 32-bit integer type > > Weird. > >> Which version of Xcode are you using? Mine says: >> >> Version 6.1 (6A1052d) > > I have exactly the same version. > > What about llvm? > > $ cc --version > Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) > Target: x86_64-apple-darwin14.0.0 > Thread model: posix > > Would you be willing to do a "make clean" and then post the entire > output of your configure script? > > - -chris > >>> On 10 Nov 2014, at 7:52pm, Christopher Schultz >>> wrote: >>> >> William, >> >> On 11/10/14 10:50 AM, William Moore wrote: > Please can someone advise me how to build mod_jk on Mac OS X > 10.10 (Yosemite / darwin 14.0.0)? I got past the failure at: > > checking for gcc... > /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.10.xctoolchain/usr/bin/cc > > >> > > checking for C compiler default output file name... configure: error: C >> compiler cannot create executables >> >> At some point in the recent past, Apple broke the command-line >> toolchains by renaming >> /Applications/Xcode.app/Contents/Developer/Toolchains/OSX[verision].xctoolchain >> >> > to >> /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain. >> >> If you in fact have an XcodeDefault.xctoolchain directory in >> Developer/Toolchains and you *don't* have the version-specific >> one, then just go in there and create a symlink: >> >> $ cd /Applications/Xcode.app/Contents/Developer/Toolchains $ sudo >> ln -s XcodeDefault.xctoolchain OSX10.10.xctoolchain >> >> This is probably how you fixed yours already. Another way to do it >> *should be* to just do this: >> >> $ >> CC=Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain >> >> > ./configure --with-apxs=`which apxs` >> >> On my system, configure completes and gives me a warning that I've >> overridden the compiler setting sniffed from apxs and warns me that >> I might get errors later. >> >> When I try to actually build, libtool does not use the CC >> specified during configure. :( >> >> So you have to go back to the whole symlink thing. >> >> FWIW, I just built mod_jk 1.2.37 (the source I had available) on >> my machine running 10.10 after solving the toolchain thing. No >> problem with a 32-bit integer or anything like that. >> >> -chris >>> >>> - >>> >>> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >>> For additional commands, e-mail: users-h...@tomcat.apache.org >>> >> >> >> - >> >> > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > -BEGIN PGP SIGNATURE- > Version: GnuPG v1 > Comment: GPGTools - http://gpgtools.org > > iQIcBAEBCAAGBQJUYT/2AAoJEBzwKT+lPKRY55gQAJIelSBD2hlZ7/jRad13ngTU > hVBwx/fH9Rc5fKUvXKiZv5zwiVdyIW3WAtI0htWUJe1xcFctZtMaUe9AMa+lfsBr > ykUIIkGpKPZiQF3yrr1aunGNJKRXJeV+oc5/hwBzjXF/dH+80BJoYLv5bT0SXOhp > 5L01YgTLlu+A2doL0pkdZT1JHXQJvbKLoqaLSV//Qh7ljM/kaKNfzYWWRqj/8HSY > pA2oHUQ4aioCyy07yXAmOSJ9mKscuxisG+GV/qC+SfDKSb6fTvc84pFGxoAxTPGg > /vWMiR8yyNjRciZ/DRFxs7+GKHFyaDhEghjw2aUJYX5SnlAxbBc/liVHFcUa2Xg7 > EkyUHDtL0W71F5E6qhtP0PggPKU3MARgdLunqH8wZXDyXTHo4klPd91TtQG6hX5l > TDfyqhu4p1k6czFmW9jwTVkjS0syzw6WiigzAUQGck55a3T2WzBGFOERhi87poyo > PmsMAGrAoinRiQAtmX91GQbCkEwBt85bdkPuMYUQo/wu8dWv0Ig9smJzXQCdqnm6 > cAPnL0SKWGwD1NZXQjgzaID9frNHVvPdfMacp3t8FFgnPE4CzdKd4LqwzOgF0+Ms > PSt6tamxw51YZ3eUy8nCQ8aX1HzboLa12VP9ErTHVod7Pd3Y7gsD4ugoeJ1UTGyb > AjYXFjHgahnH7U7GpVk2 > =viP1 > -END PGP SIGNATURE- > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org F
Re: Windows Service won't start
2014-11-10 21:04 GMT+03:00 Christopher Schultz > When a Tomcat Windows Service won't start (with the super-helpful "a > service-specific error occurred"), where can I look for detailed > information about what happened? > > (Please be kind, I'm not an everyday Windows administrator) > > I installed the service myself using a process almost exactly like this: > > C:\> SET CATALINA_HOME=[path to Tomcat] > C:\> SET CATALINA_BASE=[path to my catalina.base] > C:\> SET JAVA_HOME=[path to Java] > C:\> %CATALINA_HOME%\bin\service.bat install myproject > > I can see the Windows Service called "Apache Tomcat 7.0 myproject" in > the Services management console. Clicking "start" results in a short > wait and then the error about how the service itself had a problem > with no details. > > - From the CLI, running "net start myproject" yields a similar error. > > Any suggestions? Tomcat version = ? Run tomcat7w.exe and check that service parameters are as expected (bootstrap class name, start/stop arguments). It is also possible to use registry viewer, but using tomcat7w.exe is more convenient. Path to log files by one of options there - it shall be Tomcat log directory. If it is empty then --LogPath has default value, as documented in http://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html#Command_line_parameters Some old versions of service.bat of Tomcat 7 had a bug that "service.bat install" had to be run from console window that itself is run with elevated privileges. https://issues.apache.org/bugzilla/show_bug.cgi?id=56143 Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat performance goes down after install apr.
杨华杰 wrote: Tomcat performance goes down after install apr. I followed this doc http://tomcat.apache.org/native-doc/, I think the different is I didn't set sslengine setting as I don't use it. And I saw the error in catilina.out, I simply ignore it as I don't use it. I fired 300 concurrent calls from another server and I found tomcat just dead. Performance is much worse. Anything I did wrong? Hi. For a question like this (and basically any other question), you should really communicate - the platform (OS) under which you are running this - the Java JVM version used (x.y.z) - the Tomcat version used (x.y.z) - the APR version used (x.y.z) otherwise, how do you want anyone to comment ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org