Re: Virtual Thread with Http11Nio2Protocol
Hi Nicolas, I took a quick look that Tomcat's VirtualThreadExecutor does not implement the ExecutorService interface, which leads to this result. So I think this is a Tomcat bug. Han > On Dec 8, 2023, at 03:55, Nicolas BONAMY wrote: > > Hi, > > I try to use virtual thread on Apache Tomcat 10.1.16 with this configuration > on macOS or on Linux: > > class="org.apache.catalina.core.StandardVirtualThreadExecutor"/> > > protocol="org.apache.coyote.http11.Http11Nio2Protocol" > connectionTimeout="2" > redirectPort="8443" > maxParameterCount="1000" > useVirtualThreads="true" > /> > But when I make a request, I'm not on a virtual thread : > Thread[#76,Thread-14,5,main] . I profiled my application too but no virtual > threads are used. > > If I use a Http11NioProtocol instead of Http11Nio2Protocol, all requests are > on virtual thread : > VirtualThread[#65,http-nio-8080-virt-0]/runnable@ForkJoinPool-1-worker-1 > > class="org.apache.catalina.core.StandardVirtualThreadExecutor"/> > > > protocol="org.apache.coyote.http11.Http11NioProtocol" > connectionTimeout="2" > redirectPort="8443" > maxParameterCount="1000" > useVirtualThreads="true" > /> > Http11Nio2Protocol is not working with virtual threads? Has anyone > encountered this problem before? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Update to 10.1.14 breaks our application
https://bz.apache.org/bugzilla/show_bug.cgi?id=67664 > On Oct 13, 2023, at 05:45, Richard Cook > wrote: > > Hi, > > We have a spring boot application (v3.1.4) It currently uses > > > org.apache.tomcat > tomcat-jdbc > 10.1.13 > > > A renovate bot updated this package to 10.1.14 and now our app fails > on startup, with the following exception.. > > 2023-10-11T22:27:16.981Z WARN 7 — [ main] > o.h.e.j.e.i.JdbcEnvironmentInitiator : HHH000342: Could not obtain > connection to query metadata > java.sql.SQLException: null > at > org.apache.tomcat.jdbc.pool.ConnectionPool.setupConnection(ConnectionPool.java:351) > ~[tomcat-jdbc-10.1.14.jar!/:na] > at > org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:200) > ~[tomcat-jdbc-10.1.14.jar!/:na] > at > org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:133) > ~[tomcat-jdbc-10.1.14.jar!/:na] > at > org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.j > > > > > Caused by: java.lang.IllegalArgumentException: > org.apache.tomcat.jdbc.pool.PooledConnection is not an interface >at > java.base/java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Proxy.java:706) > ~[na:na] >at java.base/java.lang.reflect.Proxy$ProxyBuilder.(Proxy.java:648) > ~[na:na] >at > java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$1(Proxy.java:440) > ~[na:na] >at > java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329) > ~[na:na] >at > java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205) > ~[na:na] >at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:438) > ~[na:na] >at java.base/java.lang.reflect.Proxy.getProxyClass(Proxy.java:398) ~[na:na] >at > org.apache.tomcat.jdbc.pool.ConnectionPool.getProxyConstructor(ConnectionPool.java:377) > ~[tomcat-jdbc-10.1.14.jar:na] >at > org.apache.tomcat.jdbc.pool.ConnectionPool.setupConnection(ConnectionPool.java:339) > ~[tomcat-jdbc-10.1.14.jar:na] > > > The code throws the exceptino when lef.afterPropertiesSet() is called. > > > @Bean(name = "fsEntityManagerFactory") > public EntityManagerFactory entityManagerFactory(DataSource fsDataSource) { > LocalContainerEntityManagerFactoryBean lef = new > LocalContainerEntityManagerFactoryBean(); > HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); > lef.setDataSource(fsDataSource); > lef.setJpaVendorAdapter(vendorAdapter); > lef.setPackagesToScan("xx"); > lef.setPersistenceUnitName("fsPersistenceUnit"); > HashMap properties = new HashMap<>(); > properties.put("hibernate.dialect", "org.hibernate.dialect.DB2Dialect"); > properties.put(AvailableSettings.ENHANCER_ENABLE_ASSOCIATION_MANAGEMENT, > "false"); > properties.put(AvailableSettings.ENHANCER_ENABLE_DIRTY_TRACKING, "false"); > properties.put(AvailableSettings.ENHANCER_ENABLE_LAZY_INITIALIZATION, > "false"); > properties.put("hibernate.jdbc.fetch_size", hibernateFetchSize); > properties.put("hibernate.show_sql", hibernateShowSQL); > properties.put("hibernate.default_schema", hibernateDefaultSchema); > > lef.setJpaPropertyMap(properties); > lef.afterPropertiesSet(); > return lef.getObject(); > } > > > Right now I've reverted back to 10.1.13 and it works. > > What is the best way to fix this? > > I saw the release notes, updates were changed to the connection > pooling classes, but I'm unsure on how to proceed. > > Thank you, > > Rich > CONFIDENTIALITY NOTICE: > This is a transmission from Kohl's, Inc. and may contain information which is > confidential and proprietary. > If you are not the addressee, any disclosure, copying or distribution or use > of the contents of this message is expressly prohibited. > If you have received this transmission in error, please destroy it and notify > us immediately at 262-703-7000. > > CAUTION: > Internet and e-mail communications are Kohl's property and Kohl's reserves > the right to retrieve and read any message created, sent and received. Kohl's > reserves the right to monitor messages by authorized Kohl's Associates at any > time without any further consent. > > - > 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: [ANN] Apache Tomcat 9.0.67 available
Hi Greg, This bug has been fixed by Mark and it also affects other recent versions(all have been fixed next release), except for 8.5.x. Han > 2022年9月29日 16:05,Greg Huber 写道: > > Hello, > > I am testing this release and are getting lots of these type of random errors > : > > <%@include file="../widgets/lazyload.jsp" %> > > > Caused by: org.apache.jasper.JasperException: /WEB-INF/jsps/core/listMe.jsp > (line: [91], column: [2]) JSP file [../widgets/lazyload.jsp] not found > > at > org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:41) > at > org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:292) > at > org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:98) > at > org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:349) > at > org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:384) > at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:485) > at org.apache.jasper.compiler.Parser.parseFileDirectives(Parser.java:1802) > at org.apache.jasper.compiler.Parser.parse(Parser.java:141) > at > org.apache.jasper.compiler.ParserController.doParse(ParserController.java:245) > at > org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:128) > at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:202) > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:391) > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:367) > at org.apache.jasper.compiler.Compiler.compile(Compiler.java:351) > at > org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:605) > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) > at > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379) > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:327) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:779) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) > at > org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:64) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) > at > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:711) > at > org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:578) > at > org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:517) > at > org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:994) > at > org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:485) > at org.apache.tiles.request.jsp.JspRequest.doInclude(JspRequest.java:123) > ... 213 more > > If I go back to 9.0.65 everything is ok. > > Have there been any changes? > > Cheers Greg > > > - > 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: [ANN] New committer: Han Li
Thank you all for the warm welcome! Thanks to the Tomcat team for the invitation, it’s an honour! Best regards Han > 2022年9月7日 05:02,jonmcalexan...@wellsfargo.com.invalid > 写道: > > Congratulations Han! > > Dream * Excel * Explore * Inspire > Jon McAlexander > Senior Infrastructure Engineer > Asst. Vice President > He/His > > Middleware Product Engineering > Enterprise CIO | EAS | Middleware | Infrastructure Solutions > > 8080 Cobblestone Rd | Urbandale, IA 50322 > MAC: F4469-010 > Tel 515-988-2508 | Cell 515-988-2508 > > jonmcalexan...@wellsfargo.com > This message may contain confidential and/or privileged information. If you > are not the addressee or authorized to receive this for the addressee, you > must not use, copy, disclose, or take any action based on this message or any > information herein. If you have received this message in error, please advise > the sender immediately by reply e-mail and delete this message. Thank you for > your cooperation. > >> -Original Message- >> From: Mark Thomas >> Sent: Tuesday, September 6, 2022 2:38 AM >> To: Tomcat Developers List ; Tomcat Users List >> >> Subject: [ANN] New committer: Han Li >> Importance: High >> >> On behalf of the Tomcat committers I am delighted to announce that Han Li >> (lihan) has been voted in as a new Tomcat committer. >> >> Please join me in congratulating Han. >> >> Kind regards, >> >> 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 > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Error during startup
> 2022年8月9日 21:05,Christopher Schultz 写道: > > Han, > > On 8/4/22 00:49, Han Li wrote: >> Hi Mohan, >> You can open CATALINA_BASE/conf/catalina.policy file, add following >> statement within “grant” section: >> permission java.lang.RuntimePermission "getenv.*"; > > > While this will likely fix the "problem", it may not be the best solution. > The OP is running under a Security Manager, probably for a reason. It would > be best to restrict the getenv privilege to the minimum necessary to run the > application properly in that environment. That may be something closer to > > grant codeBase "file:some/specific.jar" { > permission java.lang.RuntimePermission "getenv.oneVariableName"; > } I got it. Thank you, Chris. Han. > > Thanks, > -chris > >>> 2022年8月4日 11:33,Mohan T 写道: >>> >>> Dear All, >>> >>> We are using tomcat 8.5 on suse linux 7. >>> >>> We are invoking Catalina.sh in java security enabled mode. >>> >>> Kindly help me in resolving this . >>> >>> Thanks >>> >>> Mohan >>> >>> Exception: >>> Error in Full Agent Registration Info Resolver reading environment >>> variable/system property >>> java.security.AccessControlException: access denied >>> ("java.lang.RuntimePermission" "getenv.") >>> at >>> java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) >>> at java.security.AccessController.checkPermission(AccessController.java:884) >>> at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) >>> at java.lang.System.getenv(System.java:894) >>> >>> DISCLAIMER: This communication contains information which is confidential >>> and the copyright of Ramco Systems Ltd, its subsidiaries or a third party >>> ("Ramco"). This email may also contain legally privileged information. >>> Confidentiality and legal privilege attached to this communication are not >>> waived or lost by reason of mistaken delivery to you.This email is intended >>> to be read or used by the addressee only. If you are not the intended >>> recipient, any use, distribution, disclosure or copying of this email is >>> strictly prohibited without the express written approval of Ramco. Please >>> delete and destroy all copies and email Ramco at le...@ramco.com >>> immediately. Any views expressed in this communication are those of the >>> individual sender, except where the sender specifically states them to be >>> the views of Ramco. Except as required by law, Ramco does not represent, >>> warrant and/or guarantee that the integrity of this communication has been >>> maintained nor that the communication is free of errors, virus, >>> interception or interference. If you do not wish to receive such >>> communications, please forward this communication to market...@ramco.com >>> and express your wish not to receive such communications henceforth. > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > <mailto:users-unsubscr...@tomcat.apache.org> > For additional commands, e-mail: users-h...@tomcat.apache.org > <mailto:users-h...@tomcat.apache.org>
Re: Error during startup
在 2022年8月4日星期四,Mohan T 写道: > Hi, > > Thanks for the response. > > How to identify the "grant" section > > Below is the contents of the file. > > Quote > > // Licensed to the Apache Softwarse Foundation (ASF) under one or more > // contributor license agreements. See the NOTICE file distributed with > // this work for additional information regarding copyright ownership. > // The ASF licenses this file to You under the Apache License, Version 2.0 > // (the "License"); you may not use this file except in compliance with > // the License. You may obtain a copy of the License at > // > // http://www.apache.org/licenses/LICENSE-2.0 > // > // Unless required by applicable law or agreed to in writing, software > // distributed under the License is distributed on an "AS IS" BASIS, > // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > // See the License for the specific language governing permissions and > // limitations under the License. > > // > > // catalina.policy - Security Policy Permissions for Tomcat > // > // This file contains a default set of security policies to be enforced > (by the > // JVM) when Catalina is executed with the "-security" option. In addition > // to the permissions granted here, the following additional permissions > are > // granted to each web application: > // > // * Read access to the web application's document root directory > // * Read, write and delete access to the web application's working > directory > // > > > > // == SYSTEM CODE PERMISSIONS == > === > > > // These permissions apply to javac > grant codeBase "file:${java.home}/lib/-" { > permission java.security.AllPermission; > }; > > // These permissions apply to all shared system extensions > grant codeBase "file:${java.home}/jre/lib/ext/-" { > permission java.security.AllPermission; > }; > > // These permissions apply to javac when ${java.home] points at > $JAVA_HOME/jre > grant codeBase "file:${java.home}/../lib/-" { > permission java.security.AllPermission; > }; > > // These permissions apply to all shared system extensions when > // ${java.home} points at $JAVA_HOME/jre > grant codeBase "file:${java.home}/lib/ext/-" { > permission java.security.AllPermission; > }; > > > // == CATALINA CODE PERMISSIONS == > = > grant codeBase "file:/home/ilas/rvwhome_tech/-" { >// permission java.security.AllPermission; > permission java.io.FilePermission "/home/ilas/rvwhome_tech/-", > "read,write"; > permission java.io.FilePermission > "/home/ilas/rvwhome_tech/RVWJAdmin.conf", > "read,write"; > permission java.io.FilePermission "/home/ilas/rvwhome_tech/ > ExportExcel/GridExport12.xlsm", "read,write"; > permission java.io.FilePermission > "/home/ilas/rvwhome_tech/config/cache.ccf", > "read,write"; > permission java.io.FilePermission "<>","read"; > > }; > > grant codeBase "file:/home/ilas/rvwhome_tech/ExportExcel/-"{ > //permission java.security.AllPermission; > permission java.io.FilePermission "/home/ilas/rvwhome_tech/ > ExportExcel/GridExport12.xlsm", "read,write"; > }; > > > > > > > > > > > > // These permissions apply to the daemon code > grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" { > permission java.security.AllPermission; > }; > > // These permissions apply to the logging API > // Note: If tomcat-juli.jar is in ${catalina.base} and not in > ${catalina.home}, > // update this section accordingly. > // grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..} > grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" { > permission java.io.FilePermission > > "${java.home}${file.separator}lib${file.separator}logging.properties", > "read"; > > permission java.io.FilePermission > > "${catalina.base}${file.separator}conf${file.separator}logging.properties", > "read"; > permission java.io.FilePermission > "${catalina.base}${file.separator}logs", "read, write"; > permission java.io.FilePermission > "${catalina.base}${file.separator}logs${file.separator}*", > "read, write, delete"; > > permission java.lang.RuntimePermission "shutdownHooks"; > permission java.lang.RuntimePermission "getClassLoader"; > permission java.lang.RuntimePermission "setContextClassLoader"; > > permission java.lang.management.ManagementPermission "monitor"; > > permission java.util.logging.LoggingPermission "control"; > > permission java.util.PropertyPermission > "java.util.logging.config.class", > "read"; > permission java.util.PropertyPermission > "java.util.logging.config.file", > "read"; > permission
Re: Error during startup
Hi Mohan, You can open CATALINA_BASE/conf/catalina.policy file, add following statement within “grant” section: permission java.lang.RuntimePermission "getenv.*"; Han > 2022年8月4日 11:33,Mohan T 写道: > > Dear All, > > We are using tomcat 8.5 on suse linux 7. > > We are invoking Catalina.sh in java security enabled mode. > > Kindly help me in resolving this . > > Thanks > > Mohan > > Exception: > Error in Full Agent Registration Info Resolver reading environment > variable/system property > java.security.AccessControlException: access denied > ("java.lang.RuntimePermission" "getenv.") >at > java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) >at > java.security.AccessController.checkPermission(AccessController.java:884) >at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) >at java.lang.System.getenv(System.java:894) > > DISCLAIMER: This communication contains information which is confidential and > the copyright of Ramco Systems Ltd, its subsidiaries or a third party > ("Ramco"). This email may also contain legally privileged information. > Confidentiality and legal privilege attached to this communication are not > waived or lost by reason of mistaken delivery to you.This email is intended > to be read or used by the addressee only. If you are not the intended > recipient, any use, distribution, disclosure or copying of this email is > strictly prohibited without the express written approval of Ramco. Please > delete and destroy all copies and email Ramco at le...@ramco.com immediately. > Any views expressed in this communication are those of the individual sender, > except where the sender specifically states them to be the views of Ramco. > Except as required by law, Ramco does not represent, warrant and/or guarantee > that the integrity of this communication has been maintained nor that the > communication is free of errors, virus, interception or interference. If you > do not wish to receive such communications, please forward this communication > to market...@ramco.com and express your wish not to receive such > communications henceforth.
Re: JSF NULL-String is coercing to NULL instead of empty String
You can read Mark’s comment, I hope it will help you. https://bz.apache.org/bugzilla/show_bug.cgi?id=66161#c3 > 2022年8月3日 16:04,König, Andreas, NM-HVD 写道: > > Tomcat Version: 9.0.60 > Primefaces: 11.0.5 > > Hello, > recently we updated our environment from Tomcat Version 9.0.59 to 9.0.60. > Since the update, we are having issues with some views because NULL-Strings > are no longer coerced to Empty-Strings. > I know the current behaviour is compliant to the EL specification and the > former behaviour was not. > But this update has caused some trouble, because we didn't expect such a > change in a minor version. > > The NPE is thrown when we use String.concat method in expression language, > e.g. .concat(hist.newValue) > Currently we fixed it with implementing NULL-Checks. > > But is there a possibility to configure the former behaviour? > > Thank you in advance. > Best regards, > Andreas König - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Regarding IPv6 support
> 2022年8月3日 15:18,Nitish Chitta 写道: > > Hello Team, > I wanted to know if Tomcat 7 supports requests with IPv6 addresses in the > URL as I am getting an HTTP 404 error when trying to hit the server with an > IPv6 address. Don’t you get a 404 error when you use an IPV4 address? > > Thanks & Regards, > Nitish - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org