Re: Mail Authentification
Partial message is available. Attachment: No Virus found Norton AntiVirus - www.symantec.de ** ** WARNING: WinProxy has detected a virus in file attached to this e-mail message! The attachment has been automatically removed to protect your network. WinProxy Administrator: [EMAIL PROTECTED] 06/27/04 10:30:42 WinProxy (Version 5.1 R1d (5.0.50.10)) - http://www.Ositis.com/ Antivirus Vendor: Panda Software Scan Engine Version: 2.10.1.6_3.1.5.211 Pattern File Version: 3.79587 (Timestamp: 2004/06/26 08:02:21) Machine name: SERVER Machine IP address: 217.139.38.67 Server: 209.237.227.199 Client: dark Protocol: SMTP Virus: W32/Netsky.P.worm found! Attachment: document.zip ** ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
UTF-8 character encoding and Tomcat 5.0.25
Hi, In upgrading my webapp from Tomcat 4.1.X to Tomcat 5.0.25, it seems UTF-8 character encoding no longer works as it did before. I've already read and followed advice from the Tomcat FAQ http://jakarta.apache.org/tomcat/faq/tomcatuser.html and read the bug reports related to this problem with no clues. Here's what I've done so far: 1) Add a filter which does the request.setCharacterEncoding(UTF-8); 2) Use res.setContentType(text/html; charset=utf-8); and out.println(meta http-equiv=\Content-Type\ content=\text/html; charset=utf-8\/); in my servlet when creating the html page to be output 3) Add %@ page contentType=text/html; charset=UTF-8 pageEncoding=UTF-8 % to the top of JSP files containing strings to be localized What else could I missing? What I would like to know is why is it possible for my code to work fine on Tomcat 4 but not Tomcat 5-- it would seem either something is in fact broken, or instructions need to be updated on adding some bit of information that wasn't necessary before. Thanks, Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
¤é¥»±MÂd¤k¾c
§Ö¡D¨Ó¡D¬Ý¡D¤é¡D¥»¡D±M¡DÂd¡D¤k¡D¾c¡D¯S¡D»ù¡D³á!! http://www.12.idv.tw - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DataSourceRealm
Hi! I am trying to get a DataSourceRealm running. I followed the instruction in tomcat-docs/realm-howto.html#DataSourceRealm, but as soon as i login i get DataSourceRealm[/secutity-example]: Exception performing authentication javax.naming.NameNotFoundException: Name jdbc is not bound in this Context in my logs. As DataSource i use a connectionpool which is configured according the jndi-resources-howto. Has anyone got a connectionpool as DataSourceRealm running in jakarta-tomcat-5.0.* and can post the interesting parts of his configuration? Regards, Henrik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: UTF-8 character encoding and Tomcat 5.0.25
What, exactly, is going wrong? Are the JSP pages mishandled? The request parameters? -Original Message- From: Jason Novotny [mailto:[EMAIL PROTECTED] Sent: Sunday, June 27, 2004 7:59 AM To: Tomcat Users List Subject: UTF-8 character encoding and Tomcat 5.0.25 Hi, In upgrading my webapp from Tomcat 4.1.X to Tomcat 5.0.25, it seems UTF-8 character encoding no longer works as it did before. I've already read and followed advice from the Tomcat FAQ http://jakarta.apache.org/tomcat/faq/tomcatuser.html and read the bug reports related to this problem with no clues. Here's what I've done so far: 1) Add a filter which does the request.setCharacterEncoding(UTF-8); 2) Use res.setContentType(text/html; charset=utf-8); and out.println(meta http-equiv=\Content-Type\ content=\text/html; charset=utf-8\/); in my servlet when creating the html page to be output 3) Add %@ page contentType=text/html; charset=UTF-8 pageEncoding=UTF-8 % to the top of JSP files containing strings to be localized What else could I missing? What I would like to know is why is it possible for my code to work fine on Tomcat 4 but not Tomcat 5-- it would seem either something is in fact broken, or instructions need to be updated on adding some bit of information that wasn't necessary before. Thanks, Jason - 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 and the -server option
Hello Hadn't heard about any instability on the server VM. Anybody? The -server option works fine for me on RedHat 9 and Java 1.4.2_xxx. In a recent article: http://www.kano.net/javabench/ The author is minded to write: The results I got show that no one should ever run the client JVM when given the choice... HTH. Good luck! Harry Mantheakis London, UK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with classpath
You can achieve this by using the thread context class loader.. Thread.currentThread().getContextClassLoader().getResourceAsStream(client1.properties); Or, just pass the classloader to the classes that need to load the properties files and you will get the same effect. Jake At 11:44 AM 6/26/2004 +0530, you wrote: I wanted some info on using single instance of tomcat for managing multiple web applications. I am repeating my question below, please help me out with the same ... I am running an application for multiple clients and the setup is like the set of classes being used are common and the property files are different for each client. The structure looks as below : /usr/local/common_application_classes/ - this folder contains all classes /usr/local/properties/client1/ - this folder contains properties of client1 /usr/local/properties/client2/ - this folder contains properties of client2 .. etc for all the different clients. Now, this is a web based application and the classes in the /usr/local/common_application_classes/ are being used from the web application (servlet, jsp files). The properties files are being used from the classes contained in the /usr/local/common_application_classes/ folder. I want to setup a common tomcat (preferabbly tomcat3, or tomcat4) for all these clients, but how should I setup the classpath? /usr/local/common_application_classes/ should be in tomcat's classpath. But, properties files are different for different classes, so thought of creating single tomcat and under that, multiple contexts, one for each client and the properties files goes in the respective client's context/WEB-INF/classes. But, since the classes accessing the properties files are outside tomcat (not in context/WEB-INF/classes), are not being able to access properties files - gives MissingResourceException. Let say, I have a test.jsp file in context /test, which calls a TestClass.class file and this TestClass.class file is looking up some property file through ResourceBundle. The property file is in /test/WEB-INF/classes/ directory. Now, if the TestClass.class is in /test/WEB-INF/classes, then it works perfectly fine, but if the TestClass.class is outside tomcat (included in tomcat's classpath), then it gives MissingResourceException while looking up property file. Please give me some direction to prceed further - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 22, 2004 11:45 AM Subject: Re: problem with classpath i am sorry you got a wrong address here i don't know who you are and what you are talking about - 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: class loader interdependencies
At 12:12 PM 6/26/2004 +0530, you wrote: Let say, my physical class file is located in /common and I put a soft link to this in the WEB-INF/classes of a webapp. (using the ln command - RH Linux). In this case, this class would be loaded by which class loader? The classloader of the webapp or the common class loader? I'm not entirely sure about soft linking and classloading on Linux, but I can tell you it is probably a bad strategy. You are playing with fire and, even if this works for the moment, will probably get burned in the future. Think about this; if the class is successfully loaded by the parent via the link, will that newly loaded class then have access to it's own dependencies which, presumably, exist in WEB-INF/class or WEB-INF/lib? Even if it did work, you common library would now have loaded a separate class than the classes in WEB-INF/classes and WEB-INF/lib. Not physically separate, but separate because a class' identity is define not only by itself, but by the classloader that loaded it. Again, even if it did work momentarily, you would probably end up with odd ClassCastExceptions. You have to think about classloading behavior from the beginning if you plan on using separate classloaders. Separate components which shouldn't depend on each other at compile time. If you do that, then you will know about classloading dependencies before runtime because nothing will compile until you get it straight. In certain cases, you might find that if you want to share certain libraries, that entails sharing others. In other cases, you can factor out the dependency, thereby creating a better separation of concerns between your classes. Moral of the story. Be wary of using quick fix solutions for classloader problems or use JBoss and figure that everything is in a single classloader. Good luck with that one as well. It always sounds good until you get to the details. Just be wary. Jake Ankit - Original Message - From: Cox, Charlie [EMAIL PROTECTED] To: 'Tomcat Users List' [EMAIL PROTECTED] Sent: Friday, June 25, 2004 7:27 PM Subject: RE: class loader interdependencies Classes in /common and /shared can not see classes in /WEB-INF. A class loaded by the nth classloader will not see any classes loaded by (n-1) classloader. However, it will see classes loaded by n+1 loader. This is the classloader hierarchy. Any classloader only has one parent to which it can delegate any classes that it can not resolve. Since multiple classloaders(one for each webapp) can have the same parent, the common classloader would not know which WEB-INF to reference when searching for a class. Therefore all your classes need to be in /common if any within /common reference them. As an alternate, you can copy all classes to each /WEB-INF. Charlie -Original Message- From: Larry Levin [mailto:[EMAIL PROTECTED] Sent: Friday, June 25, 2004 9:30 AM To: [EMAIL PROTECTED] Subject: class loader interdependencies Hi all; I am trying to share some jars across multiple web-apps, each of which runs in its own environment (i.e, JVM). To do this I make use of the CATALINA_BASE environment variable. My problem is in regards to class loading. I have a number of jar files that are common to each webapp but I also have a couple that are unique to each app. According to the documentation for Tomcat 4.1: from the perspective of a web application, class or resource loading looks in the following repositories, in this order: 1) /WEB-INF/classes of your web application 2) /WEB-INF/lib/*.jar of your web application 3) Bootstrap classes of your JVM 4) System class loader classes 5) $CATALINA_HOME/common/classes 6) $CATALINA_HOME/common/endorsed/*.jar 7) $CATALINA_HOME/common/lib/*.jar 8) $CATALINA_BASE/shared/classes 9) $CATALINA_BASE/shared/lib/*.jar I have therefore tried two different approaches, both of which fail for the same reason. 1st approach: I modified the standard startup script to add the shared jars to the CLASSPATH, thereby treating them as System class loader classes (i.e., category #4 in the above sequence). 2nd approach: I placed the shared jars in $CATALINA_HOME/common/lib (i.e., category #7 in the above sequence). In both cases everything works fine UNTIL one of these shared classes needs to access a class located in one of the /WEB-INF/lib/*.jar of a web application (i.e., category #2). At that point my code throws a ClassNotFoundException. My impression is that something in the class loader procedures prevents loading backwards by which I mean: IF Class X was loaded by the nth loader in the sequence (e.g., #4, the system loader), AND Class X references a previously unloaded class, THEN Tomcat will ignore any loader lower in the sequence the Class X's loader (e.g., loaders 1-3 (the /WEB-INF and bootstrap loaders in this example))
Where do the Context's go in TC5...
Hi List, I have been using TC4 for some time and decided to switch to 5.0.24 when I started working on a new project. Anyhow, I was just going to set up my JDBC pool in Tomcat when I remembered reading that all with TC5 you shouldn't put any context related stuff in the server.xml (see: tomcat-docs/config/context.html). This is were I got confused because the how-to on setting up JDBC for TC5 talks about editing the relevant context in server.xml. To increase my misery, I discovered that the logger (for my context) - that I did set up via the admin-tool - was saved in {catalina_home}\conf\Catalina\localhost\myapp.xml and works fine BUT is (after a restart) not to be seen anywhere in the admin-tool I guess my general question is, where do I specify my JDBC pool and everything else for my context? server.xml or myapp.xml? TIA Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UTF-8 character encoding and Tomcat 5.0.25
It seems all the accented characters in any language show up as ?.. Thanks, Jason Benson Margulies wrote: What, exactly, is going wrong? Are the JSP pages mishandled? The request parameters? -Original Message- From: Jason Novotny [mailto:[EMAIL PROTECTED] Sent: Sunday, June 27, 2004 7:59 AM To: Tomcat Users List Subject: UTF-8 character encoding and Tomcat 5.0.25 Hi, In upgrading my webapp from Tomcat 4.1.X to Tomcat 5.0.25, it seems UTF-8 character encoding no longer works as it did before. I've already read and followed advice from the Tomcat FAQ http://jakarta.apache.org/tomcat/faq/tomcatuser.html and read the bug reports related to this problem with no clues. Here's what I've done so far: 1) Add a filter which does the request.setCharacterEncoding(UTF-8); 2) Use res.setContentType(text/html; charset=utf-8); and out.println(meta http-equiv=\Content-Type\ content=\text/html; charset=utf-8\/); in my servlet when creating the html page to be output 3) Add %@ page contentType=text/html; charset=UTF-8 pageEncoding=UTF-8 % to the top of JSP files containing strings to be localized What else could I missing? What I would like to know is why is it possible for my code to work fine on Tomcat 4 but not Tomcat 5-- it would seem either something is in fact broken, or instructions need to be updated on adding some bit of information that wasn't necessary before. Thanks, Jason - 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: UTF-8 character encoding and Tomcat 5.0.25
In which direction? If you write %= \u % for an accented char, does it display in the browser? What does 'View/Encoding reveal for the browser's idea? -Original Message- From: Jason Novotny [mailto:[EMAIL PROTECTED] Sent: Sunday, June 27, 2004 3:29 PM To: Tomcat Users List Subject: Re: UTF-8 character encoding and Tomcat 5.0.25 It seems all the accented characters in any language show up as ?.. Thanks, Jason Benson Margulies wrote: What, exactly, is going wrong? Are the JSP pages mishandled? The request parameters? -Original Message- From: Jason Novotny [mailto:[EMAIL PROTECTED] Sent: Sunday, June 27, 2004 7:59 AM To: Tomcat Users List Subject: UTF-8 character encoding and Tomcat 5.0.25 Hi, In upgrading my webapp from Tomcat 4.1.X to Tomcat 5.0.25, it seems UTF-8 character encoding no longer works as it did before. I've already read and followed advice from the Tomcat FAQ http://jakarta.apache.org/tomcat/faq/tomcatuser.html and read the bug reports related to this problem with no clues. Here's what I've done so far: 1) Add a filter which does the request.setCharacterEncoding(UTF-8); 2) Use res.setContentType(text/html; charset=utf-8); and out.println(meta http-equiv=\Content-Type\ content=\text/html; charset=utf-8\/); in my servlet when creating the html page to be output 3) Add %@ page contentType=text/html; charset=UTF-8 pageEncoding=UTF-8 % to the top of JSP files containing strings to be localized What else could I missing? What I would like to know is why is it possible for my code to work fine on Tomcat 4 but not Tomcat 5-- it would seem either something is in fact broken, or instructions need to be updated on adding some bit of information that wasn't necessary before. Thanks, Jason - 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]
log4j question
With the following configuration: # All the .File parameters will be relative to the application's /WEB-INF/log/ # directory. # Global logger will be the general logger log4j.rootLogger=INFO, A2 log4j.rootLogger.additivity=false # This is logger for any general information we want to log log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender log4j.appender.A2.MaxFileSize=2MB log4j.appender.A2.DatePattern='.'-MM-dd log4j.appender.A2.File=log.txt log4j.appender.A2.layout=org.apache.log4j.PatternLayout log4j.appender.A2.ConversionPattern=%d [%t] %-5p %c - %m%n # This is where all the debug information will go to log4j.logger.debugger=DEBUG, A1 log4j.debugger.additivity=false log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender log4j.appender.A1.MaxFileSize=2MB log4j.appender.A1.DatePattern='.'-MM-dd log4j.appender.A1.File=debug.txt log4j.appender.A1.layout=org.apache.log4j.PatternLayout log4j.appender.A1.layout.ConversionPattern=%5p (%F:%L) - %m%n How come when I use Logger.getLogger(debugger).debug(debug stuff); The debug stuff appears in log.txt (which is the root logger set on level INFO) Best Regards, Ivan V. Jouikov (206) 228-6670 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.701 / Virus Database: 458 - Release Date: 07.06.2004
Tag handler can't evaluate EL
Tomcat 5.0.19 can run the following tag, but can't assgin or evaluate values to/from EL variable. So, Tomcat output is: ${a1} ${a1} ${a1} while expected output is: a b c Resin and JRun can do the expected behavior. ---tag handler package mytag; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import java.io.*; import javax.servlet.http.*; import java.util.*; public class foreach extends BodyTagSupport{ private Iterator iterator; private String group; public void setGroup(String group){ this.group = group; } public String getGroup(){ return group; } public int doStartTag() throws JspException{ try{ String[] intarray = new String[] {a,b,c}; ArrayList ar = new ArrayList(Arrays.asList(intarray)); iterator = ar.iterator(); if (iterator.hasNext()){ String o = (String)iterator.next(); pageContext.setAttribute(a1, o); return EVAL_BODY_BUFFERED; } else{ return SKIP_BODY; } } catch (Exception e){ System.err.println(e); } return SKIP_BODY; } public int doAfterBody() throws JspException{ try{ if (iterator == null){ return SKIP_BODY; } if (iterator.hasNext()) { String o = (String)iterator.next(); pageContext.setAttribute(a1, o); return EVAL_BODY_AGAIN; } else{ return SKIP_BODY; } } catch (Exception e){ System.err.println(e); } return SKIP_BODY; } public int doEndTag() throws JspException { try { pageContext.getOut().print(bodyContent.getString()); } catch(Exception ioe) { System.out.println(ioe); } return EVAL_PAGE; } } --test.jsp--- %@ page contentType=text/html % %@ taglib prefix=jrun uri=/WEB-INF/mytag.tld % htmlbody bgcolor=lightgreen hr [Tag Test]br jrun:foreach group=itemsql ${a1}br /jrun:foreach hr This is another testbr jrun:foreach group=itemsql ${a1}br /jrun:foreach hr This bad boy!br jrun:foreach group=itemsql ${a1}br /jrun:foreach hr/body/html --TLD ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd; taglib tlib-version1.0/tlib-version jsp-version1.2/jsp-version tag nameforeach/name tag-classmytag.foreach/tag-class body-contentJSP/body-content attribute namegroup/name requiredtrue/required rtexprvaluetrue/rtexprvalue /attribute /tag /taglib - -- Hiroshi Iwatani *stop cruelty* Annual number of institutionally euthanized cats and dogs including kittens and puppies: US 5 million, JP 500 thousand. How about your country? *for our better karma* - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
WARNING: Unexpected error forwarding to login page
Is this the correct Mailing list to post this on? I am trying to use FORM based authentication but I am getting this error in the tomcat console... code: _ Jun 25, 2004 2:51:46 PM org.apache.catalina.authenticator.FormAuthenticator authenticate WARNING: Unexpected error forwarding to login page java.lang.NullPointerException at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthent icator.java:214) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:504) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:702) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:644) at java.lang.Thread.run(Thread.java:534) _ When I try to goto my web page (http://localhost:8080/E3/common/CustomerInq/index.faces) I get a blank screen. However, if after getting the blank screen I goto the login page (http://localhost:8080/E3/login2.jsp) and type in a correct login page then I will get redirected to the CustomerInq/index.faces page correctly. This is a snippit of my web.xml... code: _ !-- Faces Servlet Mapping -- servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameresticted/web-resource-name url-pattern/common/*/url-pattern /web-resource-collection auth-constraint role-nameuser/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-page/login2.jsp/form-login-page form-error-page/loginerror.jsp/form-error-page /login-config security-role role-nameuser/role-name /security-role /web-app _ and here is the login from the Orielly JSF book that I am trying to use as a starting point... code: _ html head titleLogin/title link rel=stylesheet type=text/css href=${pageContext.request.contextPath}/style.css /head body bgcolor=white div class=titlePlease Login/div p The page you requested is only available to registered users. Please enter your username and password and click Login. /p form action=j_security_check method=post table class=tablebg tr td align=rightUsername:/td tdinput name=j_username/td /tr tr td align=rightPassword:/td td input type=password name=j_password /td /tr
RE: jspc
Hi Jason, Yes, it was of help. Thanks for your lengthy insight. Paul. Hi Paul, To specify a path for your compilation results use the -d option like so: jspc.sh -compile -d /jakarta-tomcat-5.0.25/webapps myapp/WEB-INF/classes ...the rest of you compile options... It will build any subdirs required using the directory you specify, along with the package name you give it (org.apache.jsp if you don't specify a package name) as the root directory for any subdirs. As for the work directory that is where Tomcat places any jsps that it has to compile (i.e. non-precompiled jsps) during runtime. If you run Tomcat with uncompiled jsps and walk though your app in a browser you will see compiled JSPs appear in the work directory. It will create subdirs, etc. to mimic your applications directory structure and place compiled versions there. You could just place your compiled jsps in the same respective places in the work directory before starting Tomcat and it would probably work. BUT, Tomcat will only expand .war files into the webapps directory so you have no way of packaging up these compiled files from the work directory and automatically expanding them into another work directory at Tomcat startup. That would have to be a manual process by the end user (or an install script). It is not the recommended deployment strategy. It does save you from having to worry about having the web.xml mappings correct though. Tomcat will check first in the work directory for a compiled jsp and then look for an uncompiled version if it doesn't find one there. No mappings in web.xml are required. In answer to another related question I saw posted: If you precompile your JSPs and then remove the original JSPs you need to have two things for your app to run: 1. The compiled JSP class files need to be copied over to the WEB-INF/classes directory with the correct directory structure. (The exact directory with be the package name (org.apache.jsp by default) plus any subdirs the JSP existed in under you apps root folder. i.e. if under webapps/yourapp you had a jsp in a directory subdir1/subdirB then under you WEB-INF/classes directory you would need a directory called org/apache/jsp/subdir1/subdirB and you would place that compiled JSP class there. The easiest way to do this is to run your compile with the -d option as stated above and point the output to your WEB-INF/classes directory. jspc in Tomcat 5.x should automatically create the correct subdir structure and place the class file in it. 2. Yuo need servlet definitions and mappings that tell Tomcat If someone requests this .jsp execute this servlet instead. These go in the web.xml file for your app. jspc will create a complete file or just a fragment file that contains all the mappings. You can tell it explicitly to create a fragment file with the -webinc option like so: -webinc /jakarta-tomcat-5.0.25/webapps/myapp/WEB-INF/my_web_fragment.xml I think it creates a complete web.xml if you use this option -webxml /jakarta-tomcat-5.0.25/webapps/myapp/WEB-INF/my_complete_web.xml In this case you just have to rename the file web.xml and place it in you app's WEB-INF directory. If you don't do BOTH of these things, then Tomcat won't know where to look for your compiled JSPs and will instead look for the actual .jsp. Finding nothing it will throw a 404 error. I hope this is helpful. Jason --- Paul Wallace [EMAIL PROTECTED] wrote: (sorry, wrong key!) Hi Jason, Thanks for that. Yes, it does make sense. A couple of things though, I just ran it with -compile - great. But my query about the work directory and was more towards what I am being 'encouraged' to do from the powers that be. I.e not WAR the app., but put it in the work directory. Is this ill-advised/poor practice? To accomplish this, is it as simple as dragging the compiled source under my work directory, and modifying my web.xml as advised? Why does -compile work, but not appear in the usage?! Also, can I specify a path for the compilation, rather than the classes be placed in the same dirs as the source? (I tried adding a path after the -compile switch, but it constructed and compiled a file with the same name as the class directory destination). Do I make sense?! Paul. Paul, I just use the -compile option and have jspc do the compilation from .java to .class for me. It seems to work fairly well. Once all the fully compiled (ie .class) files are placed in you applications WEB-INF/classes directory you just need to place the generated web.xml file in WEB-INF. There is an option to create a complete web.xml file that you can place in WEB-INF or, if you already have a web.xml file you want to keep, you can have jspc create an xml fragment that just contains the servlet definitions and mappings that you then add (in the appropriate place) to your existing web.xml. Then just war up you application
FW: WARNING: Unexpected error forwarding to login page
Sorry for the repost.. Formatting got messed up. Is this the correct Mailing list to post this on? I am trying to use FORM based authentication but I am getting this error in the tomcat console... code: Jun 25, 2004 2:51:46 PM org.apache.catalina.authenticator.FormAuthenticator authenticate WARNING: Unexpected error forwarding to login page java.lang.NullPointerException at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthent icator.java:214) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase .java:504) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:702) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:644) at java.lang.Thread.run(Thread.java:534) When I try to goto my web page (http://localhost:8080/E3/common/CustomerInq/index.faces) I get a blank screen. However, if after getting the blank screen I goto the login page (http://localhost:8080/E3/login2.jsp) and type in a correct login page then I will get redirected to the CustomerInq/index.faces page correctly. This is a snippit of my web.xml... code: !-- Faces Servlet Mapping -- servlet-mapping servlet-nameFaces Servlet/servlet-name url-pattern*.faces/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameresticted/web-resource-name url-pattern/common/*/url-pattern /web-resource-collection auth-constraint role-nameuser/role-name /auth-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-page/login2.jsp/form-login-page form-error-page/loginerror.jsp/form-error-page /login-config security-role role-nameuser/role-name /security-role /web-app and here is the login from the Orielly JSF book that I am trying to use as a starting point... code: html head titleLogin/title link rel=stylesheet type=text/css href=${pageContext.request.contextPath}/style.css /head body bgcolor=white div class=titlePlease Login/div p The page you requested is only available to registered users. Please enter your username and password and click Login. /p form action=j_security_check method=post table class=tablebg tr td align=rightUsername:/td tdinput name=j_username/td /tr tr td align=rightPassword:/td td input type=password name=j_password /td /tr /table input type=submit value=Login /form /body /html Any ideas are will be greatly appreciated. -David David Wilson [EMAIL PROTECTED] Staff Developer Relevant Business Systems (Fax) 678-868-1773 Please send complaints to /dev/null
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.
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]
RE: jsvc and the -server option
so I should grab a more recent jsvc? the jsvc -help shows 'null' detected, and when I add -jvm server it core dumps. I grabbed one from here: http://www.apache.org/dist/jakarta/commons/daemon/binaries/, compiled it, and reran jsvc -help, which still shows 'null', and it still dumps core when I try and select -jvm server. Is the cvs version fairly stable if I grabbed that one? or am I just missing something relatively simple? -P -Original Message- From: Bill Barker [mailto:[EMAIL PROTECTED] Sent: Friday, June 25, 2004 9:33 PM To: [EMAIL PROTECTED] Subject: Re: jsvc and the -server option The correct option is: -jvm server You can run 'jsvc -help' to see which JVM options it is able to find. Note that for at least some 1.4 JVMs, you need to upgrade the source from commons-daemon, since the version that ships with Tomcat doesn't handle detection correctly. Patrick Glennon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've seen a few references to this issue, but no solution. I can't seem to figure out how to pass the -server option to the jvm via jsvc. Jsvc only recognizes -D and -X values getting passed, and I'd obviously prefer to run the server version of the VM. I can't find an equivalent command to specify the server vm. I can't believe I'm the only one having this problem. Is every other jsvc user out there just running the default client vm? Please help! -P - 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 and the -server option
Patrick Glennon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] so I should grab a more recent jsvc? the jsvc -help shows 'null' detected, and when I add -jvm server it core dumps. I grabbed one from here: http://www.apache.org/dist/jakarta/commons/daemon/binaries/, compiled it, and reran jsvc -help, which still shows 'null', and it still dumps core when I try and select -jvm server. If JAVA_HOME isn't in the environment, you'll probably need: jsvc -home /path/to/JDK -help Is the cvs version fairly stable if I grabbed that one? or am I just missing something relatively simple? The cvs version is stable enough that it's the version I use (but I'm biased :). It's just a few bug fixes over the 1.0 version. -P -Original Message- From: Bill Barker [mailto:[EMAIL PROTECTED] Sent: Friday, June 25, 2004 9:33 PM To: [EMAIL PROTECTED] Subject: Re: jsvc and the -server option The correct option is: -jvm server You can run 'jsvc -help' to see which JVM options it is able to find. Note that for at least some 1.4 JVMs, you need to upgrade the source from commons-daemon, since the version that ships with Tomcat doesn't handle detection correctly. Patrick Glennon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I've seen a few references to this issue, but no solution. I can't seem to figure out how to pass the -server option to the jvm via jsvc. Jsvc only recognizes -D and -X values getting passed, and I'd obviously prefer to run the server version of the VM. I can't find an equivalent command to specify the server vm. I can't believe I'm the only one having this problem. Is every other jsvc user out there just running the default client vm? Please help! -P - 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]