Java null on loadup
i'd appreciate some help here people bacuase this is driving me nuts when my host setup an account and i deploy everything works great even afetr i change tomcat-users.xml and other files everything works swell. but when i touch server.xml and add this block which is supposed to default direct to my site which only holds one ware everything goes nuts : www.mydomain.com cataline.log prints this out : Nov 4, 2007 8:53:11 PM org.apache.catalina.startup.Catalina load INFO | jvm 1| 2007/11/04 20:53:11 | WARNING: Can't load server.xml from /opt/tomcat5/conf/server.xml INFO | jvm 1| 2007/11/04 20:53:11 | Nov 4, 2007 8:53:11 PM org.apache.catalina.startup.Catalina load INFO | jvm 1| 2007/11/04 20:53:11 | WARNING: Can't load server.xml from /opt/tomcat5/conf/server.xml INFO | jvm 1| 2007/11/04 20:53:11 | Nov 4, 2007 8:53:11 PM org.apache.catalina.startup.Catalina start INFO | jvm 1| 2007/11/04 20:53:11 | INFO: Server startup in 0 ms INFO | jvm 1| 2007/11/04 20:53:11 | java.lang.reflect.InvocationTargetException INFO | jvm 1| 2007/11/04 20:53:11 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) INFO | jvm 1| 2007/11/04 20:53:11 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) INFO | jvm 1| 2007/11/04 20:53:11 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) INFO | jvm 1| 2007/11/04 20:53:11 | at java.lang.reflect.Method.invoke(Method.java:585) INFO | jvm 1| 2007/11/04 20:53:11 | at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295) INFO | jvm 1| 2007/11/04 20:53:11 | at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433) INFO | jvm 1| 2007/11/04 20:53:11 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) INFO | jvm 1| 2007/11/04 20:53:11 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) INFO | jvm 1| 2007/11/04 20:53:11 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) INFO | jvm 1| 2007/11/04 20:53:11 | at java.lang.reflect.Method.invoke(Method.java:585) INFO | jvm 1| 2007/11/04 20:53:11 | at org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:238) INFO | jvm 1| 2007/11/04 20:53:11 | at java.lang.Thread.run(Thread.java:595) INFO | jvm 1| 2007/11/04 20:53:11 | Caused by: java.lang.NullPointerException INFO | jvm 1| 2007/11/04 20:53:11 | at org.apache.catalina.startup.Catalina.await(Catalina.java:616) INFO | jvm 1| 2007/11/04 20:53:11 | at org.apache.catalina.startup.Catalina.start (Catalina.java:576) INFO | jvm 1| 2007/11/04 20:53:11 | ... 12 more and that's it tomcat goes dead even if i stop it put the original server.xmlfile and restart it , doesn't matter it keeps spitting this message no mater what i do ??? what is going on here ? many thanks in advance since i've spent 36 hours allredy trying to understand what happens here
Re: Preferred configuration with Hardware Loadbalancer
What do you mean by Apache Webserver? Do you mean Apache Tomcat or Apache httpd? And do you want Failover (active-passive) or Loadbalancing (active-active)? Ronald. Op donderdag, 6 oktober 2011 10:36 schreef Alexander Diedler : Hello, I am just planning a Application cluster for Tomcat. We have a big hardware loadbalancer (Cisco) and three virtual servers. We talked about several configurations, but it is not clear for us, how to build a Tomcat cluster, with Failover and Session-Replication, but without Loadbalancing? E.g. the LB redirect the request to node 1. The Apache Webserver redirects the request to node2. So we have a double load-balancing, what ne would avoid. Best regards Alexander
Re: AW: Preferred configuration with Hardware Loadbalancer
I don't have a crystal ball to look into your setup, but I would remove httpd and set up the LB and Tomcat. Less moving parts, so it is easier to think about. And read this: http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html Ronald. Op donderdag, 6 oktober 2011 12:43 schreef Alexander Diedler : Hello, I mean a frontend Apache httpd and backend Tomcat server. Loadbalancing would be done by a hardware load balancer fronted to the Apache Webserver, so we should not balance the request two times. It should be only a Failovercluster. Best regards Alexander -Ursprüngliche Nachricht- Von: Ronald Klop (Mailing List) [mailto:ronald-mailingl...@base.nl] Gesendet: Donnerstag, 6. Oktober 2011 10:44 An: Tomcat Users List Betreff: Re: Preferred configuration with Hardware Loadbalancer What do you mean by Apache Webserver? Do you mean Apache Tomcat or Apache httpd? And do you want Failover (active-passive) or Loadbalancing (active-active)? Ronald. Op donderdag, 6 oktober 2011 10:36 schreef Alexander Diedler : > > > > > > Hello, > > I am just planning a Application cluster for Tomcat. We have a big hardware loadbalancer (Cisco) and three virtual servers. We talked about several configurations, but it is not clear for us, how to build a Tomcat cluster, with Failover and Session-Replication, but without Loadbalancing? > > E.g. the LB redirect the request to node 1. The Apache Webserver redirects the request to node2. So we have a double load-balancing, what ne would avoid. > > > > Best regards > > Alexander > > > > > > > > >
Re: AW: Securing Tomcat cluster communication
A 'connector' is used between for example Apache httpd and Tomcat. It is not used between Tomcat nodes in a cluster. Ronald. Op donderdag, 6 oktober 2011 16:22 schreef Alexander Diedler : Hello, Please search for "secret" in http://tomcat.apache.org/connectors-doc/reference/workers.html Only requests from members with the same secret word will be acceped. Greetings Alexander -Ursprüngliche Nachricht- Von: Afkham Azeez [mailto:afk...@gmail.com] Gesendet: Donnerstag, 6. Oktober 2011 16:18 An: Tomcat Users List Betreff: Securing Tomcat cluster communication Hi folks, Is there a way to do authentication in Tribes when new members try to join a cluster so that unauthorized nodes cannot join in? Also, when clustering messages are sent back & forth, how do we ensure security? Thanks Azeez
Re: URL "simplification"
Simplified explanation: Apache httpd starts as user root. Binds port 80 and than drops privileges by setuid("apache") or setuid("nobody"). In java you can't easily drop privileges. So if you start as root in Java you can't easily change user. Of course you can call native code to do this. And that is called jsvc. http://commons.apache.org/daemon/jsvc.html BTW: if you are not root on a server, you cannot bind port 80 with httpd also. BTW2: there are all kinds of new ways of assigning privileges in unix since a few years which will make it more easy to say 'user x may bind to port 80'. But I have never seen anybody using it. Ronald. Op maandag, 10 oktober 2011 13:50 schreef Darryl Lewis : Something I've always wondered about, but never figured out, is how does apache run as 'apache user' or 'nobody' and work on a port below 1024, but Tomcat can't? Anyone got a simple explanation? On 10/10/11 9:53 PM, "Mark Thomas" wrote: >On 10/10/2011 09:56, Léa Massiot wrote: >> >> Hello, >> >> Thank you for reading my post. Here is my question: >> >> - Presently, to access my WebApp first page, I have to type in the >>following >> URL in a browser: >> http://hostname-or-ip:8080/my-webapp/ >> - Instead, I wish I could type in a URL such as: >> http://my-webapp/ >> Is it possible? >> How? >> >> And by the way, I don't know what's the name of such an operation. I >>used >> the expression "URL simplification"... >> >> Thank you for pointing me in the right direction! > >There are three parts to this. > >1. Removing /my-webapp/ from the end of the URL > - Deploy your web application as the ROOT web application > Read the docs or search the list archives for the various > ways of doing this. > >2. Removing the port (8080) from the URL > - Configure your HTTP connector to use port 80 rather than 8080 > Port 80 is privileged so you'll need to run as root (bad) or use > a service wrapper (such as jsvc from Commons Daemon) that binds to > port 80 as root and then drops privileges > - Use iptables (or equivalent) to map port 8080 to 80 > >3. Replace hostname-or-ip with my-webapp > - This will require a DNS entry that resolves my-webapp to the IP > address of the machine where Tomcat is running. This is probably > already set up for the machines host name. If you don't want to use > that, you can: > - edit the hosts file on the client (fine for testing) > - talk to your network administrator about adding an appropriate > DNS entry > >Mark > >- >To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >For additional commands, e-mail: users-h...@tomcat.apache.org > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat clustering session attribute is changed without request
Op maandag, 24 oktober 2011 12:55 schreef "Hodchenkov, Paul" : Hi all, I have configured tomcat 7 cluster by using [1] with DeltaManager and it works fine. However I have the following 2 questions: 1) My application stores session map in memory(admin can force logout of any user and change some session attribute). Will this session attribute be replicated if it is changed without tomcat http request (changed by backend task for example)? 2) It's seems that expireSessionsOnShutdown=false in DeltaManager can solve the problem with http://old.nabble.com/sessionListener.sessionDestroyed-is-called-on-shutdown-of-a-node-in-the-cluster-td16178701.html? [1] http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html Best Regards, Paul Hodchenkov Senior Java developer, Oxagile Skype: paul.hodchenkov Email: mailto:paul.hodchen...@oxagile.com Hi, 1. Changes in the session are only replicated at the end of a request. BTW: My experience with holding references to Sessions in your own map is that it is harder than you think. It is more easy to create a map with blocked userids and block those users with a filter. 2. I don't understand your question. Ronald.
RE: Tomcat clustering session attribute is changed without request
Hi, Replication of the attributes is done by the cluster valve. http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-valve.html If you manage to call that code from your own application, than you can do what you want. But that is not default functionality of Tomcat. You have to make it yourself. Ronald. Op dinsdag, 25 oktober 2011 09:44 schreef "Hodchenkov, Paul" : Hi All, I have used http://code.google.com/p/psi-probe/ to debug session replication. So HttpSession attribute is NOT replicated when it is changed without http request. It's value is changed only on the local tomcat. However, when attribute is changed with http request - everything works fine. So, is there any way to force the replication of HttpSession? -Original Message- From: Pid [mailto:p...@pidster.com] Sent: Monday, October 24, 2011 4:08 PM To: Tomcat Users List Subject: Re: Tomcat clustering session attribute is changed without request On 24/10/2011 14:05, Hodchenkov, Paul wrote: > Hi, > Thanks for the reply! > -> What does 'stores session map in memory' actually mean? > It's ConcurrentMap map which is filled by HttpListener. I can access session attributes of any user using this approach. > Does changes to attributes in HttpSession cause a replication in this case? Don't know, probably. > What is the benefit of using JMX connection to access the session instead of HttpListener in this case? It means you don't have to jump through hoops to access something that is already accessible elsewhere. p > -Original Message- > From: Pid [mailto:p...@pidster.com] > Sent: Monday, October 24, 2011 3:59 PM > To: Tomcat Users List > Subject: Re: Tomcat clustering session attribute is changed without > request > > On 24/10/2011 11:55, Hodchenkov, Paul wrote: >> Hi all, >> I have configured tomcat 7 cluster by using [1] with DeltaManager and it works fine. >> However I have the following 2 questions: >> >> 1) My application stores session map in memory(admin can force logout of any user and change some session attribute). Will this session attribute be replicated if it is changed without tomcat http request (changed by backend task for example)? > > What does 'stores session map in memory' actually mean? > > Instead of copying session objects around the place, why not just use the JMX API and the operations on the Manager MBean? > > Catalina:type=Manager,context=/myapp,host=localhost > > > p > >> 2) It's seems that expireSessionsOnShutdown=false in DeltaManager can solve the problem with http://old.nabble.com/sessionListener.sessionDestroyed-is-called-on-shutdown-of-a-node-in-the-cluster-td16178701.html? >> [1] http://tomcat.apache.org/tomcat-7.0-doc/cluster-howto.html >> >> Best Regards, >> Paul Hodchenkov >> Senior Java developer, Oxagile >> Skype: paul.hodchenkov >> Email: mailto:paul.hodchen...@oxagile.com >> >> > > > > - > 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: HOW TO detect what app server you're running in
Does this help? public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("serverinfo: " + getServletContext().getServerInfo()); } Ronald. Op dinsdag, 25 oktober 2011 13:33 schreef Bob DeRemer : I may need to use some Tomcat-specific code in my web app. As a result, I would like to detect [if possible] when I'm running in Tomcat, so I can invoke the logic. If anyone knows how best to do this, ideally with some sample java code, that'd be great. Thanks, Bob
Re: [OT]RE: Maximum memory that can be assigned to Tomcat on windows platform
Op donderdag, 1 december 2011 09:39 schreef Casper Wandahl Schmidt : See below. I hope MS Outlook does some decent indend so my response is clear -.- -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: 30. november 2011 18:51 To: Tomcat Users List Subject: Re: Maximum memory that can be assigned to Tomcat on windows platform -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Casper, On 11/30/11 3:37 AM, Casper Wandahl Schmidt wrote: > Another question to ask is, why do you have 8GB memory when running > 32bit? That is just stupid since 32bit cannot address more than 4GB of > memory no matter what you do. Any sysadmin should know that right? That's per process. All reasonably recent 32-bit OSs can address way more than 4GiB internally. For example: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366778%28v=vs.85%29.aspx#memory_limits This is generally done through PAE (http://en.wikipedia.org/wiki/Physical_Address_Extension) which allows 32-bit OSs to access more than 4GiB at the kernel level, though each process is still limited to 4GiB. Aha so I learned something new today :) I'm still puzzled as to how a 32 bit CPU can compute and fetch a memory cell with address above 4GB since it cannot hold this large value. Anyway that is just too much low-level computer science for me, all I ever had was a seven week course on architecture and networking (a single week out of the seven) :) -Casper Running a machine with more than 4GiB in 32-bit mode isn't stupid at all IMO. If you have relatively small processes, there's no need for the overhead of 64-bit even if you have 16GiB or more. - -chris I have an analogy for you. If you look out of your window you only see a small part of the world. If you move your window you wil see another part of the world. This is what the OS does with PAE. It moves the window on your RAM frequently. That is why a 32 bits application only sees max. 4GB. That is the size of its window. Ronald.
timeout exception is ignored?
Hi, The method org.apache.catalina.connector.Request.parseParameters() contains this code. try { if (readPostBody(formData, len) != len) { return; } } catch (IOException e) { // Client disconnect if (context.getLogger().isDebugEnabled()) { context.getLogger().debug( sm.getString("coyoteRequest.parseParameters"), e); } return; } When there is a timeout exception during reading of the postbody it is ignored and my servlet runs without parameters. Why is this? Why don't I get the exception in my code, so I can handle it? Ronald.
Re: Tomcat memory allocation
Op vrijdag, 9 december 2011 16:11 schreef Pid : On 09/12/2011 14:52, Martin O'Shea wrote: > -Original Message- > From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] > Sent: 09 Dec 2011 14 46 > To: Tomcat Users List > Subject: RE: Tomcat memory allocation > >> From: Martin O'Shea [mailto:app...@dsl.pipex.com] >> Subject: Tomcat memory allocation > >> Following advice found elsewhere on the internet > > Always to be taken with large chunks of salt. > >> set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m -XX:MaxPermSize=128m > > You would be better off using CATALINA_OPTS, since setting JAVA_OPTS > pointlessly affects the shutdown script as well as the startup one. > >> I know that settings: >> Xms128m -Xmx512m > >> Control the initial heap size and what it can expand to. > > In a server environment, you normally want Xms and Xmx set to the same value > to avoid heap thrashing. The exact size is completely dependent on what > your webapps need. > >> But what exactly is: >> -XX:MaxPermSize=128m > > It's the amount of space to which the so-called permanent generation can > expand. PermGen holds primarily instances of java.lang.Class, so it only > needs to be specified if you have a large number of classes in your > environment. > >> Should it be set to an addition of the other settings, or the other >> settings to an addition of it? > > What does that question mean? PermGen size is completely independent of the > heap size. > > Make sure you have enough RAM available on the system to support the Xmx + > PermGen + a_lot_of_other_stuff. Monitor the system to make sure you're not > getting into paging. > > > Thanks for this Chuck. I realise now what is happening. I thought the > PermGen space was used in the heap when now I see it as just storing class > definitions. So I could reduce it below 128Mb if I choose. Is there a > default value? > > As to setting Xms and Xmx to the same, I will do that. A job hung earlier > and I wonder if memory was to blame although there is nothing in the system > or server logs to say so. Connect VisualVM to your Tomcat instance and use the monitor tab to observe the actual PermGen usage. It should be pretty stable, unless you're doing something funky like generating classes or using RMI. You'll then know how much you need to allocate. p -- [key:62590808] Don't forget jstat also: $ jstat -gc -h 10 -t 84762 3s TimestampS0CS1CS0US1U EC EUOC OU PC PUYGC YGCTFGCFGCT GCT 700819.2 1792.0 1792.0 288.0 0.0640.0289.280320.061284.6 95296.0 95013.75163.182 20064.692 67.874 700822.2 1792.0 1792.0 288.0 0.0640.0289.280320.0 61284.6 95296.0 95013.75163.182 20064.692 67.874 700825.2 1792.0 1792.0 288.0 0.0640.0289.280320.0 61284.6 95296.0 95013.75163.182 20064.692 67.874 700828.2 1792.0 1792.0 288.0 0.0640.0289.280320.0 61284.6 95296.0 95013.75163.182 20064.692 67.874 700831.1 1792.0 1792.0 288.0 0.0640.0315.580320.0 61284.6 95296.0 95013.75163.182 20064.692 67.874 700834.2 1792.0 1792.0 288.0 0.0640.0323.080320.0 61284.6 95296.0 95013.75163.182 20064.692 67.874 700837.2 1792.0 1792.0 288.0 0.0640.0323.080320.0 61284.6 95296.0 95013.75163.182 20064.692 67.874 Ronald.