Re: Setting up HTTP Basic for a full Web-App
Anyone have any thoughts on this? On 9/30/05, David Johnson [EMAIL PROTECTED] wrote: Hi all. I think I'm doing something wrong. I'veadded the following to my web application to use http-basicis there anything else I need to do to ensure anyone logging in like this has full access to the app? !-- Define a security constraint on this application -- security-constraint web-resource-collection web-resource-nameEntire Application/web-resource-name url-pattern/*/url-pattern /web-resource-collection auth-constraint !-- This role is not in the default user directory -- role-namemanager/role-name /auth-constraint /security-constraint !-- Define the login configuration for this application -- login-config auth-methodBASIC/auth-method realm-nameMy Application/realm-name /login-config !-- Security roles referenced by this web application -- security-role description The role that is required to log in to the Application /description role-namemanager/role-name /security-role -- -Dave [EMAIL PROTECTED] -- -Dave [EMAIL PROTECTED]
Setting up HTTP Basic for a full Web-App
Hi all. I think I'm doing something wrong. I'veadded the following to my web application to use http-basicis there anything else I need to do to ensure anyone logging in like this has full access to the app? !-- Define a security constraint on this application -- security-constraint web-resource-collection web-resource-nameEntire Application/web-resource-name url-pattern/*/url-pattern /web-resource-collection auth-constraint !-- This role is not in the default user directory -- role-namemanager/role-name /auth-constraint /security-constraint !-- Define the login configuration for this application -- login-config auth-methodBASIC/auth-method realm-nameMy Application/realm-name /login-config !-- Security roles referenced by this web application -- security-role description The role that is required to log in to the Application /description role-namemanager/role-name /security-role -- -Dave [EMAIL PROTECTED]
Re: load on startup
private static final SingletonObj singleton; public SingletonObj () { super (); singleton = this; } public synchronized SingletonObj getSingleton () { if ( singleton == null ) { new SingletonObj(); } return singleton; } On Fri, 2005-08-05 at 20:11 -0700, Ming Han wrote: You can use Singleton pattern, but care must be taken. For example if ( singleton == null ) { singleton = new SingletonObj(); } There might be a case where few thread running concurrently on the null checking, then multiple singleton object will be created more than one. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: load on startup
{ private static final SingletonObj singleton; // optional - use if you want the initialization to occur as class load time // Otherwise, the initialization will occur at first call to getSingleton(); // static initialization at load time static { getSingelton ()/ } private SingletonObj () { super (); singleton = this; } public static synchronized SingletonObj getSingleton () { if ( singleton == null ) { new SingletonObj(); } return singleton; } } On Fri, 2005-08-05 at 20:11 -0700, Ming Han wrote: You can use Singleton pattern, but care must be taken. For example if ( singleton == null ) { singleton = new SingletonObj(); } There might be a case where few thread running concurrently on the null checking, then multiple singleton object will be created more than one. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: load on startup
instance needs to be final, or it may be changed by some tricks that break encapsulation. On Sat, 2005-08-06 at 15:59 -0400, Mauricio Nuñez wrote: Improved version without sync locking: class SingletonObj { private static SingletonObj instance; static { instance=new SingletonObj(); } private SingletonObj() { } public static SingletonObj getInstance() // without sync ! { return instance; } } El sáb, 06-08-2005 a las 09:14 -0500, David Johnson escribió: { private static final SingletonObj singleton; // optional - use if you want the initialization to occur as class load time // Otherwise, the initialization will occur at first call to getSingleton(); // static initialization at load time static { getSingelton ()/ } private SingletonObj () { super (); singleton = this; } public static synchronized SingletonObj getSingleton () { if ( singleton == null ) { new SingletonObj(); } return singleton; } } On Fri, 2005-08-05 at 20:11 -0700, Ming Han wrote: You can use Singleton pattern, but care must be taken. For example if ( singleton == null ) { singleton = new SingletonObj(); } There might be a case where few thread running concurrently on the null checking, then multiple singleton object will be created more than one. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Tomcat is an application server ?
On Wed, 2005-06-22 at 09:08 +0200, Michael Echerer wrote: There is no meaning in saying that one can plug in required services to Tomcat. My question is by design is it an application server ?. My opinion is that Tomcat in the shipped form is not an application server. At the minimum it should provide transaction and persistence services, method level security is also preferred. One can add all the above mentioned features to any servlet engine by deploying JAR files of the required services(JNDI,JTA,persistence and even EJB). So any servlet engine becomes an application server. Am I right ? I think you are getting your terms mixed up... Your arguments could be used in regards to a full J2EE container, which Tomcat isn't on it's own but an application server just needs to serve applications and Tomcat certainly does that. Agree. Tomcat is an application server, e.g. JBoss aswell, but JBoss is a J2EE 1.x compliant application server as all parts of the spec are implemented, Tomcat is not as only parts are covered. JBoss as shipped, is installed as a set of services inside (specifically) the Tomcat application server. You have made our point that Tomcat is an application server, since JBoss does not serve applications without Tomcat or some other application server around it. The parts that are specifically JBoss can (in theory) be installed any J2EE compliant application server. Tomcat is the minimum _reference_ implementation of J2EE application server. Apart from actual bugs, Tomcat _defines_ the minimum requirements for a J2EE compliant application server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is Tomcat is an application server ?
To expand a bit on Richard's note ... On Tue, 2005-06-21 at 00:32 -0700, Richard Mixon (qwest) wrote: - Remoting implies distributing your objects across the network - a nice feature, but not often needed. Its talked about a lot - but for most applications its just not needed. J2EE is a standard that encompasses a large number of standards services, most of which are considered optional. JMS, for example, is not implemented in any commercial server directly. Instead, you must purchase a messaging system such as MQ series, (generally) a JNI wrapper code to talk to the message service, and a JMS wrapper that goes with the messaging system. This all plugs into the app server as a set of JAR files and a couple of native libraries. JTA is an extension that, likewise, is optional and pluggable. From my exposure, it also appears to be largely an evolving standard, in the sense that some of the things you would expect to support JTA don't quite do so. - Our Hibernate-based Tomcat application use Hibernate and jta.jar for transaction services and it works quite well. We have most of the advantages of declarative transaction demarcation. Hibernate demonstrates why EJB is an optional part of the J2EE specification. It is fully reasonable, during product design and exploratory coding, to unplug one persistence model and replace it with another. In the case of hibernate versus EJB 1 and 2, enough people did this that Hibernate has effectively displaced EJB's in much of the industry, and Hibernate is now the core of the EJB 3 specification. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is there a kind of EJB container in Tomcat?
Have you considered alternatives to EJB? Hibernate is very nice, free, works with POJO's (Plain Old Java Objects), is easier to use than EJB 1 or 2, and is the basis for the upcoming EJB 3 standard. On Tue, 2005-06-21 at 08:25 +0800, Kevin Kang (CSS) wrote: Hi, all Who knows whether there is a kind of container for EJB development in Tomcat, or any relative Tomcat sub-project in Apache org. thanks. Best Regards Kevin Kang MSN: [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
error-page not catching errors? Tomcat 4.1.31
Hi all I've added the following to my web.xml (thanks for the help) error-page error-code500/error-code location/error.jsp/location /error-page error-page error-code404/error-code location/error.jsp/location /error-page error-page error-codejava.lang.Exception/error-code location/error.jsp/location /error-page the problem is when I cause an error (like stopping the database then trying to hit it or reloading a page that should cause an error 500), I'm not seeing my error page. am I forgetting something? -- -Dave [EMAIL PROTECTED]
Re: Free reporting s/w that works with apache+tomcat
They are unlikely to ever look exactly alike. But, you can use a java-ActiveX bridge (there are several) to build and manipulate an excel spreadsheet as an object. I have successfully used a library from IBM AlphaWorks to do exactly this. Sadly, the library I used was a precursor to a commercial product so it is no longer free. Good luck! On Mon, 2005-05-09 at 23:57 -0700, U K Laxmi wrote: I'm developing a web application using apache+tomcat on windows 2000 machine. I'm using Ms Access 2003 as the backend. I'm using JSP for developing web application. I'm developing some web based reports in HTML. But when i export them to Excel, it doesn't look exactly same as that of HTML report. Moreover i need some header and footer information appear in the report. That i'm unable to achieve using JSP and HTML. So, i'm looking for a free reporting software that can meet above functionality and can work with apache+tomcat. If anyone know any work worunds for my problem, pls inform me. It will be a great help to me. Thank you. __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is it mean that Java code does not belong in well designed JSP pages?
The intent of JSP is that it is primarily HTML with just enough Java to make things work. Ideally, you can hand a JSP to a web designer who is not a programmer and they can make a pretty web page that works. In some shops this works. As a productivity booster, this works in some shops. But in others it is a miserable failure. With that being said, my _personal_ experience is that programming in HTML tags is a pain in the %taglib/. I don't have a problem learning another language to do a job - I regularly use COBOL, Pascal, Java, and SQL in any single project. Adding a JSP front end adds JavaScript, a couple of XML namespaces, and HTML to the mix. Using taglibs instead of code adds a level of obfuscation that, IMHO, makes it difficult to get work done. I always end up taking the servlet that was generated from the JSP and rewriting it so it works correctly, performs adequately, and generates no side effects. This is a battle that will never be resolved because both sides are right, depending on the circumstances. JSP purists will shoot me, but I'll take plain old Java code over HTML taglibs any day. Write JSP's in accordance with your shop's standards and make them work in the time allotted to the task. Ultimately, your company pays the bills, so whatever gives your shop the best productivity is the right choice. On Sun, 2005-01-23 at 09:07, Dola Woolfe wrote: I just read this thread and didn't quite understand it. If it means what it seems to mean on the surface, I'm doing everything wrong. Schematically, my typical JSP page looks like the following (basically 100% code). Is this what Craig is advising against? %@ page errorPage=ErrorPage.jsp import=html.*% [EMAIL PROTECTED] file=InitializePage.jsp% % Table table = new Table() .pAddH(#).pAddH(Action).pLN() .pAddC(1).pAddL(new Anchor(HelloPage.jsp, Say hello to my friend.)).pLN() .pAddC(2).pAddL(new Anchor(GoodByePage.jsp, Say good bye to my friend)).pLN() ; MyTemplate template = new MyTemplate (Main Actions, table); Page pAgE = new Page(new MyHead(Data Tools), new Body(template)); % %= pAgE % __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Still having OutOfMemory Problems (Tomcat 4.1.31)
HI all. Well I'm still getting my out of memory problem fairly consistently (again) using Tomcat 4.1.31 with my Struts application. When I look st the memory usage, it says tomcat is using about 110k of memory for the VM, but that's just looking at the task manager. Tomcat is installed as a service using a bat file (follows). Note the -Xms128M and -Xmx512M options are set...if doesnt seem to matter what I set these options toeven if I set them to 32m/64m! How can I tell if tomcat is REALLY using those settings? It doesnt seem to be Thanks - install.bat: @SET JAVA_HOME=C:\j2sdk_1_4_0_2 @SET TOMCAT_HOME=C:\Tomcat4.1 @SET TOMCAT_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll @SET TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME%\common\lib\servlet.jar @SET TOMCAT_ENDORSED=%TOMCAT_HOME%\common\endorsed @SET TOMCAT_LOG=%TOMCAT_HOME%\logs\stdout.log @SET TOMCAT_ERR_LOG=%TOMCAT_HOME%\logs\stderr.log %TOMCAT_HOME%\bin\tomcat.exe -install Apache Tomcat 4.1.31 %TOMCAT_JVM% -Djava.class.path=%TOMCAT_CLASSPATH% -DXms128M -DXmx512M -DXX:+PrintTenuringDistribution -DXX:+PrintGCDetails -Xverbosegc -Djava.endorsed.dirs=%TOMCAT_ENDORSED% -Dcatalina.home=%TOMCAT_HOME% -start org.apache.catalina.startup.BootstrapService -params start -stop org.apache.catalina.startup.BootstrapService -params stop -out %TOMCAT_LOG% -err %TOMCAT_ERR_LOG% - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat5 java.lang.OutOfMemoryError
Can you post a link to the archives? On Tue, 11 Jan 2005 16:31:40 -0800 (PST), Ryan Stewart [EMAIL PROTECTED] wrote: I posted a how-to on this just yesterday I think. Try the archives. It's typically a good idea to check there before you post. -Original Message- From: SARMIENTO Claudia COGA[EMAIL PROTECTED] To: 'Tomcat Users List'tomcat-user@jakarta.apache.org Date: Mon Jan 10 10:49:20 PST 2005 Subject: Tomcat5 java.lang.OutOfMemoryError Hello all: I have problems with memory in Tomcat, this happen when the servlet try to forward the result jsp only if the result is too big (a set of rows in a period date) Th bean doesn't have problems, but the servlet yes, so i think i need to change my configuration to set more memory at startup. (Actually is the default) I work in Tomcat 5.0.25 under W2000 with tomcat as a service, i read that i have to re-install tomcat (http://marc.theaimsgroup.com/?l=tomcat-userm=104331482014538w=2) the notes is for tomcat 4, is the same for tomcat 5.0? Thanks! Claudia PD: This is the exactly error: 2005-01-10 11:26:42 StandardWrapperValve[invoker]: Servlet.service() para servlet invoker lanzó excepción java.lang.OutOfMemoryError - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ Check-out GO.com GO get your free GO E-Mail account with expanded storage of 6 MB! http://mail.go.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 4.1.31 Out of Memory Follow up
Hi again I've searched through the registry as well, and at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache Tomcat 4.1.31\Parameters it DOES show the -Xmx=512M and -Xms=128M that are set in my installService.bat. It does not, however seem to be actually USING that much memory. Is there a way to easily verify how much it's using? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 4.1.31 Out of Memory Follow up
Note: This is the bat file I'm using to install... #Other Options to use # -DXX:+PrintTenuringDistribution -DXX:+PrintGCDetails -Xverbosegc # -DXms128M @SET JAVA_HOME=C:\j2sdk_1_4_0_2 @SET TOMCAT_HOME=C:\Tomcat4.1 @SET TOMCAT_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll @SET TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME%\common\lib\servlet.jar @SET TOMCAT_ENDORSED=%TOMCAT_HOME%\common\endorsed @SET TOMCAT_LOG=%TOMCAT_HOME%\logs\stdout.log @SET TOMCAT_ERR_LOG=%TOMCAT_HOME%\logs\stderr.log %TOMCAT_HOME%\bin\tomcat.exe -install Apache Tomcat 4.1.31 %TOMCAT_JVM% -Djava.class.path=%TOMCAT_CLASSPATH% -DXms64M -DXmx512M -DXX:+PrintTenuringDistribution -DXX:+PrintGCDetails -Xverbosegc -Djava.endorsed.dirs=%TOMCAT_ENDORSED% -Dcatalina.home=%TOMCAT_HOME% -start org.apache.catalina.startup.BootstrapService -params start -stop org.apache.catalina.startup.BootstrapService -params stop -out %TOMCAT_LOG% -err %TOMCAT_ERR_LOG% On Mon, 17 Jan 2005 13:05:02 -0500, David Johnson [EMAIL PROTECTED] wrote: Hi again I've searched through the registry as well, and at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache Tomcat 4.1.31\Parameters it DOES show the -Xmx=512M and -Xms=128M that are set in my installService.bat. It does not, however seem to be actually USING that much memory. Is there a way to easily verify how much it's using? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Still having OutOfMemory Problems (Tomcat 4.1.31)
I think that was the problem My new batch file is # @SET JAVA_HOME=C:\j2sdk_1_4_0_2 @SET TOMCAT_HOME=C:\Tomcat4.1 @SET TOMCAT_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll @SET TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME%\common\lib\servlet.jar @SET TOMCAT_ENDORSED=%TOMCAT_HOME%\common\endorsed @SET TOMCAT_LOG=%TOMCAT_HOME%\logs\stdout.log @SET TOMCAT_ERR_LOG=%TOMCAT_HOME%\logs\stderr.log %TOMCAT_HOME%\bin\tomcat.exe -install Apache Tomcat 4.1.31 %TOMCAT_JVM% -Djava.class.path=%TOMCAT_CLASSPATH% -Xms64m -Xmx512m -DXX:+PrintTenuringDistribution -DXX:+PrintGCDetails -Xverbosegc -Djava.endorsed.dirs=%TOMCAT_ENDORSED% -Dcatalina.home=%TOMCAT_HOME% -start org.apache.catalina.startup.BootstrapService -params start -stop org.apache.catalina.startup.BootstrapService -params stop -out %TOMCAT_LOG% -err %TOMCAT_ERR_LOG% On Mon, 17 Jan 2005 13:08:05 -0500, David Johnson [EMAIL PROTECTED] wrote: I'll give it a try. thanks! On Mon, 17 Jan 2005 13:07:26 -0500, Larry Isaacs [EMAIL PROTECTED] wrote: David, -D defines System properties, -X defines vendor specific JVM options. Thus, -DXms128M is incorrect. It should be just -Xms128M. Same for the other -DX arguments. Cheers, Larry -Original Message- From: David Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, January 17, 2005 12:52 PM To: Tomcat Users List Subject: Still having OutOfMemory Problems (Tomcat 4.1.31) HI all. Well I'm still getting my out of memory problem fairly consistently (again) using Tomcat 4.1.31 with my Struts application. When I look st the memory usage, it says tomcat is using about 110k of memory for the VM, but that's just looking at the task manager. Tomcat is installed as a service using a bat file (follows). Note the -Xms128M and -Xmx512M options are set...if doesnt seem to matter what I set these options toeven if I set them to 32m/64m! How can I tell if tomcat is REALLY using those settings? It doesnt seem to be Thanks - install.bat: @SET JAVA_HOME=C:\j2sdk_1_4_0_2 @SET TOMCAT_HOME=C:\Tomcat4.1 @SET TOMCAT_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll @SET TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME% \common\lib\servlet.jar @SET TOMCAT_ENDORSED=%TOMCAT_HOME%\common\endorsed @SET TOMCAT_LOG=%TOMCAT_HOME%\logs\stdout.log @SET TOMCAT_ERR_LOG=%TOMCAT_HOME%\logs\stderr.log %TOMCAT_HOME%\bin\tomcat.exe -install Apache Tomcat 4.1.31 %TOMCAT_JVM% -Djava.class.path=%TOMCAT_CLASSPATH% -DXms128M -DXmx512M -DXX:+PrintTenuringDistribution -DXX:+PrintGCDetails -Xverbosegc -Djava.endorsed.dirs=%TOMCAT_ENDORSED% -Dcatalina.home=%TOMCAT_HOME% -start org.apache.catalina.startup.BootstrapService -params start -stop org.apache.catalina.startup.BootstrapService -params stop -out %TOMCAT_LOG% -err %TOMCAT_ERR_LOG% - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcate 4.1.27 as a Service - Follow up to OOM problem
Hi again all I found the following when trying to find out how to REinstall tomcat as a service and to add options like the -Xmx512M what I need The batch file hates the fact that my Tomcat is located in c:\Program Files Any thoughts on how to get this to run? Thanks, Dave # installService.bat @SET JAVA_HOME=C:\j2sdk1.4.2_05 @SET TOMCAT_HOME=C:\Program Files\Tomcat4 @SET TOMCAT_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll @SET TOMCAT_CLASSPATH=%TOMCAT_HOME%\bin\bootstrap.jar;%TOMCAT_HOME%\common\lib\servlet.jar @SET TOMCAT_ENDORSED=%TOMCAT_HOME%\common\endorsed @SET TOMCAT_LOG=%TOMCAT_HOME%\logs\stdout.log @SET TOMCAT_ERR_LOG=%TOMCAT_HOME%\logs\stdout.log %TOMCAT_HOME%\bin\tomcat.exe -install Tomcat_4 %TOMCAT_JVM% -Djava.class.path=%TOMCAT_CLASSPATH% -DXmx512M -Djava.endorsed.dirs=%TOMCAT_ENDORSED% -Dcatalina.home=%TOMCAT_HOME% -start org.apache.catalina.startup.BootstrapService -params start -stop org.apache.catalina.startup.BootstrapService -params stop -out %TOMCAT_LOG% -err %TOMCAT_ERR_LOG% #uninstallService.bat tomcat.exe -uninstall Tomcat_4 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Out of Memory when compiling JSP (Struts app on Tomcat 4.1.27)
Cool. Thanks the question is how do I get all of these options working when tomcat runs as a service... On Thu, 6 Jan 2005 15:28:30 -, Dale, Matt [EMAIL PROTECTED] wrote: It could also be that the Permanent Generation has filled up, look up the docs on how to increase that or start with -XX:MaxPermSize=128M -Original Message- From: SANTOS, DANIEL (SBCSI) [mailto:[EMAIL PROTECTED] Sent: 06 January 2005 14:57 To: Tomcat Users List; [EMAIL PROTECTED] Subject: RE: Out of Memory when compiling JSP (Struts app on Tomcat 4.1.27) Chachany, It sounds like it's using the default of -Xmx64m. Probably the best way to troubleshoot out or memory errors is to see what is really happening with garbage collecting, the same way that you tune it. If you can add these options, then the JVM will spit out all kinds of useful information: -XX:+PrintTenuringDistribution -XX:+PrintGCDetails -Xverbosegc But it sounds like the problem is that it's not getting the options. What you really need to figure out is exactly how the service is getting started. For instance, if it's calling tomcat.exe then I don't believe that the JAVA_OPTS environment variable is ever looked at since that is in the startup.sh and startup.bat files (I'm not 100% certain about that however). Find out how it's starting. Also, post the version of Java you are using (since the options I gave you above don't work on all versions, I think 1.4 and up or 1.3 and up). But the -Xverbosegc works all the way back to 1.1 if I'm correct. Daniel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 06, 2005 8:25 AM To: tomcat-user@jakarta.apache.org Subject: Out of Memory when compiling JSP (Struts app on Tomcat 4.1.27) Hi all I'm working on an application currently that is experiencing some intermittent memory problems when installed onto our integration test server, but not on the development staff's local laptops. I have attempted to increase the maximum memory available to Tomcat by creating a global environment variable (because tomcat runs as a service) JAVA_OPTS=-Xmx512M Which doesnt seem to have made a difference. Is this the best way to increaqte the memory available to an application? Is my syntax wrong? Are there other options I can set that will help? The weird thing is that when I look at the memory usage of Tomcat.exe, the most memory it has used is 110,000 there seems to be no pattern to the memory errors (as usual) and it happens a lot when compiling JSP files. The system memory seems high, but not horribly so. I see the following in Task Manager MEM Usage = 885,000 (varies) Commit Charge: Limit : 2,522,244 Peak : 958,260 Anyone? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I've officially decided that JSTL is one of the worstthingsto ever happen
To beat a dead horse, religious arguments notwithstanding ... I agree that I find taglibs impossible to understand. I end up compiling the jsp to a servlet, then using the servlet as a skeleton that I refine and tune, and I finally dispose of the original jsp simply because I can't wrap my head around taglibs. To me, Java is simpler and easier for me to understand than the black magic of the taglibs. However, GUI designers aren't programmers, and they typically find java as impossible to understand as I find taglibs. If your shop has good separation of GUI and applications disciplines, taglibs are an indispensable bridge between the disciplines. C versus C++ ... In my comparative performance tests of Java (sun jre 1.4.2 b03) versus compiled languages, Java had raw performance within 10% of the compiled language. This was not an exhaustive test, but one that was intended to hit Java's weakest point relative to a native compiler. Both sets of code were as identical as the language intents allowed, and were iterated through several identical optimizations to pinpoint different bottlenecks. The 10% performance hit was pinpointed to the stackframe that is built with every {} pair in Java, which in turn eliminates an entire class of memory leak errors. For a 10% performance hit, I can live with Java for application programming. However, I recognize that there are places where that hit is critical, and I would use a compiled language (probably not C++, I'd prefer pascal derivatives or even assembly, but language is a personal preference, not a functional issue now days). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSVC, Redhat, and Tomcat 5.0.xx startup
Thanks to the people that responded to my request. I propose that this be added to the FAQ. When attempting to launch tomcat under redhat linux (any version) using jsvc with -user option during boot, and the only logged message is as follows: jsvc.exec error: Service exit with a return value of 143 The final solution (thanks to Patrick Glennon) was: 1. Ensure that the java environment (CLASSPATH, JAVA_HOME, CATALINA_HOME, etc) was fully represented in the launch script 2. Ensure that there was a proper symlink in the directories rc3.d, rc4.d, and/or rc5.d to the launch script 'tomcat' that resides in init.d example: ln -s /etc/init.d/tomcat /etc/rc3.d/S93tomcat The example value 93 is late enough to guarantee a start. On Tue, 2004-06-29 at 00:03, David Johnson wrote: Thanks for the feedback so far. It has been very helpful - I think that I am having an issue with my relative inexperience with linux boot processes. I have made the log as verbose as I could, and it appears that linux is trying to start Tomcat before the network is fully available. Tomcat.sh is a trivial modification of the sample file that is shipped with the Tomcat server. The call to Tomcat.sh is fired from a script called tomcat in init.d Is it possible that I have my startup script in the wrong folder? Thanks, Log excerpt (successful startup): INFO: Installing web application at context path from URL file:/opt/jakarta-tomcat-5.0.25/webapps/ROOT Jun 28, 2004 11:50:19 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:50:20 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jun 28, 2004 11:50:20 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=17/128 config=/opt/jakarta-tomcat-5.0.25/conf/jk2.properties Jun 28, 2004 11:50:21 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 30279 ms Log excerpt (failed startup): INFO: Installing web application at context path from URL file:/opt/jakarta-tomcat-5.0.25/webapps/ROOT Jun 28, 2004 11:12:11 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:12:12 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jun 28, 2004 11:12:12 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=22/190 config=/opt/jakarta-tomcat-5.0.25/conf/jk2.properties Jun 28, 2004 11:12:12 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 32346 ms Jun 28, 2004 11:33:11 PM org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:33:12 PM org.apache.coyote.tomcat5.CoyoteConnector pause SEVERE: Protocol handler pause failed java.net.SocketException: Network is unreachable at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.init(Socket.java:309) at java.net.Socket.init(Socket.java:124) at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:420) at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:264) at org.apache.jk.server.JkMain.pause(JkMain.java:657) at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:199) at org.apache.coyote.tomcat5.CoyoteConnector.pause(CoyoteConnector.java:1417) at org.apache.catalina.core.StandardService.stop(StandardService.java:517) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2332) at org.apache.catalina.startup.Catalina.stop(Catalina.java:605) 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.stop(Bootstrap.java:296) 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.commons.daemon.support.DaemonLoader.stop(DaemonLoader.java:241) jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled
Re: JSVC, Redhat 8, and TomCat 5.0.xx startup
So its behavior is expected when launched manually as a non-root user, and when launched manually as a root user. That leaves the launch at boot time from init.d with unexpected behavior - is the boot script not being launched under root authority? Or is there a known corrective action? Thanks, - Original Message - From: QM [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, June 27, 2004 9:21 PM Subject: Re: JSVC, Redhat 8, and TomCat 5.0.xx startup On Sun, Jun 27, 2004 at 08:48:06PM -0500, David Johnson wrote: : When using jsvc to srart the Tomcat server with its own user ID, launched from : a shell script in init.d during startup, jsvc aborts. If, on the other hand, : I launch the exact same script while logged in a root, the daemon launches : correctly and stays in memory. Finally, if I log in as tomcat, it fails : with exactly the same results as if it were launched during startup. jsvc expects to be run as root such that it can call setuid() and setgid() to change to the nonroot user that actually runs the daemon process. IIRC since jsvc expects root privs, calls to setuid() and setgid() fail when it is run as a nonroot user (in your case, tomcat) even though said user is the intended daemon user. Long story short: sounds like expected behavior to me. ;) -QM -- software -- http://www.brandxdev.net tech news -- http://www.RoarNetworX.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSVC, Redhat, and Tomcat 5.0.xx startup
Thanks for the feedback so far. It has been very helpful - I think that I am having an issue with my relative inexperience with linux boot processes. I have made the log as verbose as I could, and it appears that linux is trying to start Tomcat before the network is fully available. Tomcat.sh is a trivial modification of the sample file that is shipped with the Tomcat server. The call to Tomcat.sh is fired from a script called tomcat in init.d Is it possible that I have my startup script in the wrong folder? Thanks, Log excerpt (successful startup): INFO: Installing web application at context path from URL file:/opt/jakarta-tomcat-5.0.25/webapps/ROOT Jun 28, 2004 11:50:19 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:50:20 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jun 28, 2004 11:50:20 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=17/128 config=/opt/jakarta-tomcat-5.0.25/conf/jk2.properties Jun 28, 2004 11:50:21 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 30279 ms Log excerpt (failed startup): INFO: Installing web application at context path from URL file:/opt/jakarta-tomcat-5.0.25/webapps/ROOT Jun 28, 2004 11:12:11 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:12:12 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jun 28, 2004 11:12:12 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=22/190 config=/opt/jakarta-tomcat-5.0.25/conf/jk2.properties Jun 28, 2004 11:12:12 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 32346 ms Jun 28, 2004 11:33:11 PM org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:33:12 PM org.apache.coyote.tomcat5.CoyoteConnector pause SEVERE: Protocol handler pause failed java.net.SocketException: Network is unreachable at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.init(Socket.java:309) at java.net.Socket.init(Socket.java:124) at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:420) at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:264) at org.apache.jk.server.JkMain.pause(JkMain.java:657) at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:199) at org.apache.coyote.tomcat5.CoyoteConnector.pause(CoyoteConnector.java:1417) at org.apache.catalina.core.StandardService.stop(StandardService.java:517) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2332) at org.apache.catalina.startup.Catalina.stop(Catalina.java:605) 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.stop(Bootstrap.java:296) 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.commons.daemon.support.DaemonLoader.stop(DaemonLoader.java:241) jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Service exit with a return value of 143 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSVC, Redhat, and Tomcat 5.0.xx startup
Thanks for the feedback so far. It has been very helpful - I think that I am having an issue with my relative inexperience with linux boot processes. I have made the log as verbose as I could, and it appears that linux is trying to start Tomcat before the network is fully available. Tomcat.sh is a trivial modification of the sample file that is shipped with the Tomcat server. The call to Tomcat.sh is fired from a script called tomcat in init.d Is it possible that I have my startup script in the wrong folder? Thanks, Log excerpt (successful startup): INFO: Installing web application at context path from URL file:/opt/jakarta-tomcat-5.0.25/webapps/ROOT Jun 28, 2004 11:50:19 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:50:20 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jun 28, 2004 11:50:20 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=17/128 config=/opt/jakarta-tomcat-5.0.25/conf/jk2.properties Jun 28, 2004 11:50:21 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 30279 ms Log excerpt (failed startup): INFO: Installing web application at context path from URL file:/opt/jakarta-tomcat-5.0.25/webapps/ROOT Jun 28, 2004 11:12:11 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:12:12 PM org.apache.jk.common.ChannelSocket init INFO: JK2: ajp13 listening on /0.0.0.0:8009 Jun 28, 2004 11:12:12 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=22/190 config=/opt/jakarta-tomcat-5.0.25/conf/jk2.properties Jun 28, 2004 11:12:12 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 32346 ms Jun 28, 2004 11:33:11 PM org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote HTTP/1.1 on http-8000 Jun 28, 2004 11:33:12 PM org.apache.coyote.tomcat5.CoyoteConnector pause SEVERE: Protocol handler pause failed java.net.SocketException: Network is unreachable at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.init(Socket.java:309) at java.net.Socket.init(Socket.java:124) at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:420) at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:264) at org.apache.jk.server.JkMain.pause(JkMain.java:657) at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:199) at org.apache.coyote.tomcat5.CoyoteConnector.pause(CoyoteConnector.java:1417) at org.apache.catalina.core.StandardService.stop(StandardService.java:517) at org.apache.catalina.core.StandardServer.stop(StandardServer.java:2332) at org.apache.catalina.startup.Catalina.stop(Catalina.java:605) 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.stop(Bootstrap.java:296) 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.commons.daemon.support.DaemonLoader.stop(DaemonLoader.java:241) jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Shutdown or reload already scheduled jsvc.exec error: Service exit with a return value of 143 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSVC, Redhat 8, and TomCat 5.0.xx startup
I have noticed that a number of other people have written with this problem, and I was wondering if there was a permanent solution yet. When using jsvc to srart the Tomcat server with its own user ID, launched from a shell script in init.d during startup, jsvc aborts. If, on the other hand, I launch the exact same script while logged in a root, the daemon launches correctly and stays in memory. Finally, if I log in as tomcat, it fails with exactly the same results as if it were launched during startup. Not being a linux guru (yet) or a jsvc guru, I am guessing. It appears to me as though the version of jsvc shipped with tomcat is attempting to write the jsvc.pid file somewhere that it lacks the authority to do so during the boot process. My reading of the symptoms could be wrong, so I would like some feedback from those who are really knowledgable about these products. Is there a solution to this problem? Thanks in advance.