Re: META-INF/context.xml and deploy issue (web.xml removed?)
Hi, Is anyone can help me to find out what I am missing ? Thanks Le 02/12/2014 10:36, m...@ow2.org a écrit : Hello, I'm facing an issue with tomcat 6. In order to setup a JDNI, we added a context.xml file to our application (XWiki) in the already-deployed folder webapps/xwiki/META-INF/ and configured the existing webapps/xwiki/WEB-INF/web.xml accordingly. update of web.xml triggered the app reload which is expected. At this point I wanted to adjust the database configuration, ie by modifying webapps/xwiki/META-INF/context.xml. When I do this the changes are not taken into account because the file Catalina/localhost/xwiki.xml is not overwritten by Tomcat. The solution that came into my mind has been to force Tomcat to update the file bt deleting Catalina/localhost/xwiki.xml - which has indeed make Tomcat undeploy and deploy the app again. Here are my questions: 1) As there is no war file involved, what does undeploy and deploy means ? What is being done exactly ? 2) Why is the file webapps/xwiki/WEB-INF/web.xml is missing, after I remove xwiki.xml and the app is redeployed ? (no web.xml = no deployment so at the moment I have to manually restore a backup of this file) Thanks ! -- Martin - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
META-INF/context.xml and deploy issue
Hello, I'm facing an issue with tomcat 6. In order to setup a JDNI, we added a context.xml file to our application (XWiki) in the already-deployed folder webapps/xwiki/META-INF/ and configured the existing webapps/xwiki/WEB-INF/web.xml accordingly. update of web.xml triggered the app reload which is expected. At this point I wanted to adjust the database configuration, ie by modifying webapps/xwiki/META-INF/context.xml. When I do this the changes are not taken into account because the file Catalina/localhost/xwiki.xml is not overwritten by Tomcat. The solution that came into my mind has been to force Tomcat to update the file bt deleting Catalina/localhost/xwiki.xml - which has indeed make Tomcat undeploy and deploy the app again. Here are my questions: 1) As there is no war file involved, what does undeploy and deploy means ? What is being done exactly ? 2) Why is the file webapps/xwiki/WEB-INF/web.xml is missing, after I remove xwiki.xml and the app is redeployed ? (no web.xml = no deployment so at the moment I have to manually restore a backup of this file) Thanks ! -- Martin - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Static class across multiple tomcats?
I think sharing a common class across servlets can get tricky... I've never tried it using Tomcats intrinsic technology, but I think if you if you want to go this way then read up on the ServletContextListener. Lets you look at what other servlets are up to, so you could make something that looks at servlet 1 and if it hasnt made the common resource then, servlet 2 will make it... then when servlet 1 starts it checks servlet 2, see's its already running and uses that mm I dont like it, think code could get very messy. What I do for for this kind stuff is use Harbor So I would make the shared class, dump it in the Harbor servlet and then call it from other servlets... Harbor is a very lite application server. I wrote Harbor and I'm keen to test it on this sort of application, so if you care to give me the test code of your shared object, I make 2 servlets and show you how to share the object across all your servlets even if they run on different machines. If you interested have a look at http://coolese.100free.com/ regards, Johnny - Original Message - From: James Sherwood [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Friday, March 30, 2007 4:19 PM Subject: Static class across multiple tomcats? Hello, What I am trying to do is to have a thread running to check a database for something at a certian time. All is well but when we launch both tomcats, there are 2 threads running and I cannot figure out how to have only 1 thread running as it seams static classes are unique to each tomcat. Any ideas? Thanks, James - 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: Virtual Memory or Mem usage monitoring
I also do this, if I have threads and opening and closing db connections etc nice way to watch the thing running. I find memory is not the thing to watch other than telling you in general that the machine doesnt have enough. Watch the HANDLES those things should be go up and come down quickly or stabalize at some value. If you have a problem with dB connections or you not releasing memory the handles will just keep climbing and then eventually windows will go snail on you and everything gets very very slow. Internally Windows uses handles for everything whether its on the heap or memory mapped or access to a port, if they stable life is good. If you then find a problem... netbeans has a profiler which should help you find where you not releasing memory. regards, Johnny - Original Message - From: Jayson Enriquez [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, March 29, 2007 7:17 PM Subject: Virtual Memory or Mem usage monitoring Hi all, (another memory question) I am currently running Tomcat 5.5 on Windows server 2003 (2gb). Tomcat memory resources are monitored in Windows Task Manager. Should I be more concerned with Mem Usage or VM usage? Is Virtual Memory the actual memory usage? Will gc release memory after it hits -Xmx 256? What will/should mem drop down to after release? Catalina.bat - set CATALINA_OPTS=%CATALINA_OPTS% -Djava.library.path=C:\Program Files\Documentum\shared -Xms256m -Xmx256m -verbose:gc Thank you Jayson Enriquez CHDP - 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: Is it possible to have more than one submit button in a JSP file?
Something like this In Form input type=submit value=START name=start input type=submit value=STOP name=stop In servlet String sValueStart = request.getParameter(start); //The one clicked will have a value String sValueStop = request.getParameter(stop); //The one clicked will have a value Write reponse to Text Area etc... - Original Message - From: Teh Noranis Mohd Aris [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, March 29, 2007 4:23 AM Subject: Is it possible to have more than one submit button in a JSP file? Dear All, I hope all of you can still remember me. I had the problem of writing the file content from an applet to a servlet. Now, I'm using JSP and it works. However, from JSP code examples, I always see only one submit button to the server. I would like my system to have several submit buttons that is connected to the server, for example a button for displaying a file from the server and a button for saving a file to the server. The file to display and the file to save should use the same textarea. How should it be done? If there are any source code examples, can anyone please post it to me? Please help! Thank you. Yours Sincerely, TEH NORANIS - Need Mail bonding? Go to the Yahoo! Mail QA for great tips from Yahoo! Answers users. - 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: FileUpload to different machine
A long time now since I played with Debian, but if I remember correctly just make your java program be able to write to a linux folder /etc/whatever, then get SAMBA, it allows you to map linux drives to windows and visa versa, then you will simply map a windows share to a lnked drive on linux, you write to the linux drive, it goes to the windows share. Or you could write to the linux box and just map that as a drive on windows, to the windows user it will feel like its on their machne SAMBA. Regards Johnny - Original Message - From: Dave [EMAIL PROTECTED] To: users@myfaces.apache.org; Tomcat Users List users@tomcat.apache.org Sent: Wednesday, March 28, 2007 8:00 AM Subject: FileUpload to different machine Web application using JSF deployed on JBoss runing on Linux. Another server machine is Windows 2003. For file upload, all the file need to be stored in the windows machine. Questions: how to access the windows' file system from Linux? For file upload, can the file be uploaded directly into the windows machine even though the JBoss is running on the Linux machine? Thanks dave - Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. - 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: Basic Auth without web.xml security-constraint not working
Ha ha... sounds like you looking for a magic function, which reminds me of my first computer program... got to tell you :) A million years ago in my 1st year I was walking past the varsity main frame, I'd heard all sorts of things about this amazing beast... so I walked in, watched someone using a punch card, after they left, I typed draw nude girl... stuck it in the machine and was hell-of-a-disappointed when I got syntax error ha ha. No, I think you expecting too much the Tomcat guys have let people who want to develop a quick servlet, define the DOORWAY to the role in web.xml and then quickly add users to the role in tomcat-users.xml and have provided a few simple functions like isUserInRole, which for the simplest of web sites are not even needed. Its simple, easy, and probably good enough for most things a tomcat developer needs... very nice of them. I was hoping that for what you need it would be possible to piggyback on that simple framework, even if it meant parsing the tomcat-users.xml to gray menu's, but it seems you have to work outside of that frame-work. If you are writing code like the stuff below forget about the simple security framework tomcat provides, you dont need the Doorway in web.xml, and likewise tomcat-users.xml is not going to do a thing it only wakes up if you do the web.xml stuff. So if you define the URL and the restraining role in web.xml, then tomcat wakes up and looks at tomcat-users.xml. If not, it doesnt know you doing security, and even if you write security code, it only between you and the browser, Tomcat will just send what you tell it to and get a browser response back. If you writing code at this level forget about that config stuff. you on your own. Cant quite see how you would use JAAS, but ok you going to use Ldap or something. No magic functions you have to do something like this... Using your code below, you make a servlet, and map all the urls through it. A request comes in You grap the user name and password... You call ldap or JAAS or whatever security system you using It tells you User OK, or NOT If OK you DISPATCH the request off to the JSP page and it displays. If you want to control menu's you ask the LDAP system or whatever if user is allowed access to various menu items (which represents other roles). You stick that in a Bean pass it to the JSP page, it enables or disables the menu's, and displays. Not hard to do if you know tomcat Somewhere and somehow you have to be able to tell the system all the users and roles... Whether you get it from JAAS or LDAP or parse the tomcat-users.xml, somewhere someone has to be able to tell the system, USERA is in RoleAccessPage1,23. In fact I'm beginning to think that what you looking for is yet another mapping... So for example you may have a generic roles like, Visitors, Admin, Managers, New Employees, Company Visitors blah blah... And then have another XML file that says ADMIN - ALL PAGES VISTORS - Intro.jsp, Welcome.jsp,Instructions.jsp,How To Pay and access the good stuff.jsp I still have a feeling all you really need is the generic tomcat security and someone to write a little XMLparsing code that gives you functions like IsThisUserAllowedToAccesThisPage(User,Link); Then you have Two Maps to fill out User - Role (already standard in tomcat) Role - Link (a new XML file) MaybeAnyway I dont think you going to find the magic function you looking for, and I also dont think its an oversight by the tomcat developers, just think you looking for an additional mapping function. Maybe it would be nice if Tomcat had a function to enumerates user roles (has it?) but even then you'd still be making some additional mapping function... If you need someone to write the framework for you, once you have decided what you want, call me. Regards, Johnny - Original Message - From: Berglas, Anthony [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Cc: [EMAIL PROTECTED] Sent: Wednesday, March 28, 2007 3:26 AM Subject: RE: Basic Auth without web.xml security-constraint not working Thanks for your reply. Getting the user name and password String authorization = request.getHeader(Authorization); if (authorization == null) return 0; // Authorization headers looks like Basic blahblah, // where blahblah is the base64 encoded username and // password. We want the part after Basic . String userInfo = authorization.substring(6).trim(); BASE64Decoder decoder = new BASE64Decoder(); String nameAndPassword = ; try{ nameAndPassword = new String(decoder.decodeBuffer(userInfo)); }catch ( IOException e ){} // Decoded part looks like username:password. int index =
Re: Is it possible somehow for Tomcat to serve ASP.NET pages?
Easy to simulate, Add Thread.Sleep(1) and then print a blue screen ha ha, dont shoot me, just kidding. No, I dont think it will ever happen, I think the problem will always be that programmers on .NET dig into the win32 system too much and use add-on stuff like MS transaction servers. Would have to simulate just about all MS technologies, and that means Java programmers would have to fix it first dont want that... ok ok I cant help myself ha ha. Closest I've seen is Grasshopper http://blog.taragana.com/index.php/archive/how-to-convert-aspnet-applications-to-java-j2ee-introducing-grasshopper/ It allows a developer developing on .net to target java byte code or classes that run on Tomcat, but its always going to have to be a carefully designed contraption. Sorry no but if you new to Tomcat and thinking about Java... Welcome! - Original Message - From: kz [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Tuesday, March 27, 2007 10:16 AM Subject: Is it possible somehow for Tomcat to serve ASP.NET pages? Regards, Khurram - 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: Basic Auth without web.xml security-constraint not working
Hi Tony, Mmmm, kinda understand what you saying something like this, Tomcat wants to check the users at the FRONT DOOR, and either kick them back onto the street or let them in, but you want to let them ALL in and let some use the dining room and some use the kitchen you trying to be polite and put a NO ENTRY on the bathroom door before the user even tries. Interesting To trigger the built in Authentication you have to make the users all part of a ComeInAndLookAround ROLE, but now everyone can get through any door, so you need to check the additional roles yourself to determine access that really defeats tomcats security, thus the problem I dont like this. OR you need to leave the generic security alone, ie you have Page1AccessRole, Page2AccessRole, so that normal humans can administer the roles as Tomcat intended, and on each menu Item have IsUserAllowedToAccessPageX, if not grey it, else show it. In this case you would need to parse tomcat-users.xml which has the format like this user username=admin password= roles=admin,manager/ and it not difficult to find the roles for a user. Just some XML parsing I would go this way, because its in the expertise of the Tomcat Admin guy or girl. OR you could do the above but with your own internal logic, so you protect access to pages with tomcat and then maybe have a separate file that lists users and menu access allowed... in which case you need to make your own config file, dB would work well. could be the right way depending on what you making. OR you could decide FRONT DOOR checks are not for you and do it all yourself, in which case this code will get you going Getting the user name and password String authorization = request.getHeader(Authorization); if (authorization == null) return 0; // Authorization headers looks like Basic blahblah, // where blahblah is the base64 encoded username and // password. We want the part after Basic . String userInfo = authorization.substring(6).trim(); BASE64Decoder decoder = new BASE64Decoder(); String nameAndPassword = ; try{ nameAndPassword = new String(decoder.decodeBuffer(userInfo)); }catch ( IOException e ){} // Decoded part looks like username:password. int index = nameAndPassword.indexOf(:); String user = nameAndPassword.substring(0, index); user = user.trim(); if(user == null) return 0; String password = nameAndPassword.substring(index+1); password = password.trim(); if(password == null) return 0; To trigger the browser the headers look like this response.setStatus(response.SC_UNAUTHORIZED); response.setHeader(WWW-Authenticate, BASIC realm=\User Check\); The coding is a hassel, but you have a lot of control like Ok You Not Allowed In Here normally, but I'll let you in and grey all the menu's I'm not sure what it is you trying to do, hope this gets you going... regards, Johnny - Original Message - From: Berglas, Anthony [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, March 27, 2007 2:22 AM Subject: Basic Auth without web.xml security-constraint not working Tomcat seems to only check the Authorization: headers if there is some security-constraint explicitly declared in web.xml. However, it appears that the optimization has been incorrectly implemented because it does not then recheck the header if request.isUserInRole(...) etc. are called. So users cannot log into a system that uses request.isUserInRole(...). More specifically, my simple application tests request.isUserInRole(...) and request.getRemoteUser(). If the user lacks permissions the application sends a 401, and the user is prompted for a name/password which is sent back as a Authorization: Basic dGltOlBhc3N3b3JkMQ== So far so good. But Tomcat then ignores the Authorization: header which is correctly sent by the browser. The web.xml has login-config auth-methodBASIC/auth-method realm-nameAgile UI: tim/Password1/realm-name /login-config in it. There is no security-constraint clause in the web.xml because I do not want to declare them there. (They are instead declared internally as part of a menuing system, which calls request.isUserInRole().) A hack to make Tomcat look at the Authorization: header is to add the following to web.xml security-constraint web-resource-collection web-resource-namedbtest/web-resource-name url-pattern/dbtest/*/url-pattern /web-resource-collection auth-constraint role-namedummyrole-name /auth-constraint /security-constraint In which case it works if one accepts the unwanted dummy query. Is it possible to tell Tomcat to always check the Authorization:? Alternatively, is it
Re: Service instance serialization question
private String synchronization MyServletHardwareCallingRoutine(HttpRequest BlaBla){ CALL THE HARDWARE HERE return INFO } SYNCHRONIZATION will allow only one thread at a time, so they will Q. BUT so will the clients wait. If the clients do not need a reply from the hardware then private void MyServletHardwareCallingRoutineAsBackGroundProcess(HttpRequest BlaBla){ new HardwareSrvr().asyncStartServer(); } public class HardwareSrvr implements Runnable { private Thread runner; public HardwareSrvr () { } public void asyncStartServer(){ runner = new Thread(this); runner.start(); } } public void run() { CALL HARWARE HERE } } regards Johnny Free Software at http://coolese.100free.com/ - Original Message - From: Tom Kobialka [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, March 26, 2007 7:38 AM Subject: Service instance serialization question Hi, I have a web service which is running under the Tomcat container. Tomcat creates a new instance of this web service with each incoming simultaneous connection. The problem I am having, is that my web service calls a hardware device which can only handle one query at a time. If I have 5 instances of my web service all querying it at the same time, it hangs. I need to implement some sort of serialization such that only one request is processed from each instance at a time. Is it possible to serialize between service instances, which have been created by tomcat? Is there some external library to tomcat shared memory object which will allow me to do this? I have had a look around the web, but I'm not really sure where to start. I've come across messaging solutions, but all these seem to be targeted towards serialization between services located on completely different tomcat instances (JMS). Cheers Tom - 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: Running Java Apps From The Browser
A lot of guys asking me how to get java to automatically install if client does not have JRE. This is not an all platform solution unfortunately, but nevertheless it works for IE users. Place this is your web page OBJECT codebase=http://java.sun.com/update/1.5.0/jinstall-1_5_0_11-windows-i586.cab; classid=clsid:5852F5ED-8BF4-11D4-A245-0080C6F74284 height=25 width=27 id=Test border=1 param name=back value=false!-- Alternate non IE type HTML browsers which cannot instantiate the object -- a href=http://java.sun.com/j2se/1.5.0/download.html; Download Java Runtime/a /OBJECT If user does not have JRE, it gets it and installs it, then the links to applications will work. Maybe someone knows of a better way I dont. regards Johnny - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] ; users@tomcat.apache.org Sent: Thursday, March 22, 2007 6:50 PM Subject: Running Java Apps From The Browser Hi Teh Noranis Mohd Aris, Hope you read this. I remember you having problems with Applets, namely trying to get around security issues. Just want to tell you I made IGNITION, which you can get at http://coolese.100free.com You drop your applications into a folder on the servlet point a browser link at it it runs on user machine, with no security limitations. Normal applications work, doesnt have to be an applet or a web start special. I had a look at other technologies, and realized your problem is also a real need. So the mighty Tomcat again came to the rescue hope you and other guys find ignition useful. Its nice to be able to start java apps from a browser easily. regards, Johnny From: Teh Noranis Mohd Aris [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, March 12, 2007 5:10 AM Subject: Re: File Content Not Saved To Server Dear All, I really need this program to work as soon as possible and need urgent help! Mr. Christopher Schultz have given suggestions on how to solve the problem and I've tried his suggestions. Thank you so much, as half of the problem have been solved. I've created 3 files as suggested:
Re: Question about lib folder of Webapps
Too much pain... get yourself Netbeans, doing everything by hand is near impossible. In netbeans you can drop in your libs, make your JSP, debug it and deploy it. Good luck - Original Message - From: Evrim Agha To: Tomcat User Sent: Sunday, March 25, 2007 9:09 AM Subject: Question about lib folder of Webapps Hi everyone I'd like to build a JSP to use and show results of using Sparql + Jena + Pellet libraries. I have set up a directory called MyFirstTestDir in [TomcatDir]\webapps. Inside MyFirstTestDir, I have created a folder called WEB-INF which has a folder called lib; So I have: [TomcatDir]\webapss\MyFirstTestDir\WEB-INF\lib inside lib, I have copied all the files in lib folder of jena download + pellet download. Extremely appreciate your help with these questions: Some of the Jena jar files and Sparql jar files share the same name; therefore I can not copy them directly to lib. Could you please advise what should I do? I am using winxp and tomcat 6. Thank you in advance. -- - 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: How do I get the http://localhost/jkstatus page to display/installed
Hi Robert, Try get to it through the APACHE box http://apachebox/jkstatus Below I MODIFIED some entries to make it look better... I think you almost have it right... regards Johnny - Original Message - Thanks, but I already have that added. It appears that I don't have the jkstatus files. Are these delivered with a specific version of tomcat, or how do I get the files? Shouldn't I be able to directly hit each tomcat jkstatus instance directly like http://node1/jkstatus or http://node2/jkstatus, or is this dependent on apache and if so could I hit apache with http://apachebox/jkstatus prior to setting up the files below. Just trying to deduce why it isn't visible. This is what I have Httpd.conf file** LoadModule jk_module modules/mod_jk.so #MODIFIED IfModule !mod_jk.c LoadModule jk_module PATH2APACHE/Apache2.2/modules/mod_jk.so /IfModule JkWorkersFile conf/workers.properties JkLogFile logs/mod_jk.log JkLogLevel warn JkShmFile logs/mod_jk.shm # MODIFIED JkMount /jkstatus jkstatus JkMount /* loadbalancer **workers.properties file* # MODIFIED worker.list=jkstatus,loadbalancer #MODIFIED worker.jkstatus.type=status worker.loadbalancer.type=lb worker.loadbalancer.balanced_workers=node1,node2 worker.loadbalancer.sticky_session=1 Worker.node1.port=8209 worker.node1.host=rio worker.node1.type=ajp13 worker.node1.lbfactor=1 worker.node2.port=8309 worker.node2.host=rio worker.node2.type=ajp13 worker.node2.lbfactor=1 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Running Java Apps From The Browser
Hi Teh Noranis Mohd Aris, Hope you read this. I remember you having problems with Applets, namely trying to get around security issues. Just want to tell you I made IGNITION, which you can get at http://coolese.100free.com You drop your applications into a folder on the servlet point a browser link at it it runs on user machine, with no security limitations. Normal applications work, doesnt have to be an applet or a web start special. I had a look at other technologies, and realized your problem is also a real need. So the mighty Tomcat again came to the rescue hope you and other guys find ignition useful. Its nice to be able to start java apps from a browser easily. regards, Johnny From: Teh Noranis Mohd Aris [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, March 12, 2007 5:10 AM Subject: Re: File Content Not Saved To Server Dear All, I really need this program to work as soon as possible and need urgent help! Mr. Christopher Schultz have given suggestions on how to solve the problem and I've tried his suggestions. Thank you so much, as half of the problem have been solved. I've created 3 files as suggested:
Re: connection pool
I dont use Tomcats built in db pooling, use a different one, but I think the problem is not that it drops the connection, because any pool should simply reallocate a new one when needed. I have a feeling you are exhausting all the available connections, and the pool cant give you a new one. Are you releasing the connections after each request??? If not you will quickly run out of dB connections.. - Original Message - From: Gioia, Michael [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, March 22, 2007 4:01 PM Subject: connection pool Hi, I'm still having a problem with tomcat with keeping up the connection to the database thru the connection pool. Almost every weekend the database gets bumped and the java app that were running needs to have tomcat restarted to reconnect to the database thru the connection pool. When we come in on Monday tomcat and the database are up and running, but the app will not connect to the database. I tried to use a batch file and have it run in scheduler to stop and start the tomcat service, but it doesn't seem to work it the machine is logged out. Is there a way to reestablish the connection so our users don't have to wait until we come in on Monday to restart tomcat? MG - 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: Unable to compile class for JSP
Hi Peter, I probably got the wrong end of the stick, missed the thread etc, but its seems like you going through a whole lot of pain so I was wondering. If you have a servlet and a bunch of JSP pages, did you know that the JSP's will not compile when you Clean and Build in Netbeans. If you right click on the project name and under the compile section ask it to--- then it will. Or if you compile each JSP file then it will to. So its possible that its just an error in the JSP that goes undetected until the browser hit it. Try set it up so that it compiles all the JSP's and I have a feeeling you will see it at design time. Dont think its a bug in tomcat good luck. - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, March 21, 2007 5:00 PM Subject: AW: Unable to compile class for JSP Hi everybody, thanks for your help, which I really appreciate! I still don't know exactly what it was, but I fixed it by doing the following: - uninstall tomcat - reinstall it, not having it run as a windows service - installing it in a directory tomcat_4_1 rather then the suggested tomcat 4.1 because I hade problems with spaces in path before. Now it works! Bye Peter - Original Message - From: [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Tuesday, March 20, 2007 12:21 PM Subject: Unable to compile class for JSP Hi, This might be a silly question, but it seems to be quite a common problem (lots or links in google). But none of the offered solutions so far worked. So I am asking the people who probably know! I installed tomcat 4.1.29 with JDK 1.4.2 Trying the JSP examples coming with it, I get the following message: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Compiling 1 source file at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorH a ndler.java:130) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.j a va:293) at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.j a va:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.j a va:190) 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(Applic a tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil t erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal v e.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal v e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticato r Base.java:494) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:24 1 7) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav a :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV a lve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav a :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext. i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java: 4 80) at
Re: How do I get the http://localhost/jkstatus page to display/installed
# Add the jkstatus mount point JkMount /jkstatus jkstatus - Original Message - From: Robert Young [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, March 22, 2007 11:56 PM Subject: How do I get the http://localhost/jkstatus page to display/installed Hello, I have installed apache 2.2.4 with mod_jk.so and 2 instances of tomcat 5.5.17 in a cluster. As I read examples I see that I should be able to access http://localhost/jkstatus/. I have set up the mod_jk.so in the httpd.conf file and set up the worker.properties file. When I enter the url for http://localhost/jkstatus/ http://%3capache%3e/jkstatus I get a not found error. What do I need to do to get jkstatus working? Is this a web-app that should be installed in tomcat, and if so, where do I get it, or does this belong in the apache http server? The only thing I can see about jkstatus is within the connector archive, and I have built that, but still no jkstatus. I see java files in the connector directory, but no instructions on if I should copy these files to a specific location. Can somebody give me some direction on setting this up? Thanks for your help. - 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: JSP page not updated on each request
Mmmm, dont know I think the browser should be picking up file changes, but if you want to make sure the browser doesnt cache, then if I remember correctly search for NO-CACHE and set the headers returned, the browser will reload every time. Note that headers are different for different browsers so you have to set a few headers... google will tell you. Note that when you developing, I've noticed if you leave the browser open, it may still display previous page... but it doesnt happen once deployed. Other thing that maybe catching you is that you changing something in the servlet INIT routine... and that somehow impacts on your JSP pages say thru a bean. That wont reflect until you stop and start tomcat..INIT runs once at start up. good luck - Original Message - From: pkumar [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, March 15, 2007 9:39 AM Subject: JSP page not updated on each request Hello, The JSP pages in my project is not showing the updated one upon each request..Its showing the old one and only when i press the refresh, its showing the updated one...I believe this is the problem with Tomcat..Can someone help. Thanks in advance Pradeep -- View this message in context: http://www.nabble.com/JSP-page-not-updated-on-each-request-tf3406783.html#a9489775 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: how to configure the tomcat to automatically update class instances when a class file changed
Hello again SANGAMESHWAR In the servlet.xml config file you will see the Host name=localhost appBase=webapps unpackWARs=true autoDeploy=true The autoDeploy=true means the sevlet will reload if anything is changed under WEB-INF So if you drop another library class in, or say change web.xml, that servlet will restart WHEN IT IS IDLE. If you have a thread running in a background process, then I dont think it will ever restart. Its clever but it does mean Tomcat has to rev up all over again and on a busy server thats probably not a good thing. Other alternative is to make a plugin, and load up the classes yourself... maybe able to find a standard one, if writing a classloader seems like too much work. Or you can try my software HARBOR at http://coolese.100free.com/ it allows you to control the reloading of classes. Just out of curiosity, why is it that your beans need to change... why couldnt you just have them read from a dB or somthing? - Original Message - From: SANGAMESHWAR ALLADI [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Thursday, March 15, 2007 2:02 PM Subject: how to configure the tomcat to automatically update class instances when a class file changed hi, my class files of beans regularly changes. So,everytime i change a class file, i need to restart the tomcat server. how can i configure Tomcat to watch the changes in the class files of beans? Thanks in Advance, Sangmaeshwar.A - 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: How does one configure Plain host domain url to run web app?
Hi John, Ok, I'm going to try show you how I think about this stuff... and I'm often wrong ;) Dont use a redirect... it goes back to the browser and its not cool. Firstly make a servlet and have a look at the CONTEXT.XML file under META-INF Change it to.. ?xml version=1.0 encoding=UTF-8? Context path=/ Now have a look at WEB.XML under WEB-INF make sure the mapping is servlet-mapping servlet-nameNewServlet/servlet-name url-pattern/*/url-pattern /servlet-mapping OK now that servlet will run for any URI from the domain name up ie www.host.com/ANYTHINGorNOTHING You can play with the mapping if you dont want that... but let me show you how I do this sort of stuff, and then you can tweak it as you want. Now in the servlet make this routine protected void displayPage(HttpServletRequest request, HttpServletResponse response, String thePage) throws ServletException, IOException { RequestDispatcher dispatch = request.getRequestDispatcher(thePage); dispatch.forward(request, response); } Now when the servlet is called in protected void processRequest(HttpServletRequest request, HttpServletResponse response) do this displayPage( request, response, index.jsp); So all of a sudden you can direct any URL to any page without redirects can use the API to check the URL and use a case statement whatever. OK... heres the final trick coz it looks like you trying to run behind Apache put this in the servlet.xml file in Tomcat.conf Host name=www.site.com appBase=webapps unpackWARs=true autoDeploy=true xmlValidation=false xmlNamespaceAware=false !-- USE THIS FOR AUTO GEN OF JK MOD for Apache Forwarding to tomcat MODIFY PATHS FOR YOUR SYSTEM-- Listener className=org.apache.jk.config.ApacheConfig append=true forwardAll=false modJk=D:/DEV/Apache2.2/modules/mod_jk.so/ /Host Now when you start Tomcat it will create a folder under conf/auto it puts all the stuff apache needs in a mod_jk.file looks like this but its AUTOMATICALLY generated when tomcat starts. # Static files Alias /jsp-examples D:/DEV/Tomcat 5.5/webapps/jsp-examples Directory D:/DEV/Tomcat 5.5/webapps/jsp-examples Options Indexes FollowSymLinks DirectoryIndex index.html index.htm index.jsp /Directory # Deny direct access to WEB-INF and META-INF # Location /jsp-examples/WEB-INF/* AllowOverride None deny from all /Location Location /jsp-examples/META-INF/* AllowOverride None deny from all /Location # # Use Directory too. On Windows, Location doesn't work unless case matches # Directory D:/DEV/Tomcat 5.5/webapps/jsp-examples/WEB-INF/ AllowOverride None deny from all /Directory Directory D:/DEV/Tomcat 5.5/webapps/jsp-examples/META-INF/ AllowOverride None deny from all /Directory JkMount /jsp-examples/security/protected/j_security_check ajp13 JkMount /jsp-examples/forward/one.jsp ajp13 JkMount /jsp-examples/tagplugin/foreach.jsp ajp13 JkMount /jsp-examples/dates/date.jsp ajp13 JkMount /jsp-examples/jsp2/tagfiles/panel.jsp ajp13 JkMount /jsp-examples/xml/xml.jsp ajp13 JkMount /jsp-examples/jsp2/simpletag/repeat.jsp ajp13 JkMount /jsp-examples/CompressionTest ajp13 JkMount /jsp-examples/cal/cal2.jsp ajp13 JkMount /jsp-examples/sessions/carts.jsp ajp13 JkMount /jsp-examples/tagplugin/choose.jsp ajp13 JkMount /jsp-examples/jsptoserv/jsptoservlet.jsp ajp13 JkMount /jsp-examples/jsp2/misc/config.jsp ajp13 JkMount /jsp-examples/checkbox/checkresult.jsp ajp13 JkMount /jsp-examples/security/protected/login.jsp ajp13 JkMount /jsp-examples/jsp2/simpletag/book.jsp ajp13 JkMount /jsp-examples/forward/forward.jsp ajp13 JkMount /jsp-examples/jsp2/jspx/textRotate.jspx ajp13 JkMount /jsp-examples/simpletag/foo.jsp ajp13 JkMount /jsp-examples/security/protected/index.jsp ajp13 JkMount /jsp-examples/include/include.jsp ajp13 JkMount /jsp-examples/error/err.jsp ajp13 JkMount /jsp-examples/jsp2/el/basic-arithmetic.jsp ajp13 JkMount /jsp-examples/*.jspx ajp13 JkMount /jsp-examples/jsp2/jspx/basic.jspx ajp13 JkMount /jsp-examples/snp/snoop.jsp ajp13 JkMount /jsp-examples/error/errorpge.jsp ajp13 JkMount /jsp-examples/jsp2/jspattribute/jspattribute.jsp ajp13 JkMount /jsp-examples/include/foo.jsp ajp13 JkMount /jsp-examples/jsp2/el/functions.jsp ajp13 JkMount /jsp-examples/jsp2/tagfiles/products.jsp ajp13 JkMount /jsp-examples/jsp2/simpletag/hello.jsp ajp13 JkMount /jsp-examples/jsp2/el/basic-comparisons.jsp ajp13 JkMount /jsp-examples/colors/colrs.jsp ajp13 JkMount /jsp-examples/jsp2/jspattribute/shuffle.jsp ajp13 JkMount /jsp-examples/num/numguess.jsp ajp13 JkMount /jsp-examples/*.jsp ajp13 JkMount /jsp-examples/plugin/plugin.jsp ajp13 JkMount /jsp-examples/source.jsp
Re: how to intimate the user when his session invalidation occurs in form based authentication
Hi SANGAMESHWAR, I also had no luck with using error page tags in tomcat, they dont work. I really think you should have a separate login page, and then let the users navigate to frames etc. The only way I could get an tailor made error page to display properly was by using programmitic security in a servlet.. good luck - Original Message - From: SANGAMESHWAR ALLADI [EMAIL PROTECTED] To: users@tomcat.apache.org Sent: Monday, March 12, 2007 7:54 AM Subject: how to intimate the user when his session invalidation occurs in form based authentication *Scenario :* I have developed a state full web application using form based Container managed security of Tomcat 5.5.20. In this web application state of user is maintained by container itself. My web application consists of only JSP pages grouped into folder each having index.jsp as default page and the access to it is protected by Container using form based authentication. So when ever a request goes to server, it sends a login page for the authentication. The index page consists of two frames. One having the menu of this application and other having the content of the menu item selected. Actual problem occurs when the user clicks in the menu frame after session is invalidated then the user is getting the login page in the content frame. *How can I intimate the user about his session invalidation? * And also Some times I am getting *408 / 409(these two status code are coming in IE) or connection reset (in Mozilla)* error when the login times out when he enters the user id and password in the login page. I am handling status code 408 (login time out) error by using error page tag of web.xml. Then also it is unable to send error handling page for some requests. thanks in advance, From, Sangameshwar.A - 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: File Content Not Saved To Server
Its been a really long time since I played with Applets, but if I remember correctly I think you screwed. I dont think an applet container will let you access a local file system and send it to a server, it would create huge security holes. So even if you get the code right, browser will start outputtung security exceptions if I understand correctly, cant actually make out how you accessing the local file. I think you gonna have to use a file uploader... theres one on the apache site. My general comment is that in general Java Applets are dead microsoft saw to that. If the user has Java on their machine and you really really have to have a Swing type app then another way is to maybe use http://coolese.100free.com/ I have a free application server... easy to use, you can let them run the Swing application FROM the server. I think they would still have to pull a very small App from the browser, but it will start very quick. I think as soon as you try run any local disk access from an Applet you outta luck. - Original Message - From: Teh Noranis Mohd Aris [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, March 12, 2007 5:10 AM Subject: Re: File Content Not Saved To Server Dear All, I really need this program to work as soon as possible and need urgent help! Mr. Christopher Schultz have given suggestions on how to solve the problem and I've tried his suggestions. Thank you so much, as half of the problem have been solved. I've created 3 files as suggested: SaveFileApplet.java, SaveFileApplet.html and SaveFileServlet.java. This solves the problem of the creation of a null file by the system. Now, a file name that was input by the user was created BUT the problem is that, when I open the file, the word null was written to the file NOT the file content. The filename parameter was sent from the applet to the servlet BUT the file content parameter was not sent. This means that the file content parameter does not exist and the servlet did not receive the file content parameter! Did I pass the file content correctly from SaveFileApplet.java and did the SaveFileServlet receive the parameter using req.getParameter(teditor);? I'm attaching the 3 files (errer-free) as I mentioned. I really really hope that anyone can help me solve this problem. Thank you so much. FIRST FILE: SaveFileApplet.java // C:\jakarta-tomcat-4.1.31\webapps\ROOT\SaveFileApplet.java import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.JApplet; import javax.swing.text.BadLocationException; import java.net.*; import java.io.*; import java.util.*; public class SaveFileApplet extends JApplet implements ItemListener, ActionListener { JPanel panel1, panellabel, panelbutton, paneltext; JTextField namefile; JButton jbtSave; JTextArea textEditor; JLabel labelfile; public void init() { Container container = getContentPane(); namefile = new JTextField(10); panel1 = new JPanel(); panellabel = new JPanel(); panelbutton = new JPanel(); paneltext = new JPanel(); labelfile = new JLabel(File Name); panellabel.setLayout(new FlowLayout(FlowLayout.LEFT,50,0)); panellabel.add(labelfile); panellabel.add(namefile); panelbutton.setLayout(new GridLayout(1,1)); panelbutton.add(jbtSave = new JButton(Save)); textEditor = new JTextArea(18,63); textEditor.setFont(new Font(monospaced,Font.PLAIN,12)); JScrollPane scrollPane1 = new JScrollPane(textEditor); Linenumber linenumber1 = new Linenumber ( textEditor ); scrollPane1.setRowHeaderView(linenumber1); paneltext.add(scrollPane1); panel1.add(panellabel); panel1.add(paneltext); panel1.add(panelbutton); container.add(panel1); jbtSave.addActionListener ( new ActionListener() { public void actionPerformed (ActionEvent en) { savefile(); } } ); } // end init public void actionPerformed(ActionEvent ae) { } // End action perform public void itemStateChanged(ItemEvent ie) { } // End item state changed public void savefile() { String filename = namefile.getText(); String teditor = textEditor.getText(); URL servletUrl = null; URLConnection con; String servletName = http://localhost:8080/examples/servlet/SaveFileServlet; try { servletUrl = new URL(servletName + ?filename= + filename); con = servletUrl.openConnection(); con.setDoOutput(true); con.connect(); ByteArrayOutputStream byteOut = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(byteOut); out.writeUTF(teditor); out.flush(); out.close(); DataInputStream in = new DataInputStream(con.getInputStream()); in.close(); } catch(Exception e) { System.out.println(Exception caught...+e); } } // end savefile } // end class SaveFileApplet SECOND FILE: SaveFile Applet.html html head titlesave file/title /head body BGCOLOR=WHITE div align=center table WIDTH=70% align=center tr align=center bgcolor=#CCC66Htd SAVE FILE
Re: EJB 3.0 and Hibernate
Hi Scott, Not sure what you mean by container managed service, tomcat on its own is a servlet container, not an application container, like JBoss, maybe you saw hibernate referenced in Spring which is a whole collection of frameworks built on top of servlet technology, it uses hibernate, and has an EJB container and everything else you can think of. Spring competes with JBoss and the Sun spec. Some say the reason for EJB3 is because of Springs rapid growth and good idea's. Personally I'm thankful Tomcat hasnt tried to become a Super Can... hope it never does. I'm pretty certain that in the Hibernate manual on their site, I saw an example of how to persist in servlet technology, but remember its still not an application server, all they doing is allowing you to save a session bean to disk (dB). Hibernate is amazing technology, didnt have time to find out exactly how they do it, but I think they use reflection to pick up the get and set methods and then, insert some method probably via BCEL into the java binary class constructor, so that when the class loads it gets the data from the dB and populates the properties but thats all it really does, its not a container on its own. You can run Hibernate against any Java bean type class, doesnt have to be in Tomcat or anything, but I think if your code is something that was written for JBOSS and you trying to port it to another container... its going to be very very difficult. Probably uses all sorts of annotations that glue it to JBOSS. Anyway if you knew all this, ignore my lecture... and its not a stupid question, its seems there are pure application servers out there that consider servlet technology to be a component of the application server... think it stems from the Sun spec and JBOSS is one of them. Tomcat is just a component in JBOSS. Then there is the Spring framework which seems to have grown off the top of Servlet technology, and then there is also RESIN, which most people call a very good servlet container, but it also has an EJB container built in. So I think its becoming a grey area... Servlet technology is so powerful, I think its a natural rival to any other container out there. Just to prove the point... I wrote an Application server for Tomcat, but I must warn you that I dont like the complexity of the Super Cans, and its very very simple in comparison... means you will get it running in an hour, but if you want to use hibernate, you have to do it yourself, there are no annotations or xml glue. Can get it at http://coolese.100free.com Anyway its interesting... will the application server absorb the servlet, or will the servlet trample the stand alone application server into extinction... I think Servlets are winning and will win, which kinda creates all sorts of problems for the Sun Specs. Will probably end up as, if you want to run a bank... use JBOSS or the Sun equiv, but for everything else I think its going to be servlets. So, dont know what you doing, but dont write off Tomcat or servlets... its an absolutely amazing technology... worth a good look. If it is just a web application you trying to port, and its used some Super Can technology for persistance, I think its going to be easier to replace that. Think you'll find Tomcat a whole lot easier to learn than JBOSS. Whew! I can waffel :) - Original Message - From: Scott Purcell [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, March 12, 2007 4:11 PM Subject: EJB 3.0 and Hibernate Hello, Looking at incorporating the Java Persistence API (EJB 3.0) and was wondering if Tomcat 5.5 supports this. It looks like we need container managed services and was wondering if we can use Tomcat instead of JBoss? Thanks, Scott - 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: EJB 3.0 and Hibernate
Here you go http://www.hibernate.org/114.html shows you how to use it in Tomcat - 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 and NetBeans IDE - THE BEST
Hi there, I also only recently started using Tomcat and Netbeans and its a match made in heaven. I use Tomcat for EVERYTHING its fantastic, wonderful, best thing I ever discovered, and Netbeans is sizzling hot as well. No, you dont have to use the embedded Tomcat server, and it wont be long before you get a later Tomcat and want to use that anyway... So what you do is open TOOLS-SERVER MANAGER and point it to the Tomcat version you want to use... its that easy. Now you do not have to worry about starting and stopping Tomcat(the new one) when developing, as soon as you start a servlet it will happen automatically. If you want to stop it, you do it from INSIDE Netbeans either in the Runtime Tag, or you will see you can do it from the Tomcat Tag in the OUTPUT section of netbeans so you develop as normal. Now when you CLEAN and BUILD your project you will see that it creates a DIST folder with the WAR file... that you simply drop into the WEPAPPS folder of ANY TOMCAT and then start THAT tomcat as a standalone (without netbeans running) and its deployed you can also use the Tomcat manager from the web browser but I find this method easier. Now just one thing that can be confusing when Netbeans does all its magic and lets your debug stuff... it actually creates a temporary BUILD folder and when you testing that is the code that is ACTUALLY running in the TOMCAT you using. Now what happens alot is that you drop your WAR file into tomcat BUT its not actiully deployed because NETBEANS still has control of Tomcat and what is actually happening is that Tomcat is still running your servlet in the BUILD folder. It doesnt pick the WAR file up. So what I do before checking a WAR in tomcat, is DELETE the projects BUILD folder. Now if Tomcat complains, thats good, because you know it was still looking at the devlopment environment. Just stop tomcat, put the WAR file in WEBAPPS and restart it, it will pick up on the new WAR. Dont give up, Netbeans and Tomcat are magic, best development environment I've ever used. If you want to see some pretty cool stuff I've developed on Tomcat go to http://coolese.100free.com/ Theres a) A replication system for POSTGRESQL b) A web site search engine based on LUCENE c) An Application Server HARBOR, that lets you run normal java apps from anywhere if you also think, JBOSS, SPRING etc are too complex. ALL DONE IN TOMCAT and NETBEANS... I love them. == Hi , I am new to tomcat and be grateful for your reply and explanation. I have downloaded NetBeans which is bundled with Tomcat server . I use tomcat from within the environment to test my pages.
Re: Specifying relative path for TOMCAT 5.5 ?
Hi Rajendra, This also confused the hell out of me. Here are some tips If a url is relative, its relative to the page eg moreInfo/Details/SomePage.htm So its going to depend on the page the user is viewing and go from there... just like normal HTML pages. When you want it to go to an absolute relative page LOOK at the folders under you project name, or the folders under Web Pages in netbeans ONLY. So in Netbeans if you have Details/SomePage.jsp under Web Pages and you want the link to go there, you would write it as /Details/SomePage.jsp That little / at the beginning makes it go to that page regardless of the page it is in. Now when you want to get at your class files, you normally just use the class name, no paths. eg: jsp:useBean scope=request id=searchBean class=com.myco.searchResultBean / BUT if you want to get at say the actual bytes then one way is to ServletContext context = getServletContext(); sWebInfPath = context.getRealPath(/WEB-INF/); This will give you that actual location on your file system and then you can just use (new File) etc to get at the physical file in the sub folder. A more advanced function is to go the same way as you would if you wanted to extract the bytes of a class from a Jar file in = getClass().getResourceAsStream(sPackageName); it also works on Tomcat. Hope that helps. Heres some free software for you http://coolese.100free.com/ All done on the amazing Tomcat - Original Message - Hi, I am using TOMCAT 5.5. I am creating a file in class that is called from a JSP. However, the relative path that I have specified in the class doesn't seem to work. The path that I have used is :/webapps/Jonathon/WEB-INF/etc/subscriber.txt. Can someone please let me know, what is wrong with the relative path ? thanks in advance, Rajendra - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]