Re: NoClassDefFoundError, Tomcat isn't seeing JARs in webapps/appname/lib?
J2EE specs says librairies of a webapp must be in /WEB-INF/lib (that's for the part about subjet line where you use /lib) Now, for you mail content you seem to be indeed using WEB-INF/lib, and it seems to be the 3 libs required by wicket example. I suggest you investigate the possibility of having downloaded a broken jar. Maybe, try switching away from a beta version Ghodmode a écrit : This is related to my previous email thread, but slightly different circumstances. Apache Tomcat 6.0.14 Java 1.6.0_02-b05 Wicket 1.3.0-beta3 I'm trying to run a Wicket application and it's not working. I'm getting a NoClassDefFoundError: java.lang.NoClassDefFoundError: org/apache/wicket/protocol/http/WebApplication I think I must be misunderstanding something basic about Tomcat web application deployment. So, I create a basic HelloWorld type servlet to try and troubleshoot the problem. I've double- and triple-checked the package against the documentation and even verified it by listing the contents of the JAR with unzip. What am I doing wrong? The Wicket JAR file and two of its dependencies are in WEB-INF/lib: @home:~/dev/tomcat/webapps/HelloWicket/WEB-INF/classes$ ls -ltr ../lib total 1648 -rw-r--r-- 1 vince vince 1657246 2007-09-04 10:00 wicket-1.3.0-beta3.jar -rw-r--r-- 1 vince vince7449 2007-09-04 10:00 slf4j-simple-1.4.3.jar -rw-r--r-- 1 vince vince 15345 2007-09-04 10:00 slf4j-api-1.4.3.jar Here's my web.xml: @home:~/dev/tomcat/webapps/HelloWicket/WEB-INF$ cat web.xml ?xml version=1.0 encoding=UTF-8? !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 context-param param-nameconfiguration/param-name param-valuedevelopment/param-value /context-param servlet servlet-nameHelloWicket/servlet-name servlet-classorg.apache.wicket.protocol.http.WicketServlet /servlet-class init-param param-nameapplicationClassName/param-name param-valuemypackage.HelloWicketApp/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameHelloWicket/servlet-name url-pattern/helloWicket/*/url-pattern /servlet-mapping /web-app Here's the layout of my servlet's directory: @home:~/dev/tomcat/webapps/HelloWicket$ ls -ltrR : total 8 -rw-r--r-- 1 vince vince 44 2007-09-04 10:00 index.html drwxr-xr-x 4 vince vince 4096 2007-09-04 10:27 WEB-INF /WEB-INF: total 12 drwxr-xr-x 2 vince vince 4096 2007-09-04 10:00 lib drwxr-xr-x 3 vince vince 4096 2007-09-04 10:05 classes -rwxr-xr-x 1 vince vince 755 2007-09-04 10:08 web.xml /WEB-INF/lib: total 1648 -rw-r--r-- 1 vince vince 1657246 2007-09-04 10:00 wicket-1.3.0-beta3.jar -rw-r--r-- 1 vince vince7449 2007-09-04 10:00 slf4j-simple-1.4.3.jar -rw-r--r-- 1 vince vince 15345 2007-09-04 10:00 slf4j-api-1.4.3.jar /WEB-INF/classes: total 8 -rw-r--r-- 1 vince vince 601 2007-09-04 10:04 HelloWicket.html drwxr-xr-x 2 vince vince 4096 2007-09-04 10:20 mypackage /WEB-INF/classes/mypackage: total 16 -rw-r--r-- 1 vince vince 238 2007-09-04 10:06 HelloWicket.java -rw-r--r-- 1 vince vince 192 2007-09-04 10:20 HelloWicketApp.java -rw-r--r-- 1 vince vince 468 2007-09-04 10:20 HelloWicket.class -rw-r--r-- 1 vince vince 347 2007-09-04 10:20 HelloWicketApp.class Thank you, Vince - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NoClassDefFoundError, Tomcat isn't seeing JARs in webapps/appname/lib?
On 9/4/07, David Delbecq [EMAIL PROTECTED] wrote: J2EE specs says librairies of a webapp must be in /WEB-INF/lib (that's for the part about subjet line where you use /lib) Thank you David. That was a typo. I am actually using WEB-INF/lib. Now, for you mail content you seem to be indeed using WEB-INF/lib, and it seems to be the 3 libs required by wicket example. I suggest you investigate the possibility of having downloaded a broken jar. Maybe, try switching away from a beta version I've double-checked the JAR file and it's okay, but I re-downloaded it anyway and I still get the same results. The Wicket download page says that the latest beta is stable and suggests using it for new projects. But I tried version 1.2.6 anyway and I have the same results :( I have become convinced that this is a Tomcat problem. Just to be thorough, though, I'm going to try with an earlier version of Java. Wicket's site states that it requires 1.4. I think that it means 1.4 and up, but I'm using 1.6. So, I'll give it a try with 1.5, then with 1.4. Thank you, Vince
an easier way to deploy war file?
Hi, I use Tomcat 5.5, I installed it in an ubuntu, I have to start it as root with startup.sh. to deplay a war file during development I have to do following: 1. ftp to my home directory 2. ssh to the host as root, shutdown.sh 3. delete the program directory under webapps 4. copy war file from my home directory to webapps/ 5. start again tomcat server. any easy way to do this? Thanks. A.C. -- View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12473298 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Noob needs help with a webservice wich uses resources located in a folder
Hello First of all thank you for your answer. The owner of tomcat it's my user, but the problem is that my system doesn't have the group (or user) tomcat. I tried to launch tomcat as root (just as a test) moving the folder to the same place as the .class is, and later the same moving the folder to webapps/service/WEB-INF/lib folder... but nothing worked... any other idea? I'll keep on trying. Thank you!! PTS escribió: If my quick read of your problem is correct, (only works when run from command line) then I would venture to say that you may have a rights issue. Who owns the app? By default Tomcat starts from the scripts as owner tomcat where as from the command line it is running as you (root or some admin level). Try chown and chgrp the app to tomcat and see if that helps. No even moving it into the folder does not give Tomcat the rights to access it. You could also change the access rights but I would be careful there as letting anyone execute code is not a good thing, but chgrp to tomcat and group executable would work. Just make sure you understand what the implications of the changes you make are, even on ownership and group membership. Doug - Original Message - From: Tomás Tormo [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, September 03, 2007 7:09 AM Subject: Noob needs help with a webservice wich uses resources located in a folder Hi I'm quite noob about tomcat topic. I'm using tomcat 5.028 in Ubuntu 6.10 and I would like to find an anwer to my question about web services because i'm not able to solve it. I've written a java applicattion wich uses a wrapper to communicate with an applicattion written in C, wich is the core of my applicattion. Both the wrapper and the core are third party applicattions, and because of that i don't have the source code, I just have the API. The third party sent me an example application wich uses the core. And, as I could see in the script wich lauches the application, this folder should be added to the classpath in order to be able to be located by the wrapper applicattion. The documentation of the wrapper just says that this folder has to exist with an specific name. My problem is that my applicattion works fine launched from shell (it founds the folder and uses the core perfectly) but it doesn't work as a webservice. It is not able to find the resource folder (let's call it cfg). As I can see in the catalina log, the application tries to load the resources (via ClassLoader I guess) and then launches an exception saying that is not able to find it. The client gets a HTTPErrorCode0. I've tried a lot of ways to solve it: I tried to launch tomcat with the classpath modified from the shell itself(making it point to the folder), tried to export the classpath from startup.sh script, tried to export the classpath from catalina.sh script, tried to modify the CATALINA_OPTS variable, tried to put the folder in both lib and classes folders of the webservice folder... but nothing worked. Please.. could you help me to solve this problem? I think I've tried all the options that came to my mind (except declaring a resource in server.xml file, altought I don't know If this wrapper uses JNDI to access to the resource..).I hope I explained myself well. As I think you can see, I'm quite noob with tomcat, so please don't be so hard with your answers... :'-p Thank you very much! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: an easier way to deploy war file?
Hi, maybe there is a better way, but at least I guess you can use Ant to automate all that in one task. Yannick On 9/4/07, Angelo Chen [EMAIL PROTECTED] wrote: Hi, I use Tomcat 5.5, I installed it in an ubuntu, I have to start it as root with startup.sh. to deplay a war file during development I have to do following: 1. ftp to my home directory 2. ssh to the host as root, shutdown.sh 3. delete the program directory under webapps 4. copy war file from my home directory to webapps/ 5. start again tomcat server. any easy way to do this? Thanks. A.C. -- View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12473298 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsvc.pid question / Possibility of jsvc.pid collisions?
Yes, this is a valid issue from the start/stop tomcat perspective. If you have multipe tomcat servers running on the same machine you can use -pidfile switch to specify the different pid file location for each server. Otherwise you won't be able to start both servers simultaneously. e.g -pidfile /var/run/server1/jsvc.pid -pidfile /var/run/server2/jsvc.pid OR -pidfile /var/run/jsvc1.pid -pidfile /var/run/jsvc2.pid Thanks, -Azhar On 9/1/07, Ole Ersoy [EMAIL PROTECTED] wrote: Hi, I was wondering whether there is a possibility for collisions for multiple servers running with jsvc on the same machine. JSVC stores the tomcat process ID in: /var/run/jsvc.pid What if another server tried to do the same? Is this a valid concern and if so is there a way to change the name of jsvc.pid to say tomcat-jsvc.pid? Thanks, - Ole - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: NoClassDefFoundError, Tomcat isn't seeing JARs in webapps/appname/lib?
Just a quick one, how do you start Tomcat? Is it another user? Does the directories/apps have the correct rights. And does Tomcat/java have the necessery rights to read, and run? Regards Per Jonsson -Original Message- From: Ghodmode [mailto:[EMAIL PROTECTED] Sent: den 4 september 2007 09:22 To: Tomcat Users List Subject: Re: NoClassDefFoundError, Tomcat isn't seeing JARs in webapps/appname/lib? On 9/4/07, David Delbecq [EMAIL PROTECTED] wrote: J2EE specs says librairies of a webapp must be in /WEB-INF/lib (that's for the part about subjet line where you use /lib) Thank you David. That was a typo. I am actually using WEB-INF/lib. Now, for you mail content you seem to be indeed using WEB-INF/lib, and it seems to be the 3 libs required by wicket example. I suggest you investigate the possibility of having downloaded a broken jar. Maybe, try switching away from a beta version I've double-checked the JAR file and it's okay, but I re-downloaded it anyway and I still get the same results. The Wicket download page says that the latest beta is stable and suggests using it for new projects. But I tried version 1.2.6 anyway and I have the same results :( I have become convinced that this is a Tomcat problem. Just to be thorough, though, I'm going to try with an earlier version of Java. Wicket's site states that it requires 1.4. I think that it means 1.4 and up, but I'm using 1.6. So, I'll give it a try with 1.5, then with 1.4. Thank you, Vince This e-mail and the information it contains may be privileged and/or confidential. It is for the intended addressee(s) only. The unauthorised use, disclosure or copying of this e-mail, or any information it contains, is prohibited. If you are not an intended recipient, please contact the sender and delete the material from your computer. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat JNI Netbeans
Hi I am having some trouble configuring a web application on Tomcat 6.0.14 that is calling native libs via JNI on Red Hat Ent 3.0. I have not been able to configure it successfully and I am running out of ideas. I get errors like this java.lang.UnsatisfiedLinkError: Native Library WEB-INF/lib/libfoo.so already loaded in another classloader at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1525) And also ClassNotFound, also if I run everything from a standalone app it works fine. What discovered so far is this: http://wiki.apache.org/tomcat/HowTo#head-a4b7185ee95d0cf14a48f92c08d1eb66b561139d one cannot place the native libraries OR their JNI interfaces under the WEB-INF/lib or WEB-INF/classes directories both this class and the shared library should be placed in the $CATALINA_HOME/shared/lib directory. Actually $CATALINA_HOME/shared/lib directory doesn't exist on my installation so I created it and as test I created and placed a dummy javalibrary in a .jar file in this location. I created a dummy WebApplication and included this library via the netbeans IDE and instanciated the library class within the WebApps Serlet. I noticed when I build the project with netbeans it copied and included the java library into the WebApps .war file (in the WEB-INF/lib directory structure which is not allowed for JNI apps) . So I removed this before putting the .war file into the Tomcats WebApps directory. I have tried both setting AND not setting the CLASSPATH env variable but according to http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html Tomcat ignores CLASSPATH anyway. Does anyone have any ideas ? Thanks -- View this message in context: http://www.nabble.com/Tomcat-JNI-Netbeans-tf4376281.html#a12473998 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NoClassDefFoundError, Tomcat isn't seeing JARs in webapps/appname/lib?
On 9/4/07, Per Johnsson [EMAIL PROTECTED] wrote: Just a quick one, how do you start Tomcat? Is it another user? Does the directories/apps have the correct rights. And does Tomcat/java have the necessery rights to read, and run? Hi Per, I start Tomcat using $CATALINA_HOME/bin/startup.sh and stop it with $CATALINA_HOME/bin/shutdown.sh. I untarred the Tomcat installation with a normal user (ie: not root) and I start and stop it with the same user that untarred it. It's in a normal directory inside of my home directory. Thank you, Vince
random Listening port
Hello, I've installed tomcat 6.0 and I'm wondering why there is random port open. On tomcat 5.5, there is no random port open. What is it for ? For example : What is the first port java5107 tomcat6u IPv6 13478475 TCP *:42590 (LISTEN) java5107 tomcat8u IPv6 13478477 TCP *:8080 (LISTEN) java5107 tomcat9u IPv6 13478507 TCP *:8009 (LISTEN) java5107 tomcat 15u IPv6 13478596 TCP *:8005 (LISTEN) Thank you in advance -- Lionel CRINE - LINAGORA Administrateur Systèmes et Réseaux Tél. : 01 58 18 68 28 Fax : 01 58 18 68 29 Linagora Recrute : www.linagora.com / www.linagora.org - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NoClassDefFoundError, Tomcat isn't seeing JARs in webapps/appname/lib?
hello, Here's my web.xml: @home:~/dev/tomcat/webapps/HelloWicket/WEB-INF$ cat web.xml ?xml version=1.0 encoding=UTF-8? !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 context-param param-nameconfiguration/param-name param-valuedevelopment/param-value /context-param servlet servlet-nameHelloWicket/servlet-name servlet-classorg.apache.wicket.protocol.http.WicketServlet /servlet-class init-param param-nameapplicationClassName/param-name param-valuemypackage.HelloWicketApp/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameHelloWicket/servlet-name url-pattern/helloWicket/*/url-pattern /servlet-mapping /web-app your web.xml is a bit different from the Wicket HelloWorld example http://wicket.apache.org/examplehelloworld.html did you try with: servlet-classwicket.protocol.http.WicketServlet/servlet-class ?? and did you follow this tutorial??
Re: Tomcat JNI Netbeans
soulboy wrote: both this class and the shared library should be placed in the $CATALINA_HOME/shared/lib directory. Actually $CATALINA_HOME/shared/lib directory doesn't exist on my installation so I created it and as test I created and placed a dummy javalibrary in a .jar file in this location. For a default Tomcat 6 install, just use $CATALINA_HOME/lib Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: an easier way to deploy war file?
- *never* start tomcat as root: create a user tomcat if not already existing and run tomcat with that user-id - if it's not a production-server with very high security, grant ftp-access to user tomcat - from your local pc, ftp to your ubuntu, login as user tomcat - change to directory www/webapps - put your web-app.war that's it be sure that autodeploy is set to true. having done so, there's no need to delete any directories on your ubuntu-server cheers gregor ps: before starting tomcat as user tomcat, you might have to issue chown -R tomcat:tomcat * in $CATALINA_HOME -- what's puzzlin' you, is the nature of my game gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2 gpgp-key available @ http://pgpkeys.pca.dfn.de:11371 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: random Listening port
From: Lionel Crine [mailto:[EMAIL PROTECTED] Subject: random Listening port I've installed tomcat 6.0 and I'm wondering why there is random port open. Do you have JMX remote enabled? (Setting -Dcom.sun.management.jmxremote opens a random port with a Sun JVM.) What JVM are you using? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using HSQLDB for Authentication
Sorry, further testing showed that Tomcat was locating one of my databases, but not the one I thought. It was locating a database in %CATALINA_HOME%/data. So the database location and connectionURL which I posted previously are not consistent. Here is the corrected database location: * Locate the HSQLDB database files in %CATALINA_HOME%/data Here is the complete corrected Info: * Locate hsqldb.jar in %CATALINA_HOME%/common/lib * Locate the HSQLDB database files in %CATALINA_HOME%/data * Use the following Realm element in server.xml: Realm className=org.apache.catalina.realm.JDBCRealm driverName=org.hsqldb.jdbcDriver connectionURL=jdbc:hsqldb:data/Auth connectionName=SA connectionPassword= userTable=USER userNameCol=USERNAME userCredCol=PASSWORD userRoleTable=USER_ROLE roleNameCol=ROLENAME / -- View this message in context: http://www.nabble.com/Using-HSQLDB-for-Authentication-tf4208687.html#a12478808 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: an easier way to deploy war file?
Angelo Chen wrote: I use Tomcat 5.5, I installed it in an ubuntu, I have to start it as root with startup.sh. to deplay a war file during development I have to do following: 1. ftp to my home directory 2. ssh to the host as root, shutdown.sh 3. delete the program directory under webapps 4. copy war file from my home directory to webapps/ 5. start again tomcat server. any easy way to do this? Thanks. The Tomcat manager app simplifies this significantly. Take a look, and check whether you can use it: http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html -- ..Juha - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with form based JSP authentication using Firefox with Tomcat
Hi there, I'm new to the list, just having some trouble getting my authentication to work with Firefox. I'm trying to protect access to a member area in my new website, and am just using the built in form based security for now. I'm using Tomcat 6.0.14, IE7 and Firefox 2.0.0.6.When attempting to access the member area (/members/) the user is to be redirected to /login.jsp. The error page is the same but with a parameter (/login.jsp?error=true). When using IE7, all of this works just fine and after successful login, the user is sent to /members/When using Firefox, when everything is freshly built it works the first time. If I then log out (using session.invalidate() and being redirected to the home page) and log in again it stopsworking. After a successful login the user is presented not with the /members/ page, but with the login page again. Hitting refresh actually gives us the page we're after, so it seems to be caching thelogin page 'as' the /members/ page. --Here is a section from my web.xml:--- security-constraint display-nameMember Access/display-name web-resource-collection web-resource-nameMember Access Area/web-resource-name url-pattern/members/*/url-patternhttp-methodDELETE/http-method http-methodGET/http-methodhttp-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-nameadministrator/role-namerole-namemember/role-name role-namestudent/role-name/auth-constraint /security-constraint login-config auth-methodFORM/auth-method realm-nameMember Area/realm-name form-login-config form-login-page/login.jsp/form-login-page form-error-page/login.jsp?error=true/form-error-page /form-login-config /login-config -Here is my logout code:- % session.invalidate();response.sendRedirect(/); % Here is my login code:- form method=post action='%= response.encodeURL(j_security_check) %' table border=0 cellspacing=5 tr th align=rightUsername:/th td align=leftinput type=text name=j_username //td /tr tr th align=rightPassword:/th td align=leftinput type=password name=j_password //td /tr tr td align=rightinput type=submit value=Log In //td td align=leftinput type=reset //td /tr /table/form Note: I've tried putting the following code at the top of my login.jsp and logout.jsp files but it doesn't seem to help: % response.setHeader(Cache-Control,no-cache); response.setHeader(Cache-Control,no-store); response.setDateHeader(Expires, -1); response.setHeader(Pragma,no-cache); % Thanks very much for any assistance, Luke.
Re: an easier way to deploy war file?
If you set up Tomcat correctly, and place all your jars in the correct places you can hot deploy the war without a restart. This works over plain http, you don't even need access to the server, all you need is a password for the manager (it's better to use a database realm). There are many ways to secure the manager in production, the simplest is to remove the manager.xml and host-manager.xml files from the $CATALINA_BASE/conf/Catalina/localhost/ directory, or if your configuration permits allow the manager url to resolve only on the internal network, this is a typical scenario if tomcat is left to run on a secure port. cheers Peter is to make the manager URL resolve Gregor Schneider wrote: - *never* start tomcat as root: create a user tomcat if not already existing and run tomcat with that user-id - if it's not a production-server with very high security, grant ftp-access to user tomcat - from your local pc, ftp to your ubuntu, login as user tomcat - change to directory www/webapps - put your web-app.war that's it be sure that autodeploy is set to true. having done so, there's no need to delete any directories on your ubuntu-server cheers gregor ps: before starting tomcat as user tomcat, you might have to issue chown -R tomcat:tomcat * in $CATALINA_HOME - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with mod_jk and cygwin
Hi!. I follow the instruction to build the connector so all step was well done, but the .so archive was not create it. Thanks
Re: Problem with form based JSP authentication using Firefox with Tomcat
Try putting all of the Cache-Control commands inline, comma separated: meta http-equiv=Cache-Control content=no-store,no-cache,must-revalidate meta http-equiv=Pragma content=no-cache meta http-equiv=Expires content=-1 You can also set the headers: % response.setHeader(Cache-Control,no-cache,no-store,must-revalidate); response.setHeader(Pragma,no-cache); response.setDateHeader(Expires, -1); % I'm not sure of the implications of using /login.jsp?error=true as an error page - though it was recently discussed on this list, you may wish to search the archives. I usually place my login pages out of the way: WEB-INF/login/form.jsp WEB-INF/login/error.jsp so they can't be accessed directly. p (tip: send plain text mail to avoid crazy formatting) Luke McMahon wrote: Hi there, I'm new to the list, just having some trouble getting my authentication to work with Firefox. I'm trying to protect access to a member area in my new website, and am just using the built in form based security for now. I'm using Tomcat 6.0.14, IE7 and Firefox 2.0.0.6.When attempting to access the member area (/members/) the user is to be redirected to /login.jsp. The error page is the same but with a parameter (/login.jsp?error=true). When using IE7, all of this works just fine and after successful login, the user is sent to /members/When using Firefox, when everything is freshly built it works the first time. If I then log out (using session.invalidate() and being redirected to the home page) and log in again it stopsworking. After a successful login the user is presented not with the /members/ page, but with the login page again. Hitting refresh actually gives us the page we're after, so it seems to be caching thelogin page 'as' the /members/ page. --Here is a section from my web.xml:--- security-constraint display-nameMember Access/display-name web-resource-collectionweb-resource-nameMember Access Area/web-resource-name url-pattern/members/*/url-patternhttp-methodDELETE/http-methodhttp-methodGET/http-methodhttp-methodPOST/http-methodhttp-methodPUT/http-method /web-resource-collection auth-constraint role-nameadministrator/role-namerole-namemember/role-namerole-namestudent/role-name/auth-constraint /security-constraint login-config auth-methodFORM/auth-method realm-nameMember Area/realm-name form-login-configform-login-page/login.jsp/form-login-pageform-error-page/login.jsp?error=true/form-error-page /form-login-config /login-config -Here is my logout code:- % session.invalidate();response.sendRedirect(/); % Here is my login code:- form method=post action='%= response.encodeURL(j_security_check) %' table border=0 cellspacing=5 tr th align=rightUsername:/th td align=leftinput type=text name=j_username //td /tr tr th align=rightPassword:/th td align=leftinput type=password name=j_password //td /tr tr td align=rightinput type=submit value=Log In //td td align=leftinput type=reset //td /tr /table/form Note: I've tried putting the following code at the top of my login.jsp and logout.jsp files but it doesn't seem to help: % response.setHeader(Cache-Control,no-cache); response.setHeader(Cache-Control,no-store); response.setDateHeader(Expires, -1); response.setHeader(Pragma,no-cache); % Thanks very much for any assistance, Luke. smime.p7s Description: S/MIME Cryptographic Signature
Re: Tomcat freeze after some times
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ice, Ice72 wrote: Hi Cris, thanks for your reply. Yes: I checked the process via top/netstat/lsof and I haven't detect any strange situation. The super-strange thing is that the other webapps, on the same tomcat-instance, continue to work when the single-app fail. Sounds like a db connection pool exhaustion. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3cFx9CaO5/Lv0PARAqwEAJ9G2/L/Id9b3igPx/F4AVWfqxfAMQCfTlBy g8sHhqlF2PBWGDhx0ZSmwq4= =j3zb -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HttpSessionListener
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ashok, OFFICIAL WEBSITE wrote: 3. Problem. The listener class does not report sessionCreate and sessionDestroy. It responds perfectly to all other types of event listeners. The servlet class, of course, reports each HttpRequest as they come in. Please post your Listener's code and the configuration you use in web.xml. It doesn't work doesn't make a good post. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3cJQ9CaO5/Lv0PARAkAbAKCTJ2JpDk1yphNZlHaixWUCVcRSjgCcDyDd Te1fOL5ZK2/oZpfl61ihAcA= =MPiJ -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: localhost.log vs. catalina.out
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 icet, icet wrote: What's the difference between [catalina.out and localhost.log]? catalina.out should be where standard error and standard output for the Tomcat process are redirected. localhost.log is dependent on how you configure any Loggers in your server.xml. If you are separately configuring logging using juli or log4j, then your configuration can do all sorts of things. catalina.out is always stderr and stdout IIRC. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3cRc9CaO5/Lv0PARAmOqAJ0YGDC7pQS+n2NqIrL/Bl5c5XxargCeKz0q sIPmW6hOjRNOoMbsjub0pxw= =Vp/L -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Please help...
Brian, Hassan and Charles; did I happen to mention that you guys ROCK! Your responses assisted me in coming to the conclusion that the problem had nothing to do with the Resource element at all. It turns out that I had referenced this resource within the wrong Context (the default Context was actually being called). Silly mistake on my part, and it really helped out immensely to have some knowledgeable guys around to bounce this one off of. Thanks again for responding! Best regards, Mike Fax.com The New Way To Fax! www.fax.com Confidential: This electronic message and all contents contain information from Fax.com, Inc. which may be privileged, confidential or otherwise protected from disclosure. The information is intended to be for the addressee(s) only. If you are not an addressee, any disclosure, copy, distribution or use of the contents of this message is prohibited. If you have received this electronic message in error, please notify the sender by reply e-mail and destroy the original message and all copies. Thank you. -Original Message- From: Brian Munroe [mailto:[EMAIL PROTECTED] Sent: Sunday, September 02, 2007 10:18 AM To: Tomcat Users List Subject: Re: Please help... On 9/2/07, Caldarale, Charles R [EMAIL PROTECTED] wrote: Correct. It appears that Container is the default, but setting it explicitly certainly won't hurt. Gotcha, thanks. -- brian - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsvc.pid question / Possibility of jsvc.pid collisions?
Super - Thanks Azhar - definitely making a note of the -pidfile switch. Thanks again, - Ole Waseem Azhar wrote: Yes, this is a valid issue from the start/stop tomcat perspective. If you have multipe tomcat servers running on the same machine you can use -pidfile switch to specify the different pid file location for each server. Otherwise you won't be able to start both servers simultaneously. e.g -pidfile /var/run/server1/jsvc.pid -pidfile /var/run/server2/jsvc.pid OR -pidfile /var/run/jsvc1.pid -pidfile /var/run/jsvc2.pid Thanks, -Azhar On 9/1/07, Ole Ersoy [EMAIL PROTECTED] wrote: Hi, I was wondering whether there is a possibility for collisions for multiple servers running with jsvc on the same machine. JSVC stores the tomcat process ID in: /var/run/jsvc.pid What if another server tried to do the same? Is this a valid concern and if so is there a way to change the name of jsvc.pid to say tomcat-jsvc.pid? Thanks, - Ole - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: random Listening port
Well, good point, I think jmx is activated. I'll check that and come back to you. I'm using sun JVM 5.0 on Linux. Lionel Caldarale, Charles R a écrit : From: Lionel Crine [mailto:[EMAIL PROTECTED] Subject: random Listening port I've installed tomcat 6.0 and I'm wondering why there is random port open. Do you have JMX remote enabled? (Setting -Dcom.sun.management.jmxremote opens a random port with a Sun JVM.) What JVM are you using? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question on static variables
I have a unique situation where I'm building a polling server for a Flash/Flex application. I want to turn information around very quickly between clients and therefore don't want to use a database if I don't have to. What I want to do is store information in a few static variables used in a servlet. I'm looking for speed more than anything as the clients will be polling the server every 2-3 seconds. I'm expecting about 100 to 500 (max) clients at any given time. What I'm curious about is how Tomcat handles static variables. Coming from ASP.NET experience I know that using static variables with IIS they are held in the app domain and the app domain can be reloaded by IIS for a number of reasons (config files changed, files changed, etc.) This kinda makes using static variables in ASP.NET and IIS a bit tricky and unreliable. So the question I have is how does Tomcat handle static variables then? When would they get reloaded/recycled, etc.? I'm aware I could use something like memcached to mimic what I'm doing but again I'd rather stick to static variables if possible for the sake of simplicity. Thanks for any help on this.
Re: Question on static variables
See Thread at: http://www.techienuggets.com/Detail?tx=11977 Posted on behalf of a User Nothing to do with Tomcat. Look up the Singleton pattern and it will teach you what you need. In Response To: I have a unique situation where I'm building a polling server for a Flash/Flex application. I want to turn information around very quickly between clients and therefore don't want to use a database if I don't have to. What I want to do is store information in a few static variables used in a servlet. I'm looking for speed more than anything as the clients will be polling the server every 2-3 seconds. I'm expecting about 100 to 500 (max) clients at any given time. What I'm curious about is how Tomcat handles static variables. Coming from ASP.NET experience I know that using static variables with IIS they are held in the app domain and the app domain can be reloaded by IIS for a number of reasons (config files changed, files changed, etc.) This kinda makes using static variables in ASP.NET and IIS a bit tricky and unreliable. So the question I have is how does Tomcat handle static variables then? When would they get reloaded/recycled, etc.? I'm aware I could use something like memcached to mimic what I'm doing but again I'd rather stick to static variables if possible for the sake of simplicity. Thanks for any help on this. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with form based JSP authentication using Firefox with Tomcat
Thanks p (hope this is formatted better!) I tried this without success. I've attached the livehttpheader output below. What seems to happen in Firefox is the first time I go to the login page, it passes the jsessionid to j_security_check. If I then invalidate the session, and go to log in again, it calls j_security_check without this identifier. This might be why I'm not getting redirected to the member page, but I'm not sure of that. Like I said, this works fine in IE, but firefox still seems to either be losing its bundle after the session is invalidated or incorrectly caching the login page as the member page I'm trying to access. I've just cut and pasted the differences between the headers of the successful login, and the unsuccessful login (ie. no redirect). Success: - http://localhost:8080/members/ GET /members/ HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://localhost:8080/index.htm Failure: http://localhost:8080/members/ GET /members/ HTTP/1.1 Host: localhost:8080 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://localhost:8080/index.htm Cookie: JSESSIONID=533286C2B979BBF186A7D69AAAE33746 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: an easier way to deploy war file?
Hi Gregor, Thanks, i tried this, it works, sometimes I can see the updated program immediately, but sometimes I got all those 404 errors, I have to wait for a few minutes before I can see the updates reflected, any idea? how to reflect changes asap? Thanks. Gregor Schneider wrote: - *never* start tomcat as root: create a user tomcat if not already existing and run tomcat with that user-id - if it's not a production-server with very high security, grant ftp-access to user tomcat - from your local pc, ftp to your ubuntu, login as user tomcat - change to directory www/webapps - put your web-app.war that's it be sure that autodeploy is set to true. having done so, there's no need to delete any directories on your ubuntu-server cheers gregor ps: before starting tomcat as user tomcat, you might have to issue chown -R tomcat:tomcat * in $CATALINA_HOME -- w -- View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12490683 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: an easier way to deploy war file?
See Thread at: http://www.techienuggets.com/Detail?tx=11882 Posted on behalf of a User Even when you hot or auto-deploy the war file the previous version has to be replaces by extracting content from the new war file. There will be a pause with 404 errors if you hit the URL while the deployment is taking place. As far as I know there's no instant way of doing this. In Response To: Hi Gregor, Thanks, i tried this, it works, sometimes I can see the updated program immediately, but sometimes I got all those 404 errors, I have to wait for a few minutes before I can see the updates reflected, any idea? how to reflect changes asap? Thanks. Gregor Schneider wrote: - *never* start tomcat as root: create a user tomcat if not already existing and run tomcat with that user-id - if it's not a production-server with very high security, grant ftp-access to user tomcat - from your local pc, ftp to your ubuntu, login as user tomcat - change to directory www/webapps - put your web-app.war that's it be sure that autodeploy is set to true. having done so, there's no need to delete any directories on your ubuntu-server cheers gregor ps: before starting tomcat as user tomcat, you might have to issue chown -R tomcat:tomcat * in $CATALINA_HOME -- w -- ... http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12490683 Sent from the Tomcat - User mailing list archive at - To start a new topic, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on static variables
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chad, Chad Lung wrote: What I want to do is store information in a few static variables used in a servlet. I'm looking for speed more than anything as the clients will be polling the server every 2-3 seconds. I think what you really want is to store that information in the application context, also known as the ServletContext. Any servlet can get access to the ServletContext for any request. You can use a ServletContextListener to listen for application startup events to, say, load the data once from a database or flat file or whatever. What I'm curious about is how Tomcat handles static variables. Tomcat does not support any special handling of static variables. Coming from ASP.NET experience I know that using static variables with IIS they are held in the app domain and the app domain can be reloaded by IIS for a number of reasons (config files changed, files changed, etc.) This is sort of like the ServletContext, but in behavior only. Tomcat discards the web application (context) when you redeploy, but the JVM can hold onto references to the now-useless memory if you're not careful about how you manage your memory. If you leave references to objects from the old webapp around, you can cause the old webapp to stick around in memory. This kinda makes using static variables in ASP.NET and IIS a bit tricky and unreliable. Exactly. Same with Java and webapps. So the question I have is how does Tomcat handle static variables then? When would they get reloaded/recycled, etc.? I'm aware I could use something like memcached to mimic what I'm doing but again I'd rather stick to static variables if possible for the sake of simplicity. Using the ServletContext to store information is easy, convenient, and pretty safe. That's my recommendation. You could also take a look at the build-in database that comes with the newer JVMs. I think there's an in-memory implementation if you have complex data needs but still want the speed of RAM. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3id89CaO5/Lv0PARAvpjAJ98jJzq36367qFb/RaaGjDspFLpcACdH/NP 4FhYSHEYUx5HwggOBM2q/w4= =wLEk -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: an easier way to deploy war file?
Hi, Can war file be deployed without creating a directory, I meant, tomcat can just use the WAR file without creating a directory? Thanks, A.C. samk-2 wrote: See Thread at: http://www.techienuggets.com/Detail?tx=11882 Posted on behalf of a User Even when you hot or auto-deploy the war file the previous version has to be replaces by extracting content from the new war file. There will be a pause with 404 errors if you hit the URL while the deployment is taking place. As far as I know there's no instant way of doing this. In Response To: -- View this message in context: http://www.nabble.com/an-easier-way-to-deploy-war-file--tf4376062.html#a12491811 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat freeze after some times
Yes ... in theory. But if was this case, in the jstack dump, we should view the incoming http-req which waiting for a pooled connection (I have a ConnPool.getConnection() class/method). But ... on the dump there is anything ... P-( Christopher Schultz-2 wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ice, Ice72 wrote: Hi Cris, thanks for your reply. Yes: I checked the process via top/netstat/lsof and I haven't detect any strange situation. The super-strange thing is that the other webapps, on the same tomcat-instance, continue to work when the single-app fail. Sounds like a db connection pool exhaustion. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3cFx9CaO5/Lv0PARAqwEAJ9G2/L/Id9b3igPx/F4AVWfqxfAMQCfTlBy g8sHhqlF2PBWGDhx0ZSmwq4= =j3zb -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Tomcat-freeze-after-some-times-tf4353175.html#a12491835 Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]