|
View:
New views
20 Messages
—
Rating Filter:
Alert me
|
| < Prev | 1 - 2 | Next > |
|
|
Possible to assign different class loader for each web app with tomcatHi,
Is it possible to configure a separate class loader for each web app running under tomcat? A colleague has informed that he can do this with web sphere and I am wondering if it is possible with tomcat. Thanks Paul Ockleford ********************************************************************** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ********************************************************************** --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Possible to assign different class loader for each web app with tomcatpaul.ockleford@... wrote:
> Hi, > > Is it possible to configure a separate class loader for each web app running > under tomcat? A colleague has informed that he can do this with web sphere > and I am wondering if it is possible with tomcat. This is the case by default. No configuration is required. Mark --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Possible to assign different class loader for each web app with tomcatMark Thomas wrote:
> paul.ockleford@... wrote: >> Hi, >> >> Is it possible to configure a separate class loader for each web app >> running >> under tomcat? A colleague has informed that he can do this with web >> sphere >> and I am wondering if it is possible with tomcat. > > This is the case by default. No configuration is required. Sorry, I should also have included this link http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html and pointed out that, via configuration, you can have the classloader hierarchy that was the default in previous versions. See http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html Mark --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: Possible to assign different class loader for each web app with tomcatOk, that's strange because yesterday I had a small problem, and I assumed
that it was due to the same class being loaded on startup by 2 web apps. I had a url endpoint loaded into a config class on startup from the web.xml, for some reason no messages were reaching the correct end point. This config class is also loaded by a test version of the app running under the same tomcat as pre prod. When the second web app was loaded and its config class was loaded and the parameter read in from the web.xml it changed the value for both web apps. I have not being using java or tomcat for all that long, but I would have thought if a class loader was assigned for each web app then they would each have their own copy of the config class? Meaning that web app1 should not have been pointing at the end point for web app 2? If not then could you tell me why? Thanks -----Original Message----- From: Mark Thomas [mailto:markt@...] Sent: 09 May 2008 11:10 To: Tomcat Users List Subject: Re: Possible to assign different class loader for each web app with tomcat paul.ockleford@... wrote: > Hi, > > Is it possible to configure a separate class loader for each web app > running under tomcat? A colleague has informed that he can do this > with web sphere and I am wondering if it is possible with tomcat. This is the case by default. No configuration is required. Mark --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... ********************************************************************** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ********************************************************************** --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
[newbie] Unable to find a javac compiler;I would like to set up a Wiki and JSPWiki seems a likely candidate. So
I am trying to get Tomcat 5.5 running. (The environment is Linux OpenSUSE 10.3.) I have got as far as to have the Sample "Hello, World" Application servlet run. However, the JSP example always fails with Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK However, JAVA_HOME looks all right (to me): sakari@mach:/tmp> ll $JAVA_HOME/lib total 28960 -rw-r--r-- 1 root root 15153295 2007-03-16 12:01 ct.sym -rw-r--r-- 1 root root 145760 2007-09-22 01:43 dt.jar -rw-r--r-- 1 root root 206225 2007-09-22 01:43 htmlconverter.jar -rw-r--r-- 1 root root 18381 2007-03-16 12:01 ir.idl -rw-r--r-- 1 root root 388392 2007-09-22 01:43 jconsole.jar -rwxr-xr-x 1 root root 7056 2007-03-16 12:01 jexec -rw-r--r-- 1 root root 429 2007-03-16 12:01 orb.idl -rw-r--r-- 1 root root 1504171 2007-09-22 01:43 sa-jdi.jar -rw-r--r-- 1 root root 12158340 2007-09-22 01:43 tools.jar sakari@mach:/tmp> (There is also JDK_HOME; it is equal to JAVA_HOME.) Both java and javac work fine from the command line: sakari@mach:/tmp> java -version java version "1.6.0_01" Java(TM) SE Runtime Environment (build 1.6.0_01-b06) Java HotSpot(TM) Server VM (build 1.6.0_01-b06, mixed mode) sakari@mach:/tmp> javac -version javac 1.6.0_01 sakari@mach:/tmp> Why doesn't Tomcat find javac? Thank you, Sakari Aaltonen --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Possible to assign different class loader for each web app with tomcatThis all depends on your webapp structure. If your config class is on the
common or system class loader, it's shared by all webapps. Otherwise, (that mean if class is in WEB-INF/lib or WEB-INF/classes), it shouldn't be shared. Unless, of course, you specified a specific classloader to use by tomcat in your context.xml. Le Friday 09 May 2008 12:16:23 paul.ockleford@..., vous avez écrit : > Ok, that's strange because yesterday I had a small problem, and I assumed > that it was due to the same class being loaded on startup by 2 web apps. > > I had a url endpoint loaded into a config class on startup from the > web.xml, for some reason no messages were reaching the correct end point. > This config class is also loaded by a test version of the app running under > the same tomcat as pre prod. When the second web app was loaded and its > config class was loaded and the parameter read in from the web.xml it > changed the value for both web apps. > > I have not being using java or tomcat for all that long, but I would have > thought if a class loader was assigned for each web app then they would > each have their own copy of the config class? Meaning that web app1 should > not have been pointing at the end point for web app 2? If not then could > you tell me why? > > Thanks > > -----Original Message----- > From: Mark Thomas [mailto:markt@...] > Sent: 09 May 2008 11:10 > To: Tomcat Users List > Subject: Re: Possible to assign different class loader for each web app > with tomcat > > paul.ockleford@... wrote: > > Hi, > > > > Is it possible to configure a separate class loader for each web app > > running under tomcat? A colleague has informed that he can do this > > with web sphere and I am wondering if it is possible with tomcat. > > This is the case by default. No configuration is required. > > Mark > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@... To unsubscribe, > e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > > > ********************************************************************** > This message may contain confidential and privileged information. > If you are not the intended recipient please accept our apologies. > Please do not disclose, copy or distribute information in this e-mail > or take any action in reliance on its contents: to do so is strictly > prohibited and may be unlawful. Please inform us that this message has > gone astray before deleting it. Thank you for your co-operation. > > NHSmail is used daily by over 100,000 staff in the NHS. Over a million > messages are sent every day by the system. To find out why more and > more NHS personnel are switching to this NHS Connecting for Health > system please visit www.connectingforhealth.nhs.uk/nhsmail > ********************************************************************** > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@... > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: Possible to assign different class loader for each web app with tomcatThanks for the reply.
To be honest I am not sure, both web apps are separated, have their own web.xml files and also are accessed via different ports, however as they are effectively the same application at different stages of development they each need to load parameters in on start up to a class that holds constant values. (I dont know if this is the best or a good way to do it, its how it was done before I started). Here are some excerpts from the web.xml, the only difference in each of the 2 web apps web.xml is that they load a different value for the url endpoint, as they point to different message handling development areas: <servlet-name>ConfigurationManager</servlet-name> <servlet-class>application.util.startup.ConfigurationManager</servlet-class> <load-on-startup>1</load-on-startup> <init-param> <param-name>MESSAGE.ENDPOINT</param-name> <param-value>http://192.168.28.193/router/SOAPEndpoint</param-value> </init-param> </servlet> To be honest I am sure its a lack of understanding on my part, but thats something I want to correct! Thanks -----Original Message----- From: David Delbecq [mailto:delbd+jakarta@...] Sent: 09 May 2008 11:35 To: Tomcat Users List Subject: Re: Possible to assign different class loader for each web app with tomcat This all depends on your webapp structure. If your config class is on the common or system class loader, it's shared by all webapps. Otherwise, (that mean if class is in WEB-INF/lib or WEB-INF/classes), it shouldn't be shared. Unless, of course, you specified a specific classloader to use by tomcat in your context.xml. Le Friday 09 May 2008 12:16:23 paul.ockleford@..., vous avez écrit : > Ok, that's strange because yesterday I had a small problem, and I assumed > that it was due to the same class being loaded on startup by 2 web apps. > > I had a url endpoint loaded into a config class on startup from the > web.xml, for some reason no messages were reaching the correct end point. > This config class is also loaded by a test version of the app running under > the same tomcat as pre prod. When the second web app was loaded and its > config class was loaded and the parameter read in from the web.xml it > changed the value for both web apps. > > I have not being using java or tomcat for all that long, but I would have > thought if a class loader was assigned for each web app then they would > each have their own copy of the config class? Meaning that web app1 should > not have been pointing at the end point for web app 2? If not then could > you tell me why? > > Thanks > > -----Original Message----- > From: Mark Thomas [mailto:markt@...] > Sent: 09 May 2008 11:10 > To: Tomcat Users List > Subject: Re: Possible to assign different class loader for each web app > with tomcat > > paul.ockleford@... wrote: > > Hi, > > > > Is it possible to configure a separate class loader for each web app > > running under tomcat? A colleague has informed that he can do this > > with web sphere and I am wondering if it is possible with tomcat. > > This is the case by default. No configuration is required. > > Mark > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@... To unsubscribe, > e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > > > ********************************************************************** > This message may contain confidential and privileged information. > If you are not the intended recipient please accept our apologies. > Please do not disclose, copy or distribute information in this e-mail > or take any action in reliance on its contents: to do so is strictly > prohibited and may be unlawful. Please inform us that this message has > gone astray before deleting it. Thank you for your co-operation. > > NHSmail is used daily by over 100,000 staff in the NHS. Over a million > messages are sent every day by the system. To find out why more and > more NHS personnel are switching to this NHS Connecting for Health > system please visit www.connectingforhealth.nhs.uk/nhsmail > ********************************************************************** > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@... > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... ********************************************************************** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ********************************************************************** --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Possible to assign different class loader for each web app with tomcatpaul.ockleford@... wrote:
> Thanks for the reply. > > To be honest I am not sure, both web apps are separated, have their own > web.xml files and also are accessed via different ports, however as they are > effectively the same application at different stages of development they > each need to load parameters in on start up to a class that holds constant > values. (I don’t know if this is the best or a good way to do it, its how it > was done before I started). > > Here are some excerpts from the web.xml, the only difference in each of the > 2 web apps web.xml is that they load a different value for the url endpoint, > as they point to different message handling development areas: > > <servlet-name>ConfigurationManager</servlet-name> > > <servlet-class>application.util.startup.ConfigurationManager</servlet-class> > <load-on-startup>1</load-on-startup> > <init-param> > <param-name>MESSAGE.ENDPOINT</param-name> > <param-value>http://192.168.28.193/router/SOAPEndpoint</param-value> > > </init-param> > </servlet> > > To be honest I am sure it’s a lack of understanding on my part, but that’s > something I want to correct! It all depends on where you put the .class file or the .jar that contains the .class file. With this information we should be able to help you fix this. Cheers, Mark --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: Possible to assign different class loader for each web app with tomcatOk thanks, it's starting to become clearer now.
The class file is in a jar file that lives in tomcat\shared\lib. I am guessing that these classes are loaded by a class loader further up the hierarchy described in the tomcat docs. I suppose in this instance there would only be one class loaded? I guess if this is the case the only thing confusing me is why this class is actually loaded by tomcat when it doesn't have to be? Does the <load-on-startup>1</load-on-startup> tag not load a class specifically for this web app regardless of where the class file might be? Thanks for the help by the way. -----Original Message----- From: Mark Thomas [mailto:markt@...] Sent: 09 May 2008 12:25 To: Tomcat Users List Subject: Re: Possible to assign different class loader for each web app with tomcat paul.ockleford@... wrote: > Thanks for the reply. > > To be honest I am not sure, both web apps are separated, have their > own web.xml files and also are accessed via different ports, however > as they are effectively the same application at different stages of > development they each need to load parameters in on start up to a > class that holds constant values. (I don't know if this is the best or > a good way to do it, its how it was done before I started). > > Here are some excerpts from the web.xml, the only difference in each > of the > 2 web apps web.xml is that they load a different value for the url > endpoint, as they point to different message handling development areas: > > <servlet-name>ConfigurationManager</servlet-name> > > <servlet-class>application.util.startup.ConfigurationManager</servlet- > class> > <load-on-startup>1</load-on-startup> > <init-param> > <param-name>MESSAGE.ENDPOINT</param-name> > > <param-value>http://192.168.28.193/router/SOAPEndpoint</param-value> > > </init-param> > </servlet> > > To be honest I am sure it's a lack of understanding on my part, but > that's something I want to correct! It all depends on where you put the .class file or the .jar that contains the .class file. With this information we should be able to help you fix this. Cheers, Mark --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... ********************************************************************** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ********************************************************************** --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: [newbie] Unable to find a javac compiler;> From: sakari.aaltonen@... [mailto:sakari.aaltonen@...]
> Subject: [newbie] Unable to find a javac compiler; > > Why doesn't Tomcat find javac? Good question, since Tomcat 5.5 doesn't use the javac from tools.jar, unless you have specifically configured it to do so. Have you changed anything in conf/web.xml? - 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@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Possible to assign different class loader for each web app with tomcatpaul.ockleford@... wrote:
> Ok thanks, it's starting to become clearer now. > > The class file is in a jar file that lives in tomcat\shared\lib. I am > guessing that these classes are loaded by a class loader further up the > hierarchy described in the tomcat docs. I suppose in this instance there > would only be one class loaded? Correct. The class would be loaded once but that doesn't prevent multiple instances of the class being created. However, I suspect the class in question uses the singleton pattern so there is also only once instance. This instance will be shared between all webapps. > I guess if this is the case the only thing confusing me is why this class is > actually loaded by tomcat when it doesn't have to be? Does the > <load-on-startup>1</load-on-startup> tag not load a class specifically for > this web app regardless of where the class file might be? No. load-on-startup requires Tomcat to load the servlet when the context starts and the number dictates the order (as per the spec). The class loaders will be searched in the order described in the docs and the first instance found of the class will be used. If (as it appears from your description) you have webapp specific information being held in a singleton class then you *must* place that class in WEB-INF/classes or the jar containing it in WEB-INF/lib shared/lib is for classes that can be safely shared between multiple webapps. Personally I never used it. It generally caused more problems than it solved - one of the reasons it is removed by default in 6.0.x onwards. > Thanks for the help by the way. No problem. Mark --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: Possible to assign different class loader for each web app with tomcatThanks for the replies, I think I understand what is happening now, I think
for safety's sake I will use a separate config file for each web app instead of trying to share one between them all and load separate copies. Thank you. -----Original Message----- From: Mark Thomas [mailto:markt@...] Sent: 09 May 2008 13:41 To: Tomcat Users List Subject: Re: Possible to assign different class loader for each web app with tomcat paul.ockleford@... wrote: > Ok thanks, it's starting to become clearer now. > The class file is in > a jar file that lives in tomcat\shared\lib. I am guessing that these > classes are loaded by a class loader further up the hierarchy > described in the tomcat docs. I suppose in this instance there would > only be one class loaded? Correct. The class would be loaded once but that doesn't prevent multiple instances of the class being created. However, I suspect the class in question uses the singleton pattern so there is also only once instance. This instance will be shared between all webapps. > I guess if this is the case the only thing confusing me is why this > class is actually loaded by tomcat when it doesn't have to be? Does > the <load-on-startup>1</load-on-startup> tag not load a class > specifically for this web app regardless of where the class file might be? No. load-on-startup requires Tomcat to load the servlet when the context starts and the number dictates the order (as per the spec). The class loaders will be searched in the order described in the docs and the first instance found of the class will be used. If (as it appears from your description) you have webapp specific information being held in a singleton class then you *must* place that class in WEB-INF/classes or the jar containing it in WEB-INF/lib shared/lib is for classes that can be safely shared between multiple webapps. Personally I never used it. It generally caused more problems than it solved - one of the reasons it is removed by default in 6.0.x onwards. > Thanks for the help by the way. No problem. Mark --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... ********************************************************************** This message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies. Please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it. Thank you for your co-operation. NHSmail is used daily by over 100,000 staff in the NHS. Over a million messages are sent every day by the system. To find out why more and more NHS personnel are switching to this NHS Connecting for Health system please visit www.connectingforhealth.nhs.uk/nhsmail ********************************************************************** --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: [newbie] Unable to find a javac compiler;Quoting "Caldarale, Charles R" <Chuck.Caldarale@...>:
>> From: sakari.aaltonen@... [mailto:sakari.aaltonen@...] >> Subject: [newbie] Unable to find a javac compiler; >> >> Why doesn't Tomcat find javac? > > Good question, since Tomcat 5.5 doesn't use the javac from tools.jar, > unless you have specifically configured it to do so. Have you changed > anything in conf/web.xml? > > - Chuck No I haven't. I just took a first look at it, and the relevant section seems to be this: <servlet> <servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> <init-param> <param-name>fork</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>xpoweredBy</param-name> <param-value>false</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> By "relevant" I mean that the section starts with <!-- The JSP page compiler and execution servlet, which is the mechanism --> <!-- used by Tomcat to support JSP pages. Traditionally, this servlet --> What does it all mean? Sakari Aaltonen --------------------------------------------------------------------- To start a new topic, e-mail: users@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: [newbie] Unable to find a javac compiler;> From: sakari.aaltonen@... [mailto:sakari.aaltonen@...]
> Subject: RE: [newbie] Unable to find a javac compiler; > > I just took a first look at it, and the > relevant section seems to be this: The JSP servlet config looks normal. Are you by any chance using the 3rd-party repackaged version of Tomcat that came with your Linux distribution? If so, throw it away, and download and install a real one from tomcat.apache.org. The 3rd-party junk has caused numerous problems over the years. You might as well use Tomcat 6.0 if you're just getting started. - 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@... To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
RE: [newbie] Unable to find a javac compiler; |