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
Re: Tomcat websocket server onclose failed( Tomcat 8.5)
Thank you very much for help. Best regards, Funian Li 2018-04-18 19:00 GMT+08:00 Mark Thomas <ma...@apache.org>: > On 13/04/18 09:47, Mark Thomas wrote: > > On 13/04/18 03:13, Funian Li wrote: > >> 2018-04-12 4:19 GMT+08:00 Mark Thomas <ma...@apache.org>: > >> > >>> On 11/04/18 09:50, Funian Li wrote: > >>>> Dear All, > >>>> > >>>> A problem happen when tomcat websocket server was used. > >>> > >>>> Exact Tomcat version? > >>> > >>>> If not 8.5.30, does the problem still occur if you upgrade to 8.5.30? > >>> > >>>> Mark > >>> > >> > >> Yes , the exact Tomcat version is 8.5.30, shall i upgrade to tomcat > 9.0 ? > > > > Thanks for the version information. > > > > An upgrade to 9.0.x is unlikely to help. The code is almost identical > > between 8.5.x and 9.0.x. > > > > The next step will be to try the test case you provided to see if the > > problem can be reproduced. > > Adding the code to my (resurrected) github project for Tomcat test > cases[1] and formatting the code made the root cause obvious. > > As per the Java WebSocket specification: > > [WSC-5.1-1] In all cases, the implementation must not invoke an > endpoint instance with more than one thread per peer at a time. > > > In onMessage() a loop is entered (on the container thread for that peer) > that can never be exited because the stop message will never be > processed because that requires a container thread and the only > container thread allowed is processing the loop. > > The fix is to spwan a new thread in onMessage() and use that to write > the messages. > > Mark > > > [1] https://github.com/markt-asf/tomcat-bugs > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Tomcat websocket server onclose failed( Tomcat 8.5)
2018-04-12 4:19 GMT+08:00 Mark Thomas <ma...@apache.org>: > On 11/04/18 09:50, Funian Li wrote: > > Dear All, > > > > A problem happen when tomcat websocket server was used. > > >Exact Tomcat version? > > >If not 8.5.30, does the problem still occur if you upgrade to 8.5.30? > > >Mark > Yes , the exact Tomcat version is 8.5.30, shall i upgrade to tomcat 9.0 ? Thanks. Funian Li > >A sensor data chart with sampling freqency 50Hz is drawn. Tomcat > websocket server( Version 8.5) is used to push the data with 20ms > interval. The server code is as following: > > @ServerEndpoint("/websocketendpoint")public class WsServer {private > Session session;private boolean keepingrunning;private static > CopyOnWriteArraySet webSocketSet > = new CopyOnWriteArraySet(); > @OnClosepublic void onClose() { > System.out.println("Close Connection ..."); > keepingrunning = true; > webSocketSet.remove(this);} > @OnOpenpublic void onOpen(Session session) { >System.out.println("Open Connection ..."); >keepingrunning = true; >this.session = session; >webSocketSet.add(this); > } > @OnMessagepublic void onMessage(String message, Session session) { > System.out.println("Message from the client: " + message); > try { > Random r = new Random(); > // keep sending data > while (keepingrunning) { > int daf = r.nextInt(); > this.session.getBasicRemote().sendText(Integer.toString(daf)); > Thread.sleep(20); > } > } catch (Exception ex) { > ex.printStackTrace(); > } > System.out.println("end"); > } > @OnErrorpublic void onError(Throwable e) { > keepingrunning = true; > e.printStackTrace();}} > > The client is as following: > > var ws=new WebSocket("ws://localhost:8080/WebSocketTest/ websocketendpoint"); > function start_webserver(){ >ws.send("ac_1");} > > ws.onopen = function(evt) { > console.log("Connection open ..."); }; > > ws.onmessage = function(evt) { > console.log( "Received Message: " + evt.data); > if(chart.series[0].data.length > 400) { > chart.series[0].addPoint(parseFloat(evt.data), false, true, false); > } else{ > chart.series[0].addPoint(parseFloat(evt.data), false, false, false); > }}; > > ws.onclose = function(evt) { > console.log("Connection closed."); > ws.close();}; > > > ws.onerror = function (evt) { > console.log("error: ", evt); > }; > > > function end_webserver(){ >console.log("end the connection"); >ws.close(); >console.log("over");} > // the button > Start > stop > > > Questions: > > When start button clicked, the client can recieve the data to display the > chart continously. But the stop button clicked , the onclose function both > on client and server side did not call. It seem that onclose function is > blocked by the onmessage function because the server keep sending data. > Another websocket sever is tested and no problem happed. So is is the bug > of tomcat socketserver ? Thanks. > > Regards, > Skyspeed > > > - > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat websocket server onclose failed( Tomcat 8.5)
Dear All, A problem happen when tomcat websocket server was used. A sensor data chart with sampling freqency 50Hz is drawn. Tomcat websocket server( Version 8.5) is used to push the data with 20ms interval. The server code is as following: @ServerEndpoint("/websocketendpoint")public class WsServer {private Session session;private boolean keepingrunning;private static CopyOnWriteArraySet webSocketSet = new CopyOnWriteArraySet(); @OnClosepublic void onClose() { System.out.println("Close Connection ..."); keepingrunning = true; webSocketSet.remove(this);} @OnOpenpublic void onOpen(Session session) { System.out.println("Open Connection ..."); keepingrunning = true; this.session = session; webSocketSet.add(this); } @OnMessagepublic void onMessage(String message, Session session) { System.out.println("Message from the client: " + message); try { Random r = new Random(); // keep sending data while (keepingrunning) { int daf = r.nextInt(); this.session.getBasicRemote().sendText(Integer.toString(daf)); Thread.sleep(20); } } catch (Exception ex) { ex.printStackTrace(); } System.out.println("end"); } @OnErrorpublic void onError(Throwable e) { keepingrunning = true; e.printStackTrace();}} The client is as following: var ws=new WebSocket("ws://localhost:8080/WebSocketTest/websocketendpoint"); function start_webserver(){ ws.send("ac_1");} ws.onopen = function(evt) { console.log("Connection open ..."); }; ws.onmessage = function(evt) { console.log( "Received Message: " + evt.data); if(chart.series[0].data.length > 400) { chart.series[0].addPoint(parseFloat(evt.data), false, true, false); } else{ chart.series[0].addPoint(parseFloat(evt.data), false, false, false); }}; ws.onclose = function(evt) { console.log("Connection closed."); ws.close();}; ws.onerror = function (evt) { console.log("error: ", evt); }; function end_webserver(){ console.log("end the connection"); ws.close(); console.log("over");} // the button Start stop Questions: When start button clicked, the client can recieve the data to display the chart continously. But the stop button clicked , the onclose function both on client and server side did not call. It seem that onclose function is blocked by the onmessage function because the server keep sending data. Another websocket sever is tested and no problem happed. So is is the bug of tomcat socketserver ? Thanks. Regards, Skyspeed -
Tomcat websocket server onclose failed( Tomcat 8.5)
Dear All, A problem happen when tomcat websocket server was used. A sensor data chart with sampling freqency 50Hz is drawn. Tomcat websocket server( Version 8.5) is used to push the data with 20ms interval. The server code is as following: @ServerEndpoint("/websocketendpoint")public class WsServer {private Session session;private boolean keepingrunning;private static CopyOnWriteArraySet webSocketSet = new CopyOnWriteArraySet(); @OnClosepublic void onClose() { System.out.println("Close Connection ..."); keepingrunning = true; webSocketSet.remove(this);} @OnOpenpublic void onOpen(Session session) { System.out.println("Open Connection ..."); keepingrunning = true; this.session = session; webSocketSet.add(this); } @OnMessagepublic void onMessage(String message, Session session) { System.out.println("Message from the client: " + message); try { Random r = new Random(); // keep sending data while (keepingrunning) { int daf = r.nextInt(); this.session.getBasicRemote().sendText(Integer.toString(daf)); Thread.sleep(20); } } catch (Exception ex) { ex.printStackTrace(); } System.out.println("end"); } @OnErrorpublic void onError(Throwable e) { keepingrunning = true; e.printStackTrace();}} The client is as following: var ws=new WebSocket("ws://localhost:8080/WebSocketTest/websocketendpoint"); function start_webserver(){ ws.send("ac_1");} ws.onopen = function(evt) { console.log("Connection open ..."); }; ws.onmessage = function(evt) { console.log( "Received Message: " + evt.data); if(chart.series[0].data.length > 400) { chart.series[0].addPoint(parseFloat(evt.data), false, true, false); } else{ chart.series[0].addPoint(parseFloat(evt.data), false, false, false); }}; ws.onclose = function(evt) { console.log("Connection closed."); ws.close();}; ws.onerror = function (evt) { console.log("error: ", evt); }; function end_webserver(){ console.log("end the connection"); ws.close(); console.log("over");} // the button Start stop Questions: When start button clicked, the client can recieve the data to display the chart continously. But the stop button clicked , the onclose function both on client and server side did not call. It seem that onclose function is blocked by the onmessage function because the server keep sending data. Another websocket sever is tested and no problem happed. So is is the bug of tomcat socketserver ? Thanks. Regards, Skyspeed
WARNING: Failed to unregister MBean with name
Hi, I got errors as below. What is wrong please? I use Tomcat 8.0.36, Ubuntu 16.04 and Eclipse Neon 4.6. Thanks in advance. Nov 30, 2016 7:29:51 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-nio-8080"] Nov 30, 2016 7:29:51 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-nio-8009"] Nov 30, 2016 7:29:51 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-nio-8080"] Nov 30, 2016 7:29:51 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-nio-8009"] Nov 30, 2016 7:29:51 PM org.apache.catalina.util.LifecycleMBeanBase unregister WARNING: Failed to unregister MBean with name [Catalina:type=NamingResources,host=localhost,context=/] during component destruction javax.management.InstanceNotFoundException: Catalina:type=NamingResources,host=localhost,context=/ at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:427) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:415) at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:546) at org.apache.catalina.util.LifecycleMBeanBase.unregister(LifecycleMBeanBase.java:197) at org.apache.catalina.util.LifecycleMBeanBase.destroyInternal(LifecycleMBeanBase.java:73) at org.apache.catalina.deploy.NamingResourcesImpl.destroyInternal(NamingResourcesImpl.java:1091) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.StandardContext.destroyInternal(StandardContext.java:5626) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:832) at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1012) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:832) at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1012) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:604) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:877) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.startup.Catalina.stop(Catalina.java:703) at org.apache.catalina.startup.Catalina.start(Catalina.java:664) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:351) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:485) Nov 30, 2016 7:29:51 PM org.apache.catalina.util.LifecycleMBeanBase unregister WARNING: Failed to unregister MBean with name [Catalina:type=WebResourceRoot,host=localhost,context=/,name=Cache] during component destruction javax.management.InstanceNotFoundException: Catalina:type=WebResourceRoot,host=localhost,context=/,name=Cache at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:427) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:415) at com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:546) at org.apache.catalina.util.LifecycleMBeanBase.unregister(LifecycleMBeanBase.java:197) at org.apache.catalina.webresources.StandardRoot.destroyInternal(StandardRoot.java:779) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.StandardContext.destroyInternal(StandardContext.java:5644) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:832) at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1012) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:832) at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1012) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:604) at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:297) at
Tomcat8: WARNING: Problem with directory [/usr/share/tomcat8/common
Hi, I installed tomcat8 on Ubuntu 16 using sudo apt install tomcat8 I only need one tomcat, no need for CATALINA_BASE. But, I got warnings below. Can I ignore these warnings? Or anything I can do? Any information would be appreciated. Thanks in advance. > Aug 07, 2016 8:01:32 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/usr/share/tomcat8/common/classes], exists: [false], isDirectory: [false], canRead: [false] Aug 07, 2016 8:01:32 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/usr/share/tomcat8/common], exists: [false], isDirectory: [false], canRead: [false] Aug 07, 2016 8:01:32 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/usr/share/tomcat8/server/classes], exists: [false], isDirectory: [false], canRead: [false] Aug 07, 2016 8:01:32 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/usr/share/tomcat8/server], exists: [false], isDirectory: [false], canRead: [false] Aug 07, 2016 8:01:32 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/usr/share/tomcat8/shared/classes], exists: [false], isDirectory: [false], canRead: [false] Aug 07, 2016 8:01:32 PM org.apache.catalina.startup.ClassLoaderFactory validateFile WARNING: Problem with directory [/usr/share/tomcat8/shared], exists: [false], isDirectory: [false], canRead: [false]
Re: mod_jk errors
Thank you for both! On Fri, Jul 15, 2016 at 3:04 AM, Rainer Jung <rainer.j...@kippdata.de> wrote: > Am 12.07.2016 um 19:44 schrieb Wayne Li: > >> Hi, >> >> I have a servlet/jsp application running on tomcat 7.0.47. There are no >> static html files. >> Now I am try to use apache 2.4.7 (Ubuntu) >> as the front and forward eveything to tomcat. I installed mod_jk using >> Ubuntu's software >> center.. Things are working. But I have errors in >> /var/log/apache2/mod_jk.log: >> >> [Mon Jul 11 20:19:32.261 2016] [1175:140389159810944] [info] >> init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized >> [Mon Jul 11 20:19:32.279 2016] [1175:140389159810944] [error] >> extension_fix::jk_uri_worker_map.c (564): Could not find worker with name >> 'jk-manager' in uri map post processing. >> [Mon Jul 11 20:19:32.279 2016] [1175:140389159810944] [error] >> extension_fix::jk_uri_worker_map.c (564): Could not find worker with name >> 'jk-status' in uri map post processing. >> [Mon Jul 11 20:19:32.386 2016] [1177:140389159810944] [info] >> init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized >> [Mon Jul 11 20:19:32.386 2016] [1177:140389159810944] [error] >> extension_fix::jk_uri_worker_map.c (564): Could not find worker with name >> 'jk-manager' in uri map post processing. >> [Mon Jul 11 20:19:32.386 2016] [1177:140389159810944] [error] >> extension_fix::jk_uri_worker_map.c (564): Could not find worker with name >> 'jk-status' in uri map post processing. >> >> If I add the following lines, the errors go away: >> >> worker.list=jk-status >> worker.jk-status.type=status >> worker.jk-status.read_only=true >> worker.list=jk-manager >> worker.jk-manager.type=status >> >> But the added line read funny. The same thing appears on the left-side of >> the equal sign twice. >> Are they correct? Do I need these lines? Can I ignore the errors? >> >> Any information would be appreciated. Thanks in advance. >> > > In addition to André's excellent tutorial: mod_jk knows that some > properties configured via workers.properties take (comma-separated) lists > as values. Since sometimes maintaining these lists is error-prone, it > allows you to define the properties multiple times and will collect all > given values into one big list. That makes maintaining hte list a more > modular job. > > In your case the following is exactly equivalent: > > Either: > > worker.list=jk-status,jk-manager,myworker > > Or: > > worker.list=jk-status > #Some more config items concerning jk-status > worker.list=jk-manager > #Some more config items concerning jk-manager > worker.list=myworker > #Some more config items concerning myworker > > In both cases the internal value of worker.list after parsing the complete > file will be "jk-status,jk-manager,myworker". > > So what look a bit funny to you was supposed to be helpful ;) > > Can you ignore the errors: No. > > - If you don't want the jk-status and/or jk-manager worker features, then > look for the JkMount directives where you referenced them (or entried in a > uriworkermap.properties file but that's rarely used). > > - If you want to use the jk-status and/or jk-manager workers, you need to > define them in workers.properties like you did above. > > Regards, > > Rainer > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
mod_jk errors
Hi, I have a servlet/jsp application running on tomcat 7.0.47. There are no static html files. Now I am try to use apache 2.4.7 (Ubuntu) as the front and forward eveything to tomcat. I installed mod_jk using Ubuntu's software center.. Things are working. But I have errors in /var/log/apache2/mod_jk.log: [Mon Jul 11 20:19:32.261 2016] [1175:140389159810944] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized [Mon Jul 11 20:19:32.279 2016] [1175:140389159810944] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing. [Mon Jul 11 20:19:32.279 2016] [1175:140389159810944] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing. [Mon Jul 11 20:19:32.386 2016] [1177:140389159810944] [info] init_jk::mod_jk.c (3365): mod_jk/1.2.37 initialized [Mon Jul 11 20:19:32.386 2016] [1177:140389159810944] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-manager' in uri map post processing. [Mon Jul 11 20:19:32.386 2016] [1177:140389159810944] [error] extension_fix::jk_uri_worker_map.c (564): Could not find worker with name 'jk-status' in uri map post processing. If I add the following lines, the errors go away: worker.list=jk-status worker.jk-status.type=status worker.jk-status.read_only=true worker.list=jk-manager worker.jk-manager.type=status But the added line read funny. The same thing appears on the left-side of the equal sign twice. Are they correct? Do I need these lines? Can I ignore the errors? Any information would be appreciated. Thanks in advance.
Re: [somewhat OT] mod-jk + ssl: requests are not forward to tomcat correctly
Thanks for all! On Tue, Jul 12, 2016 at 7:17 AM, Rainer Jung <rainer.j...@kippdata.de> wrote: > Am 12.07.2016 um 12:06 schrieb André Warnier (tomcat): > >> On 12.07.2016 01:39, Wayne Li wrote: >> >>> Probably the quickest : download these files, install them on your >>>> >>> server, and change the above links. >>> Like : create a sub-directory "/js" of your webapp, and install them >>> there. >>> Then change the above links to : href="js/jquery.mobile-1.4.5.min.css" >>> >>> Yes. It works. Thanks. >>> >>> It is okay for now. but, if I do not want host these files, what should I >>> do? Can you point a direction for me please? >>> >>> >> I just wante to make some personal comments here, to what you write above >> : >> >> You are saying that you do not really want to "host" those files on your >> server, and that you (presumably) would like to continue to link to them >> directly on the jquery host. >> But I believe that there are a few considerations to take into account >> here, on the practical, ethical, and security levels : >> >> Basically, if you do this, then it means that any browser, anywhere, >> that is using your application, will now (try to) access and download >> these files directly from the jquery server, instead of from your server. >> >> 1) ethical aspect : >> Users of your application will now be using the resources and bandwidth >> of a server that is not yours, and which is supported by someone else. >> That someone else may not like this very much. >> I had a (quick and not exhaustive) look at the jquery website, and I did >> not find anything which explicitly discourages people from doing this. >> And it may well be that they actually encourage people to do this (maybe >> they are pleased to have a lot of traffic). >> >> But I believe that before doing something like this, you may want to at >> least ask them if this is ok, or what they recommend. And in particular >> in this case, since jquery is a non-profit, open-source resource for >> which you do not pay in the first place. >> >> 2) practical aspect : >> By doing this, your application becomes dependent on the fact that any >> of your user's browsers would actually be able to access that external >> server, which is not under your control. There could be some firewall >> rule which prevents such an access (now, or at any time in the future). >> That server could be down for maintenance; it could be re-organised, so >> that the files are no longer at that specific URL location; the file >> content could be changed, so that things do no longer work in exactly >> the same way; etc.. >> As you have just found out, even some browser rules (which can change >> over time) may prevent access to these files. >> And I know of some websites which take active measures to prevent people >> doing this (using their resources in such a way), for example by >> checking the "Referer" of the access to their resources. >> >> Another practical aspect, is that if something does not work anymore in >> one of your applications, your users will come to you for an >> explanation; and it may be time-consuming, in a case like this, to find >> out what exactly isn't working. >> >> 3) security aspect : >> If anyone managed to replace the content of that file (again, this is >> not under your control), they would be able to "inject" malicious >> content into your application. >> And to the world at large, this would at first look as if it was your >> application which is the culprit. >> >> These are my personal opinions only. But for the reasons above, I would >> rather host myself the resources needed by my applications. >> > > and > > 4) Privacy: the owner of the external server (here: jquery) is able to > track who is visiting your site. Your visitors might not like this. > > Regards, > > Rainer > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: mod-jk + ssl: requests are not forward to tomcat correctly
> Probably the quickest : download these files, install them on your server, and change the above links. Like : create a sub-directory "/js" of your webapp, and install them there. Then change the above links to : href="js/jquery.mobile-1.4.5.min.css" Yes. It works. Thanks. It is okay for now. but, if I do not want host these files, what should I do? Can you point a direction for me please? On Mon, Jul 11, 2016 at 12:38 PM, André Warnier (tomcat) <a...@ice-sa.com> wrote: > On 11.07.2016 19:38, Wayne Li wrote: > >> Thank you for quick reply. >> Thank you for suggest LiveHTTPHeaders for firefox. I just tried. Good. It >> says that the file was loaded. So I think the problems are in the lines >> of: >> >>http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"/> >>http://code.jquery.com/jquery-1.11.3.min.js"</a>;> >>http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"</a>;> >> >> These lines could not be forwarded under ssl? What should I do? >> Thanks. >> > > Probably the quickest : download these files, install them on your server, > and change the above links. > Like : create a sub-directory "/js" of your webapp, and install them there. > Then change the above links to : href="js/jquery.mobile-1.4.5.min.css" > > >> >> On Mon, Jul 11, 2016 at 9:28 AM, André Warnier (tomcat) <a...@ice-sa.com> >> wrote: >> >> On 11.07.2016 15:57, Wayne Li wrote: >>> >>> Hi All, >>>> >>>> >>>> Hi. Thanks you for communicating the versions and the configuration >>> below.. >>> That helps a lot in helping you. >>> >>> Can you also provide the version of the mod_jk module ? It should be in >>> the first line of the Apache httpd error log (when it starts up). >>> >>> I have a servlet/jsp application running on tomcat 7.0.47. There are no >>> >>>> static html files. >>>> Now I am try to use apache 2.4.7 (Ubuntu) >>>> as the front and forwad eveything to tomcat. I installed mod_jk using >>>> Ubuntu's software >>>> center.. Things are working: I type "localhost" on my brower bar, it >>>> shows >>>> my application. >>>> >>>> Then, I also trying to use ssl and generated self-signed certificate. It >>>> works, because >>>> the browser warns me about unknown certificate. If I type " >>>> https://www.mytest.com/index.jsp; >>>> on the browser's bar, it shows the page. But not correctly: the page >>>> contains: >>>> >>>> >>>> These extra files are not be called. >>>> >>>> >>> Sorry to ask, but *are* these files present, in the same directory as >>> your >>> index.jsp page ? >>> >>> >>> What is wrong on my side? Any information would be appreciated. Thank you >>> >>>> in advance. >>>> >>>> >>> There is some configuration information missing below : in >>> /etc/apache2/mods-available, there should be a couple of files : jk.load >>> and jk.conf. >>> What is the content of these files ? >>> >>> >>> the /etc/apache2/conf/default-ssl.conf: >>>> >>>> >>>> SSLEngine on >>>> SSLCertificateFile /etc/apache2/ssl/server.crt >>>> SSLCertificateFile /etc/apache2/ssl/server.crt >>>> >>>> >>> above, duplicate lines ? >>> >>> >>> JkMount /* ajp13_worker >>> >>>> >>>> >>>> >>>> the /etc/apache2/conf/000-default.conf: >>>> >>>> ServerName localhost >>>> DocumentRoot /ROOT >>>> JkMountCopy On >>>> >>>> JkMount jk-status >>>> Order deny,allow >>>> Allow from 127.0.0.1,localhost >>>> >>>> >>>> JkMount jk-manager >>>> Order deny,allow >>>> Allow from 127.0.0.1,localhost >>>> >>>> >>>> >>>> the /etc/apache2/workers/worker.properties: >>>> workers.tomcat_home=/tomcat >>>> workers.java_home=/jdk8 >>>> ps=/ >>>> worker.list=ajp13_worker >>>> worker.ajp13_worker.port=8009 >>>>
Re: mod-jk + ssl: requests are not forward to tomcat correctly
Thank you for quick reply. Thank you for suggest LiveHTTPHeaders for firefox. I just tried. Good. It says that the file was loaded. So I think the problems are in the lines of: http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"/> http://code.jquery.com/jquery-1.11.3.min.js"</a>;> http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"</a>;> These lines could not be forwarded under ssl? What should I do? Thanks. On Mon, Jul 11, 2016 at 9:28 AM, André Warnier (tomcat) <a...@ice-sa.com> wrote: > On 11.07.2016 15:57, Wayne Li wrote: > >> Hi All, >> >> > Hi. Thanks you for communicating the versions and the configuration below. > That helps a lot in helping you. > > Can you also provide the version of the mod_jk module ? It should be in > the first line of the Apache httpd error log (when it starts up). > > I have a servlet/jsp application running on tomcat 7.0.47. There are no >> static html files. >> Now I am try to use apache 2.4.7 (Ubuntu) >> as the front and forwad eveything to tomcat. I installed mod_jk using >> Ubuntu's software >> center.. Things are working: I type "localhost" on my brower bar, it shows >> my application. >> >> Then, I also trying to use ssl and generated self-signed certificate. It >> works, because >> the browser warns me about unknown certificate. If I type " >> https://www.mytest.com/index.jsp; >> on the browser's bar, it shows the page. But not correctly: the page >> contains: >> >> >> These extra files are not be called. >> > > Sorry to ask, but *are* these files present, in the same directory as your > index.jsp page ? > > > What is wrong on my side? Any information would be appreciated. Thank you >> in advance. >> > > There is some configuration information missing below : in > /etc/apache2/mods-available, there should be a couple of files : jk.load > and jk.conf. > What is the content of these files ? > > >> the /etc/apache2/conf/default-ssl.conf: >> >> >>SSLEngine on >>SSLCertificateFile /etc/apache2/ssl/server.crt >>SSLCertificateFile /etc/apache2/ssl/server.crt >> > > above, duplicate lines ? > > >JkMount /* ajp13_worker >> >> >> >> the /etc/apache2/conf/000-default.conf: >> >>ServerName localhost >>DocumentRoot /ROOT >>JkMountCopy On >> >> JkMount jk-status >> Order deny,allow >> Allow from 127.0.0.1,localhost >> >> >> JkMount jk-manager >> Order deny,allow >> Allow from 127.0.0.1,localhost >> >> >> >> the /etc/apache2/workers/worker.properties: >>workers.tomcat_home=/tomcat >>workers.java_home=/jdk8 >>ps=/ >>worker.list=ajp13_worker >>worker.ajp13_worker.port=8009 >>worker.ajp13_worker.host=localhost >>worker.ajp13_worker.type=ajp13 >>worker.ajp13_worker.lbfactor=1 >>worker.loadbalancer.type=lb >>worker.loadbalancer.balance_workers=ajp13_worker >>worker.list=jk-status >>worker.jk-status.type=status >>worker.jk-status.read_only=true >>worker.list=jk-manager >>worker.jk-manager.type=status >> >> > That workers.properties looks old, and contains some deprecated lines : > >workers.tomcat_home=/tomcat > >workers.java_home=/jdk8 > > Also, you do not have a load-balancing setup, so I suggest to simplify the > above and just have the following in worker.properties : > > >worker.list=ajp13_worker > >worker.ajp13_worker.port=8009 > >worker.ajp13_worker.host=localhost > >worker.ajp13_worker.type=ajp13 > > You can find this here : > http://tomcat.apache.org/connectors-doc/common_howto/quick.html > -> Minimum workers.properties > > If you need the rest, you can re-add it later. > > Another recommendation : use the browser feature (or plugin or add-on) > that allows you to see the exact dialog between the browser and the server > (HTTP requests, HTTP responses, status codes, HTTP headers etc.). That will > immensely simplify the debugging work. > For example, in Mozilla Firefox I use "LiveHTTPHeaders", > and with IE, I use "Fiddler2". > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
mod-jk + ssl: requests are not forward to tomcat correctly
Hi All, I have a servlet/jsp application running on tomcat 7.0.47. There are no static html files. Now I am try to use apache 2.4.7 (Ubuntu) as the front and forwad eveything to tomcat. I installed mod_jk using Ubuntu's software center.. Things are working: I type "localhost" on my brower bar, it shows my application. Then, I also trying to use ssl and generated self-signed certificate. It works, because the browser warns me about unknown certificate. If I type " https://www.mytest.com/index.jsp; on the browser's bar, it shows the page. But not correctly: the page contains: These extra files are not be called. What is wrong on my side? Any information would be appreciated. Thank you in advance. the /etc/apache2/conf/default-ssl.conf: SSLEngine on SSLCertificateFile /etc/apache2/ssl/server.crt SSLCertificateFile /etc/apache2/ssl/server.crt JkMount /* ajp13_worker the /etc/apache2/conf/000-default.conf: ServerName localhost DocumentRoot /ROOT JkMountCopy On JkMount jk-status Order deny,allow Allow from 127.0.0.1,localhost JkMount jk-manager Order deny,allow Allow from 127.0.0.1,localhost the /etc/apache2/workers/worker.properties: workers.tomcat_home=/tomcat workers.java_home=/jdk8 ps=/ worker.list=ajp13_worker worker.ajp13_worker.port=8009 worker.ajp13_worker.host=localhost worker.ajp13_worker.type=ajp13 worker.ajp13_worker.lbfactor=1 worker.loadbalancer.type=lb worker.loadbalancer.balance_workers=ajp13_worker worker.list=jk-status worker.jk-status.type=status worker.jk-status.read_only=true worker.list=jk-manager worker.jk-manager.type=status
Could not load com.sun.org.apache.xerces.internal.impl - exception happends randomly (not all the time)
Hello, A) Version info of my system: Server version: Apache Tomcat/7.0.53 Server built: May 1 2014 10:53:10 Server number: 7.0.53.0 OS Name:Linux OS Version: 3.0.58-0.6.2.1.5158.0.PTF-default Architecture: amd64 JVM Version:1.6.0_75-b31 Deployed app server: provisioningagent-web da-00:/opt/tomcat/webapps # ls -trl total 36480 -rwxr-x--- 1 mmas mmas 10444010 Jul 7 16:53 enumprovisioning-web.war -rwxr-x--- 1 mmas mmas 26827266 Jul 7 17:03 provisioningagent-web.war drwxr-xr-x 7 mmas mmas 480 Sep 24 09:53 enumprovisioning-web drwxr-xr-x 9 mmas mmas 980 Sep 24 09:53 provisioningagent-web da-00:/opt/tomcat/webapps # B) Issue: Below exception happens randomly (it does not happen all the time, but often): Jul 10, 2014 6:15:19 AM org.apache.catalina.loader.WebappClassLoader loadClass INFO: Illegal access: this web application instance has been stopped already. Could not load com.sun.org.apache.xerces.internal.impl .dv.dtd.DTDDVFactoryImpl. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1600) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at com.sun.org.apache.xerces.internal.utils.ObjectFactory.findProviderClass(ObjectFactory.java:358) at com.sun.org.apache.xerces.internal.utils.ObjectFactory.newInstance(ObjectFactory.java:303) at com.sun.org.apache.xerces.internal.utils.ObjectFactory.newInstance(ObjectFactory.java:289) at com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory.getInstance(DTDDVFactory.java:60) at com.sun.org.apache.xerces.internal.impl.dv.DTDDVFactory.getInstance(DTDDVFactory.java:45) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.init(XML11Configuration.java:538) at com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration.init(XIncludeAwareParserConfiguration.java:125) at com.sun.org.apache.xerces.internal.parsers.XIncludeAwareParserConfiguration.init(XIncludeAwareParserConfiguration.java:86) at com.sun.org.apache.xerces.internal.parsers.DOMParser.init(DOMParser.java:133) at com.sun.org.apache.xerces.internal.parsers.DOMParser.init(DOMParser.java:117) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.init(DocumentBuilderImpl.java:115) at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(DocumentBuilderFactoryImpl.java:72) at com.ericsson.messaging.oe.impl.bpmanagement.bpfaultmgt.ActiveAlarmList.update(ActiveAlarmList.java:597) at com.ericsson.messaging.oe.impl.bpmanagement.bpfaultmgt.ActiveAlarmList.read(ActiveAlarmList.java:823) at com.ericsson.messaging.oe.impl.bpmanagement.bpfaultmgt.SAFaultDispatc her$ActiveAlarmListVerificationTask.run(SAFaultDispatcher.java:223) at java.util.TimerThread.mainLoop(Timer.java:512) at java.util.TimerThread.run(Timer.java:462) We have done a lot of searches on the internet and found that many others have similar issue but we couldn't find a post which explains the root cause and how to prevent it to happen. Example: http://www.devconnectprogram.com/forums/posts/list/1641.page http://apache-xml-project.6118.n7.nabble.com/Could-not-load-DTDDVFactoryImpl-xerces-jar-td1020.html The most strange part is that it does not happen all the time, but sometimes (often though). We did verify the jar file (/opt/java/jre/lib/rt.jar) which contains com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl. It is always there, and the class can be correctly loaded when this does not happen. C) More info Here are the relevant code: import javax.xml.parsers.DocumentBuilderFactory; private static DocumentBuilderFactory factory; factory = DocumentBuilderFactory.newInstance(); try { DocumentBuilder docBuilder = factory.newDocumentBuilder(); } catch (Exception e) {} We stumbled into this page http://www.databasesandlife.com/java-always-explicitly-specify-which-xml-parser-to-use/ The conclusion of the page is that: Never do the following: DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); Because the new instance you get may not be what you want due to the system properties might have been changed by other apps deployed in the same container. Yes this is exactly what our code ActiveAlarmList.java was doing! So we thought that this might be the problem as we do DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); in our code. However further investigation reveals that it's not that simple. We printed out the actual classes our code wants to load (under the condition when all is working fine - the exception not occruing), they are: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
can tomcat use aio instead of nio in linux?
I have a background thread that is using hornetq client to receive jms topic message from a remote hornetq broker. This thread is started as ServletContextListener when tomcat starts. But the tomcat throws strange Exception: llegal access: this web application instance has been stopped already. Could not load java.net.SocketTimeoutException. The eventual following stack trace is caused by an error thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access, and has no functional impact. java.lang.IllegalStateException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1588) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) at org.jboss.netty.channel.socket.oio.AbstractOioWorker.run(AbstractOioWorker.java:75) at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:51) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:175) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) I suspect that hornetq use linux aio and cause jvm can't use nio which is used by tomcat. one solution may modify hornetq to use nio instead of aio. But I don't know how to do it. Another solution is letting tomcat using aio instead of nio. it it possilbe? my os is ubuntu 12.04 with libaio installed. I can send and receive topic messages in a standalone java application. My java version is : java version 1.7.0_45 Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) tomcat version is 7.0.47 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: ConnectionPoolMBean should not expose plain-text DB password
I am not familiar with JIoEndpoint discussed in https://issues.apache.org/bugzilla/show_bug.cgi?id=53139. The issue I'm facing is something different. Apparently, some effort was made to hide the DB password, but the DB password is still exposed via another getter (getDbProperties()). This seems to be a bug to me. DB passwords are highly sensitive information. JMX admins shouldn't see those either. It's not a reasonable assumption that it's okay for JMX admins to see exposed DB passwords (which should never be exposed in plaintext or encrypted form). Those who work in a company would probably concur with this point. Does that make sense to anyone? Thanks, Te On 10/5/12 6:51 AM, Shanti Suresh sha...@umich.edu wrote: Hi Te, Will it be an option for you to create a JSP as was recently discussed in this list, to expose just the particular MBeans that you need? Thanks. -Shanti On Thu, Oct 4, 2012 at 3:06 PM, Christopher Schultz ch...@christopherschultz.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Te, On 10/4/12 1:56 PM, Te Li wrote: DB password is secret information and should not be exposed via JMX. The tomcat ConnectionPool class implements ConnectionPoolMBean interface. This interface exposes connection pool configuration and statistics. However, because this interface extends PoolConfiguration which has getDbProperties() method that exposes the password property in plain text. The getPassword() method in DataSourceProxy class (which implements PoolConfiguration interface) correctly does not return the password but just a dummy value Password not available as DataSource/JMX operation. However, the password is still exposed via getDbProperties() method, which is an unexpected behavior. Due to the exposure of plain-text password, we cannot use the ConnectionPoolMBean class out of the box in our production environment and have to define our own MBean interface to expose the ConnectionPool bean. Please fix this. Sounds a lot like https://issues.apache.org/bugzilla/show_bug.cgi?id=53139 Given the response to that enhancement request, I suspect yours will get the same treatment were you to actually file it in Bugzilla. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlBt3jwACgkQ9CaO5/Lv0PDCngCfRyI8rG0cYaEh0hn8WhrPa3zj NicAoLU+IbFY3T0dw5DML2M4sssOh4gI =7BaH -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
ConnectionPoolMBean should not expose plain-text DB password
Hello, DB password is secret information and should not be exposed via JMX. The tomcat ConnectionPool class implements ConnectionPoolMBean interface. This interface exposes connection pool configuration and statistics. However, because this interface extends PoolConfiguration which has getDbProperties() method that exposes the password property in plain text. The getPassword() method in DataSourceProxy class (which implements PoolConfiguration interface) correctly does not return the password but just a dummy value Password not available as DataSource/JMX operation. However, the password is still exposed via getDbProperties() method, which is an unexpected behavior. Due to the exposure of plain-text password, we cannot use the ConnectionPoolMBean class out of the box in our production environment and have to define our own MBean interface to expose the ConnectionPool bean. Please fix this. Thanks, Te - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Rsecurity breach on tomcat 6.0.26
Hi, we are using tomcat 6.0.26 to host a java application. but recently we are experiencing security breach once or twice a week. the issue we are facing is: one user screen(or input) totallly showing up on the different user screen. Those screens have customer sensetive information. Anyone has similiar experience? how should i trace and fix it? thanks for you help. zach.
Re: Is empty Content Type of Request allowed in Tomcat?
Hi, On Tue, Aug 30, 2011 at 5:31 PM, Konstantin Kolinko knst.koli...@gmail.comwrote: Attachments are usually dropped by mailing list software. The one you mention above is no exception. GET / HTTP/1.1 Date: Tue, 30 Aug 2011 02:28:50 GMT Content-Type: Authorization: AWS AKIAJHSWPWM6W6KUXAIQ:u4QnOMbP0vuTsgpUXQ0WfXIWz9c= Host: s3.amazonaws.com:80 Connection: Keep-Alive User-Agent: Cyberduck/4.1 (8911) (Windows 7/6.1) (x86) Accept-Encoding: gzip,deflate 1) GET requests cannot have content, and thus having a Content-Type header there is confusing. 2) Content-Type header is defined in section 14.17 of RFC2616 as Content-Type = Content-Type : media-type and media-type = type / subtype *( ; parameter ) The media-type is not optional and it cannot be empty. Thanks for letting me know and your further explanation! By the way, my friend has provide me a workaround using filter, post it here in case some other might need it. I have tested it locally and it works. 1) CleanHeaderFilter.java package org.sample; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.Enumeration; import java.util.LinkedList; import java.util.List; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; public class CleanHeaderFilter implements Filter { @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpReq = new HttpServletRequestWrapper((HttpServletRequest) request) { @Override public Enumeration getHeaderNames() { if (GET.equalsIgnoreCase(getMethod())) { CollectionString c = new LinkedListString(); Enumeration headers = super.getHeaderNames(); while (headers.hasMoreElements()) { String header = (String) headers.nextElement(); if (!Content-Type.equalsIgnoreCase(header)) { c.add(header); } else { System.err.println(Remove Content-Type for GET); } } return Collections.enumeration(c); } return super.getHeaderNames(); } }; chain.doFilter(httpReq, response); } @Override public void destroy() { } } 2) add following config to your web.xml filter filter-namecleanHeaderFilter/filter-name filter-classorg.sample.CleanHeaderFilter/filter-class /filter filter-mapping filter-namecleanHeaderFilter/filter-name url-pattern/*/url-pattern /filter-mapping
Is empty Content Type of Request allowed in Tomcat?
Hello, I'm using Cyberduck as client to send request to my web server which using apache-tomcat-7.0.16 as web container. When Cyberduck sent a request with an empty Content Type, web server returned following errors: HTTP/1.1 400 Bad Request (text/plain) Bad Content-Type header value: '' I thought this error is reported by tomcat, since it has not running into my code. I've enabled Tomcat debug log, and have no clue, following are some catalina log: 2011-08-29 15:29:50,031 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.apache.catalina.startup.HostConfig- Checking context[/host-manager] reload resource D:\apache-tomcat-7.0.16\webapps\host-manager\WEB-INF\web.xml 2011-08-29 15:29:50,531 [http-apr-80-exec-5] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [uriBC] has value [/] 2011-08-29 15:29:50,531 [http-apr-80-exec-5] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [semicolon] has value [-1] 2011-08-29 15:29:50,531 [http-apr-80-exec-5] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [enc] has value [ISO-8859-1] 2011-08-29 15:29:50,531 [http-apr-80-exec-5] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Security checking request GET / 2011-08-29 15:29:50,531 [http-apr-80-exec-5] DEBUG org.apache.catalina.realm.RealmBase- No applicable constraints defined 2011-08-29 15:29:50,531 [http-apr-80-exec-5] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Not subject to any constraint 2011-08-29 15:30:00,031 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.apache.catalina.startup.HostConfig- Checking context[] redeploy resource D:\apache-tomcat-7.0.16\webapps\ROOT So is it possible to modify tomcat setting to allow empty Content Type of request? or I should try other ways (I heard someone said adding some filters?) - and What's the detailed steps? Thanks
Re: Is empty Content Type of Request allowed in Tomcat?
Thank André and Mark for your quick response, detailed answer and references! I'll try to report this issue to Cyberduck. One more question: when I uses current version of Cyberduck to connect Amazon S3, it can accept this kind of invalid request, is it a kind of fault tolerance design of Amazon S3? Should it be encouraged? or I missed something here? On Mon, Aug 29, 2011 at 9:44 PM, Mark Thomas ma...@apache.org wrote: On 29/08/2011 09:10, Isaac Li wrote: Hello, I'm using Cyberduck as client to send request to my web server which using apache-tomcat-7.0.16 as web container. When Cyberduck sent a request with an empty Content Type, web server returned following errors: Cyberduck is broken and is violating RFC2616. HTTP/1.1 400 Bad Request (text/plain) Bad Content-Type header value: '' I thought this error is reported by tomcat, since it has not running into my code. Tomcat is rejected this request. The request is invalid. I've enabled Tomcat debug log, and have no clue, following are some catalina log: If you want a clue, try reading RFC2616. So is it possible to modify tomcat setting to allow empty Content Type of request? No. or I should try other ways (I heard someone said adding some filters?) Whoever said a filter was a solution to this problem is clueless. The request is rejected long before the filters are reached. - and What's the detailed steps? 1. Get the bug in Cyberduck fixed. 2. Try again. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Is empty Content Type of Request allowed in Tomcat?
On Tue, Aug 30, 2011 at 10:00 AM, Isaac Li tingjun...@gmail.com wrote: Thank André and Mark for your quick response, detailed answer and references! I'll try to report this issue to Cyberduck. One more question: when I uses current version of Cyberduck to connect Amazon S3, See request at No.25 of Cyberduck_login_amazon_s3_ok.pcap (attched) GET / HTTP/1.1 Date: Tue, 30 Aug 2011 02:28:50 GMT Content-Type: Authorization: AWS AKIAJHSWPWM6W6KUXAIQ:u4QnOMbP0vuTsgpUXQ0WfXIWz9c= Host: s3.amazonaws.com:80 Connection: Keep-Alive User-Agent: Cyberduck/4.1 (8911) (Windows 7/6.1) (x86) Accept-Encoding: gzip,deflate it can accept this kind of invalid request, request at No.31 of Cyberduck_login_amazon_s3_ok.pcap 31 5.805868 207.171.189.80 192.168.1.104 HTTP/XML 64 HTTP/1.1 200 OK Is it a kind of fault tolerance design of Amazon S3? Should it be encouraged? or I missed something here? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Stuck at making jsvc while installing tomcat
*Hi All,* * * *I am new to use tomcat. I got a problem of installing jsvc.* * * *I followed this tutorial to setup the system http://tomcat.apache.org/tomcat-7.0-doc/setup.html. Sample command lines are:* cd $CATALINA_HOME/bin tar xvfz commons-daemon-native.tar.gz cd commons-daemon-1.0.x-native-src/unix ./configure make cp jsvc ../.. cd ../.. *I stuck at make. Below are the outputs of configure and make* ./configure [hieule2@tarekc20 unix]$ ./configure *** Current host *** checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking cached host system type... ok *** C-Language compilation tools *** checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ranlib... ranlib checking for strip... strip *** Host support *** checking C flags dependant on host system type... ok *** Java compilation tools *** checking for sablevm... NONE checking for kaffe... NONE checking for javac... /usr/bin/javac /usr/bin/javac checking wether the Java compiler (/usr/bin/javac) works... yes checking for jar... /usr/bin/jar gcc flags added checking for cap_init in -lcap... no *** Writing output files *** configure: creating ./config.status config.status: creating Makefile config.status: creating Makedefs config.status: creating native/Makefile *** All done *** Now you can issue make make (cd native; make all) make[1]: Entering directory `/home/tarek/hieule2/shenli/3_tier_server/apache-tomcat-7.0.19/bin/commons-daemon-1.0.6-native-src/unix/native' gcc -g -O2 -DOS_LINUX -DDSO_DLFCN -DCPU=\i386\ -Wall -Wstrict-prototypes -I/usr/include -I/usr/include/linux -c jsvc-unix.c -o jsvc-unix.o In file included from /usr/include/_G_config.h:44, from /usr/include/libio.h:32, from /usr/include/stdio.h:72, from jsvc.h:21, from jsvc-unix.c:18: /usr/include/gconv.h:72: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/gconv.h:88: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/gconv.h:97: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/gconv.h:174: error: expected specifier-qualifier-list before ‘size_t’ In file included from /usr/include/stdio.h:72, from jsvc.h:21, from jsvc-unix.c:18: /usr/include/libio.h:329: error: expected specifier-qualifier-list before ‘size_t’ /usr/include/libio.h:361: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/libio.h:370: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/libio.h:486: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_IO_sgetn’ In file included from jsvc.h:21, from jsvc-unix.c:18: /usr/include/stdio.h:308: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/stdio.h:315: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/stdio.h:357: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/stdio.h:359: error: format string argument not a string type /usr/include/stdio.h:361: error: expected declaration specifiers or ‘...’ before ‘size_t’ /usr/include/stdio.h:610: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread’ /usr/include/stdio.h:616: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite’ /usr/include/stdio.h:638: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fread_unlocked’ /usr/include/stdio.h:640: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘fwrite_unlocked’ In file included from jsvc.h:22, from jsvc-unix.c:18: /usr/include/stdlib.h:140: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__ctype_get_mb_cur_max’ In file included from /usr/include/sys/types.h:133, from /usr/include/stdlib.h:438, from jsvc.h:22, from jsvc-unix.c:18: /usr/include/linux/time.h:10: error: expected specifier-qualifier-list before ‘time_t’ /usr/include/linux/time.h:16: error: expected specifier-qualifier-list before ‘time_t’ In file included from /usr/include/sys/select.h:46, from /usr/include/sys/types.h:220, from /usr/include/stdlib.h:438, Similar errors continues to the end. I thought it might be some problem with my gcc compiler. Below is the gcc version information. [hieule2@tarekc20 unix]$ gcc -v Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared
Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 16:21:13 org.apache.coyote.ajp.AjpAprProtocol init 严重: Error initializing endpoint java.lang.Exception: Socket bind failed: [730048] ??×??(Э??é/??/??)í at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:412) at org.apache.coyote.ajp.AjpAprProtocol.init(AjpAprProtocol.java:89) anyone can give me some tips? Thanks Regards, Scott Li
Re: Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
thanks Mark Thomas and Goo Sam Kong I followed Goo Sam Kong 's config still have errors: Loaded APR based Apache Tomcat Native library 1.1.20. 2010-11-24 17:38:43 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2010-11-24 17:38:43 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 17:38:43 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.catalina.connector.Connector.initInternal(Connector.java:875) update config as follow, Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false SSLEnabled=true protocol=org.apache.coyote.http11.Http11AprProtocol SSLCertificateFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1.pem SSLCertificateKeyFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem SSLPassword=test / Connector port=8009 enableLookups=false redirectPort=443 protocol=AJP/1.3 / I find my SSLCertificateFile is *.pem, and Goo Sam Kong's crt, key, how do you create these files, not use OpenSSL? 在 2010年11月24日 下午5:10,Goo Sam Kong skgo...@gmail.com写道: Hi Scott, My working HTTPS connector using APR settings as below: Connector port=8443 protocol=org.apache.coyote.http11.Http11AprProtocol SSLEnabled=true maxThreads=150 scheme=https secure=true SSLCertificateFile=C:\usr\tomcat\tomcat.crt SSLCertificateKeyFile=C:\usr\tomcat\tomcat.key SSLPassword=123456 / Try to remove SSLEngine attribute and add protocol attribute, then re-start Tomcat. -- Thanks Regards, Scott Li
Re: Tomcat7 APR Connectors Config: Unable to load certificate key conf/key1cert.pem
Dear Goo Sam Kong, It' OK now , Thank you very much! I changed the cert file config as below: Connector port=443 maxHttpHeaderSize=8192 maxThreads=150 minSpareThreads=25 enableLookups=false disableUploadTimeout=true acceptCount=100 scheme=https secure=true clientAuth=false SSLEnabled=true protocol=org.apache.coyote.http11.Http11AprProtocol SSLCertificateFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem SSLCertificateKeyFile=D:\TDDownload\apache-tomcat-7.0.4\conf\key1.pem SSLPassword=test / and restart tomcat, but find another error below: Error initializing endpoint java.lang.Exception: Socket bind failed: [730048] ??×??(Э??é/??/??)í at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:412) at org.apache.coyote.ajp.AjpAprProtocol.init(AjpAprProtocol.java:89) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-25 9:17:14 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[AJP/1.3-8009]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Socket bind failed: [730048] ??×??(Э??é/??/??)í at org.apache.catalina.connector.Connector.initInternal(Connector.java:875) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) I opened the task management, and closed all the javaw.exe processes, restart Tomcat again, https://localhost/ can open now, thx! 在 2010年11月25日 上午8:45,Goo Sam Kong skgo...@gmail.com写道: Hi Scott, The exception was caused by wrong setting in your original HTTPS connector settings... In Mark's email, you need to put conf/key1cert.pem in SSLCertificateFile attribute and conf/key1.pem in SSLCertificateKeyFile attribute. 2010/11/24 Scott Li scott...@gwghk.com thanks Mark Thomas and Goo Sam Kong I followed Goo Sam Kong 's config still have errors: Loaded APR based Apache Tomcat Native library 1.1.20. 2010-11-24 17:38:43 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2010-11-24 17:38:43 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat-7.0.4\conf\key1cert.pem (error:0906D06C:PEM routines:PEM_read_bio:no start line) at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 2010-11-24 17:38:43 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] LifecycleException: Protocol handler initialization failed: java.lang.Exception: Unable to load certificate key D:\TDDownload\apache-tomcat
SSL No Certificate file specified or invalid file format
port=8009 enableLookups=false redirectPort=443 protocol=AJP/1.3 / Engine name=Catalina defaultHost=localhost Realm className=org.apache.catalina.realm.LockOutRealm Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=UserDatabase/ /Realm Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=localhost_access_log. suffix=.txt pattern=%h %l %u %t quot;%rquot; %s %b resolveHosts=false/ /Host /Engine /Service /Server step 4: Start Tomcat 7 result : 信息: Loaded APR based Apache Tomcat Native library 1.1.20. 010-11-24 9:36:38 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 010-11-24 9:36:38 org.apache.coyote.http11.Http11AprProtocol init 严重: Error initializing endpoint ava.lang.Exception: No Certificate file specified or invalid file format at org.apache.tomcat.jni.SSLContext.setCertificate(Native Method) at org.apache.tomcat.util.net.AprEndpoint.init(AprEndpoint.java:501) at org.apache.coyote.http11.Http11AprProtocol.init(Http11AprProtocol.java:80) at org.apache.catalina.connector.Connector.initInternal(Connector.java:873) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 010-11-24 9:36:38 org.apache.catalina.core.StandardService initInternal 严重: Failed to initialize connector [Connector[HTTP/1.1-443]] ifecycleException: Protocol handler initialization failed: java.lang.Exception: No Certificate file specified or invalid file format at org.apache.catalina.connector.Connector.initInternal(Connector.java:875) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:542) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:717) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:100) at org.apache.catalina.startup.Catalina.load(Catalina.java:544) at org.apache.catalina.startup.Catalina.load(Catalina.java:567) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:262) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:417) 010-11-24 9:36:38 org.apache.coyote.ajp.AjpAprProtocol init 信息: Initializing Coyote AJP/1.3 on ajp-8009 010-11-24 9:36:38 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 489 ms Thanks Regards, Scott Li
Re: SSL No Certificate file specified or invalid file format
It works, Thank you very much Konstantin Kolinko! I disabled APR by following these steps: a) remove bin\tcnative-1.dll b) remove Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / line from server.xml. c) remove 'protocol=http11.Http11AprProtocol' from server.xml's Connector , changed as follow: Connector port=443 SSLEnabled=true maxThreads=150 scheme=https secure=true clientAuth=false sslProtocol=TLS keystoreFile=conf/server.keystore keystorePass=test truststoreFile =conf/client.keystore truststorePass=test/ then https://localhost/ can open. and my question is what is the configurations with OpenSSL library (called through APR/Tomcat-Native). I have read the http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#SSL_and_Tomcat but it seems not have the configurations of APR, Can you give me the docs link you metioned? or send to my email: sc...@222m.net, Thanks! 在 2010年11月24日 上午9:54,Konstantin Kolinko knst.koli...@gmail.com写道: 2010/11/24 Scott Li scott...@gwghk.com: 信息: Loaded APR based Apache Tomcat Native library 1.1.20. 010-11-24 9:36:38 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 010-11-24 9:36:38 org.apache.coyote.http11.Http11AprProtocol init As mentioned in the docs, there are two SSL implementations that can be used by Tomcat: - one provided by Java runtime, - another provided by OpenSSL library (called through APR/Tomcat-Native). Their configurations are very different. The above log fragment shows that you are using the APR one. To configure it correctly: see docs. To disable it: a) remove bin\tcnative-1.dll b) remove Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on / line from server.xml. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org Thanks Regards, Scott Li
Error in start tomcat 5.5
Hi, I am new to tomcat and have the following error in catalina.out when starting tomcat 5.5. Any help would be appreciated! Regards Leon 06/04/2010 5:46:09 AM org.apache.coyote.http11.Http11BaseProtocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 06/04/2010 5:46:09 AM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 508 ms 06/04/2010 5:46:09 AM org.apache.catalina.core.StandardService start INFO: Starting service Catalina 06/04/2010 5:46:09 AM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.23 06/04/2010 5:46:09 AM org.apache.catalina.core.StandardHost start INFO: XML validation disabled 06/04/2010 5:46:09 AM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive sermyadmin.war log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: stacktrace.log (Permission denied) at java.io.FileOutputStream.openAppend(Native Method) at java.io.FileOutputStream.init(FileOutputStream.java:177) at java.io.FileOutputStream.init(FileOutputStream.java:102) at org.apache.log4j.FileAppender.setFile(FileAppender.java:290) at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164) at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java :133) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java :97) at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator .java:689) at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator .java:647) at org.apache.log4j.PropertyConfigurator.parseCatsAndRenderers(PropertyConf igurator.java:568) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.j ava:442) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.j ava:476) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConver ter.java:471) at org.apache.log4j.LogManager.clinit(LogManager.java:125) at org.apache.log4j.Logger.getLogger(Logger.java:105) at org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:2 83) at org.apache.commons.logging.impl.Log4JLogger.init(Log4JLogger.java:108) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA ccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImp l.java:529) at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImp l.java:235) at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:370) at org.apache.catalina.core.ContainerBase.getLogger(ContainerBase.java:381) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4119 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:760) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:714) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31 1) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:120) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022) at org.apache.catalina.core.StandardHost.start(StandardHost.java:736) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:448) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:552) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: stacktrace.log (Permission denied) at java.io.FileOutputStream.openAppend(Native Method) at java.io.FileOutputStream.init(FileOutputStream.java:177) at java.io.FileOutputStream.init(FileOutputStream.java:102) at
Can't load page via tomcat6
Hi I am trying to build sermyadmin page via tomcat6 on a RHEL5 machine. I can start tomcat6 fine, but I couldn't load even the default page. browser seems to try to load something and eventually timed out. Any ideas? I can provide other information if required. Thanks Leon
the context.xml is not preserved
Hello, in http://tomcat.apache.org/tomcat-6.0-doc/config/context.html, there is a statement: Once this file exists, it will not be replaced if a new WAR with a newer /META-INF/context.xml is placed in the host's appBase. but, in my practice, this file is always be replaced, I need help on this point, thanks. my system: Ubuntu 9.04, x86_64, tomcat 6.0.18, thanks. -- Best Regards LI Daobing -- Best Regards LI Daobing - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: the context.xml is not preserved
Hello, I am talking about the first one, and i am still digging on this problem, it sounds that if autoDeploy is on and deploy a new war package will trigger this problem. Maybe an undeploy is triggered during this process, which remove the ROOT.xml in the conf/C*/l* dir Thanks 在 2010-1-28 下午11:05,David Smith d...@cornell.edu编写: On 1/28/10 9:46 AM, LI Daobing wrote: Hello, in http://tomcat.apache.org/tomcat-6.0-doc/config... I think conf/Catalina/localhost/myAppName.xml wouldn't be replace. webapps/myAppName/META-INF/context.xml would be replaced. Which one are you referring to? --David - To unsubscribe, e-mail: users...
How to configure failover for Apache/Tomcat?
I need help--- I have two Apache web servers, two app servers with four Tomcat instances running on them (two Tomcat instances on each server). All four servers run on Red Hat Linux. Current configuration is: web1 connected to app1 only, web2 connected to app2 only. If app1 is down, all users connected to web1 are out. Is it possible to configure web1 connecting to both app1 and app2 so failover will be available? What extra hardware and/or software do I need? Thanks, Henry
RE: How to configure failover for Apache/Tomcat?
Thank you Chris! I did not use mod_jk before. I will start from the beginning. Henry -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Thursday, July 30, 2009 11:03 AM To: Tomcat Users List Subject: Re: How to configure failover for Apache/Tomcat? -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Henry, On 7/30/2009 11:35 AM, Li,Henry wrote: I have two Apache web servers, two app servers with four Tomcat instances running on them (two Tomcat instances on each server). All four servers run on Red Hat Linux. Current configuration is: web1 connected to app1 only, web2 connected to app2 only. So: web1 --- app1 [ Tomcat 1a, Tomcat 1b] web2 --- app2 [ Tomcat 1a, Tomcat 2b] Right? If app1 is down, all users connected to web1 are out. Is it possible to configure web1 connecting to both app1 and app2 so failover will be available? Yes. Given your existing configuration, it seems that using mod_jk to connect your Apache httpd instances to Tomcat is the right way to go: mod_jk supports clustering and load balancing in (roughly) the following way: 1. Create a worker for each back-end Tomcat instance you have 2. Collect all the workers above into a balancer worker that will really multiplex between the workers defined in step 1 3. Session-less users are routed to whichever back-end server makes sense based upon your chosen load balancing algorithm 4. Users /with/ sessions are always router to the server that owns their session 5. When a server fails, mod_jk detect this and forwards requests to one of the other members of the cluster 6. When the failed node comes back up, it re-joins the cluster and everything goes back to normal Note that you can either implement sticky sessions (as I have described above), or you can use session replication across your cluster. I'm not a big fan of session replication because of all the messages that need to be sent around. For my production purposes, requiring a user to login again when failover occurs is acceptable. For me, the complexity of session replication is not necessary. Your requirements may differ. For more information on mod_jk balancing and clustering, see this page: http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html This page presupposes an understanding of how mod_jk is configured. If you haven't used mod_jk before, start here: http://tomcat.apache.org/connectors-doc/ and read the links for All about workers, For the impatient, and the reference guide for Apache. If you have more questions, post back to the list. What extra hardware and/or software do I need? You'll want a hardware load-balancer to balance between web1 and web2. As for software, just adding mod_jk to the mix should do it. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkpxxEAACgkQ9CaO5/Lv0PCPFACfbRe3JJwEJhcgGW89bYP8wRrE 7EsAn0N3dM9qCB5thWTq0aFIiJEhbr/I =pM8p -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit)
Juha, Yes, there is memory leak from application. We contact the application vendor and they do not have patches to fix it for the version which we are using. So what we need is a partial/dirty fix to mimimize the recycle times. Upgrading the application will be a project which requires lots approvals. Thanks, Henry -Original Message- From: Juha Laiho [mailto:juha.la...@iki.fi] Sent: Friday, July 24, 2009 4:22 AM To: Tomcat Users List Subject: Re: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit) Li,Henry wrote: My Tomcat is running on 32-bit Red Hat 4 (2.6.9-78.0.1.ELsmp), host server has 8G physical memory and 4 processors. java version 1.4.2 gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10) I got java.lang.OutOfMemoryError Current configuration: -Xms1024M -Xmx2304M The host server has about 4.5G free memory. When I tried to increase -Xmx2304M to -Xmx3000M, I got this error: Error occurred during initialization of VM, Could not reserve enough space for object heap The maximum # I can reach is -Xmx2680M. QUESTION: Is there an upper limit for -Xmx? What is the work around? How can I use my free memory on the server to get rid of the OutOfMemoryError? Apologies if this is an obvious question, but have you checked that the applications deployed on your server have no memory leaks? A memory leak can well be the cause for an OutOfMemoryError, and upping the amount of memory reserved will just delay the death but not prevent it. Actually fixing the application defect can result in being able to run the server with significantly smaller amount of memory. -- ..Juha - 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: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit)
Thank you Andre for this information. I will look at it. Regards, Henry -Original Message- From: André Warnier [mailto:a...@ice-sa.com] Sent: Friday, July 24, 2009 9:33 AM To: Tomcat Users List Subject: Re: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit) Li,Henry wrote: Juha, Yes, there is memory leak from application. We contact the application vendor and they do not have patches to fix it for the version which we are using. So what we need is a partial/dirty fix to mimimize the recycle times. Upgrading the application will be a project which requires lots approvals. Guys, I am not really competent here, but just as a tip if you are looking for some quick-and-dirty fix, you may be interested in this tool : http://code.google.com/p/jmxsh/ Basically, it is a scriptable tool, which you could run from time to time in a cron script. I have used it to trigger GC's in Tomcat from outside, but it has many more capabilities. - 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: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit)
Thank you Alan for your help. I use top to get the 4G free memory: Mem: 8309064k total, 3426680k used, 4882384k free, 163308k buffers. Your are right, my 4 processors mean 4 cores (2 dual-core processors) I think I will take your workaround #2. Regards, Henry -Original Message- From: Alan Chaney [mailto:a...@compulsivecreative.com] Sent: Thursday, July 23, 2009 6:30 PM To: Tomcat Users List Subject: Re: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit) You are using a 32 bit operating system and a 32 bit processor. To make more than 4GB of ram available you must ensure that you have PAE support enabled in your kernel (search Google for Physical Address Extension) which may mean re-compiling for RHEL 4 (see Red Hat). Your processor may not support it but I'd suspect that when you say 4 processors you probably mean 4 cores and I believe all 4 core Intel CPUs do support PAE. Re-reading your email I see that you say that you have 4.5G of free memory - how did you determine this? 'top'? Even so, I cannot find any clear statement on the web that the 32 bit JRE will be able to address more than 4G even if you do have PAE enabled. I suspect not. Actually, 'suspect' is way too mild a term ... I would be completely astounded if you could... Possible workarounds are: 1. Try running 2 JVMs ( when you have PAE enabled) - of course this may not work in your application (you'd have to have two Tomcat instances.) 2. Your other 'workaround' is to install a 64 bit OS and a 64 bit JVM. Then you can have 7G+ for the JVM. Regards Alan Chaney Li,Henry wrote: My Tomcat is running on 32-bit Red Hat 4 (2.6.9-78.0.1.ELsmp), host server has 8G physical memory and 4 processors. java version 1.4.2 gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10) I got java.lang.OutOfMemoryError Current configuration: -Xms1024M -Xmx2304M The host server has about 4.5G free memory. When I tried to increase -Xmx2304M to -Xmx3000M, I got this error: Error occurred during initialization of VM, Could not reserve enough space for object heap The maximum # I can reach is -Xmx2680M. QUESTION: Is there an upper limit for -Xmx? What is the work around? How can I use my free memory on the server to get rid of the OutOfMemoryError? Thanks, Henry !DSPAM:4a68ee3b41041381456296! - 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
what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit)
My Tomcat is running on 32-bit Red Hat 4 (2.6.9-78.0.1.ELsmp), host server has 8G physical memory and 4 processors. java version 1.4.2 gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-10) I got java.lang.OutOfMemoryError Current configuration: -Xms1024M -Xmx2304M The host server has about 4.5G free memory. When I tried to increase -Xmx2304M to -Xmx3000M, I got this error: Error occurred during initialization of VM, Could not reserve enough space for object heap The maximum # I can reach is -Xmx2680M. QUESTION: Is there an upper limit for -Xmx? What is the work around? How can I use my free memory on the server to get rid of the OutOfMemoryError? Thanks, Henry
RE: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit)
Thank you Chuck! I will go to the 64-bit. Regards, Henry -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Thursday, July 23, 2009 7:19 PM To: Tomcat Users List Subject: RE: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit) From: Alan Chaney [mailto:a...@compulsivecreative.com] Subject: Re: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit) You are using a 32 bit operating system and a 32 bit processor. To make more than 4GB of ram available you must ensure that you have PAE support enabled in your kernel That's not relevant to the problem. PAE allows the OS to utilize more real memory; it does not change the virtual memory available to a process, which is the limitation here. Even so, I cannot find any clear statement on the web that the 32 bit JRE will be able to address more than 4G even if you do have PAE enabled. I suspect not. You are correct - enabling PAE would have no effect. 2. Your other 'workaround' is to install a 64 bit OS and a 64 bit JVM. Then you can have 7G+ for the JVM. Much preferred, if the hardware supports it. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: test all nodes in cluster
Anyone can help on my issue? Li On Tue, Apr 15, 2008 at 5:02 PM, Li Ma [EMAIL PROTECTED] wrote: We setup a Tomcat cluster with 3 nodes running behind Apache with mod_jk module. Everytime we deploy something to the cluster, we would like to make sure every single nodes is working. And from time to time, we would like to test each node to make sure they are healthy too. However, besides of accessing their IP and 8080 port, is there anyway to test against the Apache server directly? For example, is it possible to enter URL like: http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca1 http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca2 http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca3 To reach each one of the nodes? Thanks! -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com
test all nodes in cluster
We setup a Tomcat cluster with 3 nodes running behind Apache with mod_jk module. Everytime we deploy something to the cluster, we would like to make sure every single nodes is working. And from time to time, we would like to test each node to make sure they are healthy too. However, besides of accessing their IP and 8080 port, is there anyway to test against the Apache server directly? For example, is it possible to enter URL like: http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca1 http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca2 http://www.myserver.com/mywebapp/test.jsp?JSESSIONID=123456789.tomca3 To reach each one of the nodes? Thanks! -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com
Re: Running Tomcat as Standalone in linux
Check out your log see if there is any error info. On Jan 5, 2008 11:29 PM, Chris Baty [EMAIL PROTECTED] wrote: Hi guys, I want to serve a site with few graphics so I decided to use Tomcat 5.5 as my server. But I'm having difficulty getting it to run on port 80. I read http://www.ibm.com/developerworks/java/library/l-secjav.html and decided to try xinetd. I added this to /etc/xinetd/: # Redirects any port 80 requests to port 8180 (to Tomcat) service tomcat { socket_type= stream protocol= tcp user= root wait= no port= 80 redirect= localhost 8180 disable= no } it works great on that machine if I point my browser but remotely I get zilch. I've tried plugging in my ip address instead of localhost: zilch. Could anyone point me in the right direction? Thanks. Chris Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
HNY
Hi all, Happy New Year to you. And Happy New Year to Tomcat too. Li -- Small win by playing smart Big win by playing honest
Cannot access database with remote shared web hosting
Dear Team, I'm new with Tomcat Hibernate. We have a weird problem: When I test our website locally with Tomcat MySQL, everything is OK. But after I copy our webapp under Tomcat to remote web hosting, I can only access the JSP pages, not able to access data from database. The error on page is below, Data Access Failure JDBC exception on Hibernate data access; nested exception is org.hibernate.exception .SQLGrammarException: could not insert: [com.cmn.model.User] I did Google search and someone said the hibernate mapping maybe not good. In my local Tomcat, I can see bunch of * hbm.xml under work/Catalina/localhost/cmnweb /loader/com/cmn/model/ But I'm not sure the remote Tomcat since it's a shared hosting. My questions: 1) Any idea about above Hibernate Data Access Failure? 2) How does Tomcat decide to load *hbm.xml from my lib cmnweb-dao.jar, but not all .jar in WEB-INF/lib/ ? Thanks a lot! -Mike __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Perl Permissions on Tomcat
Yes, I have added debug code to the Perl program, and where it stalls seems to be the following line: $myDatabase = new Win32::ODBC($data_source); It just keeps hanging at that line. If I go to Windows Task Manager, I see perl.exe running, but at a fixed memory space (no changes). Also, forcing perl.exe off the Task Manager unstalls the CGI program and it just prints all the debug comments up to the code I wrote above. Someone suggested that I switch to another JDK but our workplace uses only Sun JDK for production servers...any insights to resolving this other than writing a whole new module in Java? -Original Message- Date: Sun Oct 14 18:29:57 EDT 2007 From: Mark Thomas [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org Li Ye Chen wrote: Script A (the problem script) continues to run after 2 minutes (with partial output some of the time). But script A ran under the command line (as opposed to the browser/Tomcat) is very fast -- under a second and gives full output. Script B runs under less than a second and gives full output. Sounds like you need to add some debugging to your script to figure out where the problem is. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cannot access database with remote shared web hosting
Thank Chris for help. I have questions embedded below. Data Access Failure JDBC exception on Hibernate data access; nested exception is org.hibernate.exception .SQLGrammarException: could not insert: [com.cmn.model.User] Can you post more of this stack trace? I wonder if the real problem is cannot connect to database, and not SQL syntax error, as suggested by the exception class. [Mike] It's a shared web hosting, thus I cannot see the whole stack trace. If it's a cannot connect to database problem, which file or settings do you suggest to look at? Can you verify that you can reach the hibernate database from your app server? There may be a firewall or other barrier between the two machines. [Mike] The Tomcat and MySQL run on same machine. Can you suggest an easy sample code to verify the connection between both? Thanks! -Mike Christopher Schultz [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike, Mike LI wrote: Data Access Failure JDBC exception on Hibernate data access; nested exception is org.hibernate.exception .SQLGrammarException: could not insert: [com.cmn.model.User] Can you post more of this stack trace? I wonder if the real problem is cannot connect to database, and not SQL syntax error, as suggested by the exception class. Can you verify that you can reach the hibernate database from your app server? There may be a firewall or other barrier between the two machines. 2) How does Tomcat decide to load *hbm.xml from my lib cmnweb-dao.jar, but not all .jar in WEB-INF/lib/ ? Tomcat loads JAR files whenever a class is requested that resides in the JAR file. They might not all be processed at once. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHIi/a9CaO5/Lv0PARAtedAJ0bKrCMSazZTalpfmH145kOrwsStACfb2Co OTMS4tdR9ATaX/HeFmPZtss= =3rG9 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Perl Permissions on Tomcat
Yes, if you mean enabling the file server/lib/servlets-cgi.jar... -Original Message- Date: Mon Oct 09 18:25:12 EDT 2000 From: Martin Gainty [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org I asked yesterday but didnt hear back..Are you implementing via CGIServlet? M-- - Original Message - From: Li Ye Chen [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, October 09, 2007 4:34 PM Subject: Re: Perl Permissions on Tomcat Okay, I did some searching on the Internet and found that according to current config in my Tomcat, it's not even running SecurityManager (the -Djava...securitymanager argument is not available in the Java tab of the Configuration screen. And it is still not working, so I'm not sure what is going on here... Any help will be appreciated! -Original Message- Date: Mon Oct 08 12:52:23 EDT 2007 From: Mark Thomas [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org Li Ye Chen wrote: Will it pose a security risk if I disable the Security Manager? I am running an enterprise firewall on the server... That depends on your environment. But you have a separate machine for development and/or testing - right? Right now we need to figure out if it is the security manager causing the problem or something else. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Permissions on Tomcat
I assume it's a permission problem since: 1) I'm trying to run script A (the script with the problem), and 2) script B ran with no problems at all, but 3) script A also ran with no problems if executed from the command line directly instead of in the browser via Tomcat server... both scripts A and B are in the WEB-INF/cgi folder of a webapp in the Tomcat server. There are no error messages. Apparently, it may also be a speed issue, since there was once when I ran script A and after a while, I stopped the transmission -- there was actually a partial output from the script. -Original Message- Date: Tue Oct 09 16:54:50 EDT 2007 From: Christopher Schultz [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Li, Li Ye Chen wrote: Hi, I'm trying to run a Perl script on Tomcat 5.5.8 -- I've managed to successfully run read-only Perl script, but the script I'm trying to run connects to the database and needs to write to the local hard drive. Whenever I try to execute the script, it creates a Perl.exe thread on my Windows server and just never return the HTML code (so the browser keeps loading) -- it seems there is a permission problem. Why do you believe there is a permissions problem? If perl.exe is running, then you have permission to run perl.exe. If you don't have permission to read the script file, then you should be getting some kind of error message somewhere. Can you see any error messages anywhere? How are you trying to execute this perl script? Be specific. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHC+qa9CaO5/Lv0PARApzZAJsGg5LMZXycPyWTHUpbJ8cyk7mWrgCcDRPo Q+HJ78JMBbf3cDZsnbveV08= =IZrk -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Permissions on Tomcat
I'm running Tomcat on Windows XP, and in my Configuration - Startup menu, the entry for the Arguments text box is start, with no other string (nothing that says -security). Does that mean I'm currently running without SecurityManager? -Original Message- Date: Mon Oct 08 12:03:37 EDT 2007 From: Mark Thomas [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org Li Ye Chen wrote: // Give all permission to servlets-cgi.jar grant codeBase file:${catalina.home}/server/lib/servlets-cgi.jar { permission java.security.AllPermission; }; Are you running with a security manger? If so, try running without and get things working that way first. Then we can focus on the permissions. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Permissions on Tomcat
Okay, I did some searching on the Internet and found that according to current config in my Tomcat, it's not even running SecurityManager (the -Djava...securitymanager argument is not available in the Java tab of the Configuration screen. And it is still not working, so I'm not sure what is going on here... Any help will be appreciated! -Original Message- Date: Mon Oct 08 12:52:23 EDT 2007 From: Mark Thomas [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org Li Ye Chen wrote: Will it pose a security risk if I disable the Security Manager? I am running an enterprise firewall on the server... That depends on your environment. But you have a separate machine for development and/or testing - right? Right now we need to figure out if it is the security manager causing the problem or something else. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Perl Permissions on Tomcat
Hi, I'm trying to run a Perl script on Tomcat 5.5.8 -- I've managed to successfully run read-only Perl script, but the script I'm trying to run connects to the database and needs to write to the local hard drive. Whenever I try to execute the script, it creates a Perl.exe thread on my Windows server and just never return the HTML code (so the browser keeps loading) -- it seems there is a permission problem. I've tried executing the script on plain old DOS and it works just fine (returns the right HTML code with database information). I've also searched the mailing archives, and tried changing the catalina.policy file by adding the following line: // Give all permission to servlets-cgi.jar grant codeBase file:${catalina.home}/server/lib/servlets-cgi.jar { permission java.security.AllPermission; }; but it doesn't work. Any idea how I can give Perl.exe read/write permission as executed through Tomcat 5.5.8? Thanks in advance! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Permissions on Tomcat
Will it pose a security risk if I disable the Security Manager? I am running an enterprise firewall on the server... -Original Message- Date: Mon Oct 08 12:03:37 EDT 2007 From: Mark Thomas [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org Li Ye Chen wrote: // Give all permission to servlets-cgi.jar grant codeBase file:${catalina.home}/server/lib/servlets-cgi.jar { permission java.security.AllPermission; }; Are you running with a security manger? If so, try running without and get things working that way first. Then we can focus on the permissions. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Perl Permissions on Tomcat
Yes, it's on a separate machine... -Original Message- Date: Mon Oct 08 12:52:23 EDT 2007 From: Mark Thomas [EMAIL PROTECTED] Subject: Re: Perl Permissions on Tomcat To: Tomcat Users List users@tomcat.apache.org Li Ye Chen wrote: Will it pose a security risk if I disable the Security Manager? I am running an enterprise firewall on the server... That depends on your environment. But you have a separate machine for development and/or testing - right? Right now we need to figure out if it is the security manager causing the problem or something else. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re[2]: Get an English name
Please watch your mouth. This group is used to discuss topics regarding tomcat. On 6/29/07, 吴熊敏 [EMAIL PROTECTED] wrote: it's none of your bisiness!!! you son of a bitch!! On Fri, 29 Jun 2007 15:10:53 +0800 Li [EMAIL PROTECTED] wrote: hi, it's out of topic. Please use your private email ... On 6/29/07, 吴熊敏 [EMAIL PROTECTED] wrote: I like the name of one of my friends.His english name is 'KEN' I think it's very good. On Fri, 29 Jun 2007 14:19:58 +0800 吴熊敏 [EMAIL PROTECTED] wrote: Hi,all I'd like to get an english name(a young and sunshine name). I'm male. Can anyone help me? Any advice will be appreciated! 吴熊敏 [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 吴熊敏 [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Small win by playing smart Big win by playing honest 吴熊敏 [EMAIL PROTECTED] -- Small win by playing smart Big win by playing honest
Re: Get an English name
hi, it's out of topic. Please use your private email ... On 6/29/07, 吴熊敏 [EMAIL PROTECTED] wrote: I like the name of one of my friends.His english name is 'KEN' I think it's very good. On Fri, 29 Jun 2007 14:19:58 +0800 吴熊敏 [EMAIL PROTECTED] wrote: Hi,all I'd like to get an english name(a young and sunshine name). I'm male. Can anyone help me? Any advice will be appreciated! 吴熊敏 [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 吴熊敏 [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Small win by playing smart Big win by playing honest
Re: Using Tomcat 5.5.23 with jdk 1.6.0_1
Defaultly tomcat 5.5 only support up to JDK5. If you wanna run your application which was written by JDK 6, you can use Tomcat 6 + JDK 6. If you really wanna use Tomcat 5.5 with JDK 6 in Linux, you may have to check if you need copy the tools.jar from JDK6 to tomcat common/lib. It should work. Regards Li On 6/29/07, Christopher Hartung [EMAIL PROTECTED] wrote: Hi there, we are using Tomcat 5.5.23 with jdk 1.6.0_1. But sometimes we get errors like this: # # An unexpected error has been detected by Java Runtime Environment: # # SIGSEGV (0xb) at pc=0x002a958a666a, pid=8528, tid=1082333536 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0-b105 mixed mode) # Problematic frame: # V [libjvm.so+0x22066a] # # An error report file with more information is saved as hs_err_pid8528.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # After this the hole instance crashed Our system is CentOS 5, 64 -Bit, jdk 1.6.0_1 64 -Bit The Application is written for JDK 1.6.0_1 do you know some problems like this? thx for your answers so long chris - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Small win by playing smart Big win by playing honest
Re: Using Tomcat 5.5.23 with jdk 1.6.0_1
Hi Caldarale, Thanks for your comments. I had the same compatibility problem on Fedora, by copying the tool.jar - although it is not a good idea- it worked out. Anyway, thanks for your comments. Regards Li On 6/29/07, Caldarale, Charles R [EMAIL PROTECTED] wrote: From: Li [mailto:[EMAIL PROTECTED] Subject: Re: Using Tomcat 5.5.23 with jdk 1.6.0_1 Defaultly tomcat 5.5 only support up to JDK5. If you wanna run your application which was written by JDK 6, you can use Tomcat 6 + JDK 6. Not true. JDK 6 is fully upward compatible with JDK 5. If you really wanna use Tomcat 5.5 with JDK 6 in Linux, you may have to check if you need copy the tools.jar from JDK6 to tomcat common/lib. Also not true, and a very bad idea. Neither Tomcat 5.5 nor Tomcat 6 require tools.jar; both versions will happily run on just a JRE. The JVM crash is, by definition, caused by faulty hardware, the OS, or a flaw in the JVM; pure Java programs cannot crash the JVM (although native code can). In the past, the -server mode of the JVM has been less stable than -client; if the hardware checks out, you might try running in -client mode to see if the problem disappears. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Small win by playing smart Big win by playing honest
Re: [OT] RE: Embed license to tomcat
Hi all, Thanks for you guys last time regarding my boss 'funky' idea for software protection. Since I am still his employee and a responsible developer, I am still planning to finish up this task. Now i am at in the forest which got a bit lost. Let me clarify again what I am going to achieve: 1. Compile all JSPs into .class (done) 2. Create key generator in order to generate Key and later put it into both Tomcat and our system 3. Create encryption key generator for the class files encryption 4. Create encrypt util class to do the encryption 5. Create my own classloader which can be used by tomcat to decrypt our class files 1 and 2 seems ok for now .. 3 and 4 is also tested fine (I am using DES for now). I had wrote a simple classloader which extends JVM's default classloader. It's decryption works fine with simple class files. When I was trying to make a similar implementation for tomcat. I found it's not that easy. There are few paths in my head which made me dizzy: Path 1. Make an independent classloader which extends URLClassLoader Path 2. Modify WebappClassLoader Path 3. As the classloading doc mentioned, configure customized loader which is located in shared folder I had tried Path 3 and it never gets me success. Any ideas about implementing custom classloader for this special purpose? Li
Re: [OT] RE: Embed license to tomcat
Hi Peter, Thanks for your reply. I did few hack, the major problem is I need instantiate classloader, but WebappClassLoader is not instantiated by itself, it always failed so far. Do you know any recommendable resource so that I can read up? On 6/12/07, Peter Crowther [EMAIL PROTECTED] wrote: From: Li [mailto:[EMAIL PROTECTED] Path 1. Make an independent classloader which extends URLClassLoader Path 2. Modify WebappClassLoader Path 3. As the classloading doc mentioned, configure customized loader which is located in shared folder I had tried Path 3 and it never gets me success. Any ideas about implementing custom classloader for this special purpose? If you're distributing a custom Tomcat anyway, why not just hack WebappClassLoader? - Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Small win by playing smart Big win by playing honest
Embed license to tomcat
Hi guys, Our company is going to deploy a system externally. In order to prevent illegal deployment by our customer to other tomcat in case. My boss asked me to embed our license ID into the tomcat by building our own tomcat. I had done several work such as creating a manager for our customized tomcat to checkout MAC ID of the machine and license ID of the deployed system. I am not so sure this is a good solution for securing deployment and our system. Any ideas? -- Small win by playing smart Big win by playing honest
Re: Embed license to tomcat
Hi thanks all you guys' comments. I agree with Filip's words that we should spend more time on doing statis secure analysis, codes refine and bug fixing instead of building a castle. Thanks Kristian but unfortunately it is not that possible to persuade my boss accept your suggestion. Thanks David, I will dive deeper to see if I could get a better and strong verification solution. As a developer, sometimes it's difficult to decide whether should follow my heart or boss ... Cheers Li
RE: multiple Tomcat on one host with multiple IPs using the same port
Hi Chuck and list, The problem I have now is once I started the first Tomcat I could not start any of others if I use the same port 80xx, the log complains about the port has already been used. On one host I have 4 different IPs 10.2.2.1 10.2.2.2 10.2.2.3 10.2.2.4 Please let me know if it's possible to setup 4 tomcat like below with 4 tomcat java processes 10.2.2.1.8080 *.*0 0 49152 0 LISTEN 10.2.2.2.8080 *.*0 0 49152 0 LISTEN 10.2.2.3.8080 *.*0 0 49152 0 LISTEN 10.2.2.4.8080 *.*0 0 49152 0 LISTEN Thanks for any comments. Regards, Ran -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 09, 2007 9:14 PM To: Tomcat Users List Subject: RE: multiple Tomcat on one host with multiple IPs using the same port From: Ran Li [mailto:[EMAIL PROTECTED] Subject: multiple Tomcat on one host with multiple IPs using the same port I need to setup 4 Tomcat on one host, this host has multiple IPs, is it possible to set them up with multiple IPs using the same listening port 8080? Assuming you want each instance of Tomcat to use a separate IP address, you must configure the desired IP address in each Connector element of each Tomcat. By default, the Connector address is 0.0.0.0, which indicates all IP addresses configured for the box. The Host elements do not need to be changed. Look here for details: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple Tomcat on one host with multiple IPs using the same port
Hello list, I need to setup 4 Tomcat on one host, this host has multiple IPs, is it possible to set them up with multiple IPs using the same listening port 8080? If it is possible could you let me know how? I tried configure different Host name in server.xml seems does not work in this way. Thanks. Regards, Ran - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
the cluster deployer can not work on 6.0.10
Hello guys On tomcat 6.0.10 , I use FarmWarDeployer and set watchEnabled=true, but I always get the error 2007-3-9 10:47:51 org.apache.catalina.ha.deploy.FarmWarDeployer messageReceived severe: javax.management.RuntimeOperationsException: Exception occured trying to get an MBean on the Apache Tomcat Configuration Reference, under The Cluster Deployer object, it said This goober is currently pretty broken, but we are working hard to fix it. Does it means the FarmWarDeployer on 6.0.10 can't work? thank you L.S.
Re: server.xml configuration..
Hi, Tomcat forbids directly access to files in your WEB-INF, which you can use the feature to setup a simple solution to protect certain jsp files so you can not direct access your jsp resource but use dispatched way to access ... On 3/6/07, Raghupathy, Gurumoorthy [EMAIL PROTECTED] wrote: Any reason why cant you put all pf the jsp inside WEB-INF folder This way you can be sure that no one is able to access your jsp file Regards Guru --- Gurumoorthy Raghupathy Email : [EMAIL PROTECTED] Internal Extn : 2337 External Phone : 01483712337 Nielsen Book 3rd Floor Midas House 62 Goldsworth Road Woking Surrey GU21 6LQ Visit us at : http://www.nielsenbookdata.co.uk/ --- -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 06 March 2007 11:37 To: Tomcat Users List Subject: Re: server.xml configuration.. Use a servlet filter which is mapped to *.jsp - see Google for more details on Servlet Filters. (javax.servlet.Filter) -Tim prt wrote: Hi to all, Where i have to config and what, to prevent direct access to my jsp files ? - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: java.lang.UnsupportedClassVersionError -- Please advise
I updated my tomcat 5 to 6 (beta) which I didnt have this problem. Class version problem sometimes caused by system time. have you changes your system time? Or try to clean up all classes you had generated and compile your java program again see how On 3/6/07, Peter Crowther [EMAIL PROTECTED] wrote: From: Arshan Varsi [mailto:[EMAIL PROTECTED] My system confi is : Win XP , JDK 6 . My env variables are : PATH :C:\Program Files\Java\jdk1.6.0\bin and CLASSPATH : . (Dot). I have ran many java programs in my system without any problems. I have installed tomcat 6 (by just using the Windows Service installer - apache.tomcat.6.0.10.exe and making no other configurations ) . Now I face problem whenever I want to run any java programs, I get error message : Exception in thread main java.lang.UnsupportedClassVersionError: Tutorial05 (Unsupported major.minor version 50.0) Could you please advise ? Something is trying to use an older JDK to run Tomcat - probably 1.5. I think you should look at the Tomcat service properties and check that it is correctly configured. - Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: server.xml configuration..
You can move your jsp files which you would like to secure to WEB-INF/, and use dispatched way to access ... then you can define few error files like 404, 503 or your own error.jspwhich can be handled by your java class wish this helps On 3/6/07, prt [EMAIL PROTECTED] wrote: Hi to all, Where i have to config and what, to prevent direct access to my jsp files ? For example, I have project name test. If i whant to show product data the link is, http://localhost/test?do=showProductData. This link run the index.jsp that is in text, and in index.jsp there is include to actions/showProducData.jsp. To prevent direct access to jsp files that are locate in actions i added this part to server.xml in the host part, Context path=/test/actions docBase=/err debug=0 crossContext=false/ So when i try to do direct access to any jsp in actions is run the index file under err. The problem is when i run the link like this http://127.0.0.1/test?do=showProductData, is not work. If i want to cover this problem i have to add Host section to server.xmlfor 127.0.0.1 and put in it this part Context path=/test/actions docBase=/err debug=0 crossContext=false/. Is there any better solution for this problem ? Thank you all. -- View this message in context: http://www.nabble.com/server.xml-configuration..-tf3353902.html#a9327284 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: [Tomcat 6.0.10] Failed to install Tomcat6 service.
Your tomcat will be installed properly even windows service creation is failed. You can run service.bat to create service ... On 3/2/07, LiuYan 刘研 [EMAIL PROTECTED] wrote: When I try to install tomcat 6.0.10, I got the following error: - Failed to install Tomcat6 service. Check your settings and permissions Ignore and continue anyway (not recommended)? - My environment: -- OS: Windows XP SP2 -- JDK: JDK1.6.0 with public JRE installed -- The account which I logon is a Domain Account, and this account is a member of Administrators group of this computer. -- I logged on the Domain, not the Local machine -- Tomcat 5.5.20 had been installed before. -- Tomcat 5.5.20 is installed to C:\Tomcat 5.5 -- I'm trying to install Tomcat 6.0.10 to C:\Tomcat 6.0 Thanks ! -- View this message in context: http://www.nabble.com/-Tomcat-6.0.10--Failed-to-install-Tomcat6-service.-tf3332526.html#a9266400 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: About Tomcat's configure
Hi, About JDK ... you cah echo JAVA_HOME and see the path, make sure it points to the right JDK directory. About configuration, you can read tomcat doc (it is deployed on your tomcat). Or visit tomcat official site. On 1/27/07, 悠 妮 [EMAIL PROTECTED] wrote: Hello All, I have two questions about configure: The first one is that, when I use Tomcat5.0 + Jdk1.5 and start server, I have the error JAVA_HOME should point to a JDK not a JRE. But I do set the JDK dir to JAVA_HOME. If I use Tomcat5.0 + Jdk1.4, it does work. The second question, when I use Tomcat5.5 + Jdk1.5, and configure the xml file refering to the manager.xml and host-manager.xml in Tomcat 5.5\conf\Catalina\localhost\, I can't visit the Jsps and Servlets in the new web app. Otherwise, I can not visit the manager and host-manager webapp. Can anyone give me an example of the configuration file? Can anyone help me? Thanks a lot. Youni. _ 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: Cannot create object of class
Hi, it seems that catalina was trying to find your MyClass in her manager's classpath java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1. Make sure your class path is correct. A faster way to test if to write a simple jsp and run your thread inside % ... %. You can need configure your system to give tomcat permission to run process or executable files... On 1/9/07, Stephan Schöffel [EMAIL PROTECTED] wrote: hi, have a problem with creating a class in the doPost method of a servlet: MyClass mc= new MyClass(); if i do so i get the following error message: HTTP Status 500 - *type* Exception report *message* *description* _The server encountered an internal error () that prevented it from fulfilling this request._ *exception* javax.servlet.ServletException: Servlet execution threw an exception *root cause* java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1 org.apache.catalina.manager.AgroManagerServlet.doPost( AgroManagerServlet.java:112) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *note* _The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs._ Apache Tomcat/5.5.20 i belive it has something to to with the timer i use in the class: public class MyClass implements Runnable{ public void run(){ final Timer timer = new Timer(); timer.schedule(new TimerTask(){ public void run(){ timer.cancel(); } }, 60*1000); } public void startUpdate(){ try{ System.out.println(do something); Process p = Runtime.getRuntime().exec(TomcatPath.getAbsInstPath ()+update/check_for_updates.exe); }catch(Exception e){ } } } dont know what do to since i need the timer task and i need it in a separate thread... --stephan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: Cannot create object of class
try to call your time in a single jsp file. say test.jsp ... %@ page import=yourtimerpath % % ... I am calling my timer here % See if you can make it work ... On 1/9/07, Stephan Schöffel [EMAIL PROTECTED] wrote: MyClass is in the manage lib. if i delete this timer-stuff it works fine... but i need the timer Li wrote: Hi, it seems that catalina was trying to find your MyClass in her manager's classpath java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1. Make sure your class path is correct. A faster way to test if to write a simple jsp and run your thread inside % ... %. You can need configure your system to give tomcat permission to run process or executable files... On 1/9/07, Stephan Schöffel [EMAIL PROTECTED] wrote: hi, have a problem with creating a class in the doPost method of a servlet: MyClass mc= new MyClass(); if i do so i get the following error message: HTTP Status 500 - *type* Exception report *message* *description* _The server encountered an internal error () that prevented it from fulfilling this request._ *exception* javax.servlet.ServletException: Servlet execution threw an exception *root cause* java.lang.NoClassDefFoundError: org/apache/catalina/manager/MyClass$1 org.apache.catalina.manager.AgroManagerServlet.doPost( AgroManagerServlet.java:112) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *note* _The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs._ Apache Tomcat/5.5.20 i belive it has something to to with the timer i use in the class: public class MyClass implements Runnable{ public void run(){ final Timer timer = new Timer(); timer.schedule(new TimerTask(){ public void run(){ timer.cancel(); } }, 60*1000); } public void startUpdate(){ try{ System.out.println(do something); Process p = Runtime.getRuntime().exec(TomcatPath.getAbsInstPath ()+update/check_for_updates.exe); }catch(Exception e){ } } } dont know what do to since i need the timer task and i need it in a separate thread... --stephan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: TOMCAT 1.4
Hi tuosu, Happy new year to you and Charles also. ;) The reason why you cant see using ps is because your tomcat startup was failed. Your tomcat startup failed is because that its port (8080) was occupied by someother running process. using lsof to check what port using 8080 is running. Li On 1/1/07, tuosu [EMAIL PROTECTED] wrote: Hello Charles, Honored to see your post, since i have seen your wonderful, worthful posts. Thanks for all your info. It was a typo - it should have been - 4.1.34 .profile = CATALINA_HOME=/tomcat-4.1.34 I am running solaris -8, postgresql-8.1.5-sol8-sparc-local j2sdk-1_4_2_13-solaris-sparc j2re-1_4_2_13-solaris-sparc J2SE_Solaris_8_Recommended patches rrdtool-1.0.49-sol8-sparc-local and opennms-1.2.8-sol8-sparc-local The question i have is - when i do ps -ae, i don't see tomcat as a deamon process. How can i make tomcat a process. If tomcat cannot be a process then how do i verify if tomcat is working or not. When i enter the following: ./catalina.sh run Using CATALINA_BASE: /tomcat-4.1.34 Using CATALINA_HOME: /tomcat-4.1.34 Using CATALINA_TMPDIR: /tomcat-4.1.34/temp Using CATALINA_OUT:/tomcat-4.1.34/logs/catalina.out Using JAVA_HOME: /usr/java log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester). log4j:WARN Please initialize the log4j system properly. Catalina.start: LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use:8080 LifecycleException: Protocol handler initialization failed: java.net.BindException: Address already in use:8080 at org.apache.coyote.tomcat4.CoyoteConnector.initialize(CoyoteConnector.java :1324) at org.apache.catalina.core.StandardService.initialize(StandardService.java :531) at org.apache.catalina.core.StandardServer.initialize(StandardServer.java :2268) at org.apache.catalina.startup.Catalina.start(Catalina.java:457) at org.apache.catalina.startup.Catalina.execute(Catalina.java:345) at org.apache.catalina.startup.Catalina.process(Catalina.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java :39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:150) Catalina.stop: LifecycleException: This server has not yet been started LifecycleException: This server has not yet been started at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2235) at org.apache.catalina.startup.Catalina.start(Catalina.java:489) at org.apache.catalina.startup.Catalina.execute(Catalina.java:345) at org.apache.catalina.startup.Catalina.process(Catalina.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java :39) at sun.reflect.DelegatingMethodAccessorImpl.invoke( DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:150) I have no clue on this error message. Thanks in advance Caldarale, Charles R wrote: From: tuosu [mailto:[EMAIL PROTECTED] Subject: TOMCAT 1.4 My O.S == sun solaris 8.0, running tomcat 1.4.2 It's highly unlikely you have Tomcat 1.4.2; the oldest level in the archives is 3.0, and that's almost seven years old. The 1.4.2 probably refers to the level of Java (JRE) you have installed. You probably need to download and install Tomcat from here: http://tomcat.apache.org/download-55.cgi Since you are most likely running version 1.4.2 of the JVM, you'll also need the JDK 1.4 Compatibility Package, from the same download page. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/TOMCAT-1.4-tf2903356.html#a8112283 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: TOMCAT 1.4
httpd is normally not for tomcat but for your webserver like apache ... and you get 404 or 405 is because your app is not deployed. Check whether your tomcat has been installed properly try to run startup.sh to see if there is any error On 1/1/07, tuosu [EMAIL PROTECTED] wrote: hello, My O.S == sun solaris 8.0, running tomcat 1.4.2 I have every thing configured as documented. When i do a ps -ae, i don't see process associated with TOMCAT/. I also don't see httpd on web-page when i click admin manager or manager i get error 404 or 405 please help. -- View this message in context: http://www.nabble.com/TOMCAT-1.4-tf2903356.html#a8111813 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: Peak load of Tomcat-powered server(s)?
Martin, For the concept No 2, I dont understand why the user defined in tomcat-users.xml will matter to number of connection or maxThreads? Can you explain more? Thanks! Li On 12/25/06, Martin Gainty [EMAIL PROTECTED] wrote: Tim makes a very good point to make this distinction clearer there are 2 distinct concepts which we need to have clear understanding 1)there may be thousands of of (browser users) connecting in (on unix as the nobody account) to a tomcat server 2)number of users which are configured under $TOMCAT_HOME/conf/tomcat- users.xml which would be configured as something like user username=tomcat password=tomcat roles=tomcat/ in the latter case the number of users would be confined to number of maxThreads for the connector used On a side note It is a welcome respite to hear from courteous and polite professionals..if only for one day! Martin-- --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: Tim Funk [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, December 25, 2006 9:47 AM Subject: Re: Peak load of Tomcat-powered server(s)? Any modern server can easily handle thousands of concurrent users. But that doesn't answer concurrent requests. Which should be 100/sec. But there are 2 major factors - use of HttpSession is light - Using HttpSession for users can kill scalability due to memory constraints. (YMMV) - Amount of work each request takes - images/css will be served very quickly as compared to JSP's or servlets which utilize database connectivity or file access. -Tim Li Ma wrote: Thanks for the suggestions. I agree lots of stuff can only be decided after putting into a specific environment. But still, any number that can be shared? How many concurrent users your Tomcat can serve? Thanks again! Li On 12/24/06, Gary Evesson [EMAIL PROTECTED] wrote: Generally in a production environment, increasing the number of threads from the default is compulsory. You need to balance that against the amount of memory that you have allocated for your JVM, which needs to be balanced against the amount of memory available in the machine. Handling concurrent users generally comes back to the number of connections that your architecture can handle and how much work your database server(s) (assuming you have some) can handle. Our experience has been that these things become an issue before tomcat does. It depends on your application *a lot*. Nothing beats real load testing to figure out where *your* stress points are. They are probably going to be different to other people... Gary -Original Message- From: Li Ma [mailto:[EMAIL PROTECTED] Sent: Sunday, December 24, 2006 12:35 PM To: Tomcat Users List Subject: Re: Peak load of Tomcat-powered server(s)? Actually you can imagine the server serves a site like mySpace where people can access their own home, blog, images, forum, etc. I know it is still not easy to answer, but I'm not looking for an answer to my specific question. I'm just looking for any similiar experience that can be shared and hoping I can learn some. Another question, how many threads do you think Tomcat can have on one machine? And will increasing number of threads help processing more requests? I think 100-150 per server per second is not a good number. But if it is true, does that mean Tomcat is not suitable for large website? And what does commercial products like WebLogic can normally do? Well, lots of question at my end. Thanks for sharing of your idea. Any thing will help. Best! Li On 12/24/06, Leon Rosenberg [EMAIL PROTECTED] wrote: The question is impossible to answer, since you don't tell us what a user will do :-) However, to give you an example, if your requests are somewhat normal-web-requests (producing html) than going for 100-150 per second and server should be a reasonable value. regards Leon P.S. Of course it depends hardly on your use-cases... for example your apache in front of tomcat could reduce the performance by 10% without giving you anything in exchange. On 12
Re: Peak load of Tomcat-powered server(s)?
Thank you all for all the answers and suggestions. Here're what I have got so far from you guys: 1. There's no way to tell a number, because there're too may factors that will definitely influence my mileage. Hehehe, I have expected this number. So I especially appreciate those who did put some numbers in their reply. 2. I need to do load test to know how far I can go. Yes, I think I will. Anyway, thank you, everybody, for your nice answers so far, especially in a holiday period. Now comes other questions I want to ask: 1. I was told Tomcat can only run max 3 nodes in cluster smoothly. What's your milage? 2. This is not related to Tomcat, but if a site has N registered users, what is the average percentage of concurrent user should I expect? I ask this because my client wants 1million registered users. But he wants me to support 20% concurrent users, which I believe is way impossible! But I need to have some number to give him the right sense. This is also important for me to setup the target. Thanks again! Li On 12/26/06, Christopher Schultz [EMAIL PROTECTED] wrote: Li Ma wrote: Actually you can imagine the server serves a site like mySpace where people can access their own home, blog, images, forum, etc. It's always different. If your disk array is different from someone else's, the answer will be different. If you are using 100baseT instead of gigabit, the answer will be different. If you have different speed memory, or better or slower motherboards, the answer will be different. What you really have to do is load test the environment. There is simply no substitute for load testing on equipment and deployment layout exactly matching your production environment. If you don't do this, you will fail. Another question, how many threads do you think Tomcat can have on one machine? That depends on the number and type of CPUs (x86 is not very specific), the amount of memory, and how much work each thread is doing. For instance, you can create tons of threads that never get used, and it will only hurt your memory usage (but will be totally worthless). If you enable 500 threads, but only use 100 of them, is it worth having 500? Probably not. And will increasing number of threads help processing more requests? I think 100-150 per server per second is not a good number. No. Your servers will be bounded by a performance number that can only be determined empirically, given target (peak) load and observations from production. But if it is true, does that mean Tomcat is not suitable for large website? And what does commercial products like WebLogic can normally do? Wow. Haven't we just gone over the is TC okay for big website use? question? Short answer: yes, TC will do just fine. Long answer: any dumbass can make anything go slow. A better question (for yourself) would be how much load do I need to handle? Do you have any target performance stats? How about a sense of the cost of the average request (usually measured in weighted database operations; SELECT is faster than INSERT or UPDATE, for instance)? Do you do any heavy operations such as XSLT? How about any other network operations such as RMI or anything like that? If you can get away with a one-box wonder, DO IT -- at least to start. It's the fastest solution per rack unit that can really achieve. Once you have performance targets, you can start to load test your setup. If you can meet your targets, you are done. Otherwise, start buying more hardware and scaling your app both horizontally (more app servers) and vertically (more physical tiers). Another course of action is to try to trim your app a bit if you are /almost/ hitting your targets. If it's a matter of a couple of % off of your target, then you might be able to make it up by streamlining an algorithm, optimizing your SQL queries, or adding an index or something to your tables. Often, Java and/or your app isn't the problem... it's your (poorly designed/configured/maintained) database. Good luck with ... all that. -chris -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com
Peak load of Tomcat-powered server(s)?
I need to setup for a client to run a myspace-like site. My client kept asking me how many concurrent user's I can support. I really don't know the answer. We will use Apache, jk_mod, Tomcat and Oracle(clustered). We will use X86 servers with Linux. Can anyone share your experience and let me know the best load you have achieved? Thanks a lot and Merry Christmas! -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com
Re: Peak load of Tomcat-powered server(s)?
Thanks for the suggestions. I agree lots of stuff can only be decided after putting into a specific environment. But still, any number that can be shared? How many concurrent users your Tomcat can serve? Thanks again! Li On 12/24/06, Gary Evesson [EMAIL PROTECTED] wrote: Generally in a production environment, increasing the number of threads from the default is compulsory. You need to balance that against the amount of memory that you have allocated for your JVM, which needs to be balanced against the amount of memory available in the machine. Handling concurrent users generally comes back to the number of connections that your architecture can handle and how much work your database server(s) (assuming you have some) can handle. Our experience has been that these things become an issue before tomcat does. It depends on your application *a lot*. Nothing beats real load testing to figure out where *your* stress points are. They are probably going to be different to other people... Gary -Original Message- From: Li Ma [mailto:[EMAIL PROTECTED] Sent: Sunday, December 24, 2006 12:35 PM To: Tomcat Users List Subject: Re: Peak load of Tomcat-powered server(s)? Actually you can imagine the server serves a site like mySpace where people can access their own home, blog, images, forum, etc. I know it is still not easy to answer, but I'm not looking for an answer to my specific question. I'm just looking for any similiar experience that can be shared and hoping I can learn some. Another question, how many threads do you think Tomcat can have on one machine? And will increasing number of threads help processing more requests? I think 100-150 per server per second is not a good number. But if it is true, does that mean Tomcat is not suitable for large website? And what does commercial products like WebLogic can normally do? Well, lots of question at my end. Thanks for sharing of your idea. Any thing will help. Best! Li On 12/24/06, Leon Rosenberg [EMAIL PROTECTED] wrote: The question is impossible to answer, since you don't tell us what a user will do :-) However, to give you an example, if your requests are somewhat normal-web-requests (producing html) than going for 100-150 per second and server should be a reasonable value. regards Leon P.S. Of course it depends hardly on your use-cases... for example your apache in front of tomcat could reduce the performance by 10% without giving you anything in exchange. On 12/24/06, Li Ma [EMAIL PROTECTED] wrote: I need to setup for a client to run a myspace-like site. My client kept asking me how many concurrent user's I can support. I really don't know the answer. We will use Apache, jk_mod, Tomcat and Oracle(clustered). We will use X86 servers with Linux. Can anyone share your experience and let me know the best load you have achieved? Thanks a lot and Merry Christmas! -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Li Ma [EMAIL PROTECTED] http://www.idealtechs.com
Re: Tomcat 5.0.28 installed under LINUX - access to file system limited to tomcat user
You dont have to become group member or owner to read. For secure reason, normally we create a group, only owner can write and execute for example, and only group member can read. If your reading access related to JDK or tomcat classpath etc. You have to create secure policy file and start tomcat in secure mode. Wish it helps Li On 12/7/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Dear Martin, Indeed, they are. Thank you Ekkehard -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Thursday, December 07, 2006 3:21 PM To: Tomcat Users List Subject: Re: Tomcat 5.0.28 installed under LINUX - access to file system limited to tomcat user Ekkehard A quick clarification please..Are any of these directories sym-linked? M- --- This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited. --- Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements dentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire. - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, December 07, 2006 7:47 AM Subject: Tomcat 5.0.28 installed under LINUX - access to file system limited to tomcat user Hello I have an installation of tomcat version 5.0.28 where tomcat runs under a user tomact on LINUX. My jsp application should read files from a directory. Read access to directory and files is limited to group sdf and file owner asd: drwxrws--- 17 asd sdf data that contains the file -rwxrwx--- asd sdf input.txt The directory is owned by a different user than tomcat. However, user tomcat is a member of the group (sdf in the example) that owns the target directory. At LINUX level as user tomcat I have access to the file. For security reasons I cannot give read access to everybody. With this set up of user rights my application cannot access the file. If I create a group tomcat and if I change owner and/or group of the directory and file to tomcat then the read access works. Is this an error in my jsp application or could I configure tomcat that it would also read files without being the owner of files or the group? Thank you very much for your help Ekkehard -- When we invent time, we invent death.
Re: Getting a webapp to run on tomcat 4.1
Can you post more detailed log info? On 11/30/06, ying lcs [EMAIL PROTECTED] wrote: Thanks. Can you please tell me which tag lib that i am using causing problem when i try to run in under Tomcat 4.x? From the exception that I see, it does not say which tag lib is causing the problem. On 11/29/06, Mark Thomas [EMAIL PROTECTED] wrote: ying lcs wrote: Hi, I have a web app runs fine on tomcat 5.0. And i am trying to see if it can run on tomcat 4.1. Tomcat 5.x and Tomcat 4.x implement different versions of the spec (see http://tomcat.apache.org/index.html). You need to use JSTL 1.0 compliant tag libs on Tomcat 4.x. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: Can't start tomcat on Debian Linux
Hi, if there are quite a few dependencies with gjc, a simple way to ignore gjc is renaming gjc's javac and java to .. say gjc-java and gjc-javac. Then you can have sun's java compiler working. On 11/11/06, Stepan Yakovenko [EMAIL PROTECTED] wrote: Hassan, you are right. I have two java's. I will remove both and reinstall SUN's to be on the safe side. Stepan. Hassan Schroeder пишет: On 11/10/06, Stepan Yakovenko [EMAIL PROTECTED] wrote: what does java -version print? [EMAIL PROTECTED]:~$ java -version java version 1.4.2 gij (GNU libgcj) version 4.1.2 20061020 (prerelease) (Debian 4.1.1-17) clearly, the Java you think you installed is, at the least, not in your path. What happens with /usr/java/jdk1.5.0_04/bin/java -version I've used .rpm distrib from sun web cite and alien tool to convert it to .deb. Personally I'd uninstall /whatever/ that thing is, and install directly from the Sun .bin version. :-) - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: Please Help!Tomcat Not Running on Linux Fedora
add JAVA_HOME to your .bash_profile and export it ... On 11/1/06, Teh Noranis Mohd Aris [EMAIL PROTECTED] wrote: Dear All, I'm very new to Linux Fedora and not quite familiar to the commands. I'm using Fedora Core 2.6.9-1.667. I've already installed j2sdk1.4.2_10 and jakarta-tomcat-4.1.31 on my computer. Unfortunately, when I tried to execute Tomcat in the bin directory by typing ./startup.sh the following message appeared: The JAVA_HOME environment variable is not defined This environment variable is needed to run this program I've used the vi .bash_profile command to set the PATH, JAVA_HOME and CATALINA_HOME as follows: # .bash_profile . . . PATH=$PATH:$HOME/bin;/j2sdk1.4.2_10/bin;/jakarta-tomcat-4.1.31 /common/lib/servlet.jar JAVA_HOME=/j2sdk1.4.2_10 CATALINA_HOME=/jakarta-tomcat-4.1.31 . . . I tried to run a java program using javac and it worked, though I'm not sure how to modify the system PATH variable. I tried to type echo $PATH but did not find the system PATH variable. Are my steps correct? Did I miss anything? Can anyone please explain to me in the most simple way how to solve the problem? To those who have already made Tomcat run on Linux Fedora, please help me! Waiting to hear from you soon. Thank you. Yours Sincerely, TEH - Access over 1 million songs - Yahoo! Music Unlimited Try it today. -- When we invent time, we invent death.
Re: Please Help!Tomcat Not Running on Linux Fedora
PATH=$PATH;$JAVA_HOME/bin;. On 11/1/06, Teh Noranis Mohd Aris [EMAIL PROTECTED] wrote: Dear All, I'm very new to Linux Fedora and not quite familiar to the commands. I'm using Fedora Core 2.6.9-1.667. I've already installed j2sdk1.4.2_10 and jakarta-tomcat-4.1.31 on my computer. Unfortunately, when I tried to execute Tomcat in the bin directory by typing ./startup.sh the following message appeared: The JAVA_HOME environment variable is not defined This environment variable is needed to run this program I've used the vi .bash_profile command to set the PATH, JAVA_HOME and CATALINA_HOME as follows: # .bash_profile . . . PATH=$PATH:$HOME/bin;/j2sdk1.4.2_10/bin;/jakarta-tomcat-4.1.31 /common/lib/servlet.jar JAVA_HOME=/j2sdk1.4.2_10 CATALINA_HOME=/jakarta-tomcat-4.1.31 . . . I tried to run a java program using javac and it worked, though I'm not sure how to modify the system PATH variable. I tried to type echo $PATH but did not find the system PATH variable. Are my steps correct? Did I miss anything? Can anyone please explain to me in the most simple way how to solve the problem? To those who have already made Tomcat run on Linux Fedora, please help me! Waiting to hear from you soon. Thank you. Yours Sincerely, TEH - Access over 1 million songs - Yahoo! Music Unlimited Try it today. -- When we invent time, we invent death.
Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern?
what you defined is correct ... a simpler way is using default setting Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=your-site-access-log- suffix=.log pattern=common resolveHosts=false/ the result should be (if you are testing from same host) 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] GET /site/ HTTP/1.1 200 306 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] GET /site/Welcome.do HTTP/1.1 200 1775 (if your user testing from remote host) 202.110.6.23 - - [18/Oct/2006:19:03:44 +0800] GET /site/Welcome.do HTTP/1.1 200 8893 ... On 10/30/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: Hello, My site is hosted on Tomcat 5.5 and I'm trying to log the IP Address of search engine bots that crawl the site. After reading the following documentation here, which is written very nicely btw http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html I configured the pattern attribute of AccessLogValve as follows: Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%a %A %h %H %u %t %r %s %b %{Referer}i %{User-Agent}i prefix=localhost_access_log. resolveHosts=false suffix=.txt / The following is a sample of what gets logged with the above configuration in server.xml . 127.0.0.1 68.120.115.43 127.0.0.1 HTTP/1.1 - [29/Oct/2006:23:50:13 -0800] GET /web/_stylesheet/table.css HTTP/1.1 304 - http://www.website.com/c/a_page.jsp; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 The documentation says that %a is Remote IP Address, however 127.0.0.1 is being logged instead of the IP Address of the requestor. Is this correct? IMO %a should be the IP Address of the agent that's making the request - ( i.e. the IP Address of a browser or a bot etc). Please let me know if there's a way to log IP Address of the agent that's making the request. Any help is appreciated. -Thank you Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern?
Hi Rashmi, if there is problem with retrieving correct remote IP address, log4j will not solve problem ... it seems like this: remote user ---(send request) --- your proxy (or maybe you use some connector or forwardor) tomcat if 127.0.0.1, seems your connector or forwardoer is located in the same host as your tomcat sharing same IP address or hostname if not 127.0.0.1, seems the request comes from proxy On 10/30/06, Pid [EMAIL PROTECTED] wrote: Do you have a local proxy between the tomcat instance and the requestor? Rashmi Rubdi wrote: Li, Thanks for the reply. As indicated in your illustration, in your case the remote IP address (IP of the client browser) is correctly displaying. But in my case, for some reason even when my website is accessed remotely it always shows local IP Address (the website's IP address) and not the remote IP address. In other words %a %A %h is translating *always* to 127.0.0.1 68.120.115.43 127.0.0.1 Where 68.120.115.43 is the IP address of the website host and not the client (remote host). The website is hosted on a Tomcat 5.5 which is configured as a virtual host. I wonder if the virtual host setting might be the cause for not logging the actual remote IP address. If I can't get Access Log Valve to log the remote IP address then I might have to try it with Log4J with Commons Logging to log the remote IP address I guess. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 3:25:38 AM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? what you defined is correct ... a simpler way is using default setting Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=your-site-access-log- suffix=.log pattern=common resolveHosts=false/ the result should be (if you are testing from same host) 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] GET /site/ HTTP/1.1 200 306 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] GET /site/Welcome.do HTTP/1.1 200 1775 (if your user testing from remote host) 202.110.6.23 - - [18/Oct/2006:19:03:44 +0800] GET /site/Welcome.do HTTP/1.1 200 8893 ... On 10/30/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: Hello, My site is hosted on Tomcat 5.5 and I'm trying to log the IP Address of search engine bots that crawl the site. After reading the following documentation here, which is written very nicely btw http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html I configured the pattern attribute of AccessLogValve as follows: Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%a %A %h %H %u %t %r %s %b %{Referer}i %{User-Agent}i prefix=localhost_access_log. resolveHosts=false suffix=.txt / The following is a sample of what gets logged with the above configuration in server.xml . 127.0.0.1 68.120.115.43 127.0.0.1 HTTP/1.1 - [29/Oct/2006:23:50:13 -0800] GET /web/_stylesheet/table.css HTTP/1.1 304 - http://www.website.com/c/a_page.jsp;; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Firefox/1.5.0.7 The documentation says that %a is Remote IP Address, however 127.0.0.1is being logged instead of the IP Address of the requestor. Is this correct? IMO %a should be the IP Address of the agent that's making the request - ( i.e. the IP Address of a browser or a bot etc). Please let me know if there's a way to log IP Address of the agent that's making the request. Any help is appreciated. -Thank you Rashmi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When we invent time, we invent death.
Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern?
Hi Rashmi, You can creater your own log handler and pack it as jar and put it under tomcat lib dir, modify the loggin.properties file to have your handler work. Also, you can create your own request processor or intercepter to retrieve source ip from header and pass to logger. Regards On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: I think my web site is behind a proxy, I was told that request.getHeader(x-forwarded-for) should work instead of request.getRemoteAddr() , and it does work when I try it. The site correctly shows the remote client's IP Address. I guess there's no pattern element in Access Log Valve for capturing the x-forwarded-for. I might have to log it with Log4J. Sincerely -Rashmi - Forwarded Message From: Rashmi Rubdi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 5:03:44 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Li and Pid, Thanks again for your replies. You are right, I also tried printing request.getRemoteAddr() in a JSP, and it always lists 127.0.0.1 As you have suggested my site could be behind a proxy, but I don't know this for sure. I've asked the host provider if this is the case and waiting for a reply. I also use Javascript based logging but that only logs requests coming from a browser and correctly logs the IP address of the requestor however, it does not log search engine bots I guess because bots disable Javascript or can't work with Javascript. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org; [EMAIL PROTECTED] Sent: Monday, October 30, 2006 8:39:12 AM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, if there is problem with retrieving correct remote IP address, log4j will not solve problem ... it seems like this: remote user ---(send request) --- your proxy (or maybe you use some connector or forwardor) tomcat if 127.0.0.1, seems your connector or forwardoer is located in the same host as your tomcat sharing same IP address or hostname if not 127.0.0.1, seems the request comes from proxy On 10/30/06, Pid [EMAIL PROTECTED] wrote: Do you have a local proxy between the tomcat instance and the requestor? Rashmi Rubdi wrote: Li, Thanks for the reply. As indicated in your illustration, in your case the remote IP address (IP of the client browser) is correctly displaying. But in my case, for some reason even when my website is accessed remotely it always shows local IP Address (the website's IP address) and not the remote IP address. In other words %a %A %h is translating *always* to 127.0.0.1 68.120.115.43 127.0.0.1 Where 68.120.115.43 is the IP address of the website host and not the client (remote host). The website is hosted on a Tomcat 5.5 which is configured as a virtual host. I wonder if the virtual host setting might be the cause for not logging the actual remote IP address. If I can't get Access Log Valve to log the remote IP address then I might have to try it with Log4J with Commons Logging to log the remote IP address I guess. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 3:25:38 AM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? what you defined is correct ... a simpler way is using default setting Valve className=org.apache.catalina.valves.AccessLogValve directory=logs prefix=your-site-access-log- suffix=.log pattern=common resolveHosts=false/ the result should be (if you are testing from same host) 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] GET /site/ HTTP/1.1 200 306 127.0.0.1 - - [18/Oct/2006:18:54:48 +0800] GET /site/Welcome.do HTTP/1.1 200 1775 (if your user testing from remote host) 202.110.6.23 - - [18/Oct/2006:19:03:44 +0800] GET /site/Welcome.do HTTP/1.1 200 8893 ... On 10/30/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: Hello, My site is hosted on Tomcat 5.5 and I'm trying to log the IP Address of search engine bots that crawl the site. After reading the following documentation here, which is written very nicely btw http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html http://tomcat.apache.org/tomcat-5.5-doc/catalina/docs/api/org/apache/catalina/valves/AccessLogValve.html I configured the pattern attribute of AccessLogValve as follows: Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%a %A %h %H %u %t %r %s %b %{Referer}i %{User-Agent}i prefix=localhost_access_log. resolveHosts=false suffix=.txt / The following is a sample of what gets logged
Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern?
Hi Rashmi, Thank you for sharing. Have a nice day. Li On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: Hi Li, I'm sorry I should have re-referenced the AccessLogValve documentation earlier. I can still get this to work with the AccessLogValve custom pattern itself by adding the request header in this pattern element %{xxx}i , where xxx is the request header. The following also worked, as shown below: Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%{x-forwarded-for}i; %H %u %t %r %s %b %{Referer}i %{User-Agent}i prefix=localhost_access_log. resolveHosts=false suffix=.txt / May be this kind of setup will slow down the performance of the site, but I'll probably disable the logging after getting an initial sample of search engine bots. Thanks for your suggestions and help, I will keep those in mind. I still need to learn Log4J and logging in general. But for now, this setup is sufficient. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 9:20:50 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, You can creater your own log handler and pack it as jar and put it under tomcat lib dir, modify the loggin.properties file to have your handler work. Also, you can create your own request processor or intercepter to retrieve source ip from header and pass to logger. Regards On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: I think my web site is behind a proxy, I was told that request.getHeader(x-forwarded-for) should work instead of request.getRemoteAddr() , and it does work when I try it. The site correctly shows the remote client's IP Address. I guess there's no pattern element in Access Log Valve for capturing the x-forwarded-for. I might have to log it with Log4J. Sincerely -Rashmi - Forwarded Message From: Rashmi Rubdi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 5:03:44 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Li and Pid, Thanks again for your replies. You are right, I also tried printing request.getRemoteAddr() in a JSP, and it always lists 127.0.0.1 As you have suggested my site could be behind a proxy, but I don't know this for sure. I've asked the host provider if this is the case and waiting for a reply. I also use Javascript based logging but that only logs requests coming from a browser and correctly logs the IP address of the requestor however, it does not log search engine bots I guess because bots disable Javascript or can't work with Javascript. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org; [EMAIL PROTECTED] Sent: Monday, October 30, 2006 8:39:12 AM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, if there is problem with retrieving correct remote IP address, log4j will not solve problem ... it seems like this: remote user ---(send request) --- your proxy (or maybe you use some connector or forwardor) tomcat if 127.0.0.1, seems your connector or forwardoer is located in the same host as your tomcat sharing same IP address or hostname if not 127.0.0.1, seems the request comes from proxy On 10/30/06, Pid [EMAIL PROTECTED] wrote: Do you have a local proxy between the tomcat instance and the requestor? Rashmi Rubdi wrote: Li, Thanks for the reply. As indicated in your illustration, in your case the remote IP address (IP of the client browser) is correctly displaying. But in my case, for some reason even when my website is accessed remotely it always shows local IP Address (the website's IP address) and not the remote IP address. In other words %a %A %h is translating *always* to 127.0.0.1 68.120.115.43 127.0.0.1 Where 68.120.115.43 is the IP address of the website host and not the client (remote host). The website is hosted on a Tomcat 5.5 which is configured as a virtual host. I wonder if the virtual host setting might be the cause for not logging the actual remote IP address. If I can't get Access Log Valve to log the remote IP address then I might have to try it with Log4J with Commons Logging to log the remote IP address I guess. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 3:25:38 AM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? what you defined is correct ... a simpler way is using default setting Valve className= org.apache.catalina.valves.AccessLogValve
Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern?
Hi Rashmi, What you use is ok, but it wont work for every case, in case of no proxy used, %{x-forwarded-for}i; may not work ... Regards On 10/31/06, Li [EMAIL PROTECTED] wrote: Hi Rashmi, Thank you for sharing. Have a nice day. Li On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: Hi Li, I'm sorry I should have re-referenced the AccessLogValve documentation earlier. I can still get this to work with the AccessLogValve custom pattern itself by adding the request header in this pattern element %{xxx}i , where xxx is the request header. The following also worked, as shown below: Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%{x-forwarded-for}i; %H %u %t %r %s %b %{Referer}i %{User-Agent}i prefix=localhost_access_log. resolveHosts=false suffix=.txt / May be this kind of setup will slow down the performance of the site, but I'll probably disable the logging after getting an initial sample of search engine bots. Thanks for your suggestions and help, I will keep those in mind. I still need to learn Log4J and logging in general. But for now, this setup is sufficient. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 9:20:50 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, You can creater your own log handler and pack it as jar and put it under tomcat lib dir, modify the loggin.properties file to have your handler work. Also, you can create your own request processor or intercepter to retrieve source ip from header and pass to logger. Regards On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: I think my web site is behind a proxy, I was told that request.getHeader(x-forwarded-for) should work instead of request.getRemoteAddr() , and it does work when I try it. The site correctly shows the remote client's IP Address. I guess there's no pattern element in Access Log Valve for capturing the x-forwarded-for. I might have to log it with Log4J. Sincerely -Rashmi - Forwarded Message From: Rashmi Rubdi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 5:03:44 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Li and Pid, Thanks again for your replies. You are right, I also tried printing request.getRemoteAddr() in a JSP, and it always lists 127.0.0.1 As you have suggested my site could be behind a proxy, but I don't know this for sure. I've asked the host provider if this is the case and waiting for a reply. I also use Javascript based logging but that only logs requests coming from a browser and correctly logs the IP address of the requestor however, it does not log search engine bots I guess because bots disable Javascript or can't work with Javascript. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org; [EMAIL PROTECTED] Sent: Monday, October 30, 2006 8:39:12 AM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, if there is problem with retrieving correct remote IP address, log4j will not solve problem ... it seems like this: remote user ---(send request) --- your proxy (or maybe you use some connector or forwardor) tomcat if 127.0.0.1, seems your connector or forwardoer is located in the same host as your tomcat sharing same IP address or hostname if not 127.0.0.1, seems the request comes from proxy On 10/30/06, Pid [EMAIL PROTECTED] wrote: Do you have a local proxy between the tomcat instance and the requestor? Rashmi Rubdi wrote: Li, Thanks for the reply. As indicated in your illustration, in your case the remote IP address (IP of the client browser) is correctly displaying. But in my case, for some reason even when my website is accessed remotely it always shows local IP Address (the website's IP address) and not the remote IP address. In other words %a %A %h is translating *always* to 127.0.0.1 68.120.115.43 127.0.0.1 Where 68.120.115.43 is the IP address of the website host and not the client (remote host). The website is hosted on a Tomcat 5.5 which is configured as a virtual host. I wonder if the virtual host setting might be the cause for not logging the actual remote IP address. If I can't get Access Log Valve to log the remote IP address then I might have to try it with Log4J with Commons Logging to log the remote IP address I guess. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat
Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern?
Hi, I am using my own log handler which is application server independent. the pattern you use for dealing with proxy is ok, in some case, we try to find an approach to be adaptive for both cases that with or without proxy. It's good to hear that you solve your problem. Li On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: Hi Li, In my case my *website* itself is behind a proxy, that's why no matter who (remote or local) made the request it always shows the local IP 127.0.0.1, I have no choice but to use the x-forwarded-for header. As long as the site is behind a proxy I'll have to settle with x-forwarded-for . If my host provider removes the proxy then only I can use %a and %h. But in your case your *website* is not behind a proxy, that's why %{x-forwarded-for}i doesn't work for you , I think. So in your case simply using %a and/or %h is sufficient. I think %{x-forwarded-for}i could also be used to capture the IP Address of a *client* that's behind a proxy, but I haven't tested this. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 11:23:34 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, What you use is ok, but it wont work for every case, in case of no proxy used, %{x-forwarded-for}i; may not work ... Regards On 10/31/06, Li [EMAIL PROTECTED] wrote: Hi Rashmi, Thank you for sharing. Have a nice day. Li On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: Hi Li, I'm sorry I should have re-referenced the AccessLogValve documentation earlier. I can still get this to work with the AccessLogValve custom pattern itself by adding the request header in this pattern element %{xxx}i , where xxx is the request header. The following also worked, as shown below: Valve className=org.apache.catalina.valves.AccessLogValve directory=logs pattern=%{x-forwarded-for}i; %H %u %t %r %s %b %{Referer}i %{User-Agent}i prefix=localhost_access_log. resolveHosts=false suffix=.txt / May be this kind of setup will slow down the performance of the site, but I'll probably disable the logging after getting an initial sample of search engine bots. Thanks for your suggestions and help, I will keep those in mind. I still need to learn Log4J and logging in general. But for now, this setup is sufficient. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 9:20:50 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, You can creater your own log handler and pack it as jar and put it under tomcat lib dir, modify the loggin.properties file to have your handler work. Also, you can create your own request processor or intercepter to retrieve source ip from header and pass to logger. Regards On 10/31/06, Rashmi Rubdi [EMAIL PROTECTED] wrote: I think my web site is behind a proxy, I was told that request.getHeader(x-forwarded-for) should work instead of request.getRemoteAddr() , and it does work when I try it. The site correctly shows the remote client's IP Address. I guess there's no pattern element in Access Log Valve for capturing the x-forwarded-for. I might have to log it with Log4J. Sincerely -Rashmi - Forwarded Message From: Rashmi Rubdi [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, October 30, 2006 5:03:44 PM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Li and Pid, Thanks again for your replies. You are right, I also tried printing request.getRemoteAddr() in a JSP, and it always lists 127.0.0.1 As you have suggested my site could be behind a proxy, but I don't know this for sure. I've asked the host provider if this is the case and waiting for a reply. I also use Javascript based logging but that only logs requests coming from a browser and correctly logs the IP address of the requestor however, it does not log search engine bots I guess because bots disable Javascript or can't work with Javascript. -Regards Rashmi - Original Message From: Li [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org; [EMAIL PROTECTED] Sent: Monday, October 30, 2006 8:39:12 AM Subject: Re: Is it possible to log IP Address of requestor with custom AccessLogValve pattern? Hi Rashmi, if there is problem with retrieving correct remote IP address, log4j will not solve problem ... it seems like this: remote user ---(send request) --- your proxy (or maybe you use some connector or forwardor) tomcat
Re: Hi
check log message ... On 10/27/06, adeyemi adesina [EMAIL PROTECTED] wrote: Hello Users, I got an error message The page cannot be found. when I tried to access the 'Tomcat Manager' page by Clicking Start-All Programs- Apache Tomacat 5.5- 'Tomcat Manager' on Windows XP. I have accessed the 'Tomcat Manager' page several times before, but I am having a problem accessing it now. Could someone tell me what to do to resolve this error message. An early response will be appreciated. Kind Regards, 'Yemi. -- When we invent time, we invent death.
RE: What would you do with field defect rate predictions?
Thank you very much for your response. By field defect I mean a bug in the Bug Database. I was wondering if you think predictions at the time of release of the number of field defects in each month after release can help: -allocate resources, such as having enough people available to fix problems -adjust the deployment date, like pushing back the release, or -identify possible ways of improving the process, assuming that the predictions are made using software metrics, such as the number of changes to the code Thanks Paul -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 24, 2006 9:38 AM To: Tomcat Users List Subject: Re: What would you do with field defect rate predictions? Good Morning Paul- from what I see I would interpret a greater initial defect rate with open source offerings vs commercial (OS) but the attenuation over time brings the OpenSource defect rates almost equivalent to their commercial counterpart(s) Is this correct? BTW: This is a great tool to have to understand in a visual sense what happens with defects of commercial offerings vs OpenSource counterpart over time Thanks, Martin -- This e-mail communication and any attachments may contain confidential and privileged information for the use of the designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents - Original Message - From: Paul Luo Li [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, October 23, 2006 9:39 PM Subject: What would you do with field defect rate predictions? Hi I have been examining Tomcat bugs and have been looking for ways of predicting the field defect rate, that is, predicting at the time of release the number of field defects in each time interval after the release. I am brainstorming possible applications for this research. I was wondering what you all think Tomcat can do (or do better) if it had field defect rate predictions. Your input would really give my research a reality check. Thank you very much for your time. Paul Li P.S. I did some preliminary modeling for Tomcat using achieved data: http://www.cs.cmu.edu/~paulluo/Papers/p178-Li.pdf Paul Luo Li, [EMAIL PROTECTED] www.cs.cmu.edu/~paulluo B.S. Mathematics, University of Virginia 2001. Ph.D Student Software Engineering, Carnegie Mellon University, 2001- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What would you do with field defect rate predictions?
Hi I have been examining Tomcat bugs and have been looking for ways of predicting the field defect rate, that is, predicting at the time of release the number of field defects in each time interval after the release. I am brainstorming possible applications for this research. I was wondering what you all think Tomcat can do (or do better) if it had field defect rate predictions. Your input would really give my research a reality check. Thank you very much for your time. Paul Li P.S. I did some preliminary modeling for Tomcat using achieved data: http://www.cs.cmu.edu/~paulluo/Papers/p178-Li.pdf Paul Luo Li, [EMAIL PROTECTED] www.cs.cmu.edu/~paulluo B.S. Mathematics, University of Virginia 2001. Ph.D Student Software Engineering, Carnegie Mellon University, 2001- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem Deploying an Application
Hi, Try to re-install tomcat ... wish it works Li On 10/20/06, Marco Aurélio S. Silva [EMAIL PROTECTED] wrote: Hi, I discover some thing new about the problem... This application is using a jar file that have the ServletContextListener, and it's used by the web application, til monday this was working ok, and still working on my PC and in other servers, but one of them is given the problem When I use the class implementing ServletContextListener in the web application it works OK, but when I use the class that implements ServletContextListener in the JAR file, I got the stack that I sent... It's correct what I'm doing??? I do this becuse I have two application that use the same ServletContextListener Thanks, -- Marco Aurélio S. Silva [EMAIL PROTECTED] 2006/10/19, Marco Aurélio S. Silva [EMAIL PROTECTED]: Hi Li, I checked and the javax/servlet/http/HttpServletRequest is in the jar, I had try to change the jar and nothing happens... I write a simple test page and everything run correctly... I use the same war file in other server, and it deploys and run, only on this server I'm having problem I try to deploy the probe application and the same problem occurs.. Thanks, -- Marco Aurélio S. Silva [EMAIL PROTECTED] 2006/10/19, Li [EMAIL PROTECTED]: If so, I dont see any problem for your tomcat since some webapp can be deployed without any problem. Can you check: 1. there is javax/servlet/http/HttpServletRequest in your servlet jar (under common), do not place it in your WEB-INF/lib 2. you can write a very simple test page as home page for the webapp you r going to deploy, see if there is any problem wish it helps, good luck On 10/19/06, Marco Aurélio S. Silva [EMAIL PROTECTED] wrote: The both are ok! I have some applications running well and some give me this problem 2006/10/19, Li [EMAIL PROTECTED]: It looks like servlet jar can not be found, if your class path setting is ok, make sure the permission is ok On 10/19/06, Marco Aurélio S. Silva [EMAIL PROTECTED] wrote: Hi folks, I'm trying to deploy an application on my Tomcat 5.5.9 under a Windows 2003 Server with JVM 1.5.0_04, and get the following stack error: 19/Out/2006 11:02:13 org.apache.catalina.core.StandardWrapperValveinvoke SEVERE: Servlet.service() for servlet HTMLManager threw exception java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest at org.apache.commons.fileupload.servlet.ServletRequestContext.getContentType ( ServletRequestContext.java:72) at org.apache.commons.fileupload.FileUploadBase.parseRequest ( FileUploadBase.java:290) at org.apache.commons.fileupload.FileUploadBase.parseRequest( FileUploadBase.java:268) at org.apache.catalina.manager.HTMLManagerServlet.doPost ( HTMLManagerServlet.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter( ApplicationFilterChain.java :173) at org.apache.catalina.core.StandardWrapperValve.invoke( StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke( StandardContextValve.java:178) at org.apache.catalina.authenticator.AuthenticatorBase.invoke( AuthenticatorBase.java:482) at org.apache.catalina.core.StandardHostValve.invoke ( StandardHostValve.java :126) at org.apache.catalina.valves.ErrorReportValve.invoke( ErrorReportValve.java :105) at org.apache.catalina.core.StandardEngineValve.invoke( StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service( CoyoteAdapter.java :148) at org.apache.coyote.http11.Http11Processor.process( Http11Processor.java :856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection (Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket( PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt ( LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run ( ThreadPool.java:684) at java.lang.Thread.run(Unknown Source) I was looking for how to solve it, and find that it seems to be a problem on the ClassLoader, and only a new installation of the Tomcat solve it! Is that true or there is another way to solve it? I checked the servlet-api.jar and it's ok! Thanks, -- Marco Aurélio S. Silva [EMAIL PROTECTED