Re: Can't connect to X11 window server using '0:0' as the value of the display and now java.awt.HeadlessException
On Thu, 2003-03-20 at 20:36, Micael wrote: For me the easiest thing was just to provide the right command line options (java.awt.headless=true) when I started up Tomcat. May I ask, how you did this ? I've also encountered JNI_OnLoad errors runing on Solaris due, I suspect, the lack of XWindows on my server. I tried adding the headless flag to my catalina.sh script as follows ~ elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 else $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 fi But that just resulted in the following error, java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121) at java.awt.Window.(Window.java:266) at java.awt.Frame.(Frame.java:398) at java.awt.Frame.(Frame.java:363) at ImageUtils.loadImage(Unknown Source) where the loadImage() function is simply supposed to load an image, public static Image loadImage(String fileName) { Image image = Toolkit.getDefaultToolkit().getImage(fileName); MediaTracker mediaTracker = new MediaTracker(new Frame()); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException ie) { // } return image; } Any ideas/help would be great. Stephen. ps. I also tried PJA but couldn't get that to work either :( - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs
Re: Can't connect to X11 window server using '0:0' as the value of the display and now java.awt.HeadlessException
I added the headless flag to catalina.sh as follows: # - Execute The Requested Command - echo Using CATALINA_BASE: $CATALINA_BASE echo Using CATALINA_HOME: $CATALINA_HOME echo Using CATALINA_TMPDIR: $CATALINA_TMPDIR echo Using JAVA_HOME: $JAVA_HOME if [ $1 = jpda ] ; then if [ -z $JPDA_ADDRESS ]; then JPDA_ADDRESS=8000 fi if [ -z $JDPA_OPTS ]; then JPDA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n fi CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS shift fi CATALINA_OPTS=-Djava.awt.headless=true This worked fine. At 08:15 AM 3/23/03 +, you wrote: On Thu, 2003-03-20 at 20:36, Micael wrote: For me the easiest thing was just to provide the right command line options (java.awt.headless=true) when I started up Tomcat. May I ask, how you did this ? I've also encountered JNI_OnLoad errors runing on Solaris due, I suspect, the lack of XWindows on my server. I tried adding the headless flag to my catalina.sh script as follows ~ elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 else $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 fi But that just resulted in the following error, java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121) at java.awt.Window.(Window.java:266) at java.awt.Frame.(Frame.java:398) at java.awt.Frame.(Frame.java:363) at ImageUtils.loadImage(Unknown Source) where the loadImage() function is simply supposed to load an image, public static Image loadImage(String fileName) { Image image = Toolkit.getDefaultToolkit().getImage(fileName); MediaTracker mediaTracker = new MediaTracker(new Frame()); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException ie) { // } return image; } Any ideas/help would be great. Stephen. ps. I also tried PJA but couldn't get that to work either :( - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't connect to X11 window server using '0:0' as the value of the display and now java.awt.HeadlessException
Thanks Micael. Tried the same thing and got the same results. Looks like Catalina/Tomcat is indeed using headless mode but it's not working with my Java (1.4) and operating system (SunOS 5.6). I'm presuming you're using this to create/generate graphics in a servlet ? Do you mind posting sample Java that creates a Toolkit or MediaTracker (and which therefore requires headless mode) ? I can't fathom what's wrong with mine. Mine works fine when running on Win2K and Tomcat, but now dying on Sun. Thanks for the help, Stephen. Micael [EMAIL PROTECTED] wrote: I added the headless flag to catalina.sh as follows: # - Execute The Requested Command - echo Using CATALINA_BASE: $CATALINA_BASE echo Using CATALINA_HOME: $CATALINA_HOME echo Using CATALINA_TMPDIR: $CATALINA_TMPDIR echo Using JAVA_HOME: $JAVA_HOME if [ $1 = jpda ] ; then if [ -z $JPDA_ADDRESS ]; then JPDA_ADDRESS=8000 fi if [ -z $JDPA_OPTS ]; then JPDA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n fi CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS shift fi CATALINA_OPTS=-Djava.awt.headless=true This worked fine. At 08:15 AM 3/23/03 +, you wrote: On Thu, 2003-03-20 at 20:36, Micael wrote: For me the easiest thing was just to provide the right command line options (java.awt.headless=true) when I started up Tomcat. May I ask, how you did this ? I've also encountered JNI_OnLoad errors runing on Solaris due, I suspect, the lack of XWindows on my server. I tried adding the headless flag to my catalina.sh script as follows ~ elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 else $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 fi But that just resulted in the following error, java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121) at java.awt.Window.(Window.java:266) at java.awt.Frame.(Frame.java:398) at java.awt.Frame.(Frame.java:363) at ImageUtils.loadImage(Unknown Source) where the loadImage() function is simply supposed to load an image, public static Image loadImage(String fileName) { Image image = Toolkit.getDefaultToolkit().getImage(fileName); MediaTracker mediaTracker = new MediaTracker(new Frame()); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException ie) { // } return image; } Any ideas/help would be great. Stephen. ps. I also tried PJA but couldn't get that to work either :( - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs
JDBC Driver disappears when using Mod_jk !
Dear Sirs, This is truly bizarre. I've been runing Apache+mod_webapp in front of one of our websites for quite a time now and it has worked fine for serving up JSP pages. So, the Apache-mod_webapp-Tomcat communication seems to be working OK. I recently added a JNDI datasource to the Tomcat web application. The datasource is configured perfectly, as proven with the useful servlet (below) which we always use to test JNDI datasource connections. ie. http://www.oursite.com:8080/ourapp/TestDb?jndi=jdbc/dbname reports that we successfully created a database connection from the JNDI datasource. However, when we now try to access via mod_webapp ie. http://www.oursite.com/ourapp/TestDb?jndi=jdbc/dbname it reports an error message Cannot load JDBC driver class 'null' How can this be ??? Apache+mod_webapp has been proven to be configured properly since we've been serving up JSP from this webapp for months. When connecting directly to Tomcat on port 8080, the JNDI resource does indeed exist and we can create the connection so the JDBC driver must exist too (and it does) ! Why does the JDBC driver seem to disappear when using mod_webapp??? I hope somebody can shed some light on this. Thank you in advance, Soefara. ps. here's the servlet we use for testing JNDI datasource connections, maybe some of you will find it useful. -- import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; import java.sql.*; import javax.sql.*; import javax.naming.*; public class DbHandlerDebug extends HttpServlet { public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Connection conn = null; String jndiName = request.getParameter(jndi); response.setContentType(text/html); PrintWriter out = new PrintWriter(response.getOutputStream() ); out.println(htmlbodyh3Test JNDI/h3); Context ctx = null; DataSource ds = null; if (jndiName == null) { out.println(font color=#ffpUsage : send argument 'jndi'. br eg. /servlet/TestDB?jndi=jdbc/ourdb); } try { ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); out.println(liRetrieved Context); ds = (DataSource) envCtx.lookup(jndiName); out.println(liObtained Datasource); conn = ds.getConnection(); out.println(liGot Connection); out.println(h3OK :-)/h3); } catch (NamingException e) { out.println(Failed to get datasource from context : + e.getMessage()); } catch (SQLException e) { out.println(Failed to get DB connection : + e.getMessage()); } catch (Exception e) { out.println(Unexpected error : + e.getMessage()); } out.flush(); } } _ Download ringtones, logos and picture messages from MSN Malaysia http://www.msn.com.my/mobile/ringtones/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat servlet invoker
Which is why you should be using a Model2 framework like Barracuda, Struts, Maverick, and other frameworks. Jake At 01:59 PM 3/23/2003 +0200, you wrote: What will be used to invoke the servlet then ? The servlet mapping is one to one. What happen if I have a lot of servlets ? The 1 to 1 mapping may cause some maintainance problem. Thanks. NBS - Original Message - From: James Carman [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 7:01 AM Subject: Re: tomcat servlet invoker You should not use the invoker servlet. You should set up servlet mappings in your web.xml file for your servlets. - Original Message - From: Boon Seong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 6:01 AM Subject: tomcat servlet invoker Hi, With reference to the documentation at http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.21-beta/REL EASE-NOTES , on the section Enabling invoker servlet, there is this note - Using the invoker servlet in a production environment is not recommended and is unsupported. - Wonder what we should use for servlet invokation for a production environment ? Thanks. nbs - 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: install tomat on winZP pro
What do you mean? What are you trying to do with Winzip? Jake At 12:28 AM 3/23/2003 -0500, you wrote: I need to get tomcat4.1.24 working on windows ZP but for some reason it won't work right. Here is my CATALINA_HOME = C:\Program Files\Apache Group\Tomcat4.1 I have also added my servlet.jar file to my classpath here that it is C:\Program Files\Apache Group\Tomcat4.1\common\lib\servlet.jar I really need this for a couple of school project I have to get done So thanks if anyone can help -- Antoine [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reloading shared/lib JAR files?
Hi Jeff, Thank you very much for the detailed outline. The reason why I wanted to use a central library was that I wanted to prevent different versions of my core libs haunting the contexts of the Tomcat server. So you're suggested solution would be to leave it up to the separate contexts to update and use the newer lib files. The only drawback of this terms of use is, that you have one component n times installed across the various contexts of the Tomcat. This was what I wanted to avoid So to use both ideas, what about the following: *) central repository of all versions of all helper jar files /{$tomcat_home}/repository/v1.jar /{$tomcat_home}/repository/v2.jar *) each application context picks the version it likes to use /{$tomcat_home}/webapps/myapp/WEB-INF/lib/link to v1.jar /{$tomcat_home}/webapps/myapp2/WEB-INF/lib/link to v2.jar Do you think the approach outlined above makes sense? I think this would reduce the scattered library version troubles and it would even be possible to search all the contexts to find out which versions are used. Thx for your feedback Johannes Jeff Jensen [EMAIL PROTECTED] 22.03.2003 16:44 Please respond to Tomcat Users List [EMAIL PROTECTED] To 'Tomcat Users List' [EMAIL PROTECTED] cc Subject RE: Reloading shared/lib JAR files? Also, from a release management standpoint, the risk is the dependency of all the apps on the specific versions of the jars in shared/lib. Meaning, if one app needs a newer version of a shared component placed in shared/lib, then all are forced to upgrade as well. Timing on upgrading the other apps is not usually so helpful, particularly when needing even a small coding change! It is typically better to use the source control tool to integrate specific versions of shared components into its own codeline - so the codeline is complete without external dependencies (reproducible builds from the source tree). If it is a 3rd party component, check-in the distributables and integrate/merge the right versions of them into your different product codelines. If it is your own component, do the same - check-in the distributables. For deployment, as part of the normal build/package/deploy process, place the shared components in WEB-INF/lib so each app can have its own version. As Tim says, this would rethink the design and solve the problem by not having anything in shared/lib. At the same time, eliminating a potential cross-application dependency problem. Disclaimer - there may be something in your environment that forces you to use shared/lib (or possibly never even have an upgrade problem), whether technical (can't think of much other than large footprint jars) or political ;-) Your mileage may vary. -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Saturday, March 22, 2003 8:50 AM To: Tomcat Users List Subject: Re: Reloading shared/lib JAR files? If you redeploy jars into /shared/lib - they will not be reloaded on a webapp reload and there is no way to reload them(except a stop/start of tomcat). But jars/classes in WEB-INF/ can be reloaded. If you have jars in shared/lib that need reloaded when an webapp is reloaded - you might need to rethink the design of those shared libs. -Tim Johannes Fiala wrote: Hi there, I know it is possible to reload a web-application using the manager app (especially the JAR-files in WEB-INF/lib). Is it possible to also include the shared/lib directory? We have some helper JARs, which are used by four web contexts, so I'd prefer to put them into /shared/lib. However, if it doesn't get reloaded after an update of /shared/lib, I have no means to perform a hot redeploy if only the JAR files change. thx alot Johannes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Handling release management with Tomcat
Hi there, We have a multiple server and multiple release system using Tomcat 4.1.18. Given the issues we have to address we want to ease updating from version to the other without facing big risks or interoperability issues. Servers acting as clients calling soap requests etc. should be able to stick with lower-level releases or test beta-releases easily. I'd propose the following procedure for dealing with multiple releases easily: {$TOMCAT_HOME}/webapps/myapp-1.0 {$TOMCAT_HOME}/webapps/myapp-1.1 {$TOMCAT_HOME}/webapps/myapp-1.2beta {$TOMCAT_HOME}/webapps/myapp-1.3alpha main application entry: {$TOMCAT_HOME}/webapps/myapp Above are the separate versions of the Tomcat Contexts of myapp. To switch between the different versions of myapp, two options exist in my opinion: *) using a symbolic file system link to point to the version of myapp which is the lead version *) using JK to link to the proper myapp-x.x directory (only possible with Apache/Tomcat connected with JK). Which version do you think is preferable? Do different options exist which make more sense? The release management should allow to: *) decide to still take the lower level release (e.g. 1.0) explicitly, so clients could take the link with myapp-1.0 to do so. *) decide to test a higher level beta release (e.g. 1.2beta) However, the main entry focuses on the current release. Hotfixes could be dealt with that system as well. What do you think ? Johannes
Re: Can't connect to X11 window server using '0:0' as the valueof the display and now java.awt.HeadlessException
Hi, Here is a good link: http://www.geocities.com/marcoschmidt.geo/java-image-faq.html#x Hope you enjoy. Georges Stephen Riek wrote: Thanks Micael. Tried the same thing and got the same results. Looks like Catalina/Tomcat is indeed using headless mode but it's not working with my Java (1.4) and operating system (SunOS 5.6). I'm presuming you're using this to create/generate graphics in a servlet ? Do you mind posting sample Java that creates a Toolkit or MediaTracker (and which therefore requires headless mode) ? I can't fathom what's wrong with mine. Mine works fine when running on Win2K and Tomcat, but now dying on Sun. Thanks for the help, Stephen. Micael [EMAIL PROTECTED] wrote: I added the headless flag to catalina.sh as follows: # - Execute The Requested Command - echo Using CATALINA_BASE: $CATALINA_BASE echo Using CATALINA_HOME: $CATALINA_HOME echo Using CATALINA_TMPDIR: $CATALINA_TMPDIR echo Using JAVA_HOME: $JAVA_HOME if [ $1 = jpda ] ; then if [ -z $JPDA_ADDRESS ]; then JPDA_ADDRESS=8000 fi if [ -z $JDPA_OPTS ]; then JPDA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n fi CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS shift fi CATALINA_OPTS=-Djava.awt.headless=true This worked fine. At 08:15 AM 3/23/03 +, you wrote: On Thu, 2003-03-20 at 20:36, Micael wrote: For me the easiest thing was just to provide the right command line options (java.awt.headless=true) when I started up Tomcat. May I ask, how you did this ? I've also encountered JNI_OnLoad errors runing on Solaris due, I suspect, the lack of XWindows on my server. I tried adding the headless flag to my catalina.sh script as follows ~ elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 else $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 fi But that just resulted in the following error, java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121) at java.awt.Window.(Window.java:266) at java.awt.Frame.(Frame.java:398) at java.awt.Frame.(Frame.java:363) at ImageUtils.loadImage(Unknown Source) where the loadImage() function is simply supposed to load an image, public static Image loadImage(String fileName) { Image image = Toolkit.getDefaultToolkit().getImage(fileName); MediaTracker mediaTracker = new MediaTracker(new Frame()); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException ie) { // } return image; } Any ideas/help would be great. Stephen. ps. I also tried PJA but couldn't get that to work either :( - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs
Problem with Bookmarking a Login Page
Does anyone know of a Struts work around for the problem with Tomact in bookmarking the login page for container managed security? There was a brief thread on this issue about a month ago [http://www.mail-archive.com/[EMAIL PROTECTED]/msg59734.html] There is a SourceForge project called SecurityFilter that can be used to replace Tomcat's container managed security, but it would be nice to be able to work with Tomcat. Has anyone tried to call j_security_check directly from an Action class? Once you can authenticate a user you would be able to get the roles for that user. Is there a way to set up a JDBC Realm purely in Struts? I did not see any information on this in a quick scan of the documentation. Hopefully, the good people working on Tomcat see this as a bug that needs to be fixed. Quote from a recent thread in the Tomcat news group: I wish that there was a legitimate configuration change to enable you to bookmark a login.jsp page--such as a j_success_url parameter which instructs Tomcat where to send users if not doing an automated login process. Another user stated, ...I simply just can't believe that there are Tomcat instances out there in a live production environment with configured realms that suffer from this problem. Surely there must be something http://www.mail-archive.com/[EMAIL PROTECTED]/msg77974.html Thanks. Mike __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Webapp Precompilation using Ant and Jasper howto
Hi there, I read the Jasper howto (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jasper-howto.html), but I didn't get the build.xml file to work. here's the commandline I typed in: F:\srcant -Dtomcat.home=f:/tomcat-4.1.18 -Dwebapp.path=f:/tomcat-4.1.18/webapps/myapp I get the following error: Buildfile: build.xml jspc: 2003-03-23 03:26:39 - ERROR-the file '\views\liste.jsp' gene rated the following general exception: java.lang.NullPointerException [jasper2] Error in class org.apache.jasper.JspC BUILD FAILED file:F:/soap/esv/src/build.xml:21: org.apache.jasper.JasperException Total time: 2 seconds liste.jsp itself is simply empty, so it seems that Jasper didn't produce any output! I tried it both with tomcat running and tomcat stopped. here's the build.xml file in F:\src\build.xml: project name=Webapp Precompilation default=all basedir=. target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${tomcat.home}/server/lib include name=*.jar/ /fileset fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${webapp.path} webXmlFragment=${webapp.path}/WEB-INF/generated_web.xml outputDir=${webapp.path}/WEB-INF/src / /target target name=compile mkdir dir=${webapp.path}/WEB-INF/classes/ mkdir dir=${webapp.path}/WEB-INF/lib/ javac destdir=${webapp.path}/WEB-INF/classes optimize=off debug=on failonerror=false srcdir=${webapp.path}/WEB-INF/src excludes=**/*.smap classpath pathelement location=${webapp.path}/WEB-INF/classes/ fileset dir=${webapp.path}/WEB-INF/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/common/classes/ fileset dir=${tomcat.home}/common/lib include name=*.jar/ /fileset pathelement location=${tomcat.home}/shared/classes/ fileset dir=${tomcat.home}/shared/lib include name=*.jar/ /fileset /classpath include name=** / exclude name=tags/** / /javac /target target name=all depends=jspc,compile /target /project Can anybody shed any light onto this issue? thx alot Johannes
Re: Problem with Bookmarking a Login Page
The way I always do it is I create a User (with email, fullName, etc.) class which is mapped into my database to the same tables I instruct Tomcat to use for a JdbcRealm. Then, I set up a filter which makes sure that a User object exists when there is a user principal. You can use the request.getUserPrincipal().getName() to find out the username of the logged in user. In your filter, you do something like... User user = ( User )request.getSession().getAttribute( user ); if( user == null request.getUserPrincipal() != null ) { user = UserDao.getUserByName( request.getUserPrincipal().getName() ); request.setAttribute( user, user ); } Hope this helps! - Original Message - From: Mike Duffy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 8:10 AM Subject: Problem with Bookmarking a Login Page Does anyone know of a Struts work around for the problem with Tomact in bookmarking the login page for container managed security? There was a brief thread on this issue about a month ago [http://www.mail-archive.com/[EMAIL PROTECTED]/msg59734.html] There is a SourceForge project called SecurityFilter that can be used to replace Tomcat's container managed security, but it would be nice to be able to work with Tomcat. Has anyone tried to call j_security_check directly from an Action class? Once you can authenticate a user you would be able to get the roles for that user. Is there a way to set up a JDBC Realm purely in Struts? I did not see any information on this in a quick scan of the documentation. Hopefully, the good people working on Tomcat see this as a bug that needs to be fixed. Quote from a recent thread in the Tomcat news group: I wish that there was a legitimate configuration change to enable you to bookmark a login.jsp page--such as a j_success_url parameter which instructs Tomcat where to send users if not doing an automated login process. Another user stated, ...I simply just can't believe that there are Tomcat instances out there in a live production environment with configured realms that suffer from this problem. Surely there must be something http://www.mail-archive.com/[EMAIL PROTECTED]/msg77974.html Thanks. Mike __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.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]
Jasper Compilation - Vol. 2 (continued from Webapp Precompilation using Antand Jasper howto)
Hi there, I've just built an ant task to allow for compilation of Jsps (jspc) *) the compiled jsps are put into /web/WEB-INF/src/*.java *) a generated WEB-INF directory is created at /web/WEB-INF/generated_web.xml However, I'd like to accomplish the following: *) automatically merge the generated_web.xml into the web.xml that already exists *) deploy the webapp to the container (not only install, I mean deploy) Has anybody done this so far? thx Johannes !-- == jspc task definition == -- target name=jspc taskdef classname=org.apache.jasper.JspC name=jasper2 classpath id=jspc.classpath pathelement location=${java.home}/../lib/tools.jar/ fileset dir=${catalina.home}/server/lib include name=*.jar/ /fileset fileset dir=${catalina.home}/common/lib include name=*.jar/ /fileset /classpath /taskdef jasper2 validateXml=false uriroot=${webapp.path} webXmlFragment=${webapp.path}/WEB-INF/generated_web.xml outputDir=${webapp.path}/WEB-INF/src / /target
Re: install tomat on winZP pro
I think the original poster meant Windows XP Professional. Java in general does not deal with spaces in file and directory names very well. Try installing tomcat into a directory with no spaces in the names, such as: C:\tomcat and, of course, set CATALINA_HOME to the same. -d Jacob Kjome wrote: What do you mean? What are you trying to do with Winzip? Jake At 12:28 AM 3/23/2003 -0500, you wrote: I need to get tomcat4.1.24 working on windows ZP but for some reason it won't work right. Here is my CATALINA_HOME = C:\Program Files\Apache Group\Tomcat4.1 I have also added my servlet.jar file to my classpath here that it is C:\Program Files\Apache Group\Tomcat4.1\common\lib\servlet.jar I really need this for a couple of school project I have to get done So thanks if anyone can help -- Antoine [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Dhruva B. Reddy ResortQuest International, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JK2 - FreeBSD - Apache 2 on FreeBSD
Hi all, Following the instructions on http://www.thinlizard.com/lizard/modjk2.html I was able to compile mod_jk2 (thank you!) I've tried a number of variations of the jk2 configuration, but cannot get it to work. I keep on getting a series of errors: [Sun Mar 23 17:13:00 2003] [notice] mod_jk.post_config() first invocation [Sun Mar 23 17:13:01 2003] [notice] mod_jk.post_config() second invocation [Sun Mar 23 17:13:02 2003] [notice] Apache configured -- resuming normal operations [Sun Mar 23 17:13:02 2003] [notice] jk2_init() Found child 26498 in scoreboard slot 2 [Sun Mar 23 17:13:02 2003] [notice] jk2_init() Found child 26499 in scoreboard slot 3 [Sun Mar 23 17:13:02 2003] [notice] workerEnv.init() ok /usr/local/etc/apache2/workers2.properties [Sun Mar 23 17:13:02 2003] [notice] jk2_init() Found child 26500 in scoreboard slot 4 [Sun Mar 23 17:13:02 2003] [notice] workerEnv.init() ok /usr/local/etc/apache2/workers2.properties [Sun Mar 23 17:13:02 2003] [notice] jk2_init() Found child 26496 in scoreboard slot 0 [Sun Mar 23 17:13:02 2003] [notice] jk2_init() Found child 26497 in scoreboard slot 1 [Sun Mar 23 17:13:02 2003] [notice] workerEnv.init() ok /usr/local/etc/apache2/workers2.properties [Sun Mar 23 17:13:02 2003] [notice] workerEnv.init() ok /usr/local/etc/apache2/workers2.properties [Sun Mar 23 17:13:02 2003] [notice] workerEnv.init() ok /usr/local/etc/apache2/workers2.properties [Sun Mar 23 17:13:02 2003] [error] mod_jk child init 1 0 [Sun Mar 23 17:13:14 2003] [notice] jk2_init() Found child 26505 in scoreboard slot 5 [Sun Mar 23 17:13:14 2003] [notice] workerEnv.init() ok /usr/local/etc/apache2/workers2.properties [Sun Mar 23 17:13:49 2003] [notice] shm.createSlot() Create 1 0x2834e000 0x2835 [Sun Mar 23 17:13:49 2003] [notice] workerEnv.init() create slot epStat.4 [Sun Mar 23 17:15:04 2003] [error] channelSocket.open() connect failed xxx.x.com:8009 60 Operation timed out [Sun Mar 23 17:15:04 2003] [error] ajp13.connect() failed ajp13:xxx.xxx.com:8009 [Sun Mar 23 17:15:04 2003] [error] ajp13.service() failed to connect endpoint errno=60 Operation timed out [Sun Mar 23 17:15:04 2003] [error] ajp13.service() Error forwarding ajp13:xxx..com:8009 1 1 [Sun Mar 23 17:15:04 2003] [notice] ajp13.done() close endpoint ajp13:xxx.xxx.com:8009 error_state 1 [Sun Mar 23 17:15:04 2003] [error] lb.service() worker failed 12 for ajp13:xxx..com:8009 [Sun Mar 23 17:15:04 2003] [notice] lb.getWorker() All workers in error state, use the one with oldest error [Sun Mar 23 17:16:19 2003] [error] channelSocket.open() connect failed xxx..com:8009 60 Operation timed out [Sun Mar 23 17:16:19 2003] [error] ajp13.connect() failed ajp13:xxx.xxx.com:8009 [Sun Mar 23 17:16:19 2003] [error] ajp13.service() failed to connect endpoint errno=60 Operation timed out [Sun Mar 23 17:16:19 2003] [error] ajp13.service() Error forwarding ajp13:xxx.xxx.com:8009 1 1 [Sun Mar 23 17:16:19 2003] [notice] ajp13.done() close endpoint ajp13:xxx.xxx.com:8009 error_state 1 [Sun Mar 23 17:16:19 2003] [error] lb.service() worker failed 12 for ajp13:.xxx.com:8009 [Sun Mar 23 17:16:19 2003] [notice] lb.getWorker() All workers in error state, use the one with oldest error [Sun Mar 23 17:16:19 2003] [notice] lb.getWorker() We tried all possible workers 2 [Sun Mar 23 17:16:19 2003] [error] lb_worker.service() all workers in error or disabled state [Sun Mar 23 17:16:19 2003] [error] mod_jk.handler() Error connecting to tomcat 12 I'm at a loss :-( If anybody has any clear explanations/examples of the jk2 configuration I would appreciate it (a lot!) Thanks in advance, Michele Mr. Michele Neylon Blacknight Solutions - affordable linux hosting http://www.blacknightsolutions.com/ This e-mail messages has been scanned by MailScanner and is believed to be clean of dangerous content and virus'. http://www.mailscanner.info - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: install tomat on winZP pro
Please forgive me about the winZP i meant winXP at the time I was extremely tired when posting my problem. I will try it with no spaces On Sun, 2003-03-23 at 11:39, Dhruva B. Reddy wrote: I think the original poster meant Windows XP Professional. Java in general does not deal with spaces in file and directory names very well. Try installing tomcat into a directory with no spaces in the names, such as: C:\tomcat and, of course, set CATALINA_HOME to the same. -d Jacob Kjome wrote: What do you mean? What are you trying to do with Winzip? Jake At 12:28 AM 3/23/2003 -0500, you wrote: I need to get tomcat4.1.24 working on windows ZP but for some reason it won't work right. Here is my CATALINA_HOME = C:\Program Files\Apache Group\Tomcat4.1 I have also added my servlet.jar file to my classpath here that it is C:\Program Files\Apache Group\Tomcat4.1\common\lib\servlet.jar I really need this for a couple of school project I have to get done So thanks if anyone can help -- Antoine [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Antoine [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help with Servlets
I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help!
Re: Help with Servlets
At 13:53 23.3.2003 -0500, you wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! You need also something like servlet-mapping servlet-nameHelloWorldExample/servlet-name url-pattern/mytest/url-pattern /servlet-mapping in your web.xml Kaarle Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! - Kaarle Kaila http://www.iki.fi/kaila mailto:[EMAIL PROTECTED] tel: +358 50 3725844 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with Servlets
Thank you very much. I did just try that and it didn't help, but perhaps it's only one of many things I have wrong. Thanks. - Original Message - From: Kaarle Kaila [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 1:59 PM Subject: Re: Help with Servlets At 13:53 23.3.2003 -0500, you wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! You need also something like servlet-mapping servlet-nameHelloWorldExample/servlet-name url-pattern/mytest/url-pattern /servlet-mapping in your web.xml Kaarle Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! - Kaarle Kaila http://www.iki.fi/kaila mailto:[EMAIL PROTECTED] tel: +358 50 3725844 - 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: Help with Servlets
At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! -- p niemandt [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with Servlets
Thank you. I am seeing some success with this! If I have multiple servlets, do I need to publish all to the container individually and map each request to the servlet individually and does the order matter? Thanks again... Jeff - Original Message - From: p niemandt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:22 PM Subject: Re: Help with Servlets At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! -- p niemandt [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: Help with Servlets
Yes, you do need to provide a servlet mapping for each of your servlets you wish to run, unless you want to run the invoker servlet (not recommended). Usually you map a different url pattern for each servlet in your webapp. This can be somewhat tedious, so I use XDoclet to generate my web.xml file for me! But, for simple projects, this is not necessary. - Original Message - From: Jeff Brewer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:46 PM Subject: Re: Help with Servlets Thank you. I am seeing some success with this! If I have multiple servlets, do I need to publish all to the container individually and map each request to the servlet individually and does the order matter? Thanks again... Jeff - Original Message - From: p niemandt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:22 PM Subject: Re: Help with Servlets At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! -- p niemandt [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: Help with Servlets
Oh, yes the order matters how you define things in your web.xml file. It has to follow the DTD. - Original Message - From: Jeff Brewer [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:46 PM Subject: Re: Help with Servlets Thank you. I am seeing some success with this! If I have multiple servlets, do I need to publish all to the container individually and map each request to the servlet individually and does the order matter? Thanks again... Jeff - Original Message - From: p niemandt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:22 PM Subject: Re: Help with Servlets At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to http://localhost:8080/examples/servlet/HelloWorldExample; Note that the page displays. Now browse to http://localhost:8080/dumfries/servlet/HelloWorldExample; and behold the error message. What am I doing wrong How can I make this work??? I'm supposed to be half way done with my project and I can't get my first servlet to work!!! Help! -- p niemandt [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: Help with Servlets
First, as a suggestion, you will need to understand XML and DTD's: This will explain what the web.xml file can and can not do. Then: There are multiple ways of doing servlet mappings: I tend to stay away from war files, for no particular reason at all, so, in that case, I need to map all my servlets and their requests in the web.xml file. I have no experience with war files, but understand you do / can do it differently using that. web.xml You need to publish every and all servlets, FIRST. You need to map all the servlets to their requests, after publishing all the servlets ... web-app !-- Publish the servlet to the container -- servlet servlet-nameServlet1/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet servlet servlet-nameServlet2/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet servlet servlet-nameServlet3/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameServlet1/servlet-name url-pattern/Servlet1/*/url-pattern /servlet-mapping servlet-mapping servlet-nameServlet2/servlet-name url-pattern/Servlet2/*/url-pattern /servlet-mapping servlet-mapping servlet-nameServlet3/servlet-name url-pattern/Servlet3/*/url-pattern /servlet-mapping /web-app etc, ad infinitum ... hth, Paul On Sun, 2003-03-23 at 19:46, Jeff Brewer wrote: Thank you. I am seeing some success with this! If I have multiple servlets, do I need to publish all to the container individually and map each request to the servlet individually and does the order matter? Thanks again... Jeff - Original Message - From: p niemandt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:22 PM Subject: Re: Help with Servlets At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/j2ee/dtds/web-app_2_3.dtd; servlet servlet-nameHelloWorldExample/servlet-name servlet-classHelloWorldExample/servlet-class /servlet web-app /web-app Add the following tag to the server.xml file: Context path=/dumfries docBase=dumfries debug=0 reloadable=true / Start the server and browse to
Re: Can't connect to X11 window server using '0:0' as the value of the display and now java.awt.HeadlessException
Here are two uses, if they are of help. I am using Red Hat 7.2 Linux. FIRST: public JPEGEncoder(Image image, int quality, OutputStream out) { MediaTracker tracker = new MediaTracker(this); tracker.addImage(image, 0); try { tracker.waitForID(0); } catch (InterruptedException e) { } /* Quality of the image. * 0 to 100 and from bad image quality, high compression to good * image quality low compression*/ this.quality = quality; /* Getting picture information * It takes the Width, Height and RGB scans of the image. */ info= new JPEGInfo(image); imageHeight = info.imageHeight; imageWidth = info.imageWidth; outStream = new BufferedOutputStream(out); dct = new JPEGDCT(quality); huffman = new JPEGConvert(imageWidth,imageHeight); } SECOND: public class JPEGCompression { /* The parameter element compressionQuality is the compression (compressionQuality) from * 0 to 100. */ public void compress(String inputImage, String outputImage, String compressionQuality) { FileOutputStream dataOut = null; int compression = 80; File outputFile = new File(outputImage); int i = 1; // Makes sure there are no duplicates while (outputFile.exists()) { outputFile = new File(outputImage.substring(0, outputImage.lastIndexOf(.)) + (i++) + .jpg); } File inputFile = new File(inputImage); if (inputFile.exists()) { try { dataOut = new FileOutputStream(outputFile); } catch(IOException e) {} try { compression = Integer.parseInt(compressionQuality); } catch (NumberFormatException e) { e.printStackTrace(); } Image image = Toolkit.getDefaultToolkit().getImage(inputImage); JPEGEncoder encoder = new JPEGEncoder(image, compression, dataOut); encoder.compress(); try { dataOut.close(); } catch(IOException e) {} } else { throw new IllegalArgumentException(We couldn't find + inputImage + . Is it in another directory?); } } } At 09:09 AM 3/23/03 +, you wrote: Thanks Micael. Tried the same thing and got the same results. Looks like Catalina/Tomcat is indeed using headless mode but it's not working with my Java (1.4) and operating system (SunOS 5.6). I'm presuming you're using this to create/generate graphics in a servlet ? Do you mind posting sample Java that creates a Toolkit or MediaTracker (and which therefore requires headless mode) ? I can't fathom what's wrong with mine. Mine works fine when running on Win2K and Tomcat, but now dying on Sun. Thanks for the help, Stephen. Micael [EMAIL PROTECTED] wrote: I added the headless flag to catalina.sh as follows: # - Execute The Requested Command - echo Using CATALINA_BASE: $CATALINA_BASE echo Using CATALINA_HOME: $CATALINA_HOME echo Using CATALINA_TMPDIR: $CATALINA_TMPDIR echo Using JAVA_HOME: $JAVA_HOME if [ $1 = jpda ] ; then if [ -z $JPDA_ADDRESS ]; then JPDA_ADDRESS=8000 fi if [ -z $JDPA_OPTS ]; then JPDA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n fi CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS shift fi CATALINA_OPTS=-Djava.awt.headless=true This worked fine. At 08:15 AM 3/23/03 +, you wrote: On Thu, 2003-03-20 at 20:36, Micael wrote: For me the easiest thing was just to provide the right command line options (java.awt.headless=true) when I started up Tomcat. May I ask, how you did this ? I've also encountered JNI_OnLoad errors runing on Solaris due, I suspect, the lack of XWindows on my server. I tried adding the headless flag to my catalina.sh script as follows ~ elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 else $_RUNJAVA
Re: Can't connect to X11 window server using '0:0' as the value of the display and now java.awt.HeadlessException
The material George gave you is really good. Do you have X11 installed, even if not running? I am not a Solaris guy, so don't know what that may mean in that context. At 09:09 AM 3/23/03 +, you wrote: Thanks Micael. Tried the same thing and got the same results. Looks like Catalina/Tomcat is indeed using headless mode but it's not working with my Java (1.4) and operating system (SunOS 5.6). I'm presuming you're using this to create/generate graphics in a servlet ? Do you mind posting sample Java that creates a Toolkit or MediaTracker (and which therefore requires headless mode) ? I can't fathom what's wrong with mine. Mine works fine when running on Win2K and Tomcat, but now dying on Sun. Thanks for the help, Stephen. Micael [EMAIL PROTECTED] wrote: I added the headless flag to catalina.sh as follows: # - Execute The Requested Command - echo Using CATALINA_BASE: $CATALINA_BASE echo Using CATALINA_HOME: $CATALINA_HOME echo Using CATALINA_TMPDIR: $CATALINA_TMPDIR echo Using JAVA_HOME: $JAVA_HOME if [ $1 = jpda ] ; then if [ -z $JPDA_ADDRESS ]; then JPDA_ADDRESS=8000 fi if [ -z $JDPA_OPTS ]; then JPDA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n fi CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS shift fi CATALINA_OPTS=-Djava.awt.headless=true This worked fine. At 08:15 AM 3/23/03 +, you wrote: On Thu, 2003-03-20 at 20:36, Micael wrote: For me the easiest thing was just to provide the right command line options (java.awt.headless=true) when I started up Tomcat. May I ask, how you did this ? I've also encountered JNI_OnLoad errors runing on Solaris due, I suspect, the lack of XWindows on my server. I tried adding the headless flag to my catalina.sh script as follows ~ elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 else $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 fi But that just resulted in the following error, java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121) at java.awt.Window.(Window.java:266) at java.awt.Frame.(Frame.java:398) at java.awt.Frame.(Frame.java:363) at ImageUtils.loadImage(Unknown Source) where the loadImage() function is simply supposed to load an image, public static Image loadImage(String fileName) { Image image = Toolkit.getDefaultToolkit().getImage(fileName); MediaTracker mediaTracker = new MediaTracker(new Frame()); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException ie) { // } return image; } Any ideas/help would be great. Stephen. ps. I also tried PJA but couldn't get that to work either :( - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly
Re: JasperException: Your session on the server has timed out.
What I see from the log is that the error is not related to the Session of the user, or the Session of the application to Service Desk... My question is, what Session is related the error to? what other Session exist beside the HttpSession? may the filter have is own session? Thanks in advance Ramiro Gonzalez wrote: I have an Struts Application, with a filter for login. I 'm using Solaris 5.8, Sun JDK 1.4.1_02, Tomcat 4.1.18. The problem occurs after the night, when nobody use the application. Then, in the first login we get the messages that appear after this. The only way to reestablish the application is to make a reload by the Tomcat Manager Application. (Between the messages are inserted the lines of code of the filter). Some ideas? //LOG //The filter begin... //Is a new session... Sat Mar 22 11:25:57 GMT-06:00 2003:Session nueva y nula Sat Mar 22 11:25:57 GMT-06:00 2003:Session nueva y nula Sat Mar 22 11:25:57 GMT-06:00 2003:Session nueva y nula // filterConfig.getServletContext().getRequestDispatcher(/logon.jsp) .forward(request, response); //NOTE: new Date(): session.getId(): session.getCreationTime() Sat Mar 22 11:25:57 GMT-06:00 2003:Session: 77271861DF61013F87B786651BE77901:Sat Mar 22 11:25:57 GMT-06:00 2003 Sat Mar 22 11:25:57 GMT-06:00 2003:Session: 77271861DF61013F87B786651BE77901:Sat Mar 22 11:25:57 GMT-06:00 2003 Sat Mar 22 11:25:57 GMT-06:00 2003:Session: 77271861DF61013F87B786651BE77901:Sat Mar 22 11:25:57 GMT-06:00 2003 Sat Mar 22 11:25:57 GMT-06:00 2003:Session: 77271861DF61013F87B786651BE77901:Sat Mar 22 11:25:57 GMT-06:00 2003 //The user send his user and password Mar 22, 2003 11:26:00 AM org.apache.struts.util.PropertyMessageResources init INFO: Initializing, config='com.hp.ov.fercdt.ApplicationResources', returnNull=true //The program check Service Desk service is up Haciendo ping a Service Desk... 10.105.25.162 Ping OK //The user is validated and acepted, the program destroy and create a new session HttpSession session = hreq.getSession(false); if(session != null) { session.invalidate(); } // Create a new session for this user session = hreq.getSession(true); session.setAttribute(Parametros.SIGNED_ON_USER_SESSION_KEY,userString); session.setAttribute(Parametros.USER_FORM, userString); session.setAttribute(Parametros.PASS_FORM, passString); session.setAttribute(Parametros.ERROR, null); hres.sendRedirect(SolicitudCambio.jsp); // the user is redirected to the main screen of the application. //the filter catch the new request Sat Mar 22 11:26:01 GMT-06:00 2003:Session: 942038E15432A3A4EC3C0F3BE4C667B9:Sat Mar 22 11:26:01 GMT-06:00 2003 // the line at com.hp.ov.fercdt.backend.AseguraUsuarioFirmado.doFilter(AseguraUsuarioFirmado.java:74) chain.doFilter(request, response); org.apache.jasper.JasperException: Your session on the server has timed out. Click OK to log on, then try again. at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at com.hp.ov.fercdt.backend.AseguraUsuarioFirmado.doFilter(AseguraUsuarioFirmado.java:74) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at
Re: Help with Servlets
Thanks to everyone who helped. I have one final question; where can I find documentation for how to maintain these files? Thanks - Original Message - From: p niemandt [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 3:06 PM Subject: Re: Help with Servlets First, as a suggestion, you will need to understand XML and DTD's: This will explain what the web.xml file can and can not do. Then: There are multiple ways of doing servlet mappings: I tend to stay away from war files, for no particular reason at all, so, in that case, I need to map all my servlets and their requests in the web.xml file. I have no experience with war files, but understand you do / can do it differently using that. web.xml You need to publish every and all servlets, FIRST. You need to map all the servlets to their requests, after publishing all the servlets ... web-app !-- Publish the servlet to the container -- servlet servlet-nameServlet1/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet servlet servlet-nameServlet2/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet servlet servlet-nameServlet3/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameServlet1/servlet-name url-pattern/Servlet1/*/url-pattern /servlet-mapping servlet-mapping servlet-nameServlet2/servlet-name url-pattern/Servlet2/*/url-pattern /servlet-mapping servlet-mapping servlet-nameServlet3/servlet-name url-pattern/Servlet3/*/url-pattern /servlet-mapping /web-app etc, ad infinitum ... hth, Paul On Sun, 2003-03-23 at 19:46, Jeff Brewer wrote: Thank you. I am seeing some success with this! If I have multiple servlets, do I need to publish all to the container individually and map each request to the servlet individually and does the order matter? Thanks again... Jeff - Original Message - From: p niemandt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 2:22 PM Subject: Re: Help with Servlets At least you didn't say you've tried everything: I hate that, if you have tried everything, something would have worked ;-), but anyways, I'm going of on a tangent ... Firstly, your web.xml looks kinda screwed: You have nothing mapped int the wep app. Then, quite likely your major problem is that you have not mapped any requests to your servlet. You need to map your web application to it's implementation. It's not enough to just state your web descriptor {Like your post shows}, you will also need something like !-- Map requests to servlet -- servlet-mapping servlet-nameServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping after ALL the servlet / definitions. So something like ... ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app !-- Publish the servlet to the container -- servlet servlet-nameYourServletName/servlet-name servlet-classJavaPackage.ServletClass/servlet-class /servlet !-- Map requests to servlet -- servlet-mapping servlet-nameYourServletName/servlet-name url-pattern/*/url-pattern /servlet-mapping /web-app That's of course, assuming a few things ... 1. Your servlet is compiled, and a proper extension of HttpServlet 2. You want everything under http://yourservername.domain/YourServletName to go to your servlet. 3. And probably another few things, Hopefully this will help you in the right direction ... Paul On Sun, 2003-03-23 at 18:53, Jeff Brewer wrote: I've spent DAYS and DAYS and DAYS trying to get tomcat to run servlets. Nothing I try works. I have followed the instructions in three books, several online tutorials and attempted to decipher tomcat documentation on the apache site. I've installed and reinstalled two versions to Tomcat (currently on 4.1.24). I've modified server.xml and web.xml files until my fingers are sore from typing. Any help would be GREATLY appreciated. Nothing helps; nothing works except the tomcat examples which mock me! Here is my problem: From a clean install of tomcat, create a new directory under webapps called dumfries. Create subdirectories dumfries/WEB-INF/classes. Copy the file HelloWorldExample.class from webapps/examples/WEB-INF/classes and paste it into webapps/dumfries/WEB-INF/classes Create the following file and save as web.xml in the webapps/dumfries/WEB-INF directory: ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
Re: Can't connect to X11 window server using '0:0' as the value of the display and now java.awt.HeadlessException
Hi all, It have been a long time since I read any post... but I can't ignore someone in trouble. I had a similar problem using java.AWT with linux... It needs a graphics system server, like windows or X11 running in your server. But as X11 was too heavy for my system, my workaround was to start Xvfb (X virtual frame buffer). Google it to get a Solaris Xvfb... take a look also at http://developer.java.sun.com/developer/bugParade/bugs/4281163.html Regards, miagi On Sun, 23 Mar 2003 12:15:04 -0800, Micael [EMAIL PROTECTED] escreveu : De: Micael [EMAIL PROTECTED] Data: Sun, 23 Mar 2003 12:15:04 -0800 Para: Tomcat Users List [EMAIL PROTECTED] Assunto: Re: Can't connect to X11 window server using '0:0' as the value of the display and now java.awt.HeadlessException The material George gave you is really good. Do you have X11 installed, even if not running? I am not a Solaris guy, so don't know what that may mean in that context. At 09:09 AM 3/23/03 +, you wrote: Thanks Micael. Tried the same thing and got the same results. Looks like Catalina/Tomcat is indeed using headless mode but it's not working with my Java (1.4) and operating system (SunOS 5.6). I'm presuming you're using this to create/generate graphics in a servlet ? Do you mind posting sample Java that creates a Toolkit or MediaTracker (and which therefore requires headless mode) ? I can't fathom what's wrong with mine. Mine works fine when running on Win2K and Tomcat, but now dying on Sun. Thanks for the help, Stephen. Micael [EMAIL PROTECTED] wrote: I added the headless flag to catalina.sh as follows: # - Execute The Requested Command - echo Using CATALINA_BASE: $CATALINA_BASE echo Using CATALINA_HOME: $CATALINA_HOME echo Using CATALINA_TMPDIR: $CATALINA_TMPDIR echo Using JAVA_HOME: $JAVA_HOME if [ $1 = jpda ] ; then if [ -z $JPDA_ADDRESS ]; then JPDA_ADDRESS=8000 fi if [ -z $JDPA_OPTS ]; then JPDA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=$JPDA_ADDRESS,server=y,suspend=n fi CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS shift fi CATALINA_OPTS=-Djava.awt.headless=true This worked fine. At 08:15 AM 3/23/03 +, you wrote: On Thu, 2003-03-20 at 20:36, Micael wrote: For me the easiest thing was just to provide the right command line options (java.awt.headless=true) when I started up Tomcat. May I ask, how you did this ? I've also encountered JNI_OnLoad errors runing on Solaris due, I suspect, the lack of XWindows on my server. I tried adding the headless flag to my catalina.sh script as follows ~ elif [ $1 = start ] ; then shift touch $CATALINA_BASE/logs/catalina.out if [ $1 = -security ] ; then echo Using Security Manager shift $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Djava.security.manager \ -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 else $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \ -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH \ -Dcatalina.base=$CATALINA_BASE \ -Dcatalina.home=$CATALINA_HOME \ -Djava.io.tmpdir=$CATALINA_TMPDIR \ -Djava.awt.headless=true \ org.apache.catalina.startup.Bootstrap $@ start \ $CATALINA_BASE/logs/catalina.out 21 fi But that just resulted in the following error, java.awt.HeadlessException at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:121) at java.awt.Window.(Window.java:266) at java.awt.Frame.(Frame.java:398) at java.awt.Frame.(Frame.java:363) at ImageUtils.loadImage(Unknown Source) where the loadImage() function is simply supposed to load an image, public static Image loadImage(String fileName) { Image image = Toolkit.getDefaultToolkit().getImage(fileName); MediaTracker mediaTracker = new MediaTracker(new Frame()); mediaTracker.addImage(image, 0); try { mediaTracker.waitForID(0); } catch (InterruptedException ie) { // } return image; } Any ideas/help would be great. Stephen. ps. I also tried PJA but couldn't get that to work either :( - With Yahoo! Mail you can get a bigger mailbox -- choose a size that fits your needs LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in
tomcat auto-configuration file for mod_jk (apache-mod_jk-tomcat)
Hello, I can't seem to figure out what needs to be done on the tomcat side to get the Apache Auto configuration file TOMCAT_HOME/conf/jk/mod_jk.conf-auto The mod_jk documentation says This file is created by enabling the Apache auto-configuration as described in the Tomcat documentation - but I can't find any reference to this in the tomcat documentation. When I try to to Include this file in httpd.conf I get the following error: httpd: could not open document config file /usr/local/jakarta-tomcat/conf/jk/mod_jk.conf-auto Which makes sense as the file is not there. Please Help! Richie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LE version?
What's the difference between Tomcat and Tomcat LE? I can't find anything about LE in the documentation. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LE version?
Tomcat LE does not have some XML parsers included. -Original Message- From: Mayne, Peter [mailto:[EMAIL PROTECTED] Sent: Sunday, March 23, 2003 3:31 PM To: Tomcat Users List Subject: LE version? What's the difference between Tomcat and Tomcat LE? I can't find anything about LE in the documentation. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - 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: LE version?
The information below is copied from : http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.24/bin/ README.html Apache Tomcat 4.1.24 This release of Tomcat 4.1 is available in two different packaging options: Standard: This is a full binary distrbution of Tomcat 4, which includes all optional libraries and an XML parser (Xerces 2.0.1), and can be run on JDK 1.2+. JDK 1.4 LE: This is a lightweight binary distribution of Tomcat 4, designed to be run on JDK 1.4. It does not include any of the optional binaries or the necessary XML parser (which is included in JDK 1.4). This build can be run on JDK 1.2+ by adding an XML parser. All the components of this distribution are open source software. This package does not contain JavaMail, Java Activation Framework, Xerces, JNDI or the JDBC Standard Extension. -Original Message- From: Mayne, Peter [mailto:[EMAIL PROTECTED] Sent: Sunday, March 23, 2003 3:31 PM To: Tomcat Users List Subject: LE version? What's the difference between Tomcat and Tomcat LE? I can't find anything about LE in the documentation. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - 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]
Non-servlet application
I have an application that needs to run as a service (on Windows) responding to various events, none of which are HTTP/servlet/JSP related. I could set it up as a separate Windows service (similar to jk_nt_service). However, since there is an instance of Tomcat running already, it would be easier to write it as a Tomcat application. Is this a suitable use for Tomcat? If so, what is the right way of going about this? Thanks. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
servlet problems with web app outside Tomcat directory
Hello, I've been struggling for several days with setting up a modest web application outside the Tomcat installation directory. I have JSPs compiling, executing, and returning the proper display data, but I cannot get my servlets to work: I only get 404 errors. I'm running Apache 2.0.44 and Tomcat 4.1.18 on Linux. I have mod_jk.so included in httpd.conf to provide AJP connectors to Tomcat. I have a /home/web directory set up to contain all of my sites' filesystems. One of these--we'll call it appsite.com--is happily laid out in /home/web/appsite.com. I take care of the virtual hosts in my Apache httpd.conf file. I have laid out the following structure for the site: /home/web/appsite.com/webapps/ROOT. This is where I have JSPs and static files. I set the DocumentRoot in httpd.conf to /home/web/appsite.com/webapps/ROOT/. I also added an include directive to include mod_jk directives in a separate file. In the mod_jk configuration file, I include these servlet-specific JkMount directives: JkMount /servlet ajp13 JkMount /servlet/* ajp13 In server.xml, I have the following containers defined: Engine name=Tomcat-Apache-mod_jk defaultHost=www.appsite.com debug=0 .. Host name=www.appsite.com debug=1 appBase=/home/web/www.appsite.com/webapps .. Context path= docBase=ROOT debug=0/ The servlets are located in /home/web/appsite.com/webapps/ROOT/WEB-INF/classes/mypackage/. I'm trying to call them through www.appsite.com/servlet/myprefix.ServletX, and that's when I get the 404. Is there something else I need to do to map servlet to the webapps/ROOT/WEB-INF/classes directory of my site? Thanks, Michael
RE: LE version?
Title: RE: LE version? So it is. Thanks. Looking at the Apache distribution site (http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.1.24/bin/), this is stated up front on the web page. However, this information is not present at the mirror I use to download from (http://apache.ausgamers.com/jakarta/tomcat-4/binaries/) and which I'm recommended to use by Apache, so I've never seen it. Neither is it in the README.txt in the distribution, and there isn't a README.html in the distribution bin directory. Sigh. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 -Original Message- From: Richie Chauhan [mailto:[EMAIL PROTECTED]] Sent: Monday, 24 March 2003 10:35 AM To: 'Tomcat Users List' Subject: RE: LE version? The information below is copied from : http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4 .1.24/bin/ README.html Apache Tomcat 4.1.24 This release of Tomcat 4.1 is available in two different packaging options: Standard: This is a full binary distrbution of Tomcat 4, which includes all optional libraries and an XML parser (Xerces 2.0.1), and can be run on JDK 1.2+. JDK 1.4 LE: This is a lightweight binary distribution of Tomcat 4, designed to be run on JDK 1.4. It does not include any of the optional binaries or the necessary XML parser (which is included in JDK 1.4). This build can be run on JDK 1.2+ by adding an XML parser. All the components of this distribution are open source software. This package does not contain JavaMail, Java Activation Framework, Xerces, JNDI or the JDBC Standard Extension. -Original Message- From: Mayne, Peter [mailto:[EMAIL PROTECTED]] Sent: Sunday, March 23, 2003 3:31 PM To: Tomcat Users List Subject: LE version? What's the difference between Tomcat and Tomcat LE? I can't find anything about LE in the documentation. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - 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] The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion.
load-on-startup order
Tomcat 4.1.18 I have two applications, A and B, where a servlet in B depends on a servlet in A being up, so I have in A's web.xml: servlet ... load-on-startup1/load-on-startup /servlet in B's web.xml: servlet ... load-on-startup5/load-on-startup /servlet which should make A start first. However, when Tomcat starts, B's init() is called first. B's init() attempts to make a connection to A's servlet, but A hasn't started yet, so everything hangs. Am I doing this correctly? Thanks. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: load-on-startup order
Mayne, Peter wrote: Tomcat 4.1.18 I have two applications, A and B, where a servlet in B depends on a servlet in A being up, so I have in A's web.xml: servlet ... load-on-startup1/load-on-startup /servlet in B's web.xml: servlet ... load-on-startup5/load-on-startup /servlet which should make A start first. However, when Tomcat starts, B's init() is called first. B's init() attempts to make a connection to A's servlet, but A hasn't started yet, so everything hangs. Am I doing this correctly? Thanks. PJDM With your setup/solution you realy canĀ“t tell if application A will load before B. Load-on-startup orders the servlets in each application (web.xml) -- Tomas Health is merely the slowest possible rate at which one can die. ~ [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: load-on-startup order
Instead of performing the necessary logic in the init method, why not try lazy-loading. Only initialize whatever you need when it is requested the first time. By the way, what are you trying to do? I've never heard of anyone having this kind of requirement/architecture. Just curious. - Original Message - From: Mayne, Peter [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 7:42 PM Subject: load-on-startup order Tomcat 4.1.18 I have two applications, A and B, where a servlet in B depends on a servlet in A being up, so I have in A's web.xml: servlet ... load-on-startup1/load-on-startup /servlet in B's web.xml: servlet ... load-on-startup5/load-on-startup /servlet which should make A start first. However, when Tomcat starts, B's init() is called first. B's init() attempts to make a connection to A's servlet, but A hasn't started yet, so everything hangs. Am I doing this correctly? Thanks. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - 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 order
Title: RE: load-on-startup order So load-on-startup only orders within an application, not between applications? Application A is a message handler. Application B is a listener which must register with A when it starts, so A can forward incoming messages to B. Therefore, B can't lazy load: if B doesn't register with A, then A won't know to forward messages to B, and B will never get called. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 -Original Message- From: James Carman [mailto:[EMAIL PROTECTED]] Sent: Monday, 24 March 2003 12:36 PM To: Tomcat Users List Subject: Re: load-on-startup order Instead of performing the necessary logic in the init method, why not try lazy-loading. Only initialize whatever you need when it is requested the first time. By the way, what are you trying to do? I've never heard of anyone having this kind of requirement/architecture. Just curious. - Original Message - From: Mayne, Peter [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Sunday, March 23, 2003 7:42 PM Subject: load-on-startup order Tomcat 4.1.18 I have two applications, A and B, where a servlet in B depends on a servlet in A being up, so I have in A's web.xml: servlet ... load-on-startup1/load-on-startup /servlet in B's web.xml: servlet ... load-on-startup5/load-on-startup /servlet which should make A start first. However, when Tomcat starts, B's init() is called first. B's init() attempts to make a connection to A's servlet, but A hasn't started yet, so everything hangs. Am I doing this correctly? Thanks. PJDM -- Peter Mayne Technology Consultant Spherion Technology Solutions Level 1, 243 Northbourne Avenue, Lyneham, ACT, 2602 T: 61 2 62689727 F: 61 2 62689777 The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - 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] The information contained in this email and any attachments to it: (a) may be confidential and if you are not the intended recipient, any interference with, use, disclosure or copying of this material is unauthorised and prohibited; and (b) may contain personal information of the recipient and/or the sender as defined under the Privacy Act 1988 (Cth). Consent is hereby given by the recipient(s) to collect, hold and use such information and any personal information contained in a response to this email, for any reasonable purpose in the ordinary course of Spherion's business, including forwarding this email internally or disclosing it to a third party. All personal information collected by Spherion will be handled in accordance with Spherion's Privacy Policy. If you have received this email in error, please notify the sender and delete it. (c) you agree not to employ or arrange employment for any candidate(s) supplied in this email and any attachments without first entering into a contractual agreement with Spherion. You further agree not to divulge any information contained in this document to any person(s) or entities without the express permission of Spherion. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JDBC Driver disappears when using Mod_WEBAPP
Sorry, just realized the title should have read JDBC driver disappears when using mod_webapp. From: Soefara Redzuan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: JDBC Driver disappears when using Mod_jk ! Dear Sirs, This is truly bizarre. I've been runing Apache+mod_webapp in front of one of our websites for quite a time now and it has worked fine for serving up JSP pages. So, the Apache-mod_webapp-Tomcat communication seems to be working OK. I recently added a JNDI datasource to the Tomcat web application. The datasource is configured perfectly, as proven with the useful servlet (below) which we always use to test JNDI datasource connections. ie. http://www.oursite.com:8080/ourapp/TestDb?jndi=jdbc/dbname reports that we successfully created a database connection from the JNDI datasource. However, when we now try to access via mod_webapp ie. http://www.oursite.com/ourapp/TestDb?jndi=jdbc/dbname it reports an error message Cannot load JDBC driver class 'null' How can this be ??? Apache+mod_webapp has been proven to be configured properly since we've been serving up JSP from this webapp for months. When connecting directly to Tomcat on port 8080, the JNDI resource does indeed exist and we can create the connection so the JDBC driver must exist too (and it does) ! Why does the JDBC driver seem to disappear when using mod_webapp??? I hope somebody can shed some light on this. Thank you in advance, Soefara. ps. here's the servlet we use for testing JNDI datasource connections, maybe some of you will find it useful. -- import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; import java.sql.*; import javax.sql.*; import javax.naming.*; public class DbHandlerDebug extends HttpServlet { public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Connection conn = null; String jndiName = request.getParameter(jndi); response.setContentType(text/html); PrintWriter out = new PrintWriter(response.getOutputStream() ); out.println(htmlbodyh3Test JNDI/h3); Context ctx = null; DataSource ds = null; if (jndiName == null) { out.println(font color=#ffpUsage : send argument 'jndi'. br eg. /servlet/TestDB?jndi=jdbc/ourdb); } try { ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:/comp/env/); out.println(liRetrieved Context); ds = (DataSource) envCtx.lookup(jndiName); out.println(liObtained Datasource); conn = ds.getConnection(); out.println(liGot Connection); out.println(h3OK :-)/h3); } catch (NamingException e) { out.println(Failed to get datasource from context : + e.getMessage()); } catch (SQLException e) { out.println(Failed to get DB connection : + e.getMessage()); } catch (Exception e) { out.println(Unexpected error : + e.getMessage()); } out.flush(); } } _ Download ringtones, logos and picture messages from MSN Malaysia http://www.msn.com.my/mobile/ringtones/default.asp - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Are you in love? Find a date on MSN Personals http://match.msn.com.my/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reloading shared/lib JAR files?
No probs - hope that helped. Here are some more thoughts... Please elaborate on why you want to avoid having n copies of a jar version in different contexts. In theory, it is a good principle, but I will argue that that principle applies well to source code and other situations, but not necessarily in this deployment context. I think you need to question your motives for this quest... - is there a driving business or technical need? - is it a purist drive? The multiple copies issue matters only with larger memory footprints. Take a look at the size of your classes - my guess is your core jars are less than 1 Meg each, and probably close to 250K(?). Hardly cause for concern in either case, unless you are deploying many many apps on this one server. Additionally, - links do not work well in source control tools - you could have the deployment script (ant) create the link for you upon deployment; at least then the app's dependency on the external jar is documented in the automated deployment tool, but what is it to do when the jar to link to does not exist? - how do you guarantee a reproducible build with that approach? - and a last perhaps - there might exist optimizations under the hood to mitigate the multiple copies of classes It is best to have all dependencies possible under source control with the app. source + tools = product. Commonly, main tools are assumed to exist such as the OS, the compiler, ant, checkstyle, etc., but in a rigorous engineering environment they will be under source control too as they are dependencies of the product. However, external jars for APIs, libs, etc. (e.g. log4j, junit, struts, custom libs) are not assumed and the version used is under control of the source tree for the product. Under your proposal, you still have different versions of core libs haunting the server - they are just in one place now. I think you have just moved the problem to a different location. Plus, you may not ever accurately know which apps are using a particular jar. And I think you have a more complex situation of guaranteeing the right version is in use for each product! Using the source control tool to handle the product dependencies is still the best approach. tangent I have only been talking from a webapp/war level. Remember, there are two best practice levels to place jars: WAR level and EAR level. If multiple webapps are packaged into an ear and all rely on the same jar version, it may be appropriate to share the jar at the ear level. But, my other arguments apply here with the one app needs the newer version, all must upgrade issue. Buyer beware... /tangent Here is the scenario to think from: New deployment/runtime server, new build server, fresh install of Tomcat. What is the most foolproof method to get an app up and running? 1) Sync a workspace to a label or head revision of the app version's source tree. 2) Type ant deploy. This is very easy and a guaranteed reproducible build with dependencies under source control of the app. This has an assumption: the build and deployment servers are already configured with tools to the appropriate level that you are source controlling dependencies to (e.g. Tomcat, Java, Ant) since they are not under source control. Messing around with jars, etc. - assuming they are on the server - is not error-proof, and invites pain! Architecture, design, and coding are a lot more fun than diagnosing runtime problems that are attributed to deployment problems... Make the deployment process clean, simple, and straightforward as you can. My opinion is that your ideas, while admirable in their quest, are interjecting complexity at the risk of creating runtime problems attributed to deployment problems. well, I ranted longer than expected...hope that helps your thoughts and progress! -Original Message- From: Johannes Fiala [mailto:[EMAIL PROTECTED] Sent: Sunday, March 23, 2003 5:06 AM To: Tomcat Users List Subject: RE: Reloading shared/lib JAR files? Hi Jeff, Thank you very much for the detailed outline. The reason why I wanted to use a central library was that I wanted to prevent different versions of my core libs haunting the contexts of the Tomcat server. So you're suggested solution would be to leave it up to the separate contexts to update and use the newer lib files. The only drawback of this terms of use is, that you have one component n times installed across the various contexts of the Tomcat. This was what I wanted to avoid So to use both ideas, what about the following: *) central repository of all versions of all helper jar files /{$tomcat_home}/repository/v1.jar /{$tomcat_home}/repository/v2.jar *) each application context picks the version it likes to use /{$tomcat_home}/webapps/myapp/WEB-INF/lib/link to v1.jar /{$tomcat_home}/webapps/myapp2/WEB-INF/lib/link to v2.jar Do you think the approach outlined above makes sense? I think this would reduce the scattered library version
mod_jk2 build issue
Hi, I am configuring Apache1.3.27 to talk to Tomcat 4.1.18. All was going fine until I tried to build mod_jk2 on a SunOs 2.8 machine. Given that there are no binaries for solaris 8 (SunOs 2.8), I have downloaded the source: jakarta-tomcat-connectors-jk2-2.0.2-src. When I try to build the shared library mod_jk2.so, although I follow the instructions, both build processes fail (the ant-based build as well as the make-based build). Can I get the binaries for mod_jk2.so for 'SunOs 2.8/Solaris 8' from anywhere? Alternatively, is there a build process that works? Any help will be greatly appreciated. Cheers, Steve