Tomcat 9 returning 404 for audio files
I just upgraded a legacy application from Tomcat 7 to Tomcat 9. It's deployed as a war file. I'm facing a weird issue with audio files playback. When loading a page that contains an audio file. First time Tomcat returns 404 error but if reloading the page, audio file is loaded properly and no error from Tomcat. I'm using html 5 audio control to display the file. All other static resources(images, css and js files) are working without any issues. Only audio files are having this issue. I enabled the logs for DefaultServlet in Tomcat. Follwong is the log entry when I try to open the audio file first time. I can see 404 being returned from server in Chrome dev tools. *09-Mar-2024 20:12:50.747 INFO DefaultServlet.serveResource: Serving resource '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers and data* Following is the log for 2nd attempt. This time audio is available and playable in browser. *09-Mar-2024 20:13:00.371 INFO DefaultServlet.serveResource: Serving resource '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers and data * *09-Mar-2024 20:13:01.372 INFO DefaultServlet.serveFile: contentType='audio/mpeg'* Here is the audio control code: I've tried relative path and full path but result is the same in both cases. I've spent days trying to solve this but no luck :( I would really appreciate any guidance to solve this issue. Thanks!
Re: Tomcat 9 returning 404 for audio files
Thanks for replying!! Yes audio files are generated dynamically from DB.in a Servlet. I've verified that audio file exists on file system before returning the html code that contains audo control. On Mon, Mar 11, 2024, 5:22 a.m. Mark Thomas wrote: > On 11/03/2024 02:21, Sam wrote: > > I just upgraded a legacy application from Tomcat 7 to Tomcat 9. It's > > deployed as a war file. I'm facing a weird issue with audio files > playback. > > > > When loading a page that contains an audio file. First time Tomcat > returns > > 404 error but if reloading the page, audio file is loaded properly and no > > error from Tomcat. > > > > I'm using html 5 audio control to display the file. > > > > All other static resources(images, css and js files) are working without > > any issues. Only audio files are having this issue. > > > > I enabled the logs for DefaultServlet in Tomcat. Follwong is the log > entry > > when I try to open the audio file first time. I can see 404 being > returned > > from server in Chrome dev tools. > > > > > > *09-Mar-2024 20:12:50.747 INFO DefaultServlet.serveResource: Serving > > resource '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers and > > data* > > Following is the log for 2nd attempt. This time audio is available and > > playable in browser. *09-Mar-2024 20:13:00.371 INFO > > DefaultServlet.serveResource: Serving resource > > '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers and data * > > *09-Mar-2024 20:13:01.372 INFO DefaultServlet.serveFile: > > contentType='audio/mpeg'* > > Are the audio files generated dynamically on request? > > Mark > > > > > > Here is the audio control code: > > > > > > >> > > > > > type="audio/mpeg" > > > > > > > > > I've tried relative path and full path but result is the same in both > cases. > > > > I've spent days trying to solve this but no luck :( > > > > I would really appreciate any guidance to solve this issue. > > > > Thanks! > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Tomcat 9 returning 404 for audio files
On the server side, I'm checking that file exists before returning the file path to the browser. We are also dynamically creating pdf files this way and no issues with accessing them. I found something interesting: https://tomcat.apache.org/tomcat-9.0-doc/config/resources.html From this link: *Resources are cached by default.* I'll try with *Cache-Control* request header and see if it helps! Thank you! On Mon, Mar 11, 2024 at 11:46 AM Mark Thomas wrote: > On 11/03/2024 11:31, Sam wrote: > > Thanks for replying!! > > > > Yes audio files are generated dynamically from DB.in a Servlet. > > > > I've verified that audio file exists on file system before returning the > > html code that contains audo control. > > Is there any chance of an attempt to access the file before it is > created? The resources implementation can cache "not found" results for > a short period of time. > > You might want to test the code with a simple text file to determine > whether file type is a factor (which seems unlikely but you never know). > > Mark > > > > > > > On Mon, Mar 11, 2024, 5:22 a.m. Mark Thomas wrote: > > > >> On 11/03/2024 02:21, Sam wrote: > >>> I just upgraded a legacy application from Tomcat 7 to Tomcat 9. It's > >>> deployed as a war file. I'm facing a weird issue with audio files > >> playback. > >>> > >>> When loading a page that contains an audio file. First time Tomcat > >> returns > >>> 404 error but if reloading the page, audio file is loaded properly and > no > >>> error from Tomcat. > >>> > >>> I'm using html 5 audio control to display the file. > >>> > >>> All other static resources(images, css and js files) are working > without > >>> any issues. Only audio files are having this issue. > >>> > >>> I enabled the logs for DefaultServlet in Tomcat. Follwong is the log > >> entry > >>> when I try to open the audio file first time. I can see 404 being > >> returned > >>> from server in Chrome dev tools. > >>> > >>> > >>> *09-Mar-2024 20:12:50.747 INFO DefaultServlet.serveResource: Serving > >>> resource '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers > and > >>> data* > >>> Following is the log for 2nd attempt. This time audio is available and > >>> playable in browser. *09-Mar-2024 20:13:00.371 INFO > >>> DefaultServlet.serveResource: Serving resource > >>> '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers and data * > >>> *09-Mar-2024 20:13:01.372 INFO DefaultServlet.serveFile: > >>> contentType='audio/mpeg'* > >> > >> Are the audio files generated dynamically on request? > >> > >> Mark > >> > >> > >>> > >>> Here is the audio control code: > >>> > >>> > >>> >>>> > >>> > > >>>src="/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3" > >>> type="audio/mpeg" > > >>> > >>> > >>> > >>> I've tried relative path and full path but result is the same in both > >> cases. > >>> > >>> I've spent days trying to solve this but no luck :( > >>> > >>> I would really appreciate any guidance to solve this issue. > >>> > >>> Thanks! > >>> > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >> For additional commands, e-mail: users-h...@tomcat.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Tomcat 9 returning 404 for audio files
Service is running on Windows, I've verified no access issues! Issue occurs only the first time, Subsequently audio loads properly. Thank you! On Mon, Mar 11, 2024 at 12:43 PM Ivano Luberti wrote: > Could it be the file is created with incorrect access rights? > > Il 11/03/2024 16:46, Mark Thomas ha scritto: > > On 11/03/2024 11:31, Sam wrote: > >> Thanks for replying!! > >> > >> Yes audio files are generated dynamically from DB.in a Servlet. > >> > >> I've verified that audio file exists on file system before returning the > >> html code that contains audo control. > > > > Is there any chance of an attempt to access the file before it is > > created? The resources implementation can cache "not found" results > > for a short period of time. > > > > You might want to test the code with a simple text file to determine > > whether file type is a factor (which seems unlikely but you never know). > > > > Mark > > > >> > >> > >> On Mon, Mar 11, 2024, 5:22 a.m. Mark Thomas wrote: > >> > >>> On 11/03/2024 02:21, Sam wrote: > >>>> I just upgraded a legacy application from Tomcat 7 to Tomcat 9. It's > >>>> deployed as a war file. I'm facing a weird issue with audio files > >>> playback. > >>>> > >>>> When loading a page that contains an audio file. First time Tomcat > >>> returns > >>>> 404 error but if reloading the page, audio file is loaded properly > >>>> and no > >>>> error from Tomcat. > >>>> > >>>> I'm using html 5 audio control to display the file. > >>>> > >>>> All other static resources(images, css and js files) are working > >>>> without > >>>> any issues. Only audio files are having this issue. > >>>> > >>>> I enabled the logs for DefaultServlet in Tomcat. Follwong is the log > >>> entry > >>>> when I try to open the audio file first time. I can see 404 being > >>> returned > >>>> from server in Chrome dev tools. > >>>> > >>>> > >>>> *09-Mar-2024 20:12:50.747 INFO DefaultServlet.serveResource: Serving > >>>> resource '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' > >>>> headers and > >>>> data* > >>>> Following is the log for 2nd attempt. This time audio is available and > >>>> playable in browser. *09-Mar-2024 20:13:00.371 INFO > >>>> DefaultServlet.serveResource: Serving resource > >>>> '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers and data * > >>>> *09-Mar-2024 20:13:01.372 INFO DefaultServlet.serveFile: > >>>> contentType='audio/mpeg'* > >>> > >>> Are the audio files generated dynamically on request? > >>> > >>> Mark > >>> > >>> > >>>> > >>>> Here is the audio control code: > >>>> > >>>> > >>>> >>>>> > >>>> > >>>>>>>> src="/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3" > >>>> type="audio/mpeg" > > >>>> > >>>> > >>>> > >>>> I've tried relative path and full path but result is the same in both > >>> cases. > >>>> > >>>> I've spent days trying to solve this but no luck :( > >>>> > >>>> I would really appreciate any guidance to solve this issue. > >>>> > >>>> Thanks! > >>>> > >>> > >>> - > >>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >>> For additional commands, e-mail: users-h...@tomcat.apache.org > >>> > >>> > >> > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > -- > > Archimede Informatica tratta i dati personali in conformità a quanto > stabilito dal Regolamento UE n. 2016/679 (GDPR) e dal D. Lgs. 30 giugno > 2003 n. 196 > per come modificato dal D.Lgs. 10 agosto 2018 n. 101. > Informativa completa > < > http://www.archicoop.it/fileadmin/pdf/InformativaTrattamentoDatiPersonali.pdf > > > > Il contenuto di questo messaggio e dei suoi eventuali allegati è > riservato. Nel caso in cui Lei non sia il destinatario, La preghiamo di > contattare telefonicamente o via e-mail il mittente ai recapiti sopra > indicati e di cancellare il messaggio e gli eventuali allegati dal Suo > sistema senza farne copia o diffonderli. Le opinioni espresse sono > quelle dell'autore e non rappresentano necessariamente quelle della > Società. > This message and any attachment are confidential.If you are not the > intended recipient, please telephone or email the sender and delete this > message and any attachment from your system. If you are not the intended > recipient you must not copy this message or attachment or disclose the > contents to any other person. Any opinions presented are solely those of > the author and do not necessarily represent those of the Company. > > dott. Ivano Mario Luberti > > Archimede Informatica società cooperativa a r. l. > Via Gereschi 36, 56127 Pisa > > tel.: +39 050/580959 | fax: +39 050/8932061 > > web: www.archicoop.it > linkedin: www.linkedin.com/in/ivanoluberti > facebook: www.facebook.com/archimedeinformaticapisa/ >
Re: Tomcat 9 returning 404 for audio files
Hi Chris, I'm creating the audio file dynamically from DB and I check if the file exists using File.exists() method. Before returning the html code with audio tag, I'm verifying that file exists on File System. Thanks! On Mon, Mar 11, 2024 at 2:36 PM Christopher Schultz < ch...@christopherschultz.net> wrote: > Sam, > > On 3/11/24 13:04, Sam wrote: > > On the server side, I'm checking that file exists before returning the > file > > path to the browser. We are also dynamically creating pdf files this way > > and no issues with accessing them. > > How are you checking to see if the file exists? It's possible that your > check-for-existance triggers the "not found" in Tomcat's > instance, then you create your file on-disk and return the path to the > browser, then the browser requests the path and gets the cached "not > found". > > > I found something interesting: > > https://tomcat.apache.org/tomcat-9.0-doc/config/resources.html From this > > link: > > *Resources are cached by default.* > > > > I'll try with *Cache-Control* request header and see if it helps! > > This isn't likey to be the problem. I think the cache you are fighting > is the one Tomcat maintains for "resources" which is how Tomcat loads > things from ... well, everywhere. Not caching things like "not found" > makes things go very slowly. > > -chris > > > On Mon, Mar 11, 2024 at 11:46 AM Mark Thomas wrote: > > > >> On 11/03/2024 11:31, Sam wrote: > >>> Thanks for replying!! > >>> > >>> Yes audio files are generated dynamically from DB.in a Servlet. > >>> > >>> I've verified that audio file exists on file system before returning > the > >>> html code that contains audo control. > >> > >> Is there any chance of an attempt to access the file before it is > >> created? The resources implementation can cache "not found" results for > >> a short period of time. > >> > >> You might want to test the code with a simple text file to determine > >> whether file type is a factor (which seems unlikely but you never know). > >> > >> Mark > >> > >>> > >>> > >>> On Mon, Mar 11, 2024, 5:22 a.m. Mark Thomas wrote: > >>> > >>>> On 11/03/2024 02:21, Sam wrote: > >>>>> I just upgraded a legacy application from Tomcat 7 to Tomcat 9. It's > >>>>> deployed as a war file. I'm facing a weird issue with audio files > >>>> playback. > >>>>> > >>>>> When loading a page that contains an audio file. First time Tomcat > >>>> returns > >>>>> 404 error but if reloading the page, audio file is loaded properly > and > >> no > >>>>> error from Tomcat. > >>>>> > >>>>> I'm using html 5 audio control to display the file. > >>>>> > >>>>> All other static resources(images, css and js files) are working > >> without > >>>>> any issues. Only audio files are having this issue. > >>>>> > >>>>> I enabled the logs for DefaultServlet in Tomcat. Follwong is the log > >>>> entry > >>>>> when I try to open the audio file first time. I can see 404 being > >>>> returned > >>>>> from server in Chrome dev tools. > >>>>> > >>>>> > >>>>> *09-Mar-2024 20:12:50.747 INFO DefaultServlet.serveResource: Serving > >>>>> resource '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers > >> and > >>>>> data* > >>>>> Following is the log for 2nd attempt. This time audio is available > and > >>>>> playable in browser. *09-Mar-2024 20:13:00.371 INFO > >>>>> DefaultServlet.serveResource: Serving resource > >>>>> '/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3' headers and data > * > >>>>> *09-Mar-2024 20:13:01.372 INFO DefaultServlet.serveFile: > >>>>> contentType='audio/mpeg'* > >>>> > >>>> Are the audio files generated dynamically on request? > >>>> > >>>> Mark > >>>> > >>>> > >>>>> > >>>>> Here is the audio control code: > >>>>> > >>>>> > >>>>>>>>>>> > >>>>> >>> > >>>>> >> src="/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3" > >>>>> type="audio/mpeg" > > >>>>> > >>>>> > >>>>> > >>>>> I've tried relative path and full path but result is the same in both > >>>> cases. > >>>>> > >>>>> I've spent days trying to solve this but no luck :( > >>>>> > >>>>> I would really appreciate any guidance to solve this issue. > >>>>> > >>>>> Thanks! > >>>>> > >>>> > >>>> - > >>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >>>> For additional commands, e-mail: users-h...@tomcat.apache.org > >>>> > >>>> > >>> > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > >> For additional commands, e-mail: users-h...@tomcat.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Tomcat 9 returning 404 for audio files
Hi, Yes, path is tomcat/webapps/ROOT/wav/ As I said earlier, 404 error is only returned 1st time. Subsequent requests work fine. On Tue, Mar 12, 2024, 3:13 a.m. Anson Cheung wrote: > src="/wav/2B916004DFE94FA40446429E1671C893_0001053.mp3" > Please confirm that your file is placed under the path > "/apache-tomcat-9.0.30/webapps/ROOT/wav/" not " /wav/ " > > On Tue, Mar 12, 2024 at 11:20 AM Sam wrote: > > > Hi Chris, > > > > I'm creating the audio file dynamically from DB and I check if the file > > exists using File.exists() method. > > > > Before returning the html code with audio tag, I'm verifying that file > > exists on File System. > > > > Thanks! > > > > On Mon, Mar 11, 2024 at 2:36 PM Christopher Schultz < > > ch...@christopherschultz.net> wrote: > > > > > Sam, > > > > > > On 3/11/24 13:04, Sam wrote: > > > > On the server side, I'm checking that file exists before returning > the > > > file > > > > path to the browser. We are also dynamically creating pdf files this > > way > > > > and no issues with accessing them. > > > > > > How are you checking to see if the file exists? It's possible that your > > > check-for-existance triggers the "not found" in Tomcat's > > > instance, then you create your file on-disk and return the path to the > > > browser, then the browser requests the path and gets the cached "not > > > found". > > > > > > > I found something interesting: > > > > https://tomcat.apache.org/tomcat-9.0-doc/config/resources.html From > > this > > > > link: > > > > *Resources are cached by default.* > > > > > > > > I'll try with *Cache-Control* request header and see if it helps! > > > > > > This isn't likey to be the problem. I think the cache you are fighting > > > is the one Tomcat maintains for "resources" which is how Tomcat loads > > > things from ... well, everywhere. Not caching things like "not found" > > > makes things go very slowly. > > > > > > -chris > > > > > > > On Mon, Mar 11, 2024 at 11:46 AM Mark Thomas > wrote: > > > > > > > >> On 11/03/2024 11:31, Sam wrote: > > > >>> Thanks for replying!! > > > >>> > > > >>> Yes audio files are generated dynamically from DB.in a Servlet. > > > >>> > > > >>> I've verified that audio file exists on file system before > returning > > > the > > > >>> html code that contains audo control. > > > >> > > > >> Is there any chance of an attempt to access the file before it is > > > >> created? The resources implementation can cache "not found" results > > for > > > >> a short period of time. > > > >> > > > >> You might want to test the code with a simple text file to determine > > > >> whether file type is a factor (which seems unlikely but you never > > know). > > > >> > > > >> Mark > > > >> > > > >>> > > > >>> > > > >>> On Mon, Mar 11, 2024, 5:22 a.m. Mark Thomas > > wrote: > > > >>> > > > >>>> On 11/03/2024 02:21, Sam wrote: > > > >>>>> I just upgraded a legacy application from Tomcat 7 to Tomcat 9. > > It's > > > >>>>> deployed as a war file. I'm facing a weird issue with audio files > > > >>>> playback. > > > >>>>> > > > >>>>> When loading a page that contains an audio file. First time > Tomcat > > > >>>> returns > > > >>>>> 404 error but if reloading the page, audio file is loaded > properly > > > and > > > >> no > > > >>>>> error from Tomcat. > > > >>>>> > > > >>>>> I'm using html 5 audio control to display the file. > > > >>>>> > > > >>>>> All other static resources(images, css and js files) are working > > > >> without > > > >>>>> any issues. Only audio files are having this issue. > > > >>>>> > > > >>>>> I enabled the logs for DefaultServlet in Tomcat. Follwong is the > > log >
Re: Tomcat 9 returning 404 for audio files
Thank you so much! Finally issue is resolved. Regards! On Tue, Mar 12, 2024, 11:43 p.m. Anson Cheung wrote: > ok,it's a problem caused by tomcat cache. You need to disable it. Please > refer to > > https://serverfault.com/questions/40205/how-do-i-disable-tomcat-caching-im-having-weird-static-file-problems > > On Wed, Mar 13, 2024 at 3:46 AM Chuck Caldarale wrote: > > > > > > On Mar 12, 2024, at 13:15, Sam wrote: > > > > > > As I said earlier, 404 error is only returned 1st time. > > > > > > Subsequent requests work fine. > > > > > > What triggers the creation of the audio file? Is it possible that the > > trigger creates a file-not-found state in the Tomcat resource cache, and > > that’s what is returned the first time? > > > > - Chuck > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > >
Re: Apache2.x + Apache Tomcat5.x + mod_jk + virtual host on windows XP
on the same line.. i can access my jsp-examples frm http://localhost/jsp-examples.. but whn i pass my IP address to frnds (whn i m connected to the internet)...it shows page not available/requested page is not available... i m using tomcat 5.5 anf apache 2.2.3... the configuration seems OK to me i m able to access the local apps from tomcat... ny suggestions... thanks On 10/14/06, Chezang <[EMAIL PROTECTED]> wrote: hi list, I have both apache and tomcat working on my windows desktop. I have also configured mod_jk successfully ( I could access the jsp-examples from http://localhost/jsp-examples). I would like to configure virtual host on apache so that i can also develop other applications in the same web server. I configured mod_jk connector so that whenever there are requests for jsp and servlet pages the requests are forwarded to tomcat server. I have the following doubts and problems: 1. Where do i place the jsp and servlet pages i create in tomcat server. Do I have to create corresponding virtual host directory in tomcat server as we do in apache web server?. 2. How do I configure workers properties, server.xml, virtual host and the corresponding jkmount. please can anyone give the steps involved in doing these?. please help me I'm a tomcat newbie. thanks in advance. che - 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 with Apache 2.2.0
Anyone tried the newest apache 2.2.0 with tomcat using jk? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How does tomcat parse multipart requests?
Dear Guys, I want to know how tomcat parse multipart requests? Or tomcat does not parse multipart requests at all? I try to find the answer from tomcat 5.5 source,but failed because don't know where to begin. Thanks, Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
UnsatisfiedLinkError when loading DLL twice
Hi, All My servlet use a DLL, currently the DLL is located at window system32 and in the webapp's WEB-INF/lib. But I sometimes got the "UnsatisfiedLinkError". Can anyone tell me where should the DLL put? and what kind of system variable I need to set for the tomcat classloader to load the DLL? I am using Window XP Pro. Any suggestions or Hints, I will be very appreciate! Thanks Sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: UnsatisfiedLinkError when loading DLL twice
Thanks Rajeev Jha. I probably put the DLL in many places. After I clean them up from other places, I have not seen the error so far. Sam -Original Message- From: Rajeev Jha [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 12, 2006 5:21 AM To: Tomcat Users List Subject: Re: UnsatisfiedLinkError when loading DLL twice if the DLL in windows system 32 then it should be picked right up. have you registered this DLL or not ? if not then try registering this dll first. >--- "Ho, Sam" <[EMAIL PROTECTED]> wrote: > > > >>Hi, All >>My servlet use a DLL, currently the DLL is located >>at window system32 and in the webapp's WEB-INF/lib. >>But I sometimes got the "UnsatisfiedLinkError". Can >>anyone tell me where should the DLL put? and what >>kind of system variable I need to set for the tomcat >>classloader to load the DLL? I am using Window XP >>Pro. >>Any suggestions or Hints, I will be very appreciate! >> >>Thanks >>Sam >> >> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: UnsatisfiedLinkError when loading DLL twice
Thank you for your reply I probably put the DLL into many places. As a result the DLL appears in the PATH at least twice. After I clean them up in other places, I have not seen the error so far. Thanks again Sam -Original Message- From: Wade Chandler [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 11, 2006 4:40 PM To: Tomcat Users List Subject: Re: UnsatisfiedLinkError when loading DLL twice --- "Ho, Sam" <[EMAIL PROTECTED]> wrote: > Hi, All > My servlet use a DLL, currently the DLL is located > at window system32 and in the webapp's WEB-INF/lib. > But I sometimes got the "UnsatisfiedLinkError". Can > anyone tell me where should the DLL put? and what > kind of system variable I need to set for the tomcat > classloader to load the DLL? I am using Window XP > Pro. > Any suggestions or Hints, I will be very appreciate! > > Thanks > Sam If you are using loadLibrary then you need to have it on the path which "system32" satisfies. Putting it under WEB-INF/lib isn't doing anything for you (if using loadLibrary). You could use System.load and get the exact loacation of the file using the servlet methods to get the full path and then call that to load the file directly without leaving it up to path loading and name matching. I do this when I want definite version control over the version of a library I'm using. Now, for the UnsatisfiedLinkError, have you debugged this? One, debug the java code (you can run the debugger in tomcat just like other java applications). Step to the line or set a break point and see what other setup maybe isn't getting initialized when this happens. Next, but probably what I would actually do first, debug your C library. Setup a breakpoint in the entry point (DllMain) and see if it is loading or starting to load and maybe bombing out there..it may be bombing out in some static section of your DLL before you even get to your entry point. Wade - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Configuring Tomcat Service Wrapper for remote debugging.
I am having trouble finding info on how to configure the Tomcat Wrapper Service (Tomcat 5.0.x) for remote debugging. The Tomcat "How TO" page lists the following: "If you run Tomcat using service wrapper, check the documentation for the service to determine how to set the required JVM options." I cannot find this documentation. Sam Ganzman Channel Logistics LLC (856) 428 9201 X 111
Why tomcat has a wrapped dbcp?
Why tomcat has a wrapped dbcp? Is there any difference? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Deploy application from Eclipse (windows) to Tomcat (in linux).
Hi, Is there any user guide I can read thru for deploying applicatoin from windows eclipse to linux tomcat? I am using tomcat 5.5 Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
example about deploy application from windows eclipse to linux Tomcat
Hi, Can anyone link me an example about deploy application from windows eclipse to linux Tomcat? Thanks - 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 Displaying Result of a MySQL Join in Tomcat
why not use Linux? On Sun, Aug 3, 2008 at 10:02 AM, Glyn Thomas <[EMAIL PROTECTED]> wrote: > I am in the process of converting a Tomcat front end for a MySQL database > from > > Windows XP to Windows Vista. > > > > The XP version used MySQL Version 5.0.22, Tomcat 5.5.20, JRE 1.5.0 release > > 12 with Tomcat JDK 4 Compatibility Pack, and J/Connector 5.0.6. > > > > The Vista version is using MySQL Version 5.0.51a, Tomcat 5.5.26, JRE > > 1.6.0_05, and J/Connector 5.1.6. > > > > I am unable to display any parts of a result set that are retrieved from > > JOINed tables in the Vista version - this works fine in the XP version. I > > already tried converting the queries to use JOIN syntax instead of WHERE > > syntax, without improvement. > > > > For example, this query works correctly in the MySQL command line: > > > > SELECT > > i.ImageID,i.DateDay,i.DateMonth,i.DateYear,i.Location1,i.Location2,i.Scanned > > YN,i.MediaID,c.Description as 'Country', s.SubjectID, s.SubjectTypeID, > > i.CountryID,i.PhotographerID, i.VolumeNumber FROM image_tbl i JOIN > > lu_country_tbl c ON (i.countryid=c.countryid) JOIN xrf_image_subject_tbl si > > ON (si.Imageid=i.imageid) JOIN subject_tbl s ON (si.Subjectid=s.subjectid) > > WHERE (i.imageid=1234); > > > > In JSP, I retrieve the results of this query into an rsImages variable, and > > then iterate through the rows using: > > > > > > > > Rows that retrieve directly from the image_tbl work correctly e.g. > > ${row.ImageID} will display the image ID. > > > > However, elements from the joined tables, such as ${row.Country} and > > ${row.SubjectID} don't get retrieved. > > > > Any ideas? > > > > Thanks, > > Glyn Thomas > > > > > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mvn command line failed with archetype....
Hi, I am wondering how to fix the following attached error (mvn command run)? I tried to follow the instruction shown in the following website, but got error. http://struts.apache.org/2.x/docs/developing-a-portlet-using-eclipse.html === attached mvn command run === Maven version: 2.0.9 Java version: 1.6.0_10-beta OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows" D:\workspace\samples\portlet>mvn archetype:create -DgroupId=com.mycompany.mypor let \ [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: < 1 second [INFO] Finished at: Fri Aug 08 17:32:51 EST 2008 [INFO] Final Memory: 2M/4M [INFO] D:\workspace\samples\portlet>mvn archetype:create -DgroupId=com.mycompany.mypor let -DartifactId=myportlet -DarchetypeGroupId=org.apache.struts -DarchetypeAr ifactId=struts2-archetype-portlet -DarchetypeVersion=2.0.9-SNAPSHOT -Dremote epositories=http://people.apache.org/repo/m2-snapshot-repository [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:create] (aggregator-style) [INFO] [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexu .velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [archetype:create] [WARNING] This goal is deprecated. Please use mvn archetype:generate instead [INFO] Defaulting package to group ID: com.mycompany.myportlet [INFO] We are using command line specified remote repositories: http://people.a ache.org/repo/m2-snapshot-repository [INFO] snapshot org.apache.struts:struts2-archetype-portlet:2.0.9-SNAPSHOT: che king for updates from id0 Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/st uts/struts2-archetype-portlet/2.0.9-SNAPSHOT/struts2-archetype-portlet-2.0.9-SN PSHOT.jar [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Error creating from archetype Embedded error: OldArchetype does not exist. Unable to download the artifact from any repository [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 10 seconds [INFO] Finished at: Fri Aug 08 17:33:37 EST 2008 [INFO] Final Memory: 8M/15M [INFO] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mvn failed with archetype....
Hi, I am wondering how to fix the following attached error (mvn command run)? I tried to follow the instruction shown in the following website, but got error. http://struts.apache.org/2.x/docs/developing-a-portlet-using-eclipse.html === attached mvn command run === Maven version: 2.0.9 Java version: 1.6.0_10-beta OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows" D:\workspace\samples\portlet>mvn archetype:create -DgroupId=com.mycompany.mypor let \ [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: < 1 second [INFO] Finished at: Fri Aug 08 17:32:51 EST 2008 [INFO] Final Memory: 2M/4M [INFO] D:\workspace\samples\portlet>mvn archetype:create -DgroupId=com.mycompany.mypor let -DartifactId=myportlet -DarchetypeGroupId=org.apache.struts -DarchetypeAr ifactId=struts2-archetype-portlet -DarchetypeVersion=2.0.9-SNAPSHOT -Dremote epositories=http://people.apache.org/repo/m2-snapshot-repository [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:create] (aggregator-style) [INFO] [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexu .velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [archetype:create] [WARNING] This goal is deprecated. Please use mvn archetype:generate instead [INFO] Defaulting package to group ID: com.mycompany.myportlet [INFO] We are using command line specified remote repositories: http://people.a ache.org/repo/m2-snapshot-repository [INFO] snapshot org.apache.struts:struts2-archetype-portlet:2.0.9-SNAPSHOT: che king for updates from id0 Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/st uts/struts2-archetype-portlet/2.0.9-SNAPSHOT/struts2-archetype-portlet-2.0.9-SN PSHOT.jar [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Error creating from archetype Embedded error: OldArchetype does not exist. Unable to download the artifact from any repository [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 10 seconds [INFO] Finished at: Fri Aug 08 17:33:37 EST 2008 [INFO] Final Memory: 8M/15M [INFO] Reply Forward - 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 POST to servlet: 16384 bytes maximum?
Hi, I am wondering how to fix the following attached error (mvn command run)? I tried to follow the instruction shown in the following website, but got error. http://struts.apache.org/2.x/docs/developing-a-portlet-using-eclipse.html === attached mvn command run === Maven version: 2.0.9 Java version: 1.6.0_10-beta OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows" D:\workspace\samples\portlet>mvn archetype:create -DgroupId=com.mycompany.mypor let \ [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [ERROR] BUILD FAILURE [INFO] [INFO] Invalid task '\': you must specify a valid lifecycle phase, or a goal in the format plugin:goal or pluginGroupId:pluginArtifactId:pluginVersion:goal [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: < 1 second [INFO] Finished at: Fri Aug 08 17:32:51 EST 2008 [INFO] Final Memory: 2M/4M [INFO] D:\workspace\samples\portlet>mvn archetype:create -DgroupId=com.mycompany.mypor let -DartifactId=myportlet -DarchetypeGroupId=org.apache.struts -DarchetypeAr ifactId=struts2-archetype-portlet -DarchetypeVersion=2.0.9-SNAPSHOT -Dremote epositories=http://people.apache.org/repo/m2-snapshot-repository [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:create] (aggregator-style) [INFO] [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexu .velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [archetype:create] [WARNING] This goal is deprecated. Please use mvn archetype:generate instead [INFO] Defaulting package to group ID: com.mycompany.myportlet [INFO] We are using command line specified remote repositories: http://people.a ache.org/repo/m2-snapshot-repository [INFO] snapshot org.apache.struts:struts2-archetype-portlet:2.0.9-SNAPSHOT: che king for updates from id0 Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/st uts/struts2-archetype-portlet/2.0.9-SNAPSHOT/struts2-archetype-portlet-2.0.9-SN PSHOT.jar [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Error creating from archetype Embedded error: OldArchetype does not exist. Unable to download the artifact from any repository [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 10 seconds [INFO] Finished at: Fri Aug 08 17:33:37 EST 2008 [INFO] Final Memory: 8M/15M [INFO] Reply Forward - 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: mvn command line failed with archetype....
Actually I tried that with what you said, this is the error message getting from that ONE command line. There is no \ at the end. Thanks On Sat, Aug 9, 2008 at 12:04 AM, David Smith <[EMAIL PROTECTED]> wrote: > Might also want to try putting the whole command on the same line instead of > trying to do the continuation '\' operator which may not work on Windows. > That last '\' character is being interpreted by mvn as a parameter. > > --David > > Christopher Schultz wrote: >> >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Sam, >> >> This is probably a question best asked on the Maven mailing list. >> >> - -chris >> >> Sam Wun wrote: >> | Hi, >> | >> | I am wondering how to fix the following attached error (mvn command >> run)? >> | I tried to follow the instruction shown in the following website, but >> got error. >> | >> http://struts.apache.org/2.x/docs/developing-a-portlet-using-eclipse.html >> | >> | >> | === attached mvn command run === >> | Maven version: 2.0.9 >> | Java version: 1.6.0_10-beta >> | OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows" >> | >> | D:\workspace\samples\portlet>mvn archetype:create >> - -DgroupId=com.mycompany.mypor >> | let \ >> | [INFO] Scanning for projects... >> | [INFO] Searching repository for plugin with prefix: 'archetype'. >> | [INFO] >> - >> | [ERROR] BUILD FAILURE >> | [INFO] >> - >> | [INFO] Invalid task '\': you must specify a valid lifecycle phase, or >> a goal in >> | the format plugin:goal or >> pluginGroupId:pluginArtifactId:pluginVersion:goal >> | [INFO] >> - >> | [INFO] For more information, run Maven with the -e switch >> | [INFO] >> - >> | [INFO] Total time: < 1 second >> | [INFO] Finished at: Fri Aug 08 17:32:51 EST 2008 >> | [INFO] Final Memory: 2M/4M >> | [INFO] >> - >> | >> | D:\workspace\samples\portlet>mvn archetype:create >> - -DgroupId=com.mycompany.mypor >> | let -DartifactId=myportlet -DarchetypeGroupId=org.apache.struts >> - -DarchetypeAr >> | ifactId=struts2-archetype-portlet -DarchetypeVersion=2.0.9-SNAPSHOT >> -Dremote >> | epositories=http://people.apache.org/repo/m2-snapshot-repository >> | [INFO] Scanning for projects... >> | [INFO] Searching repository for plugin with prefix: 'archetype'. >> | [INFO] >> - >> | [INFO] Building Maven Default Project >> | [INFO]task-segment: [archetype:create] (aggregator-style) >> | [INFO] >> - >> | [INFO] Setting property: classpath.resource.loader.class => >> 'org.codehaus.plexu >> | .velocity.ContextClassLoaderResourceLoader'. >> | [INFO] Setting property: velocimacro.messages.on => 'false'. >> | [INFO] Setting property: resource.loader => 'classpath'. >> | [INFO] Setting property: resource.manager.logwhenfound => 'false'. >> | [INFO] [archetype:create] >> | [WARNING] This goal is deprecated. Please use mvn archetype:generate >> instead >> | [INFO] Defaulting package to group ID: com.mycompany.myportlet >> | [INFO] We are using command line specified remote repositories: >> http://people.a >> | ache.org/repo/m2-snapshot-repository >> | [INFO] snapshot >> org.apache.struts:struts2-archetype-portlet:2.0.9-SNAPSHOT: che >> | king for updates from id0 >> | Downloading: >> http://people.apache.org/repo/m2-snapshot-repository/org/apache/st >> | >> >> uts/struts2-archetype-portlet/2.0.9-SNAPSHOT/struts2-archetype-portlet-2.0.9-SN >> | PSHOT.jar >> | [INFO] >> - >> | [ERROR] BUILD ERROR >> | [INFO] >> - >> | [INFO] Error creating from archetype >> | >> | Embedded error: OldArchetype does not exist. >> | Unable to download the artifact from any repository >>
Re: How to programmatically add parameters to ServletRequest objects?
Hi, I have just configured Eclipse 3.4 with tomcat in windows vista. The environemt is running JDK1.6 and JRE 1.5, but I have selected jdk1.6 for the enviornemt. When I press the Start Tomcat menu in the Eclispe menu bar, it thrown the following exception in the Eclispe console: 10/08/2008 12:51:14 AM org.apache.catalina.startup.Bootstrap initClassLoaders SEVERE: Class loader creation threw exception java.io.IOException: The filename, directory name, or volume label syntax is incorrect at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396) at java.io.File.getCanonicalPath(File.java:559) at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:199) at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:179) at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:103) at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:212) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) How can I troubleshoot this error and what may be the issue that caused this error? Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can start tomcat within Eclipse.
sorry about the preivous email with a different subject. Here is the quest with the right subject name: Hi, I have just configured Eclipse 3.4 with tomcat in windows vista. The environemt is running JDK1.6 and JRE 1.5, but I have selected jdk1.6 for the enviornemt. When I press the Start Tomcat menu in the Eclispe menu bar, it thrown the following exception in the Eclispe console: 10/08/2008 12:51:14 AM org.apache.catalina.startup.Bootstrap initClassLoaders SEVERE: Class loader creation threw exception java.io.IOException: The filename, directory name, or volume label syntax is incorrect at java.io.WinNTFileSystem.canonicalize0(Native Method) at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396) at java.io.File.getCanonicalPath(File.java:559) at org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:199) at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:179) at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:103) at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:212) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) How can I troubleshoot this error and what may be the issue that caused this error? Thanks - 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: Can't start tomcat within Eclipse.
Hi, this is a follow up of the problem I am having. In Ecllipse: I defined JAVA_HOME in eclipse as C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar TOMCAT_HOME as C:/apache-tomcat-5.5.17 Still in Eclipse: In the Tomcat option -> JVM Settings, I choose JRE1.6.0_07 for JRE, and C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar for Classpath Is there anything wrong with my configuration/setup? Thanks Sam On Sun, Aug 10, 2008 at 1:00 AM, Sam Wun <[EMAIL PROTECTED]> wrote: > sorry about the preivous email with a different subject. > Here is the quest with the right subject name: > > Hi, I have just configured Eclipse 3.4 with tomcat in windows vista. > The environemt is running JDK1.6 and JRE 1.5, but I have selected > jdk1.6 for the enviornemt. > When I press the Start Tomcat menu in the Eclispe menu bar, it thrown > the following exception in the Eclispe console: > > 10/08/2008 12:51:14 AM org.apache.catalina.startup.Bootstrap initClassLoaders > SEVERE: Class loader creation threw exception > java.io.IOException: The filename, directory name, or volume label > syntax is incorrect > at java.io.WinNTFileSystem.canonicalize0(Native Method) > at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396) > at java.io.File.getCanonicalPath(File.java:559) > at > org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:199) > at > org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:179) > at > org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:103) > at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:212) > at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) > > How can I troubleshoot this error and what may be the issue that > caused this error? > > Thanks > - 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: Can't start tomcat within Eclipse.
thansk for the response, it is actually a typo when I type it in the email here. In eclipse, I use \ instead of / Thansk On Sun, Aug 10, 2008 at 3:41 AM, Johnny Kewl <[EMAIL PROTECTED]> wrote: > > - Original Message ----- From: "Sam Wun" <[EMAIL PROTECTED]> > To: "Tomcat Users List" > Sent: Saturday, August 09, 2008 6:31 PM > Subject: Re: Can't start tomcat within Eclipse. > > >> Hi, >> >> this is a follow up of the problem I am having. >> In Ecllipse: >> I defined JAVA_HOME in eclipse as >> C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar >> TOMCAT_HOME as >> C:/apache-tomcat-5.5.17 >> >> Still in Eclipse: >> In the Tomcat option -> JVM Settings, I choose JRE1.6.0_07 for JRE, and >> C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar for Classpath >> >> Is there anything wrong with my configuration/setup? >> >> Thanks >> Sam >> >> On Sun, Aug 10, 2008 at 1:00 AM, Sam Wun <[EMAIL PROTECTED]> wrote: >>> >>> sorry about the preivous email with a different subject. >>> Here is the quest with the right subject name: >>> >>> Hi, I have just configured Eclipse 3.4 with tomcat in windows vista. >>> The environemt is running JDK1.6 and JRE 1.5, but I have selected >>> jdk1.6 for the enviornemt. >>> When I press the Start Tomcat menu in the Eclispe menu bar, it thrown >>> the following exception in the Eclispe console: >>> >>> 10/08/2008 12:51:14 AM org.apache.catalina.startup.Bootstrap >>> initClassLoaders >>> SEVERE: Class loader creation threw exception >>> java.io.IOException: The filename, directory name, or volume label >>> syntax is incorrect >>> at java.io.WinNTFileSystem.canonicalize0(Native Method) >>> at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396) >>> at java.io.File.getCanonicalPath(File.java:559) >>> at >>> org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:199) >>> at >>> org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:179) >>> at >>> org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:103) >>> at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:212) >>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) >>> >>> How can I troubleshoot this error and what may be the issue that >>> caused this error? >>> >>> Thanks >>> > > SAM, I not an Eclipse user > > But it look like your slashes are wrong... MS is backwards ;) > > Not > > C:/apache-tomcat-5.5.17 > > C:\apache-tomcat-5.5.17 > > If that doesnt work try > > C:\apache-tomcat-5.5.17\bin > > this is wrong as well.. > > C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar > > \ > > and if that doesnt work try... > > "C:\Program Files\Java\jdk1.6.0_10" > > You really should not have to show an IDE anything more than where Java > is... > > Good Luck ;) > > I'm a whoosie, I use Netbeans... run setup, done... but real men use Emacs > ;) > > --- > HARBOR : http://www.kewlstuff.co.za/index.htm > The most powerful application server on earth. > The only real POJO Application Server. > See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm > --- > > > > - > 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: Can't start tomcat within Eclipse.
On Sun, Aug 10, 2008 at 3:41 AM, Johnny Kewl <[EMAIL PROTECTED]> wrote: > > - Original Message ----- From: "Sam Wun" <[EMAIL PROTECTED]> > To: "Tomcat Users List" > Sent: Saturday, August 09, 2008 6:31 PM > Subject: Re: Can't start tomcat within Eclipse. > > >> Hi, >> >> this is a follow up of the problem I am having. >> In Ecllipse: >> I defined JAVA_HOME in eclipse as >> C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar >> TOMCAT_HOME as >> C:/apache-tomcat-5.5.17 >> >> Still in Eclipse: >> In the Tomcat option -> JVM Settings, I choose JRE1.6.0_07 for JRE, and >> C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar for Classpath >> >> Is there anything wrong with my configuration/setup? >> >> Thanks >> Sam >> >> On Sun, Aug 10, 2008 at 1:00 AM, Sam Wun <[EMAIL PROTECTED]> wrote: >>> >>> sorry about the preivous email with a different subject. >>> Here is the quest with the right subject name: >>> >>> Hi, I have just configured Eclipse 3.4 with tomcat in windows vista. >>> The environemt is running JDK1.6 and JRE 1.5, but I have selected >>> jdk1.6 for the enviornemt. >>> When I press the Start Tomcat menu in the Eclispe menu bar, it thrown >>> the following exception in the Eclispe console: >>> >>> 10/08/2008 12:51:14 AM org.apache.catalina.startup.Bootstrap >>> initClassLoaders >>> SEVERE: Class loader creation threw exception >>> java.io.IOException: The filename, directory name, or volume label >>> syntax is incorrect >>> at java.io.WinNTFileSystem.canonicalize0(Native Method) >>> at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:396) >>> at java.io.File.getCanonicalPath(File.java:559) >>> at >>> org.apache.catalina.startup.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:199) >>> at >>> org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:179) >>> at >>> org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:103) >>> at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:212) >>> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409) >>> >>> How can I troubleshoot this error and what may be the issue that >>> caused this error? >>> >>> Thanks >>> > > SAM, I not an Eclipse user > > But it look like your slashes are wrong... MS is backwards ;) > > Not > > C:/apache-tomcat-5.5.17 > > C:\apache-tomcat-5.5.17 > > If that doesnt work try > > C:\apache-tomcat-5.5.17\bin > > this is wrong as well.. > > C:/Program Files/Java/jdk1.6.0_10/lib/tools.jar > > \ > > and if that doesnt work try... > > "C:\Program Files\Java\jdk1.6.0_10" > > You really should not have to show an IDE anything more than where Java > is... yeah, I only have jdk and jre. but can't fidn its java lib classes? > > Good Luck ;) > > I'm a whoosie, I use Netbeans... run setup, done... but real men use Emacs > ;) > > --- > HARBOR : http://www.kewlstuff.co.za/index.htm > The most powerful application server on earth. > The only real POJO Application Server. > See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm > --- > > > > - > 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]
Tomcat within Eclipse
Hi, Can anyone tell me how to resolve the followoing exception? and how do I know whether tomcat service is really running. 11/08/2008 14:47:47 org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.6.0_07\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;d:\ant171\bin;D:\apache-maven-2.0.9\bin;C:\Program Files\Nmap 11/08/2008 14:47:47 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 11/08/2008 14:47:47 org.apache.catalina.startup.Catalina load INFO: Initialization processed in 502 ms 11/08/2008 14:47:47 org.apache.naming.NamingContext lookup WARNING: Unexpected exception resolving reference java.io.IOException: Cannot rename original file to C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml.old at org.apache.catalina.users.MemoryUserDatabase.save(MemoryUserDatabase.java:582) at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:104) at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140) at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source) at org.apache.naming.NamingContext.lookup(NamingContext.java:793) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113) at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardServer.start(StandardServer.java:703) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 11/08/2008 14:47:47 org.apache.catalina.mbeans.GlobalResourcesLifecycleListener createMBeans SEVERE: Exception processing Global JNDI Resources javax.naming.NamingException: Cannot rename original file to C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml.old at org.apache.naming.NamingContext.lookup(NamingContext.java:805) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113) at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109) at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardServer.start(StandardServer.java:703) at org.apache.catalina.startup.Catalina.start(Catalina.java:578) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 11/08/2008 14:47:47 org.apache.catalina.core.StandardService start INFO: Starting service Catalina 11/08/2008 14:47:47 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 11/08/2008 14:47:47 org.apache.naming.NamingContext lookup WARNING: Unexpected exception resolving reference java.io.IOExceptio
Re: Tomcat within Eclipse
Can you tell me how to setup a *userdatabase* for this case? Thank you for your reply. On Mon, Aug 11, 2008 at 5:14 PM, Jens Kapitza <[EMAIL PROTECTED]> wrote: > Sam Wun schrieb: >> >> Hi, >> >> Can anyone tell me how to resolve the followoing exception? >> and how do I know whether tomcat service is really running. >> >> 11/08/2008 14:47:47 org.apache.catalina.core.AprLifecycleListener init >> INFO: The APR based Apache Tomcat Native library which allows optimal >> performance in production environments was not found on the >> java.library.path: C:\Program >> >> Files\Java\jre1.6.0_07\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program >> Files/Java/jre6/bin/client;C:/Program >> >> Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;d:\ant171\bin;D:\apache-maven-2.0.9\bin;C:\Program >> Files\Nmap >> 11/08/2008 14:47:47 org.apache.coyote.http11.Http11Protocol init >> INFO: Initializing Coyote HTTP/1.1 on http-8080 >> 11/08/2008 14:47:47 org.apache.catalina.startup.Catalina load >> INFO: Initialization processed in 502 ms >> 11/08/2008 14:47:47 org.apache.naming.NamingContext lookup >> WARNING: Unexpected exception resolving reference >> java.io.IOException: Cannot rename original file to C:\Program >> Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml.old >> > > is this location writeable? >> >> SEVERE: Catalina.start: >> LifecycleException: No UserDatabase component found under key >> UserDatabase >> > > chain error ??? >> >>at >> org.apache.catalina.realm.UserDatabaseRealm.start(UserDatabaseRealm.java:261) >>at >> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1037) >>at >> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) >>at >> org.apache.catalina.core.StandardService.start(StandardService.java:516) >>at >> org.apache.catalina.core.StandardServer.start(StandardServer.java:710) >>at org.apache.catalina.startup.Catalina.start(Catalina.java:578) >>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >>at java.lang.reflect.Method.invoke(Unknown Source) >>at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) >>at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) >> 11/08/2008 14:47:47 org.apache.catalina.startup.Catalina start >> INFO: Server startup in 104 ms >> > > tomcat is running but with no userdatabase (?) >> >> 11/08/2008 14:49:20 org.apache.catalina.core.StandardServer await >> WARNING: StandardServer.await: Invalid command 'GET / HTTP/1.1' received >> > > i think tomcat can't do anything with no userdatabase so all commands are > invalid (?) > > > Jens Kapitza > > - > 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: Tomcat within Eclipse
Hi, I have the server.xml path defined in Eclipse (3.4): C:\Program Files\Apache Software Foundation\Tomcat 6.0 Where is the startup.bat file? I can't find this batch file. Thanks On Mon, Aug 11, 2008 at 3:27 PM, Johnny Kewl <[EMAIL PROTECTED]> wrote: > > - Original Message - From: "Sam Wun" <[EMAIL PROTECTED]> > To: "Tomcat Users List" > Sent: Monday, August 11, 2008 6:57 AM > Subject: Tomcat within Eclipse > > >> Hi, >> >> Can anyone tell me how to resolve the followoing exception? >> and how do I know whether tomcat service is really running. >> >> 11/08/2008 14:47:47 org.apache.catalina.core.AprLifecycleListener init >> INFO: The APR based Apache Tomcat Native library which allows optimal >> performance in production environments was not found on the >> java.library.path: C:\Program >> >> Files\Java\jre1.6.0_07\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program >> Files/Java/jre6/bin/client;C:/Program >> >> Files/Java/jre6/bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;d:\ant171\bin;D:\apache-maven-2.0.9\bin;C:\Program >> Files\Nmap >> 11/08/2008 14:47:47 org.apache.coyote.http11.Http11Protocol init >> INFO: Initializing Coyote HTTP/1.1 on http-8080 >> 11/08/2008 14:47:47 org.apache.catalina.startup.Catalina load >> INFO: Initialization processed in 502 ms >> 11/08/2008 14:47:47 org.apache.naming.NamingContext lookup >> WARNING: Unexpected exception resolving reference >> java.io.IOException: Cannot rename original file to C:\Program >> Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat-users.xml.old >> at >> org.apache.catalina.users.MemoryUserDatabase.save(MemoryUserDatabase.java:582) >> at >> org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:104) >> at >> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140) >> at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source) >> at org.apache.naming.NamingContext.lookup(NamingContext.java:793) >> at org.apache.naming.NamingContext.lookup(NamingContext.java:140) >> at >> org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113) >> at >> org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71) >> at >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137) >> at >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109) >> at >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81) >> at >> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) >> at org.apache.catalina.core.StandardServer.start(StandardServer.java:703) >> at org.apache.catalina.startup.Catalina.start(Catalina.java:578) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >> at java.lang.reflect.Method.invoke(Unknown Source) >> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) >> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) >> 11/08/2008 14:47:47 >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener >> createMBeans >> SEVERE: Exception processing Global JNDI Resources >> javax.naming.NamingException: Cannot rename original file to >> C:\Program Files\Apache Software Foundation\Tomcat >> 6.0\conf\tomcat-users.xml.old >> at org.apache.naming.NamingContext.lookup(NamingContext.java:805) >> at org.apache.naming.NamingContext.lookup(NamingContext.java:140) >> at >> org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113) >> at >> org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71) >> at >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137) >> at >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109) >> at >> org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81) >> at >> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecyc
javax.transaction:jta:jar:1.0.1B
HI, I am following an example from the following link, but got error and using maven building the project. http://cwiki.apache.org/S2WIKI/struts-2-spring-2-jpa-ajax.html I have downloaded jta-1.1-classes.jar and used maven install it in the repository. Output from build process: [INFO] [ERROR] BUILD ERROR [INFO] [INFO] Failed to resolve artifact. Missing: -- 1) javax.transaction:jta:jar:1.0.1B Try downloading the file manually from: http://java.sun.com/products/jta Then, install it using the command: mvn install:install-file -DgroupId=javax.transaction -DartifactId=jta -Dve rsion=1.0.1B -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=javax.transaction -DartifactId=jta -Dvers ion=1.0.1B -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) quickstart:quickstart:war:0.1-SNAPSHOT 2) javax.transaction:jta:jar:1.0.1B 2) com.sun:tools:jar:1.5.0 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=com.sun -DartifactId=tools -Dversion=1. 5.0 -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=com.sun -DartifactId=tools -Dversion=1.5. 0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) quickstart:quickstart:war:0.1-SNAPSHOT 2) org.apache.struts:struts2-core:jar:2.0.6 3) com.sun:tools:jar:1.5.0 -- 2 required artifacts are missing. for artifact: quickstart:quickstart:war:0.1-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2) [INFO] [INFO] For more information, run Maven with the -e switch [INFO] [INFO] Total time: 9 minutes 39 seconds [INFO] Finished at: Wed Aug 13 01:03:31 EST 2008 [INFO] Final Memory: 4M/8M [INFO] D:\DEV\quickstart> - 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 JConsole
Hi, I m using Eclipse 3.4 (in Vista) and Tomcat 5.5 (in linux) as J2EE development environment. I want to build a online order form to interact with backend database in linux. I know I can use dreamweaver to create web page (html template), but I don't know how to use it and dont' have the time to learn it. Is there any standard jsp package or library I can use from Eclipse or Tomcat to build an online order form? How about Struts or Springs library? Your suggestion is highly appreciated. Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form design or framework from Eclipse or Tomcat.
Hi, I m using Eclipse 3.4 (in Vista) and Tomcat 5.5 (in linux) as J2EE development environment. I want to build a online order form to interact with backend database in linux. I know I can use dreamweaver to create web page (html template), but I don't know how to use it and dont' have the time to learn it. Is there any standard jsp package or library I can use from Eclipse or Tomcat to build an online order form? How about Struts or Springs library? Your suggestion is highly appreciated. Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
simple online order form
Hi, I want to build a simple online order form with Struts, eclipse, and tomcat (mysql database). Is there any example/tutorial I can follow to create this simple project? I found many tutorials are based on MyEclipse, but I am using Elcipse 3.4. Thank you in advance.
establsh remote db connection
Hi, I triedto follow the tutorial shown in the link below http://java.sys-con.com/node/152270 but I amstuck with the mysql location. I haveinstalled mysql database engine in a linux server. Thetutorial I am following on is started in windows Vista with Eclipse 3.4, it assumed we installed mysql in the local system (windows ). I havedownloaded its tutorial files in a zip file and saved them in windows vista. The list1 file is also shown below: xml version='1.0' encoding='utf-8'?> factory org.apache.commons.dbcp.BasicDataSourceFactory url jdbc:mysql://localhost/test?autoReconnect=true password maxActive 100 maxWait 5000 driverClassName com.mysql.jdbc.Driver username ODBC maxIdle 2 where should I make change in this file in order to make this project look for db connection in my linux box? Thanks
java version in windows and tomcat server
Hi, when I create a web project in windows Eclipse (3.4), I use jre6. But in my tomcat server (linux), it s using jre5. Do I have to make the jre version to be the same for both platforms? Because if I package it in a war file in windows, the lib jar files are all in jre6 version. Then when I deploy this war file to the tomcat server, will it still work? Thanks >
errors in deploying war file to tomcat 5.5
Hi, I tried to deploy a war file (built from Eclipse in windows) into tomcat 5.5(in linux). I got the following errors: Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost' Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: init: Global resources are available Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' Aug 24, 2008 12:32:53 PM org.apache.catalina.core.ApplicationContext log INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' Aug 24, 2008 12:33:24 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet HTMLManager threw exception java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream at org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302) at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:157) at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) What is the problem and how to fix it? Your suggestion is highly appreciated. Thanks Sam
Re: Re: errors in deploying war file to tomcat 5.5
> - Original Message - > From: Edoardo Panfili > Sent: 24/08/08 02:28 am > To: Tomcat Users List > Subject: Re: errors in deploying war file to tomcat 5.5 > > Edoardo Panfili ha scritto: > > sam wun ha scritto: > >> Hi, > >> > >> > >> > >> I tried to deploy a war file (built from Eclipse in windows) into > >> tomcat 5.5(in linux). > >> > >> I got the following errors: > >> > >> > >> > >> Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: init: Associated with Deployer > >> 'Catalina:type=Deployer,host=localhost' > >> Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: init: Global resources are available > >> Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' > >> Aug 24, 2008 12:32:53 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' > >> Aug 24, 2008 12:33:24 PM org.apache.catalina.core.StandardWrapperValve > >> invoke > >> SEVERE: Servlet.service() for servlet HTMLManager threw exception > >> java.lang.NoClassDefFoundError: > >> org/apache/commons/io/output/DeferredFileOutputStream > >> at > >> > org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103) > > >> > >> at > >> > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350) > > >> > >> at > >> > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302) > > >> > >> at > >> > org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:157) > > >> > >> at > javax.servlet.http.HttpServlet.service(HttpServlet.java:710) > >> at > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > >> at > >> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) > > >> > >> at > >> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) > > >> > >> at > >> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > > >> > >> at > >> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) > > >> > >> at > >> > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) > > >> > >> at > >> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) > >> > >> at > >> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) > >> > >> at > >> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) > > >> > >> at > >> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) > >> > >> at > >> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) > >> > >> at > >> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) > > >> > >> at > >> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) > > >> > >> at > >> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) > > >> > >> at > >> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) > > >> > >> at java.lang.Thread.run(Unknown Source) > >> > >> What is the problem and how to fix it? > >> > >> > >> > >> Your suggestion is highly appreciated. > >> > >> Thanks > >> > >> Sam > >> > > > > It seems that you need > > org/apache/commons/io/output/DeferredFileOutputStream.class > > you can find it in commons-io-1.3.2.jar > > put commons-io-1.3.2.jar in WEB-INF/lib > > > > >>I'm sorry: 1.3.2 is my version maybe you have another one. > > > > Hi, where can I find the commons-io file? > > > > I tried to search it in the tomcat path, but not found: > > linux:~ # cd tomcat/ > linux:~/tomcat # find . -name "commons-io-*.jar" > linux:~/tomcat # > > > > Thanks > > > > > Edoardo > > - > 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: Re: errors in deploying war file to tomcat 5.5
Hi, I have downloaded commons-io-1.3.1.jar file and put it in the MET-INF\lib\ folder in Eclipse(3.4). Then I highlight the project name , right click it, select Export->War file to export the project into a war file. Have I missing any step? NOw I still getting the same errors. BTW, how to see the content of the war file I built from Eclipse? Thanks > - Original Message - > From: Edoardo Panfili > Sent: 24/08/08 02:28 am > To: Tomcat Users List > Subject: Re: errors in deploying war file to tomcat 5.5 > > Edoardo Panfili ha scritto: > > sam wun ha scritto: > >> Hi, > >> > >> > >> > >> I tried to deploy a war file (built from Eclipse in windows) into > >> tomcat 5.5(in linux). > >> > >> I got the following errors: > >> > >> > >> > >> Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: init: Associated with Deployer > >> 'Catalina:type=Deployer,host=localhost' > >> Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: init: Global resources are available > >> Aug 24, 2008 12:32:46 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' > >> Aug 24, 2008 12:32:53 PM org.apache.catalina.core.ApplicationContext > log > >> INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' > >> Aug 24, 2008 12:33:24 PM org.apache.catalina.core.StandardWrapperValve > >> invoke > >> SEVERE: Servlet.service() for servlet HTMLManager threw exception > >> java.lang.NoClassDefFoundError: > >> org/apache/commons/io/output/DeferredFileOutputStream > >> at > >> > org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103) > > >> > >> at > >> > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350) > > >> > >> at > >> > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302) > > >> > >> at > >> > org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:157) > > >> > >> at > javax.servlet.http.HttpServlet.service(HttpServlet.java:710) > >> at > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > >> at > >> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) > > >> > >> at > >> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) > > >> > >> at > >> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > > >> > >> at > >> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) > > >> > >> at > >> > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525) > > >> > >> at > >> > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) > >> > >> at > >> > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) > >> > >> at > >> > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) > > >> > >> at > >> > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) > >> > >> at > >> > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) > >> > >> at > >> > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) > > >> > >> at > >> > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) > > >> > >> at > >> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) > > >> > >> at > >> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) > > >> > >> at java.lang.Thread.run(Unknown Source) > >> > >> What is the problem and how to fix it? > >> > >> > >> > >> Your suggestion is highly appreciated. > >> > >> Thanks > >> > >> Sam > >> > > > > It seems that you need > > org/apache/commons/io/output/DeferredFileOutputStream.class > > you can find it in commons-io-1.3.2.jar > > put commons-io-1.3.2.jar in WEB-INF/lib > I'm sorry: 1.3.2 is my version maybe you have another one. > > Edoardo > > - > 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: Re: Re: errors in deploying war file to tomcat 5.5
Hi, In said, I have put the commons-io-1.3.1.jar file in the WEB-INF/lib/ directory. Thanks. > - Original Message - > From: Len Popp > Sent: 25/08/08 01:32 am > To: Tomcat Users List > Subject: Re: Re: errors in deploying war file to tomcat 5.5 > > Shouldn't the .jar file go in WEB-INF/lib? Where is the > commons-fileupload.jar file? commons-io.jar should go in the same > directory. > > .war and .jar files are the same as .zip files, so you can unpack them > using any utility that unpacks .zip files. On Windows, the easiest way > is to rename the file with a .zip extension, then you can right-click > on it and Extract All. > -- > Len > > On Sun, Aug 24, 2008 at 03:58, sam wun <[EMAIL PROTECTED]> wrote: > > Hi, > > > > > > > > I have downloaded commons-io-1.3.1.jar file and put it in the > MET-INF\lib\ > > folder in Eclipse(3.4). > > > > Then I highlight the project name , right click it, select Export->War > file > > to export the project into a war file. > > > > Have I missing any step? > > > > NOw I still getting the same errors. > > > > > > > > BTW, how to see the content of the war file I built from Eclipse? > > > > > > > > Thanks > > > > > > > > > >> - Original Message - > >> From: Edoardo Panfili > >> Sent: 24/08/08 02:28 am > >> To: Tomcat Users List > >> Subject: Re: errors in deploying war file to tomcat 5.5 > >> > >> Edoardo Panfili ha scritto: > >> > sam wun ha scritto: > >> >> Hi, > >> >> > >> >> > >> >> > >> >> I tried to deploy a war file (built from Eclipse in windows) into > >> >> tomcat 5.5(in linux). > >> >> > >> >> I got the following errors: > >> >> > >> >> > >> >> > >> >> Aug 24, 2008 12:32:46 PM > org.apache.catalina.core.ApplicationContext > >> log > >> >> INFO: HTMLManager: init: Associated with Deployer > >> >> 'Catalina:type=Deployer,host=localhost' > >> >> Aug 24, 2008 12:32:46 PM > org.apache.catalina.core.ApplicationContext > >> log > >> >> INFO: HTMLManager: init: Global resources are available > >> >> Aug 24, 2008 12:32:46 PM > org.apache.catalina.core.ApplicationContext > >> log > >> >> INFO: HTMLManager: list: Listing contexts for virtual host > 'localhost' > >> >> Aug 24, 2008 12:32:53 PM > org.apache.catalina.core.ApplicationContext > >> log > >> >> INFO: HTMLManager: list: Listing contexts for virtual host > 'localhost' > >> >> Aug 24, 2008 12:33:24 PM > org.apache.catalina.core.StandardWrapperValve > >> >> invoke > >> >> SEVERE: Servlet.service() for servlet HTMLManager threw exception > >> >> java.lang.NoClassDefFoundError: > >> >> org/apache/commons/io/output/DeferredFileOutputStream > >> >> at > >> >> > >> > org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103) > >> >> > >> >> at > >> >> > >> > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350) > >> >> > >> >> at > >> >> > >> > org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302) > >> >> > >> >> at > >> >> > >> > org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:157) > >> >> > >> >> at > >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710) > >> >> at > >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > >> >> at > >> >> > >> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) > >> >> > >> >> at > >> >> > >> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) > >> >> > >> >> at > >> >> > >> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > >> >> > >> >> at > >> >> > >
Re: RE: Tomcat does not unpack WAR file (Tomcat 5.5.20)
hi, I m having the same problem. the war file is not unpack. I have found the following parameters are set in the server.xml file: unpackWARs="true" autoDeploy="true" I have *deploy* a cat.war file to the following directory: linux:~/tomcat/apache-tomcat-5.5.26/webapps # ls -l total 78 drwxr-xr-x 11 root root 320 Aug 26 10:02 . drwxr-xr-x 11 root root 376 Jul 31 04:27 .. drwxr-xr-x 4 root root 312 Jul 31 04:25 ROOT drwxr-xr-x 13 root root 432 Jul 31 04:26 admin drwxr-xr-x 5 root root 120 Jan 29 2008 balancer drwxr-xr-x 4 root root 96 Aug 26 10:02 cat -rw-r--r-- 1 root root 76716 Aug 26 10:02 cat.war drwxr-xr-x 21 root root 592 Jul 22 07:44 jsp-examples drwxr-xr-x 4 root root 272 Jul 31 04:13 manager drwxr-xr-x 4 root root 320 Jul 22 07:44 servlets-examples drwxr-xr-x 12 root root 1504 Jul 22 07:44 tomcat-docs drwxr-xr-x 3 root root 168 Jul 22 07:44 webdav linux:~/tomcat/apache-tomcat-5.5.26/webapps # The directory *cat* is created by tomcat and the cat.war file is in the directory as well. But inside cat/ directory contains only 2 folders: linux:~/tomcat/apache-tomcat-5.5.26/webapps # cd cat linux:~/tomcat/apache-tomcat-5.5.26/webapps/cat # ls -l total 0 drwxr-xr-x 4 root root 96 Aug 26 10:02 . drwxr-xr-x 11 root root 320 Aug 26 10:02 .. drwxr-xr-x 2 root root 80 Aug 26 10:02 META-INF drwxr-xr-x 4 root root 120 Aug 26 10:02 WEB-INF How to instruct tomcat to unpack this cat.war file as well? Thanks Sam > - Original Message - > From: Martin Gainty > Sent: 24/08/08 06:49 am > To: Tomcat Users List > Subject: RE: Tomcat does not unpack WAR file (Tomcat 5.5.20) > > > check your unpackWARS and autoDeploy parameters are both set to 'true' > e.g. > $TOMCAT_HOME/conf/server.xml > > unpackWARs="true" autoDeploy="true" > > HTH > Martin > __ > Disclaimer and confidentiality note > Everything in this e-mail and any attachments relates to the official > business of Sender. This transmission is of a confidential nature and > Sender does not endorse distribution to any party other than intended > recipient. Sender does not necessarily endorse content contained within > this transmission. > > > > Date: Sat, 23 Aug 2008 23:40:06 +0300 > > From: [EMAIL PROTECTED] > > To: users@tomcat.apache.org > > Subject: Re: Tomcat does not unpack WAR file (Tomcat 5.5.20) > > > > Thanks Johnny > > > > On the production server, Tomcat is actually being started up by > another > > 'parent' application. Since this does not appear to be a (pure) > 'Tomcat' > > issue, I will take it up with the guys who manage the 'parent' app. > > > > Thanks for the assistance. > > > > Johnny Kewl wrote: > > > > > > - Original Message - From: "Peter" <[EMAIL PROTECTED]> > > > To: > > > Sent: Friday, August 22, 2008 4:07 PM > > > Subject: Tomcat does not unpack WAR file (Tomcat 5.5.20) > > > > > > > > >> Hi > > >> > > >> When I drop a WAR file into the webapps folder on my dev machine - > > >> running Tomcat 6.0.16 - Tomcat unpacks it on startup. > > >> > > >> When I do the same on the production box - running Tomcat 5.5.20 - > > >> nothing happens. > > >> > > >> The WAR file that I am deploying is ROOT.war; there is a > > >> corresponding ROOT.xml under conf\Catalina\localhost. (I'm not sure > > >> if those details have any bearing on the problem - according to one > > >> archived post, there may be a connection.) > > >> > > >> On both machines, the tags look identical: > > >> > > >> > >>unpackWARs="true" autoDeploy="true" > > >>xmlValidation="false" xmlNamespaceAware="false"> > > >> > > >> Any assistance would be appreciated. :) > > >> > > >> Pete > > >> > > >> -- > > >> Peter Cimring > > >> Software Developer > > >> (: +972 52-545-9364 > > >> *: [EMAIL PROTECTED] > > > > > > Pete, nothing comes to mind, you seem to have the bases covered... > > > One possibility is that the existing ROOT web ap is busy... > > > Maybe a thread running or something... TC will not start up the new > > > guy, if the old one cant let go.. > > > > > > possibly from the manager console /manager/html tell the old one to &g
how to reference a class to the current src directory.
Hi there, I have created a Web project using Eclipse 3.4. However, it can't resolve the class reference to the current directory. Here is the project layout and description of the problem: >DBTest >src > command CommandExecutor.java ... ... DatabaseCommand.java ... Double-clicks on the file CommandExecutor.java, it display the following content: package command; import java.sql.Connection; import java.sql.SQLException; import javax.sql.DataSource; import javax.naming.InitialContext; import javax.naming.Context; import javax.naming.NamingException; /** * Gets and caches data sources, gets connections * Implements Singleton pattern */ public class CommandExecutor { private static CommandExecutor myOnlyInstance = null; private DataSource ds = null; // accessor method for the singleton public static CommandExecutor getInstance() throws NamingException { if (myOnlyInstance == null) { myOnlyInstance = new CommandExecutor(); } return myOnlyInstance; } // Constructor for the singleton private CommandExecutor() throws NamingException { getDataSource(); } // get the data source from initial context public DataSource getDataSource() throws NamingException { if (ds == null) { InitialContext ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup("java:comp/env"); ds = (DataSource) envCtx.lookup("jdbc/TestDB"); } return ds; } // get the SQL connection from the database public Connection getConnection() throws NamingException, SQLException { return getDataSource().getConnection(); } // execute particular database command public Object executeDatabaseCommand(DatabaseCommand c) throws Exception { Connection conn = null; try { conn = getConnection(); Object o = c.executeDatabaseOperation(conn); return o; } catch (SQLException e) { throw e; } catch (NamingException ne) { throw ne; } finally { if (conn != null) conn.close(); } } } The DatabaseCommand has error. Move the cursor onto the name of DatabaseCommand, an error message popup: DatabaseCommand cannot be resolved as a type 3 quick fixes available: . Add type parameter "DatabaseCommand" to "CommandExecutor" . Add type parameter "DatabaseCommand" to "executeDatabaseCommand(DatabaseCommand)" . Fix Project Setup... I think I need to choose the third option "Fix Project Setup". Now, from Java Build Path, under the Source menu tab, it has the the following layout: DBTest/src Included: (All) Excluded: (None) Native librarylocation (None) Look back the very beginning of this post, you can see the class file DatabaseCommand.java file is already defined in the same directory as as CommandExecutor.java defined. How to tell Eclipse compiler that the DatabaseCommand class is in the same directory as the CommandExecutor.java? Thanks Sam
Re: RE: how to reference a class to the current src directory.
Hi, Thanks for the help. Can you tell me how to compile these .java files into classes in Eclipse(3.4)? All these java files are under "command" package. Thanks Sam > - Original Message - > From: Tandel, Aswin > Sent: 26/08/08 02:23 am > To: Tomcat Users List > Subject: RE: how to reference a class to the current src directory. > > Hi, > > For the classes in the same directory it is not required to give class > path reference. > > Chances are that DatabaseCommand is not compiled. > Check if you have the class file in bin directory. > > If not then clean the project and build again > > > Thanks and Regards, > Ashwin Tandel > Email - [EMAIL PROTECTED] > > -Original Message- > From: sam wun [mailto:[EMAIL PROTECTED] > Sent: Monday, August 25, 2008 12:04 PM > To: Tomcat Users List > Subject: how to reference a class to the current src directory. > > Hi there, > > I have created a Web project using Eclipse 3.4. However, it can't resolve > the class reference to the current directory. > Here is the project layout and description of the problem: > > >DBTest > >src > > command > CommandExecutor.java > ... > ... > DatabaseCommand.java > ... > > > Double-clicks on the file CommandExecutor.java, it display the following > content: > > package command; > > import java.sql.Connection; > import java.sql.SQLException; > import javax.sql.DataSource; > import javax.naming.InitialContext; > import javax.naming.Context; > import javax.naming.NamingException; > > /** > * Gets and caches data sources, gets connections > * Implements Singleton pattern > */ > > public class CommandExecutor { > > private static CommandExecutor myOnlyInstance = null; > private DataSource ds = null; > > // accessor method for the singleton > public static CommandExecutor getInstance() throws NamingException > { > if (myOnlyInstance == null) { > myOnlyInstance = new CommandExecutor(); > } > return myOnlyInstance; > } > > // Constructor for the singleton > private CommandExecutor() throws NamingException { > getDataSource(); > } > > // get the data source from initial context > public DataSource getDataSource() throws NamingException { > > if (ds == null) { > > InitialContext ctx = new InitialContext(); > Context envCtx = (Context) > ctx.lookup("java:comp/env"); > ds = (DataSource) envCtx.lookup("jdbc/TestDB"); > > } > > return ds; > } > > // get the SQL connection from the database > public Connection getConnection() throws NamingException, > SQLException { > return getDataSource().getConnection(); > > } > > // execute particular database command > public Object executeDatabaseCommand(DatabaseCommand c) throws > Exception { > > Connection conn = null; > try { > conn = getConnection(); > Object o = c.executeDatabaseOperation(conn); > return o; > } catch (SQLException e) { > throw e; > } catch (NamingException ne) { > throw ne; > } finally { > if (conn != null) conn.close(); > } > } > } > > The DatabaseCommand has error. Move the cursor onto the name of > DatabaseCommand, an error message popup: > > DatabaseCommand cannot be resolved as a type > 3 quick fixes available: > . Add type parameter "DatabaseCommand" to "CommandExecutor" > . Add type parameter "DatabaseCommand" to > "executeDatabaseCommand(DatabaseCommand)" > . Fix Project Setup... > > I think I need to choose the third option "Fix Project Setup". > > Now, from Java Build Path, under the Source menu tab, it has the the > following layout: > DBTest/src > Included: (All) > Excluded: (None) > Native librarylocation (None) > > Look back the very beginning of this post, you can see the class file > DatabaseCommand.java file is already defined in the same directory as as > CommandExecutor.java defined. > > How to tell Eclipse compiler that the DatabaseCommand class is in the > same > directory as the CommandExecutor.java? > > Thanks > Sam > > - > 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: RE: how to reference a class to the current src directory.
I just found out I have a class missing in the src (command) directory. I need to create a Customer and Order class and .java file. The Cusotmer and Order class is related to the database tables Customer and Order. I am wondering how to create a getters and setters of Customer and Order class in Eclipse? thanks sam > - Original Message - > From: Tandel, Aswin > Sent: 26/08/08 02:23 am > To: Tomcat Users List > Subject: RE: how to reference a class to the current src directory. > > Hi, > > For the classes in the same directory it is not required to give class > path reference. > > Chances are that DatabaseCommand is not compiled. > Check if you have the class file in bin directory. > > If not then clean the project and build again > > > Thanks and Regards, > Ashwin Tandel > Email - [EMAIL PROTECTED] > > -Original Message- > From: sam wun [mailto:[EMAIL PROTECTED] > Sent: Monday, August 25, 2008 12:04 PM > To: Tomcat Users List > Subject: how to reference a class to the current src directory. > > Hi there, > > I have created a Web project using Eclipse 3.4. However, it can't resolve > the class reference to the current directory. > Here is the project layout and description of the problem: > > >DBTest > >src > > command > CommandExecutor.java > ... > ... > DatabaseCommand.java > ... > > > Double-clicks on the file CommandExecutor.java, it display the following > content: > > package command; > > import java.sql.Connection; > import java.sql.SQLException; > import javax.sql.DataSource; > import javax.naming.InitialContext; > import javax.naming.Context; > import javax.naming.NamingException; > > /** > * Gets and caches data sources, gets connections > * Implements Singleton pattern > */ > > public class CommandExecutor { > > private static CommandExecutor myOnlyInstance = null; > private DataSource ds = null; > > // accessor method for the singleton > public static CommandExecutor getInstance() throws NamingException > { > if (myOnlyInstance == null) { > myOnlyInstance = new CommandExecutor(); > } > return myOnlyInstance; > } > > // Constructor for the singleton > private CommandExecutor() throws NamingException { > getDataSource(); > } > > // get the data source from initial context > public DataSource getDataSource() throws NamingException { > > if (ds == null) { > > InitialContext ctx = new InitialContext(); > Context envCtx = (Context) > ctx.lookup("java:comp/env"); > ds = (DataSource) envCtx.lookup("jdbc/TestDB"); > > } > > return ds; > } > > // get the SQL connection from the database > public Connection getConnection() throws NamingException, > SQLException { > return getDataSource().getConnection(); > > } > > // execute particular database command > public Object executeDatabaseCommand(DatabaseCommand c) throws > Exception { > > Connection conn = null; > try { > conn = getConnection(); > Object o = c.executeDatabaseOperation(conn); > return o; > } catch (SQLException e) { > throw e; > } catch (NamingException ne) { > throw ne; > } finally { > if (conn != null) conn.close(); > } > } > } > > The DatabaseCommand has error. Move the cursor onto the name of > DatabaseCommand, an error message popup: > > DatabaseCommand cannot be resolved as a type > 3 quick fixes available: > . Add type parameter "DatabaseCommand" to "CommandExecutor" > . Add type parameter "DatabaseCommand" to > "executeDatabaseCommand(DatabaseCommand)" > . Fix Project Setup... > > I think I need to choose the third option "Fix Project Setup". > > Now, from Java Build Path, under the Source menu tab, it has the the > following layout: > DBTest/src > Included: (All) > Excluded: (None) > Native librarylocation (None) > > Look back the very beginning of this post, you can see the class file > DatabaseCommand.java file is already defined in the same directory as as > CommandExecutor.java defined. > > How to tell Eclipse compiler that the DatabaseCommand class is in the > same > directory as the CommandExecutor.java? > > Thanks > Sam > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
how to create domain.Order class
Hi, I have a java class file CreateOrder.java with the following coding: package command; import java.sql.Connection; import java.sql.SQLException; import java.sql.PreparedStatement; import domain.Order; /** * Create Order in the database */ public class CreateOrder implements DatabaseCommand { private Order order; public CreateOrder(Order o) { this.order = o; } public Object executeDatabaseOperation(Connection conn) throws SQLException { // Create order PreparedStatement sta = conn.prepareStatement("INSERT INTO ORDERS (ID, CUST_ID, DATE_PLACED, AMOUNT) VALUES (?, ?, ?, ?)"); sta.setInt(1, order.getId()); sta.setInt(2, order.getCustId()); sta.setDate(3, order.getDatePlaced()); sta.setInt(4, order.getOrderAmount()); int rows_inserted = sta.executeUpdate(); sta.close(); return rows_inserted; } } Can anyone tell me how to create domain.Order class? I am using Eclipse 3.4, the project name is DBTest with the following structure: > DBTest Deployment Descriptor: DBTest Java Resourse: src +command ... CreateOrder.java ... Libraries Build WebContent JavaScript Support I am wondering where to create a domain.Order class/java file. Do I have to create a directory domain under src/ directory and then create Order.java file inside theh domain folder? Thanks Sam
Can't generate class file from Interface
Hi, In Eclipse 3.4 (not sure about the previous version), I have a project, in the src, there is a interface file called "DatabaseCommand.java". This file is an interface file. It s content is shown below: package command; import java.sql.Connection; import java.sql.SQLException; public interface DatabaseCommand { public Object executeDatabaseOperation(Connection conn) throws SQLException ; } Another file CreateOrder.java *implements* this interface. Its content shown as below: Package command; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.sql.ResultSet; import java.util.ArrayList; import domain.Customer; /** * List existing customers in the database */ public class ListCustomers implements DatabaseCommand { public Object executeDatabaseOperation(Connection conn) throws SQLException { // List customers in the database ArrayList list = new ArrayList(); Statement sta = conn.createStatement(); ResultSet rs = sta.executeQuery("SELECT ID, FIRST_NAME, LAST_NAME, ADDRESS FROM CUSTOMER"); while(rs.next()) { Customer cust = new Customer(); cust.setId(rs.getInt(1)); cust.setFirstName(rs.getString(2)); cust.setLastName(rs.getString(3)); cust.setAddress(rs.getString(4)); list.add(cust); } rs.close(); sta.close(); return list; } } When I press Clt-B to build the project(All), DatabaseCommand.java does not get compiled, no DatabaseCommand.class generated in the build\classes\command\ directory. The syntax highlithed in the CreateOrder.java file indicated that DatabaseCommand is an unknown type, that meant no class found. How can I get around this issue? may be I should ask how to generate an interface dot class file (eg. DatabaseCommand.class in this instance)? Thanks Sam
Can't execute servlet project
HI tere, I have completed a servlet project in Eclipse (3.4). I also made a war.file by seleting the project name (DBTest in this case) and the export command from the Eclipse menu, and export it to the Tomcat 5.5.26 server in linux using manager. However when I click on the project name (/DBTest) in the manager webpage, it shown the following error: = HTTP Status 404 - /DBTest/ type Status report message /DBTest/ description The requested resource (/DBTest/) is not available. Apache Tomcat/5.5.26 = Here is the jsp file in the tomcat server: linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # ls . .. META-INF WEB-INF customers.jsp its content is shown as below: linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # vi customers.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> Customers list Registered Customers: ID First Name Last Name Address Orders <% for(domain.Customer c : customers) { %> <%= c.getId() %> <%= c.getFirstName() %> <%= c.getLastName() %> <%= c.getAddress() %> Orders <% } %> If I execute a more specific url (http://10.1.9.1:8080/DBTest/customers.jsp) from the web browser (firefox), it shows different errors: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Exception in JSP: /customers.jsp:11 8: 9: 10: 11: 12: 13: Registered Customers: 14: Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause javax.servlet.ServletException: bean customers not found within scope org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) org.apache.jsp.customers_jsp._jspService(customers_jsp.java:97) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.lang.InstantiationException: bean customers not found within scope org.apache.jsp.customers_jsp._jspService(customers_jsp.java:55) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. I haven't create any *bean*, but servlet only. How to get fix problem? Your help is much appreciated. Thanks Sam
Re: Re: Can't execute servlet project
Hi, thanks for trying to help. I dont' have a clue on this *bean*. The entire tutorial doesn't mention about how to setup a bean... The tutorial I;ve followed is shown as below: http://java.sys-con.com/node/152270 Thanks Sam > - Original Message - > From: David Smith > Sent: 26/08/08 11:28 pm > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > 1. The 404 error accessing /DbTest/ -- define a welcome file in > DBTest/WEB-INF/web.xml. Online docs at tomcat.apache.org and the > servlet spec will help with this. > > 2. It would appear you need to do some more research on what you want to > do. It looks like you are trying to expose an ArrayList stored in the > request scope, but the jsp can't find it, hence the error. Where is > this object supposed to come from if you didn't create a bean? > > --David > > sam wun wrote: > > HI tere, > > > > I have completed a servlet project in Eclipse (3.4). > > I also made a war.file by seleting the project name (DBTest in this > case) > > and the export command from the Eclipse menu, and export it to the > Tomcat > > 5.5.26 server in linux using manager. > > > > However when I click on the project name (/DBTest) in the manager > webpage, > > it shown the following error: > > = > > HTTP Status 404 - /DBTest/ > > type Status report > > message /DBTest/ > > > > description The requested resource (/DBTest/) is not available. > > Apache Tomcat/5.5.26 > > = > > > > Here is the jsp file in the tomcat server: > > linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # ls > > . .. META-INF WEB-INF customers.jsp > > its content is shown as below: > > > > linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # vi customers.jsp > > <%@ page language="java" contentType="text/html; charset=ISO-8859-1" > > pageEncoding="ISO-8859-1"%> > > > > > > > > > > Customers list > > > > > > > > > scope="request"/> > > > > Registered Customers: > > > > > > ID > > First Name > > Last Name > > Address > > Orders > > > > <% for(domain.Customer c : customers) { %> > > > > <%= c.getId() %> > > <%= c.getFirstName() %> > > <%= c.getLastName() %> > > <%= c.getAddress() %> > > Orders > > <% } %> > > > > > > > > > > > > If I execute a more specific url > > (http://10.1.9.1:8080/DBTest/customers.jsp) from the web browser > (firefox), > > it shows different errors: > > > > HTTP Status 500 - > > > > type Exception report > > > > message > > > > description The server encountered an internal error () that prevented > it > > from fulfilling this request. > > > > exception > > > > org.apache.jasper.JasperException: Exception in JSP: /customers.jsp:11 > > > > 8: > > 9: > > 10: > > 11: type="java.util.ArrayList" > > scope="request"/> > > 12: > > 13: Registered Customers: > > 14: > > > > > > Stacktrace: > > > > > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) > > > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause > > > > javax.servlet.ServletException: bean customers not found within scope > > > > > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) > > > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) > > org.apache.jsp.customers_jsp._jspService(customers_jsp.java:97) > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > > > >
Re: Re: Can't execute servlet project
HI there, It sounds logical, but there is no LIstCustomers in the DBTest folder. Thanks Sam > - Original Message - > From: David Smith > Sent: 27/08/08 09:59 pm > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > I see the jsp is a view and as such wasn't designed to be run on > it's own. Try http://localhost/DBTest/ListCustomers in your browser. > That should hit the servlet which in turn should generate the required > bean and forward the user to your jsp. > > --David > > > sam wun wrote: > > Hi, thanks for trying to help. > > > > I dont' have a clue on this *bean*. > > > > The entire tutorial doesn't mention about how to setup a bean... > > > > > > > > The tutorial I;ve followed is shown as below: > > > > http://java.sys-con.com/node/152270 > > > > > > > > > > > > Thanks > > > > Sam > > > > > > > > > >> - Original Message - > >> From: David Smith > >> Sent: 26/08/08 11:28 pm > >> To: Tomcat Users List > >> Subject: Re: Can't execute servlet project > >> > >> 1. The 404 error accessing /DbTest/ -- define a welcome file in > >> DBTest/WEB-INF/web.xml. Online docs at tomcat.apache.org and the > >> servlet spec will help with this. > >> > >> 2. It would appear you need to do some more research on what you want > to > >> do. It looks like you are trying to expose an ArrayList stored in the > >> request scope, but the jsp can't find it, hence the error. Where is > >> this object supposed to come from if you didn't create a bean? > >> > >> --David > >> > >> sam wun wrote: > >> > >>> HI tere, > >>> > >>> I have completed a servlet project in Eclipse (3.4). > >>> I also made a war.file by seleting the project name (DBTest in this > >>> > >> case) > >> > >>> and the export command from the Eclipse menu, and export it to the > >>> > >> Tomcat > >> > >>> 5.5.26 server in linux using manager. > >>> > >>> However when I click on the project name (/DBTest) in the manager > >>> > >> webpage, > >> > >>> it shown the following error: > >>> = > >>> HTTP Status 404 - /DBTest/ > >>> type Status report > >>> message /DBTest/ > >>> > >>> description The requested resource (/DBTest/) is not available. > >>> Apache Tomcat/5.5.26 > >>> = > >>> > >>> Here is the jsp file in the tomcat server: > >>> linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # ls > >>> . .. META-INF WEB-INF customers.jsp > >>> its content is shown as below: > >>> > >>> linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # vi customers.jsp > >>> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" > >>> pageEncoding="ISO-8859-1"%> > >>> > >>> > >>> > >>> > >> > >>> Customers list > >>> > >>> > >>> > >>> type="java.util.ArrayList" > >>> scope="request"/> > >>> > >>> Registered Customers: > >>> > >>> > >>> ID > >>> First Name > >>> Last Name > >>> Address > >>> Orders > >>> > >>> <% for(domain.Customer c : customers) { %> > >>> > >>> <%= c.getId() %> > >>> <%= c.getFirstName() %> > >>> <%= c.getLastName() %> > >>> <%= c.getAddress() %> > >>> Orders > >>> <% } %> > >>> > >>> > >>> > >>> > >>> > >>> If I execute a more specific url > >>> (http://10.1.9.1:8080/DBTest/customers.jsp) from the web browser > >>> > >> (firefox), > >> > >>> it shows different errors: > >>> > >>> HTTP Status 500 - > >>&g
Re: Re: Can't execute servlet project
I got a similar web.xml, but the is different. Here is the entire content of my web.xml. http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> DBTest Servlet to create customers CreateCustomerServlet CreateCustomerServlet servlet.CreateCustomerServlet CreateCustomerServlet /CreateCustomerServlet index.html index.htm index.jsp default.html default.htm default.jsp DB Connection jdbc/TestDB javax.sql.DataSource Container However, I don't see "CreateCustomerServlet" copied into my DBTest folder in the linux(tomcat) server. Here is the project directory listing of my tomcat server (in linux): linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # ls . .. META-INF WEB-INF customers.jsp Thanks Sam > - Original Message - > From: David Smith > Sent: 27/08/08 11:29 pm > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > But if you followed the tutorial, there should be a servlet mapping in > your web.xml looking like what I copied and pasted from the article > below: > > > Create Customers Servlet > ListCustomers > ListCustomers > servlet.ListCustomersServlet > > > ListCustomers > /ListCustomers > > > This defines a servlet in the element and then defines the > URLs this servlet should service in the element. In > this case there doesn't need to be a physical file named ListCustomers > in the top level of the DbTest webapp. > > Your tutorial was very much geared to showing you how Eclipse works, > more or less assuming you had some familiarity with servlet and/or java > programming. I would recommend finding some tutorial material that > focuses on servlet/jsp programming, ignoring IDEs like Eclipse. > > --David > > sam wun wrote: > > HI there, > > > > > > > > It sounds logical, but there is no LIstCustomers in the DBTest folder. > > > > > > > > Thanks > > > > Sam > > > > > > > > > >> - Original Message - > >> From: David Smith > >> Sent: 27/08/08 09:59 pm > >> To: Tomcat Users List > >> Subject: Re: Can't execute servlet project > >> > >> I see the jsp is a view and as such wasn't designed to be run on > >> it's own. Try http://localhost/DBTest/ListCustomers in your browser. > >> That should hit the servlet which in turn should generate the required > >> bean and forward the user to your jsp. > >> > >> --David > >> > >> > >> sam wun wrote: > >> > >>> Hi, thanks for trying to help. > >>> > >>> I dont' have a clue on this *bean*. > >>> > >>> The entire tutorial doesn't mention about how to setup a bean... > >>> > >>> > >>> > >>> The tutorial I;ve followed is shown as below: > >>> > >>> http://java.sys-con.com/node/152270 > >>> > >>> > >>> > >>> > >>> > >>> Thanks > >>> > >>> Sam > >>> > >>> > >>> > >>> > >>> > > > - > 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: Re: Can't execute servlet project
OK, I followed your instruction to invoke the servlet class file, but I got errors. the url is http://10.1.9.1:8080/DBTest/CreateCustomerServlet Errors are: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Error allocating a servlet instance org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Unknown Source) root cause java.lang.UnsupportedClassVersionError: Bad version number in .class file java.lang.ClassLoader.defineClass1(Native Method) java.lang.ClassLoader.defineClass(Unknown Source) java.security.SecureClassLoader.defineClass(Unknown Source) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1853) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:875) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1330) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1209) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Unknown Source) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. It looks like it invoked the class, but... not sure... Thanks Sam > - Original Message - > From: David Smith > Sent: 28/08/08 12:44 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > Looks normal .. you won't get a file named CreateCustomerServlet under > DbTest. You should get a class named CreateCustomerServlet.class in > WEB-INF/classes/servlet. That class will be called when your webapp > receive's a request for > http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was > installed with listening on port 8080 and it's installed on your local > workstation). That's what the ... > part of web.xml is all about -- mapping URLs to servlets. > > > --David > > sam wun wrote: > > I got a similar web.xml, but the is different. > > > > Here is the entire content of my web.xml. > > > > > > > > > > > xmlns="http://java.sun.com/xml/ns/j2ee"; > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> > > > > DBTest > > > > > > Servlet to create customers > > > > CreateCustomerServlet > > CreateCustomerServlet > > > > servlet.CreateCustomerServlet > > > > > > CreateCustomerServlet > > /CreateCustomerServlet > > > > > > index.html > > index.htm > > index.jsp > > default.html > > default.htm > > default.jsp > > > > > > DB Connection > > jdbc/TestDB > > javax.sql.DataSource > > Container > > > > > > > > > > > > However, I don't see "CreateCustomerServlet" copied into my DBTest > folder > > in the linux(tomcat) server. > > > > Here is the project directory listing of my tomcat server (in linux): > > > > linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # ls >
Re: Re: Can't execute servlet project
HI there, I managed to fix the jdk version error, now it comes with a different error. The url I am trying to put on the firefox browser is http://10.1.9.1:8080/DBTest/CreateCustomerServlet The error is: TTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Cannot create JDBC driver of class '' for connect URL 'null' servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause java.sql.SQLException: No suitable driver java.sql.DriverManager.getDriver(Unknown Source) org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) command.CommandExecutor.getConnection(CommandExecutor.java:54) command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs. > - Original Message - > From: David Smith > Sent: 28/08/08 12:44 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > Looks normal .. you won't get a file named CreateCustomerServlet under > DbTest. You should get a class named CreateCustomerServlet.class in > WEB-INF/classes/servlet. That class will be called when your webapp > receive's a request for > http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was > installed with listening on port 8080 and it's installed on your local > workstation). That's what the ... > part of web.xml is all about -- mapping URLs to servlets. > > > --David > > sam wun wrote: > > I got a similar web.xml, but the is different. > > > > Here is the entire content of my web.xml. > > > > > > > > > > > xmlns="http://java.sun.com/xml/ns/j2ee"; > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> > > > > DBTest > > > > > > Servlet to create customers > > > > CreateCustomerServlet > > CreateCustomerServlet > > > > servlet.CreateCustomerServlet > > > > > > CreateCustomerServlet > > /CreateCustomerServlet > > > > > > index.html > > index.htm > > index.jsp > > default.html > > default.htm > > default.jsp > > > > > > DB Connection > > jdbc/TestDB > > javax.sql.DataSource > > Container > > > > > > > > > > > > However, I don't see "CreateCustomerServlet" copied into my DBTest > folder > > in the linux(tomcat) server. > > > > Here is the project directory listing of my tomcat server (in linux): > > > > linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest # ls > > . .. META-INF WEB-INF customers.jsp > > > > > > > > Thanks > > > > Sam > > > > > > > > > > > > > > > > > >> - Original Message - > >> From: David Smith > >> Sent: 27/08/08 11:29 pm > >> To: Tomcat Users List > >> Subject: Re: Can't execute servlet project > >> > >> But if you followed the tutorial, there should
Re: Re: Re: Can't execute servlet project
BTW, where should I place the web.xml file in the tomcat server? The web (root) execution path of my tomcat server is: /tomcat/apache-tomcat-5.5.26/webapps/DBTest Thanks Sam > - Original Message - > From: sam wun > Sent: 28/08/08 02:45 am > To: Tomcat Users List, Tomcat Users List > Subject: Re: Re: Can't execute servlet project > > HI there, > > > > I managed to fix the jdk version error, now it comes with a different > error. > > The url I am trying to put on the firefox browser is > > http://10.1.9.1:8080/DBTest/CreateCustomerServlet > > > > > > The error is: > > TTP Status 500 - > > type Exception report > > message > > description The server encountered an internal error () that prevented it > from fulfilling this request. > > exception javax.servlet.ServletException: Cannot create JDBC driver of > class '' for connect URL 'null' > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create > JDBC driver of class '' for connect URL 'null' > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) > command.CommandExecutor.getConnection(CommandExecutor.java:54) > command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > root cause java.sql.SQLException: No suitable driver > java.sql.DriverManager.getDriver(Unknown Source) > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) > command.CommandExecutor.getConnection(CommandExecutor.java:54) > command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > note The full stack trace of the root cause is available in the Apache > Tomcat/5.5.26 logs. > > - Original Message - > > From: David Smith > > Sent: 28/08/08 12:44 am > > To: Tomcat Users List > > Subject: Re: Can't execute servlet project > > > > Looks normal .. you won't get a file named CreateCustomerServlet under > > DbTest. You should get a class named CreateCustomerServlet.class in > > WEB-INF/classes/servlet. That class will be called when your webapp > > receive's a request for > > http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat was > > installed with listening on port 8080 and it's installed on your local > > workstation). That's what the ... > > part of web.xml is all about -- mapping URLs to servlets. > > > > > > --David > > > > sam wun wrote: > > > I got a similar web.xml, but the is different. > > > > > > Here is the entire content of my web.xml. > > > > > > > > > > > > > > > > > xmlns="http://java.sun.com/xml/ns/j2ee"; > > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> > > > > > > DBTest > > > > > > > > > Servlet to create customers > > > > > > CreateCustomerServlet > > > CreateCustomerServlet > > > > > > servlet.CreateCustomerServlet > > > > > > > > > CreateCustomerServlet > > > /CreateCustomerServlet > > > > > > > > > index.html > > > index.htm > > > index.jsp > > > default.html > > > default.htm > > > default.jsp > > > > > > > > > DB Connection > > > jdbc/TestDB > > >
Re: Re: Can't execute servlet project
HI there, According to the tomcat online document, do I have to modify the context.xml file? $CATALINA_HOME/conf/context.xml with the following new setup: where username/password is the root/admin user/password of the mysql database? thanks > - Original Message - > From: David Smith > Sent: 28/08/08 03:06 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > The datasource for your webapp isn't setup correctly. Take a look at > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html > for help on how to properly setup a database connection pool. My only > edit that article I would recommend is don't add ?autoReconnect=true to > the end of the mysql database url. Instead, add validationQuery="select > 1" to the element in your context.xml file so > connections are tested and regenerated as needed. > > --David > > sam wun wrote: > > HI there, > > > > > > > > I managed to fix the jdk version error, now it comes with a different > > error. > > > > The url I am trying to put on the firefox browser is > > > > http://10.1.9.1:8080/DBTest/CreateCustomerServlet > > > > > > > > > > > > The error is: > > > > TTP Status 500 - > > > > type Exception report > > > > message > > > > description The server encountered an internal error () that prevented > it > > from fulfilling this request. > > > > exception javax.servlet.ServletException: Cannot create JDBC driver of > > class '' for connect URL 'null' > > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot > create > > JDBC driver of class '' for connect URL 'null' > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) > > command.CommandExecutor.getConnection(CommandExecutor.java:54) > > > command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) > > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause java.sql.SQLException: No suitable driver > > java.sql.DriverManager.getDriver(Unknown Source) > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) > > command.CommandExecutor.getConnection(CommandExecutor.java:54) > > > command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) > > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > note The full stack trace of the root cause is available in the Apache > > Tomcat/5.5.26 logs. > > > >> - Original Message - > >> From: David Smith > >> Sent: 28/08/08 12:44 am > >> To: Tomcat Users List > >> Subject: Re: Can't execute servlet project > >> > >> Looks normal .. you won't get a file named CreateCustomerServlet under > >> DbTest. You should get a class named CreateCustomerServlet.class in > >> WEB-INF/classes/servlet. That class will be called when your webapp > >> receive's a request for > >> http://localhost:8080/DbTest/CreateCustomerServlet (assuming tomcat > was > >> installed with listening on port 8080 and it's installed on your local > >> workstation). That's what the ... > > >> part of web.xml is all about -- mapping URLs to servlets. > >> > >> > >> --David > >> > >> sam wun wrote: > >> > >>> I got a similar web.xml, but the is different. > >>> > >>> Here is the entire content of my web.xml. > >>> > >>> > >>> > >>> > >>> >>> xmlns="http://java.sun.com/xml/ns/j2ee"; >
Re: Can't execute servlet project
Do I need to put mysql driver in the common/lib/ directory in linux? Currently this tomcat server (in linux) has the following jar flies in the common/lib/ folder: linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls . commons-el.jar jasper-compiler.jar jsp-api.jar naming-factory.jar servlet-api.jar .. jasper-compiler-jdt.jar jasper-runtime.jar naming-factory-dbcp.jar naming-resources.jar If I need to have that, where can I download it? Thanks > - Original Message - > From: sam wun > Sent: 28/08/08 04:44 pm > To: Tomcat Users List > Subject: Re: Re: Can't execute servlet project > > HI there, > > > > According to the tomcat online document, do I have to modify the > context.xml file? > > $CATALINA_HOME/conf/context.xml > > > > with the following new setup: auth="Container" > type="javax.sql.DataSource" >maxActive="100" maxIdle="30" maxWait="1" >username="javauser" password="javadude" > driverClassName="com.mysql.jdbc.Driver" > > url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/> > > > > where username/password is the root/admin user/password of the mysql > database? > > > > thanks > > > > > > > - Original Message - > > From: David Smith > > Sent: 28/08/08 03:06 am > > To: Tomcat Users List > > Subject: Re: Can't execute servlet project > > > > The datasource for your webapp isn't setup correctly. Take a look at > > > > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html > > for help on how to properly setup a database connection pool. My only > > edit that article I would recommend is don't add ?autoReconnect=true to > > the end of the mysql database url. Instead, add > validationQuery="select > > 1" to the element in your context.xml file so > > connections are tested and regenerated as needed. > > > > --David > > > > sam wun wrote: > > > HI there, > > > > > > > > > > > > I managed to fix the jdk version error, now it comes with a different > > > error. > > > > > > The url I am trying to put on the firefox browser is > > > > > > http://10.1.9.1:8080/DBTest/CreateCustomerServlet > > > > > > > > > > > > > > > > > > The error is: > > > > > > TTP Status 500 - > > > > > > type Exception report > > > > > > message > > > > > > description The server encountered an internal error () that > prevented > > it > > > from fulfilling this request. > > > > > > exception javax.servlet.ServletException: Cannot create JDBC driver > of > > > class '' for connect URL 'null' > > > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > > root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot > > create > > > JDBC driver of class '' for connect URL 'null' > > > > > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) > > > > > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) > > > command.CommandExecutor.getConnection(CommandExecutor.java:54) > > > > > command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) > > > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:33) > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > > root cause java.sql.SQLException: No suitable driver > > > java.sql.DriverManager.getDriver(Unknown Source) > > > > > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143) > > > > > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) > > > command.CommandExecutor.getConnection(CommandExecutor.java:54) > > > > > command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) > > > servlet.CreateCustomerSe
Re: Re: Can't execute servlet project
Hi, I couldn't find an installation document about installing the driver. I;ve downloaded the driver: linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls mysql-connector-java-5.1.3-rc-bin.jar mysql-connector-java-5.1.3-rc-bin.jar Do you know how to configure tomcat to make use of it? Thanks Sam > - Original Message - > From: Pid > Sent: 28/08/08 06:47 pm > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > sam wun wrote: > > Do I need to put mysql driver in the common/lib/ directory in linux? > > Yes, that's a basic requirement. > > > If I need to have that, where can I download it? > > The MySQL site - you could probably have guessed that. > > http://dev.mysql.com/usingmysql/java/ > > > > Thanks > > > > > > > >> - Original Message - > >> From: sam wun > >> Sent: 28/08/08 04:44 pm > >> To: Tomcat Users List > >> Subject: Re: Re: Can't execute servlet project > >> > >> HI there, > >> > >> > >> > >> According to the tomcat online document, do I have to modify the > >> context.xml file? > >> > >> $CATALINA_HOME/conf/context.xml > >> > >> > >> > >> with the following new setup: >> auth="Container" > >> type="javax.sql.DataSource" > >>maxActive="100" maxIdle="30" maxWait="1" > >>username="javauser" password="javadude" > >> driverClassName="com.mysql.jdbc.Driver" > >> > >> url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/> > >> > >> > >> > >> where username/password is the root/admin user/password of the mysql > >> database? > >> > >> > >> > >> thanks > >> > >> > >> > >> > >> > >>> - Original Message - > >>> From: David Smith > >>> Sent: 28/08/08 03:06 am > >>> To: Tomcat Users List > >>> Subject: Re: Can't execute servlet project > >>> > >>> The datasource for your webapp isn't setup correctly. Take a look at > >>> > >>> > >> > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html > >>> for help on how to properly setup a database connection pool. My > only > >>> edit that article I would recommend is don't add ?autoReconnect=true > to > >>> the end of the mysql database url. Instead, add > >> validationQuery="select > >>> 1" to the element in your context.xml file so > >>> connections are tested and regenerated as needed. > >>> > >>> --David > >>> > >>> sam wun wrote: > >>>> HI there, > >>>> > >>>> > >>>> > >>>> I managed to fix the jdk version error, now it comes with a > different > >>>> error. > >>>> > >>>> The url I am trying to put on the firefox browser is > >>>> > >>>> http://10.1.9.1:8080/DBTest/CreateCustomerServlet > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> The error is: > >>>> > >>>> TTP Status 500 - > >>>> > >>>> type Exception report > >>>> > >>>> message > >>>> > >>>> description The server encountered an internal error () that > >> prevented > >>> it > >>>> from fulfilling this request. > >>>> > >>>> exception javax.servlet.ServletException: Cannot create JDBC driver > >> of > >>>> class '' for connect URL 'null' > >>>> servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) > >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > >>>> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > >>>> > >>>> root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot > >>> create > >>>> JDBC driver of class '' for connect URL 'null' > >>>> > >>>> > >> > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) > >>>>
Why GlassFish
Hi, Just a quick question, I found that Tomcat is quite capable with servlet application, but lack of EJB support. Is GlassFish designed to fill the gaps to support EJB application only? Thanks
Monitor contanier
Hi there, What can I use to monitor tomcat container? Thanks
Re: Can't execute servlet project
Hi, I have added testdb.jsp in the following path in Suse linux (the tomcat server): /tomcat/apache-tomcat-5.5.26/webapps/DBTest/ The content of the testdb.jsp code is: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> select FIRST_NAME from DBTest.Customer DB Test Results Foo ${row.foo} Bar ${row.bar} when I execute url 10.1.9.1:8080/testdb.jsp in firefox web browser, it shown the following error: HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:317) org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:148) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557) org.apache.jasper.compiler.Parser.parse(Parser.java:127) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156) org.apache.jasper.compiler.Compiler.compile(Compiler.java:296) org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) Here is the web.xml file I got: (in the path /tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/) http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> DBTest Create customer servlet CreateCustomerServlet CreateCustomerServlet servlet.CreateCustomerServlet CreateCustomerServlet /CreateCustomerServlet index.html index.htm index.jsp default.html default.htm default.jsp DB Connection jdbc/TestDB javax.sql.DataSource Container Thanks Sam javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > - Original Message - > From: Martin Gainty > Sent: 28/08/08 10:07 pm > To: [EMAIL PROTECTED] > Subject: RE: Can't execute servlet project > > david's advice is correct.. > > configure ./META-INF/ApplicationContext.xml > debug="5" reloadable="true" crossContext="true"> > > > > > > > > > > > > > >type="javax.sql.DataSource" >maxActive="100" maxIdle="30" maxWait="1" >username="javauser" password="javadude" > driverClassName="com.mysql.jdbc.Driver" > > url="jdbc:mysql://localhost:3306/javatest?autoReconnect=true"/> > > > //sub in the username and password for the DB > also in /WEB-INF/web.xml you would need this entry > http://java.sun.com/xml/ns/j2ee"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; > version="2.4"> > MySQL Test App > > DB Connection > jdbc/TestDB > javax.sql.DataSource > Co
Re: Re: Can't execute servlet project
Hi there, I have followed the tutorial about how to setup db connection (with mysql). But still giving me the followoing errors: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed with this application org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:317) org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:148) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557) org.apache.jasper.compiler.Parser.parse(Parser.java:127) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156) org.apache.jasper.compiler.Compiler.compile(Compiler.java:296) org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) I feel a bit confused about where to put the web.xml file and context.xml file. Here I assumed create the context.xml file in /tomcat/apache-tomcat-5.5.26/webapps/DBTest/META-INF and web.xml in /tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF and mysql-connector-java is in the following path: linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/lib # ls . .. mysql-connector-java-5.1.3-rc-bin.jar What is missing and where I incorrectly setup the file? Your suggestion is highly appreciated. Thanks > - Original Message - > From: David Smith > Sent: 28/08/08 03:06 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > The datasource for your webapp isn't setup correctly. Take a look at > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html > for help on how to properly setup a database connection pool. My only > edit that article I would recommend is don't add ?autoReconnect=true to > the end of the mysql database url. Instead, add validationQuery="select > 1" to the element in your context.xml file so > connections are tested and regenerated as needed. > > --David > > sam wun wrote: > > HI there, > > > > > > > > I managed to fix the jdk version error, now it comes with a different > > error. > > > > The url I am trying to put on the firefox browser is > > > > http://10.1.9.1:8080/DBTest/CreateCustomerServlet > > > > > > > > > > > > The error is: > > > > TTP Status 500 - > > > > type Exception report > > > > message > > > > description The server encountered an internal error () that prevented > it > > from fulfilling this request. > > > > exception javax.servlet.ServletException: Cannot create JDBC driver of > > class '' for connect URL 'null' > > servlet.CreateCustomerServlet.doGet(CreateCustomerServlet.java:38) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:690) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot > create > > JDBC driver of class '' for connect URL 'null' > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) > > > > > org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) > > command.CommandExecutor.getConnection(CommandExecutor.java:54) > > > command.CommandExecutor.executeDatabaseCommand(CommandExecutor.java:38) > > servlet.CreateCustomerServlet.doGet(CreateCus
Re: Re: Can't execute servlet project
Hi David, No, I don't have this 2 jar files in the common/lib/ directory. where can I download it from? Thanks Sam > - Original Message - > From: David Smith > Sent: 02/09/08 10:39 pm > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > Do you have jstl.jar and standard.jar in your WEB-INF/lib directory? > > --David > > sam wun wrote: > > Hi, > > > > > > > > I have added testdb.jsp in the following path in Suse linux (the tomcat > > server): > > > > /tomcat/apache-tomcat-5.5.26/webapps/DBTest/ > > > > > > > > The content of the testdb.jsp code is: > > > > > > > > <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> > > <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > > > > > > select FIRST_NAME from DBTest.Customer > > > > > > > > > > DB Test > > > > > > > > Results > > > > > > Foo ${row.foo} > > Bar ${row.bar} > > > > > > > > > > > > > > > > when I execute url 10.1.9.1:8080/testdb.jsp in firefox web browser, it > > shown the following error: > > > > HTTP Status 500 - > > > > type Exception report > > > > message > > > > description The server encountered an internal error () that prevented > it > > from fulfilling this request. > > > > exception org.apache.jasper.JasperException: The absolute uri: > > http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml > or > > the jar files deployed with this application > > > > > org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) > > > > > org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) > > > > > org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) > > > > > org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:317) > > > > > org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:148) > > > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424) > > org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493) > > org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557) > > org.apache.jasper.compiler.Parser.parse(Parser.java:127) > > > > > org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212) > > > > > org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) > > org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156) > > org.apache.jasper.compiler.Compiler.compile(Compiler.java:296) > > org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) > > org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) > > > > > org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > > > Here is the web.xml file I got: > > > > (in the path /tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/) > > > > > > > > > > > xmlns="http://java.sun.com/xml/ns/j2ee"; > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> > > > > DBTest > > > > > > Create customer servlet > > > > CreateCustomerServlet > > > > CreateCustomerServlet > > > > > > servlet.CreateCustomerServlet > > > > > > > > CreateCustomerServlet > > > > /CreateCustomerServlet > > > > > > index.html > > index.htm > > index.jsp > > default.html > > default.htm > > default.jsp > > > >
Re: Re: Can't execute servlet project
I just went to the website , very confused. The taglib file is not a jar file. they are binary or source file. And I couldn't find standard.jar file either. Thanks > - Original Message - > From: David Smith > Sent: 02/09/08 11:44 pm > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > Hmmm... good question. I moved over to Maven and don't manually > download these any more. This looks like it should do the trick: > > Try > http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi > > --David > > sam wun wrote: > > Hi David, > > > > > > > > No, I don't have this 2 jar files in the common/lib/ directory. > > > > where can I download it from? > > > > > > > > Thanks > > > > Sam > > > > > > > > > > > >> - Original Message - > >> From: David Smith > >> Sent: 02/09/08 10:39 pm > >> To: Tomcat Users List > >> Subject: Re: Can't execute servlet project > >> > >> Do you have jstl.jar and standard.jar in your WEB-INF/lib directory? > >> > >> --David > >> > >> sam wun wrote: > >> > >>> Hi, > >>> > >>> > >>> > >>> I have added testdb.jsp in the following path in Suse linux (the > tomcat > >>> server): > >>> > >>> /tomcat/apache-tomcat-5.5.26/webapps/DBTest/ > >>> > >>> > >>> > >>> The content of the testdb.jsp code is: > >>> > >>> > >>> > >>> <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> > >>> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > >>> > >>> > >>> select FIRST_NAME from DBTest.Customer > >>> > >>> > >>> > >>> > >>> DB Test > >>> > >>> > >>> > >>> Results > >>> > >>> > >>> Foo ${row.foo} > >>> Bar ${row.bar} > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> when I execute url 10.1.9.1:8080/testdb.jsp in firefox web browser, > it > >>> shown the following error: > >>> > >>> HTTP Status 500 - > >>> > >>> type Exception report > >>> > >>> message > >>> > >>> description The server encountered an internal error () that > prevented > >>> > >> it > >> > >>> from fulfilling this request. > >>> > >>> exception org.apache.jasper.JasperException: The absolute uri: > >>> http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml > >>> > >> or > >> > >>> the jar files deployed with this application > >>> > >>> > >>> > >> > org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) > >> > >>> > >>> > >>> > >> > org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) > >> > >>> > >>> > >>> > >> > org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) > >> > >>> > >>> > >>> > >> > org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:317) > >> > >>> > >>> > >>> > >> > org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:148) > >> > >>> > >>> > >> > org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424) > >> > >>> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493) > >>> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557) > >>> org.apache.jasper.compiler.Parser.parse(Parser.java:127) > >>> > >>> > >>> > >> > org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212) > >> > >>> > >>> > >>>
Re: Re: Can't execute servlet project
Thanks David, After copied the jstl and standard dot jar files into the directory: linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/lib # ls . .. jstl.jar mysql-connector-java-5.1.3-rc-bin.jar standard.jar I got the following different errors: (In line 4, what is jdbc/TestDB? I have database called javatest, and table testdata. Should I rename it to jdbc/javatest? HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Exception in JSP: /testdb.jsp:4 1: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> 2: <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> 3: 4: 5: select id, foo, bar from testdata 6: 7: Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276) org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159) org.apache.jsp.testdb_jsp._jspx_meth_sql_005fquery_005f0(testdb_jsp.java:101) org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:58) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > - Original Message - > From: David Smith > Sent: 03/09/08 01:23 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > Download the binary zip file and expand it. Within it is a lib > directory with just standard.jar and jstl.jar. > > --David > > sam wun wrote: > > I just went to the website , very confused. > > > > The taglib file is not a jar file. they are binary or source file. > > > > And I couldn't find standard.jar file either. > > > > > > > > Thanks > > > > > > > > > >> - Original Message - > >> From: David Smith > >> Sent: 02/09/08 11:44 pm > >> To: Tomcat Users List > >> Subject: Re: Can't execute servlet project > >> > >> Hmmm... good question. I moved over to Maven and don't manually > >> download these any more. This looks like it should do the trick: > >> > >> Try > >> > http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi > >> > >> --David > >> > >> sam wun wrote: > >> > >>> Hi David, > >>> > >>> > >>> > >>> No, I don't have this 2 jar files in the common/lib/ directory. > >>> > >>> where can I download it from? > >>> > >>> > >>> > >>> Thanks > >>> > >>> Sam > >>> > >>> > >>>
Re: Can't execute servlet project
The URL I put in the firefox browser is: 10.1.9.1:8080/DBtest/testdb.jsp Here is the /tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/web.xml file: http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";> DBTest Create customer servlet CreateCustomerServlet CreateCustomerServlet servlet.CreateCustomerServlet CreateCustomerServlet /CreateCustomerServlet index.html index.htm index.jsp default.html default.htm default.jsp DB Connection jdbc/TestDB javax.sql.DataSource Container > - Original Message - > From: sam wun > Sent: 03/09/08 01:41 am > To: Tomcat Users List > Subject: Re: Re: Can't execute servlet project > > Thanks David, > > > > After copied the jstl and standard dot jar files into the directory: > > linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/lib # ls > . .. jstl.jar mysql-connector-java-5.1.3-rc-bin.jar standard.jar > > > > I got the following different errors: > > (In line 4, what is jdbc/TestDB? I have database called javatest, and > table > testdata. Should I rename it to jdbc/javatest? > > > > > > HTTP Status 500 - > > type Exception report > > message > > description The server encountered an internal error () that prevented it > from fulfilling this request. > > exception org.apache.jasper.JasperException: Exception in JSP: > /testdb.jsp:4 > > 1: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> > 2: <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > 3: > 4: > 5: select id, foo, bar from testdata > 6: > 7: > > > Stacktrace: > > > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451) > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > root cause javax.servlet.ServletException: Unable to get connection, > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > create JDBC driver of class '' for connect URL 'null'" > > > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82) > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > root cause javax.servlet.jsp.JspException: Unable to get connection, > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > create JDBC driver of class '' for connect URL 'null'" > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276) > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159) > > > org.apache.jsp.testdb_jsp._jspx_meth_sql_005fquery_005f0(testdb_jsp.java:101) > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:58) > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) &
Re: Re: Can't execute servlet project
This is the only context.xml file I got in the tomcat (5.5.26) directory: /tomcat/apache-tomcat-5.5.26/conf/context.xml: WEB-INF/web.xml > - Original Message - > From: David Smith > Sent: 03/09/08 01:49 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot create JDBC driver of class '' for connect URL 'null'" > > This error typically indicates the JNDI db pool hasn't been setup > correctly. Some config option isn't setup. What's in this webapp's > context xml file? Also what's in it's WEB-INF/web.xml? Lastly, you > should have your database driver jar file in tomcat's common/lib (for > tomcat v 5.5) or /lib (tomcat v 6). > > You can also take a look at tomcat's JDBC Datasource howto's on the > tomcat website for your version of tomcat which offer a lot of help. > > --David > > sam wun wrote: > > Thanks David, > > > > > > > > After copied the jstl and standard dot jar files into the directory: > > > > linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/lib # ls > > . .. jstl.jar mysql-connector-java-5.1.3-rc-bin.jar standard.jar > > > > > > > > I got the following different errors: > > > > (In line 4, what is jdbc/TestDB? I have database called javatest, and > table > > testdata. Should I rename it to jdbc/javatest? > > > > > > > > > > > > HTTP Status 500 - > > > > type Exception report > > > > message > > > > description The server encountered an internal error () that prevented > it > > from fulfilling this request. > > > > exception org.apache.jasper.JasperException: Exception in JSP: > > /testdb.jsp:4 > > > > 1: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> > > 2: <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > > 3: > > 4: > > 5: select id, foo, bar from testdata > > 6: > > 7: > > > > > > Stacktrace: > > > > > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause javax.servlet.ServletException: Unable to get connection, > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > > create JDBC driver of class '' for connect URL 'null'" > > > > > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) > > > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) > > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82) > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause javax.servlet.jsp.JspException: Unable to get connection, > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > > create JDBC driver of class '' for connect URL 'null'" > > > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276) > > > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159) > > > > > org.apache.jsp.testdb_jsp._jspx_meth_sql_005fquery_005f0(testdb_jsp.java:101) > > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:58) > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > &g
Re: Re: Can't execute servlet project
Here is the mysql-connector jar file I got in the common/lib directory: linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls mysql* mysql-connector-java-5.1.3-rc-bin.jar Is thsi the correct mysql jar file? Thanks Sam > - Original Message - > From: David Smith > Sent: 03/09/08 01:49 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot create JDBC driver of class '' for connect URL 'null'" > > This error typically indicates the JNDI db pool hasn't been setup > correctly. Some config option isn't setup. What's in this webapp's > context xml file? Also what's in it's WEB-INF/web.xml? Lastly, you > should have your database driver jar file in tomcat's common/lib (for > tomcat v 5.5) or /lib (tomcat v 6). > > You can also take a look at tomcat's JDBC Datasource howto's on the > tomcat website for your version of tomcat which offer a lot of help. > > --David > > sam wun wrote: > > Thanks David, > > > > > > > > After copied the jstl and standard dot jar files into the directory: > > > > linux:~/tomcat/apache-tomcat-5.5.26/webapps/DBTest/WEB-INF/lib # ls > > . .. jstl.jar mysql-connector-java-5.1.3-rc-bin.jar standard.jar > > > > > > > > I got the following different errors: > > > > (In line 4, what is jdbc/TestDB? I have database called javatest, and > table > > testdata. Should I rename it to jdbc/javatest? > > > > > > > > > > > > HTTP Status 500 - > > > > type Exception report > > > > message > > > > description The server encountered an internal error () that prevented > it > > from fulfilling this request. > > > > exception org.apache.jasper.JasperException: Exception in JSP: > > /testdb.jsp:4 > > > > 1: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> > > 2: <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > > 3: > > 4: > > 5: select id, foo, bar from testdata > > 6: > > 7: > > > > > > Stacktrace: > > > > > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause javax.servlet.ServletException: Unable to get connection, > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > > create JDBC driver of class '' for connect URL 'null'" > > > > > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) > > > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) > > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82) > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause javax.servlet.jsp.JspException: Unable to get connection, > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > > create JDBC driver of class '' for connect URL 'null'" > > > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276) > > > > > org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159) > > > > > org.apache.jsp.testdb_jsp._jspx_meth_sql_005fquery_005f0(testdb_jsp.java:101) > > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:58) > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > org.apache.jasper.servlet.Jsp
Re: Re: Can't execute servlet project
After moved the context.xml file to /tomcat/apache-tomcat-5.5.26/conf/Catalina/localhost/ with the content changed to: WEB-INF/web.xml (I have the exact db, table and username/password created like this). And I have removed the context.xml file in webapps/DBTest/WEB-INF/lib/ My testdb.jsp in /tomcat/apache-tomcat-5.5.26/webapps/DBTest looks is shown below: <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> select id, foo, bar from testdata DB Test Results Foo ${row.foo} Bar ${row.bar} Then shudown and restarted tomcat server. I m still getting the DataSource Invalid errors: HTTP Status 500 - 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 get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) root cause javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'" org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) ... javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > - Original Message - > From: David Smith > Sent: 03/09/08 03:06 am > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > > > > Here is the mysql-connector jar file I got in the common/lib directory: > > > > linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls mysql* > > mysql-connector-java-5.1.3-rc-bin.jar > > > > > > > > Is thsi the correct mysql jar file? > > > Yes ... looks good. Just be sure this is the only place you have a > mysql JDBC driver installed. There should not be one in > webapps/DBTest/WEB-INF/lib if it exists here. > > > This is the only context.xml file I got in the tomcat (5.5.26) > directory: > > > > /tomcat/apache-tomcat-5.5.26/conf/context.xml: ... > That is the universal one. The context xml file should be either in > your webapp's META-INF folder named context.xml or in tomcat's > conf/Catalina/localhost named DBTest.xml. It only contains a ... > xml element and it's contents. Something like: > > > type="javax.sql.DataSource" >maxActive="100" maxIdle="30" maxWait="1" >username="javauser" password="javadude" > driverClassName="com.mysql.jdbc.Driver" >url="jdbc:mysql://localhost:3306/javatest" > validationQuery="select 1" /> > > > Obviously replace the username, password, and URL with what's > appropriate to your database environment. > > You can read more on this at > > http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html > > --David > > sam wun wrote: > > Here is the mysql-connector jar file I got in the common/lib directory: > > > > linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls mysql* > > mysql-connector-java-5.1.3-rc-bin.jar > > > > > > > > Is thsi the correct mysql jar file? > > > > > > > > Thanks > > > > Sam > > > > > > > > > > > > > >> - Original Message - > >> From: David Smith > >> Sent: 03/09/08 01:49 am > >> To: Tomcat Users List > >> Subject:
Re: Re: Re: Can't execute servlet project
I found there are some xml file in the conf/ directory: linux:~/tomcat/apache-tomcat-5.5.26/conf # ls . Catalina catalina.policy logging.properties server.xml web.xml .. DBTest.xml catalina.properties server-minimal.xml tomcat-users.xml linux:~/tomcat/apache-tomcat-5.5.26/conf # do I need to remove DBTest.xml and web.xml here? Thanks Sam > - Original Message - > From: sam wun > Sent: 03/09/08 11:13 am > To: Tomcat Users List > Subject: Re: Re: Can't execute servlet project > > After moved the context.xml file to > /tomcat/apache-tomcat-5.5.26/conf/Catalina/localhost/ > > with the content changed to: > > > > > WEB-INF/web.xml > > > > type="javax.sql.DataSource" > maxActive="100" maxIdle="30" maxWait="1" > username="javauser" password="javadude" > driverClassName="com.mysql.jdbc.Driver" > url="jdbc:mysql://localhost:3306/javatest" > validationQuery="select 1" /> > > (I have the exact db, table and username/password created like this). > > And I have removed the context.xml file in webapps/DBTest/WEB-INF/lib/ > > My testdb.jsp in /tomcat/apache-tomcat-5.5.26/webapps/DBTest looks is > shown > below: > > <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> > <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > > > select id, foo, bar from testdata > > > > > DB Test > > > > Results > > > Foo ${row.foo} > Bar ${row.bar} > > > > > > > > Then shudown and restarted tomcat server. > > > I m still getting the DataSource Invalid errors: > > > > HTTP Status 500 - > > 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 get connection, > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > create JDBC driver of class '' for connect URL 'null'" > > > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460) > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > root cause javax.servlet.ServletException: Unable to get connection, > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > create JDBC driver of class '' for connect URL 'null'" > > > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82) > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > ... > > > > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > - Original Message - > > From: David Smith > > Sent: 03/09/08 03:06 am > > To: Tomcat Users List > > Subject: Re: Can't execute servlet project > > > > > > > > Here is the mysql-connector jar file I got in the common/lib > directory: > > > > > > linux:~/tomcat/apache-tomcat-5.5.26/common/lib # ls mysql* > > > mysql-connector-java-5.1.3-rc-bin.jar > > > > > > > > > > > > Is thsi the correct mysql jar file? > > > > > Yes ... looks good. Just be sure this is the only place you have a > > mysql JDBC driver installed. There should not be one in > > webapps/DBTest/WEB-INF/lib if it exists here. > > > > > This is the only context.xml file I got in the tomcat (5.5.26) > > directory: > > > > > > /tomcat/apache-tomcat-5.5.26/conf/context.xml: ... > > That is the universal one. The context xml file sho
Re: Re: Can't execute servlet project - it works now
After this final changed (renamed the context.xml file to DBTest.xml), it works fine now. Thank you very much for the help along the way. Without your patient and effort, I wouldn't be able to get this going. Thanks Sam > - Original Message - > From: David Smith > Sent: 03/09/08 12:35 pm > To: Tomcat Users List > Subject: Re: Can't execute servlet project > > If the context xml file is in > /tomcat/apache-tomcat-5.5.26/conf/Catalina/localhost, it should be named > after your webapp (e.g.: DBTest.xml). It's only named context.xml when > in your webapp's META-INF folder. > > --David > > sam wun wrote: > > After moved the context.xml file to > > /tomcat/apache-tomcat-5.5.26/conf/Catalina/localhost/ > > > > with the content changed to: > > > > > > > > > > WEB-INF/web.xml > > > > > > > > > type="javax.sql.DataSource" > >maxActive="100" maxIdle="30" maxWait="1" > >username="javauser" password="javadude" > > driverClassName="com.mysql.jdbc.Driver" > >url="jdbc:mysql://localhost:3306/javatest" > > validationQuery="select 1" /> > > > > (I have the exact db, table and username/password created like this). > > > > And I have removed the context.xml file in webapps/DBTest/WEB-INF/lib/ > > > > My testdb.jsp in /tomcat/apache-tomcat-5.5.26/webapps/DBTest looks is > shown > > below: > > > > <%@ taglib uri="http://java.sun.com/jsp/jstl/sql"; prefix="sql" %> > > <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %> > > > > > > select id, foo, bar from testdata > > > > > > > > > > DB Test > > > > > > > > Results > > > > > > Foo ${row.foo} > > Bar ${row.bar} > > > > > > > > > > > > > > > > Then shudown and restarted tomcat server. > > > > > > I m still getting the DataSource Invalid errors: > > > > > > > > HTTP Status 500 - > > > > 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 get connection, > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > > create JDBC driver of class '' for connect URL 'null'" > > > > > org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > root cause javax.servlet.ServletException: Unable to get connection, > > DataSource invalid: "org.apache.tomcat.dbcp.dbcp.SQLNestedException: > Cannot > > create JDBC driver of class '' for connect URL 'null'" > > > > > org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841) > > > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774) > > org.apache.jsp.testdb_jsp._jspService(testdb_jsp.java:82) > > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) > > > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > > > > ... > > > > > > > > > > > > javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > > > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >
Good JSP editor
Hi there, I know it is better for me to ask this quetion in a jsp forum, but I couldn't find one for mailing list . And you guys are very helpful too in terms of this experience. If you are using a good jsp editor, can you tell me where its download link? My current development enviornment is Eclipse 3.4 and Tomcat 5.5.26 Thanks
Re: Exchange Language
Can this witty exchange continue in private email? - Original Message - From: "Jacob Rhoden" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Thursday, June 21, 2007 12:27 AM Subject: Re: Exchange Language > Oops, I did not mean to send this to the mailing list. Sorry. We should > take the conversation off the tomcat mailing list. > > _ > Jacobs Blog -- http://www.jacobrhoden.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]
Exception Thrown in a JSP
I am trying to figure out how to debug the following exception that's thrown in one of my jsps. The line number from the exception trace is 259. If this is a line number from the underlying jsp then the line is: <%@ include file="inc/footer.jsp" %> this is also the last line in the jsp. If, on the, other hand the line is from the resulting servlet code the line is: out.write("channel =\"460022903\";\n"); This also makes no sense. Here's the complete stack trace: java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:427) at org.apache.jsp.commentList_jsp._jspService(org.apache.jsp.commentList_jsp:259) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:307) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
APR Library with JBoss/Tomcat
I notice my new version of JBoss (4.2.1GA) gives the following message in the server logs: 2007-08-05 15:41:32,650 INFO [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: ../lib I wen't to the Apche APR site (a more cryptic site is hard to imagine. :):)) And downloaded the source code for Windows. I build the apr library using Visual C++ now my question is where does the static library go? Does Tomcat have to be built using this library or can it be dropped in the Java library path has the message above says. The APR site is silent about how to actually deploy this library. Thanks for any 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: APR Library with JBoss/Tomcat
I saw all that but again it doesn't say where those dlls get deployed...? I was able to build everything myself from the source code that the APR project provides but there's no document that talks about deployment. If you can point me towards a link that talks about the deployment I would be grateful. - Original Message - From: "Len Popp" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Sunday, August 05, 2007 4:51 PM Subject: Re: APR Library with JBoss/Tomcat > As the log message says, what you need is the Apache Tomcat Native > library. (The APR is one part of that.) > The Tomcat docs have a page about this - for example, > http://tomcat.apache.org/tomcat-5.5-doc/apr.html for version 5.5. > That page points to a download page that has both source and compiled > binaries for Windows: http://tomcat.heanet.ie/native/ > -- > Len > > On 8/5/07, Sam Klin <[EMAIL PROTECTED]> wrote: > > I notice my new version of JBoss (4.2.1GA) gives the following message in > > the server logs: > > > > 2007-08-05 15:41:32,650 INFO > > [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native > > library which allows optimal performance in production environments was not > > found on the java.library.path: ../lib > > > > I wen't to the Apche APR site (a more cryptic site is hard to imagine. :):)) > > And downloaded the source code for Windows. I build the apr library using > > Visual C++ now my question is where does the static library go? Does Tomcat > > have to be built using this library or can it be dropped in the Java library > > path has the message above says. The APR site is silent about how to > > actually deploy this library. > > > > Thanks for any 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] > > > > > > ----- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - Original Message - From: "Sam Klin" <[EMAIL PROTECTED]> To: "Tomcat Users List" Sent: Sunday, August 05, 2007 4:27 PM Subject: APR Library with JBoss/Tomcat > I notice my new version of JBoss (4.2.1GA) gives the following message in > the server logs: > > 2007-08-05 15:41:32,650 INFO > [org.apache.catalina.core.AprLifecycleListener] The Apache Tomcat Native > library which allows optimal performance in production environments was not > found on the java.library.path: ../lib > > I wen't to the Apche APR site (a more cryptic site is hard to imagine. :):)) > And downloaded the source code for Windows. I build the apr library using > Visual C++ now my question is where does the static library go? Does Tomcat > have to be built using this library or can it be dropped in the Java library > path has the message above says. The APR site is silent about how to > actually deploy this library. > > Thanks for any 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] > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
grant codeBase not working for my jar
Hello all, I have a Servlet running on tomcat-5.5.20, Ubuntu Feisty Fawn, which is accessing some hardware through a shell script. The following provides adequate permissions for everything to work grant { permission java.io.FilePermission "/bin/sh", "execute"; permission java.io.FilePermission "/tmp/thinktank-scanner.bmp", "read,delete"; }; However, you may notice that the "grant" provides this level of access to *all* Servlets and JSPs. I'd like to restrict the permissions to just my Servlet. My application is mounted on /scanner and the servlet is mounted on / scanner/scanner, the only jar file in the application is located at /var/lib/tomcat5.5/webapps/scanner/WEB-INF/lib/scanner.jar As far as I understand it, if I change my permissions to grant codeBase "jar:file:${catalina.home}/webapps/scanner/WEB-INF/lib/ scanner.jar!/-" { permission java.io.FilePermission "/bin/sh", "execute"; permission java.io.FilePermission "/tmp/thinktank-scanner.bmp", "read,delete"; }; then everything should work... but it doesn't. Instead I don't get any permissions in my Servlet to do what I need to do. Does anyone have any ideas? -- Sam http://fommil.me.uk http://javablog.co.uk - 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: grant codeBase not working for my jar
Hello Mark, That doesn't give me any additional input... I already know which permissions I need, I just want to restrict them to the one Servlet. If you really want to know the exception, I'll print it here but I don't think it's relevant... Caused by: java.security.AccessControlException: access denied (java.io.FilePermission /bin/sh execute) at java.security.AccessControlContext.checkPermission (AccessControlContext.java:323) at java.security.AccessController.checkPermission (AccessController.java:546) at java.lang.SecurityManager.checkPermission (SecurityManager.java:532) at java.lang.SecurityManager.checkExec(SecurityManager.java: 779) at java.lang.ProcessBuilder.start(ProcessBuilder.java:447) at thinktank.scanner.server.ScanImage.scan(ScanImage.java:116) On 17 Sep 2007, at 16:26, Mark Thomas wrote: Sam Halliday wrote: Does anyone have any ideas? Start Tomcat with -Djava.security.debug=access,failure That should tell you what permissions you are missing. -- Sam - 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: grant codeBase not working for my jar
Hmm, where should I expect to see the extra debugging output. It isn't in any of the log files. The permissions are perfectly fine... it is in the assignation of the permissions to the correct jar file/servlet that things are getting messed up. Will the debugging output really point to that? On 17 Sep 2007, at 17:14, Mark Thomas wrote: Sam Halliday wrote: That doesn't give me any additional input... I already know which permissions I need, I just want to restrict them to the one Servlet. The debug output should tell you what coedbase is requesting what permission. I can't tell where, but you are missing at least one permission somewhere. -- Sam - 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: grant codeBase not working for my jar
On 17 Sep 2007, at 18:16, Mark Thomas wrote: Sam Halliday wrote: Hmm, where should I expect to see the extra debugging output. It isn't in any of the log files. Should be on standard out. Aah! That's why I wasn't seeing it. There is a pretty bad bug in Ubuntu which puts the output into a pipe which is never read. The standard workaround to allow tomcat to start up is to pipe it into / dev/null (unbelievable! and it's been like this since the year began)... report is here https://bugs.launchpad.net/ubuntu/+source/ tomcat5.5/+bug/97096 Anyway that's not all that important. I was able to redirect it to a file and have obtained the output. Again, it's quite clear that the permissions are not being set for my jar file access: domain that failed ProtectionDomain (file:/var/lib/tomcat5.5/ webapps/scanner/WEB-INF/lib/scanner.jar ) despite the fact that the security policy is grant codeBase "jar:file:${catalina.home}/webapps/scanner/WEB-INF/lib/ scanner.jar!/-" { permission java.io.FilePermission "/bin/sh", "execute"; permission java.io.FilePermission "/tmp/thinktank-scanner.bmp", "read,delete"; }; I've even tried it with "file:${catalina.home}/webapps/scanner/WEB- INF/lib/scanner.jar" and with the explicit path "file:/var/lib/ tomcat5.5/webapps/scanner/WEB-INF/lib/scanner.jar", but no success.. (remember, these permissions are correct... it works when I remove the explicit codeBase piece). I'd be greatly obliged if somebody could please see if my syntax for specifying a jar file is correct. log output follows: access: access denied (java.io.FilePermission /bin/sh execute) java.lang.Exception: Stack trace at java.lang.Thread.dumpStack(Thread.java:1206) at java.security.AccessControlContext.checkPermission (AccessControlContext.java:313) at java.security.AccessController.checkPermission (AccessController.java:546) at java.lang.SecurityManager.checkPermission(SecurityManager.java:532) at java.lang.SecurityManager.checkExec(SecurityManager.java:779) at java.lang.ProcessBuilder.start(ProcessBuilder.java:447) at thinktank.scanner.server.ScanImage.scan(ScanImage.java:116) at thinktank.scanner.server.ScannerSetupImpl.setScannerSettings (ScannerSetupImpl.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse (RPC.java:528) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall (RemoteServiceServlet.java:265) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost (RemoteServiceServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java: 243) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:517) at org.apache.catalina.security.SecurityUtil.execute (SecurityUtil.java:275) at org.apache.catalina.security.SecurityUtil.doAsPrivilege (SecurityUtil.java:161) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:245) at org.apache.catalina.core.ApplicationFilterChain.access$0 (ApplicationFilterChain.java:177) at org.apache.catalina.core.ApplicationFilterChain$1.run (ApplicationFilterChain.java:156) at java.security.AccessController.doPrivileged(Native Method) at org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:152) at org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol $Http11ConnectionHandler.processConnection(Http11BaseP
Re: grant codeBase not working for my jar
On 18 Sep 2007, at 03:08, Mark Thomas wrote: I am not sure if my mail client is mangling the urls you are using but it looks like you are using '/' characters after 'file:' Must be your e-mail client... I've tried jar and file (no slash after file:) "jar:file:${catalina.home}/webapps/scanner/WEB-INF/lib/scanner.jar!/-" file only (no slash after file:) "file:${catalina.home}/webapps/scanner/WEB-INF/lib/scanner.jar" and explicit path (slash after file) "file:/var/lib/tomcat5.5/webapps/scanner/WEB-INF/lib/scanner.jar" and confirmed that this is where the jar file is... but tomcat is still refusing to give the permissions on a per-jar basis! Maybe this is a bug with the Ubuntu release? -- Sam http://javablog.co.uk - 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 tutorial
Hi, I am new to Tomcat. Is there any Tomcat tutorial (eg. example of projects) I can download from the web? Thanks S Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Re: Tomcat tutorial
- Original Message From: Patrick Fong <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Friday, March 28, 2008 2:53:49 PM Subject: Re: Tomcat tutorial >> I find developerworks.ibm.com a good source of example projects. Thanks for the info. But I can't open this webpage. Thanks S tomcat.apache.org has a couple, but not as good as others. On Fri, Mar 28, 2008 at 2:32 PM, Sam Wun <[EMAIL PROTECTED]> wrote: > Hi, > > I am new to Tomcat. Is there any Tomcat tutorial (eg. example of projects) > I can download from the web? > > Thanks > S > > > > > > Be a better friend, newshound, and > know-it-all with Yahoo! Mobile. Try it now. > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ > Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Re: Tomcat tutorial
- Original Message From: Patrick Fong <[EMAIL PROTECTED]> To: Tomcat Users List Sent: Friday, March 28, 2008 3:25:46 PM Subject: Re: Tomcat tutorial >>try ibm.com/developerworks Hi, this works for me. But where should I go into in order to download tomcat tutorials? Thanks sam On Fri, Mar 28, 2008 at 3:17 PM, Sam Wun <[EMAIL PROTECTED]> wrote: > > > > - Original Message > From: Patrick Fong <[EMAIL PROTECTED]> > To: Tomcat Users List > Sent: Friday, March 28, 2008 2:53:49 PM > Subject: Re: Tomcat tutorial > > >> I find developerworks.ibm.com a good source of example projects. > Thanks for the info. But I can't open this webpage. > > Thanks > S > > > > > tomcat.apache.org has a couple, but not as good as others. > > On Fri, Mar 28, 2008 at 2:32 PM, Sam Wun <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I am new to Tomcat. Is there any Tomcat tutorial (eg. example of > projects) > > I can download from the web? > > > > Thanks > > S > > > > > > > > > > > > Be a better friend, newshound, and > > know-it-all with Yahoo! Mobile. Try it now. > > http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ > > > > > > > > Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Usage of Hibernate
Hi, I am new to Hibernate. >From googl'ing around, I found that Hibernate is designed for mapping object >classes and database. But this doesn't entirely solve my puzzle on this framework, that is what it's distinct advantage over simple usage of JDBC? UnlessHibernate has another important/popular usage rather than only dealingwith database, I would think this is may be the only reason whyHibernate getting more popularity. Can anyone tell me? Thanks Sam You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost. http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Why use SOAP in Java
Hi, I am wondering why use SOAP with Java? Since SOAP is based on RPC, I think the best question may be asked, why use RPC for client-server application? Thanks __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Tomcat upgrade and JSTL XML library
Hello, I have a web application that uses JSP 2.0 tag files and the Jakarta standard implementation of the JSTL. Essentially, I have JSP files that use custom tag files, both of which use the JSTL XML tag libraries for XML manipulation. Under Tomcat 5.5.17 and earlier, in my tag file, I was able to do something like: <%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml"; %> This is some content '' And this would correctly display "'This is some content'" in the generated HTML. Once I tried to deploy the above in any Tomcat version 5.5.20 or above, this failed to work, and would only display the single brackets, not the content ("''"). What does work is changing the line above to: '' Basically removing the foo part of the xpath. I am using the same version of the jstl jars in both cases, the only difference is Tomcat. Obviously, I could go through and change every place where the is used, but would rather not have the code be specific to the servlet container. I am unable to find any description of a change that could possibly cause this, and am wondering if there is anyone who has encountered this same problem. Am I missing some setting in my web.xml that would control this? Any help is greatly appreciated. thanks! sam -- Sam Weinger Consultant at Wrycan, Inc. sam dot weinger at wrycan dot 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]
very slow class loading on initial JSP/servlet request after restart
I've been struggling with a very severe problem on one of my three Tomcat servers since late December. I'm completely stumped. I'm running 6.0.18 on all three servers, which are all running Fedora Core 9, all currently running Sun's JDK 1.6.0_12. The only difference is hardware. The server that's being a problem is a Dell PowerEdge 1950, quad dual core. All three servers are configured exactly the same, with Apache HTTPD and using mod_proxy_ajp to pass requests on to Tomcat's AJP connector. All Tomcat instances are running the tomcat-native APR v1.1.14 that comes bundled with Tomcat. However, this problem persists on the problematic server if I don't run tomcat-native APR. The problem, which spontaneously appeared a few days before Christmas on this one server, is that the initial request of a JSP or servlet takes AGES to respond, usually exceeding several minutes. I've found that compilation of a JSP to a class file is nearly instant, but response from the resulting compiled class takes forever. Further, I found that this only happens when the offending JSP (or servlet) imports classes that I wrote, located in a JAR in Tomcat's /lib directory or inside the web app's WEB-INF/lib directory, or expanded out under WEB-INF/classes. For example, the following simple JSP, <%@ page import="java.util.*, java.io.*, net.ims.jcms.*" %> <% java.util.Date endDate = new java.util.Date(); out.println(endDate.toString()); %> takes AGES to respond, the first time it is requested after a Tomcat restart (even if the compiled class is present under the /work tree), while another JSP with the same executable lines: <%@ page import="java.util.*, java.io.* %> <% java.util.Date endDate = new java.util.Date(); out.println(endDate.toString()); %> responds immediately. The net.ims.jcms package is something I wrote. After the first time a JSP has been requested, subsequent requests respond immediately. So, the server still functions, but there is a horribly long delay before pages respond after a Tomcat restart. Again, this is not a compilation issue; I've monitored the /work directory and can see that the class files appear very quickly. In addition, this problem recurs after a Tomcat restart when the compiled class files already exist under /work. I've run the JVM with the -verbose:class option, and, sure enough, the long delay corresponds to a long delay before the page's class is loaded by the JVM. As soon as the JVM spits out the line saying it loaded the class, the response is sent. So, my conclusion is that the class loader simply takes a very long time, on the first request, if the class imports the package that I wrote. After the class is loaded into memory by that first request, subsequent requests respond normally. I cannot divine any problem with my JAR file or classes within it that would result in this problem; furthermore, it only occurs on one of three servers running the exact same everything. I have run MEMTEST86 on the offending server and memory seems to be fine. It is fine for all other services, processes, etc. The problem is robust on this specific server - it has transcended versions of Tomcat, the JVM, the kernel version, etc. I would greatly appreciate any suggestions for further diagnostics, things to try, offending things I may have done in my Java package, etc. Thanks! - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Caldarale, Charles R wrote: 1) What are the servers that don't have a problem? One is a single AMD Athlon 64 2800+, running the 64-bit Sun JDK (same version). The other is a dual AMD Athlon MP 2000+, running the 32-bit Sun JDK (same version). And the "bad" server has "8" Intel Xeon E5310 CPUs running the 32-bit Sun JDK (it is indeed a dual quad-core, not a quad dual-core, as I incorrectly typed in my original post). 2) How much RAM is on each server? The Athlon 64 has 1.5 GB RAM (2 GB swap). The dual 32-bit Athlon has 1 GB RAM (2 GB swap). The "bad" server has 2 GB RAM (2 GB swap). 3) Is the JDK 32- or 64-bit on each server? 32-bit on the two 32-bit machines, 64-bit on the 64-bit machine. 4) What's the Java heap size for Tomcat on each server? I've played with heap size quite a bit to no avail. Currently, all are running 768 MB with the following JDK options: JAVA_OPTS="-Xms768m -Xmx768m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=128m -XX:MaxPermSize=128m" 5) Are you using the same file system on all three servers? What is it (ext3, reiser, ???)? Yes. ext3 on all three machines, all are running current Fedora Core 9 distros (well, except for the new kernel which came out yesterday). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Ron McNulty wrote: Hi Sam You jar - does it include any JSP tag files written as JSP fragments? There are known issues in this area. The dependency management seems to get confused, resulting in lots of unnecessary compilation of the .tag files No, it doesn't, Ron. But thanks for the heads-up on that. The JAR just contains class files for a couple of packages. And compilation occurs quickly; it's the loading of the compiled class that's taking forever, even if they're already compiled from a previous Tomcat run. And, once the class is loaded (as indicated by the output line from the -verbose:class JVM option) execution is quick. I've not been able to get any diagnostic to indicate what's going on during the interminable wait for pagename_jsp.class to load after the initial page request. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Christopher Schultz wrote: Sam, On 2/19/2009 6:23 PM, Sam Hokin wrote: The problem, which spontaneously appeared a few days before Christmas on this one server, is that the initial request of a JSP or servlet takes AGES to respond, usually exceeding several minutes. Good... then you'll have plenty of time to /take a thread dump/ while it's spinning its wheels. Well, I have used a number of diagnostics, like jconsole, jstat and jhat, but haven't been able to glean anything informative from them about my issue. I've run the -Xloggc JVM option, and watched it garbage collect, again not informing me of anything. Yes, if I could figure out what the JVM is actually DOING doing the long wait, I'd hopefully be able to deal with it, but I honestly haven't been able to figure out how to do that. What do you suggest? I'll cast my hat into the ring: I suspect you're loading a resource that wants to looking an external resource (like an XML file with a remote DTD/Schema and validation is on in the parser) and the DNS is tripping you up. No, there are no external references in my Java package. It's all just local class files. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Caldarale, Charles R wrote: Run jstack several times during the delay, and then let's compare the set of thread dumps. What is the CPU utilization during the delay? OK, done. The CPU utilization during the delay is tiny, 1% or less. I've run jstack before, during, and after I've done a first request on my tiny offending test JSP. Since the jstack output is lengthy (I've got several sites running on this public server, unavoidably), I've thrown the resulting output on my server for easier viewing. jstack.0.txt ran BEFORE my test request. jstack.1-11.txt ran DURING the long wait. jstack.12,13.txt ran AFTER the response was received. http://ims.net/jstack/jstack.0.txt http://ims.net/jstack/jstack.1.txt http://ims.net/jstack/jstack.2.txt http://ims.net/jstack/jstack.3.txt http://ims.net/jstack/jstack.4.txt http://ims.net/jstack/jstack.5.txt http://ims.net/jstack/jstack.6.txt http://ims.net/jstack/jstack.7.txt http://ims.net/jstack/jstack.8.txt http://ims.net/jstack/jstack.9.txt http://ims.net/jstack/jstack.10.txt http://ims.net/jstack/jstack.11.txt http://ims.net/jstack/jstack.12.txt http://ims.net/jstack/jstack.13.txt I wish I could divine something informative from these. Perhaps one of you can. I'm also trying to use Wireshark to see if there is some specific net activity that's going on during the long wait, as suggested by David Smith. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Christopher Schultz wrote: jstack.8.txt is the last thread dump where File.exists was stalled. http://ims.net/jstack/jstack.9.txt http://ims.net/jstack/jstack.10.txt http://ims.net/jstack/jstack.11.txt The server appears to be idle, here. It's a little weird that thread 9770 has NO STACK INFO AT ALL. http://ims.net/jstack/jstack.12.txt http://ims.net/jstack/jstack.13.txt Also idle. Yeah, I _thought_ it was still stalled on 9-11, but it looks like I misjudged the timing by a bit. I was flipping back and forth between virtual windows, hitting jstack while checking if my browser had the response from the server. Obviously, the File.exists method shouldn't be taking that long... it's a pretty simple operation. Are you using an NFS or other network share? Does your disk have any physical problems? Is this machine running next to any equipment that generates a lot of stray alpha particles? :) Not that I know of. :) We now know it's hanging on java.io.File.exists(), though, so I suppose that's leading us somewhere. It's a logical RAID array on four physical disks. I've run fsck on it (when this all first happened) and it's fine. And this problem persists no matter where the classes are on the disk; whether they're in a JAR file anywhere, or split out under WEB-INF/classes. I don't think it can be a disk issue. I guess I could write a standalone Java routine to play with the File.exists() method and see if I can reproduce the delay "manually" - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
I'd like to correct an error I made in my earlier report of this problem. It turns out that the response delay in my simple test JSP IS during compilation! I ran stat on the files in question, as well as looked at the time shown on the response page (which is all the test JSP does). (I think I got confused by the output of the -verbose:class JVM option earlier.) Here's the file sequence from stat: File: `test4.jsp' Size: 146 Blocks: 8 IO Block: 4096 regular file Device: fd00h/64768dInode: 7701336 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 500/ sam) Gid: ( 100/ users) Access: 2009-02-20 13:39:29.0 -0600 <--- Tomcat accesses the file Modify: 2009-02-20 10:39:09.0 -0600 Change: 2009-02-20 13:39:06.0 -0600 File: `/usr/local/tomcat/work/Catalina/www.ims.net/_/org/apache/jsp/test4_jsp.class' Size: 3520Blocks: 8 IO Block: 4096 regular file Device: fd00h/64768dInode: 10650578Links: 1 Access: (0644/-rw-r--r--) Uid: ( 501/ tomcat) Gid: ( 501/ tomcat) Access: 2009-02-20 13:40:17.0 -0600 <--- the compiled class appears almost a minute later Modify: 2009-02-20 13:40:17.0 -0600 Change: 2009-02-20 13:40:17.0 -0600 The HTTP response came immediately after that, the page displaying: Fri Feb 20 13:40:17 CST 2009. As before, jstack reveals that the thread is stalling on java.io.File.exists(), or specifically java.io.UnixFileSystem.getBooleanAttributes(java.io.File). On my other two servers, the exact same JSP as above is accessed, compiled and responds within one second. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Chuck's comment about JSP to Java translation done by Jasper reminded me that I should have included the time on the Java source file created during JSP compilation. It shows that the Java source file was created immediately, but accessed again six seconds later (!), presumably by the compiler. File: `/usr/local/tomcat/work/Catalina/www.ims.net/_/org/apache/jsp/test4_jsp.java' Size: 2333Blocks: 8 IO Block: 4096 regular file Device: fd00h/64768dInode: 10650454Links: 1 Access: (0644/-rw-r--r--) Uid: ( 501/ tomcat) Gid: ( 501/ tomcat) Access: 2009-02-20 13:39:35.0 -0600 Modify: 2009-02-20 13:39:29.0 -0600 Change: 2009-02-20 13:39:29.0 -0600 In summary: test4.jsp accessed at 13:39:29; test4_jsp.java created at 13:39:29; test4_jsp.java accessed at 13:39:35; test4_jsp.class created at 13:40:17; HTTP response at 13:40:17. I'm going to play with File.exists() in this and the other servers to see if there is some generic problem with file access on the slow server. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request afterrestart
Actually, /usr/local/tomcat is a symlink to /usr/local/apache-tomcat-6.0.18. But that's a pretty important symlink for me, to make it easy to change Tomcat versions. But I'll investigate that. That's the only symlink involved that I can think of. Caldarale, Charles R wrote: From: Sam Hokin [mailto:s...@ims.net] Subject: Re: very slow class loading on initial JSP/servlet request afterrestart I'm going to play with File.exists() in this and the other servers to see if there is some generic problem with file access on the slow server. Make sure to try both in and outside of Tomcat's work directory and the webapp's directory underneath it. Might be something odd going on with that specific path. (No symlinks involved, I hope.) - Chuck - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
An update. I've written a simple standalone Java routine that calls File.exists(). It never hangs. In fact, I ran it against the class file that Tomcat creates from a test JSP; it doesn't hang, returns false for the (long) time it takes Tomcat to create the class file on the slow system, then returns true after the class file is created (and the HTTP response is sent). I ran my routine as the tomcat user. Since compilation seems to be the issue, I tried replacing Jasper JDT (by removing jasper-jdt.jar from /lib) with Ant (by placing ant.jar in /lib) and restarting Tomcat. This did not improve my problem. JSPs still compile slowly with Ant instead of JDT on the slow machine (and fast on the other machines). I've reverted back to JDT. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Thanks, Chris. I ran e2fsck with the -c option, which runs badblocks, when I tested it earlier. And I just ran badblocks again - 0 bad blocks found. I wish I could fix this by simply as swapping out a bad disk (notwithstanding Andre's desire for intellectual pursuits), but I really think it's software, either in some service mucking up the JVM or the JVM itself. But it only manifests itself under Tomcat, and then only when this particular package is imported. Christopher Schultz wrote: Sam and David, On 2/20/2009 1:36 PM, David Smith wrote: Sam Hokin wrote: It's a logical RAID array on four physical disks. I've run fsck on it (when this all first happened) and it's fine. It _could_ be a disk issue. I've seen disks that scan fine contain a growing number of blocks causing read errors and continuous retries. Yeah, you gotta run badblocks on it. fsck just checks the filesystem integrity, not the physical disk. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
André Warnier wrote: Sam Hokin wrote: I'd like to correct an error I made in my earlier report of this problem. It turns out that the response delay in my simple test JSP IS during compilation! I ran stat on the files in question, as well as looked at the time shown on the response page (which is all the test JSP does). (I think I got confused by the output of the -verbose:class JVM option earlier.) Restarting from the point above.. Leaving the current test jsp page in place, but taking a copy of it under another name, does the symptom then also show up on the copy ? Yes, always. That's how I reproduce it without having to restart the server. I just copy from test1.jsp to test2.jsp, and then test2.jsp takes a long time to compile. It's a very robust problem, with no specific source or compiled files involved. It just requires a JSP that hasn't yet been compiled. The same with the whole webapp, copied under another name. Any web app. There are four running now, I used to have about 8 running on this server, and I've put new web apps on (like yesterday), always reproducing the problem. But all of these web apps import my Java package at the top of the JSPs. Separate question : does this Tomcat, contrary to the others, have the SecurityManager on ? or vice-versa ? No it doesn't. SecurityManager is not on any of the servers. I have not changed catalina.policy, and I do not invoke Tomcat with the -security option. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Christopher Schultz wrote: Sam, On 2/20/2009 6:44 PM, Sam Hokin wrote: Thanks, Chris. I ran e2fsck with the -c option, which runs badblocks, when I tested it earlier. And I just ran badblocks again - 0 bad blocks found. Did you run badblocks on the array, or on an individual disk? I would expect the disk-level check to be more useful. On the array. I'm not even sure I can get at a single disk from the OS with this hardware RAID configuration. The OS had no idea that it's a RAID array as far as I know. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Mark Thomas wrote: Sam Hokin wrote: Thanks, Chris. I ran e2fsck with the -c option, which runs badblocks, when I tested it earlier. And I just ran badblocks again - 0 bad blocks found. I wish I could fix this by simply as swapping out a bad disk (notwithstanding Andre's desire for intellectual pursuits), but I really think it's software, either in some service mucking up the JVM or the JVM itself. But it only manifests itself under Tomcat, and then only when this particular package is imported. Do you see the same issue if you pre-compile that JSP? Surprisingly, yes. So it's not only a compilation issue. After some individual tests, I compiled the JSPs from the four sites I have running on this server and restarted Tomcat, and the LONG delay before Tomcat begins serving page requests continues. I looked at my individual test JSP, now precompiled, and, sure enough, it takes a long time to respond to the first request after a Tomcat restart. In fact, it wasn't any better than when Tomcat compiles them on the fly. So I'm back to thinking the classloader is involved in this delay as well. I did check, just to be sure, and Tomcat did not write any class files under Catalina/work. And if I deleted a compiled class file on a site, a request throws an error logged in catalina.out. So, Tomcat is definitely using the compiled classes. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: very slow class loading on initial JSP/servlet request after restart
Juha Laiho wrote: One tool that I haven't yet seen suggested is 'strace', the Linux system call tracer. This will show all the calls your application makes to the operating system. As you say the application is mostly idle during the delay, it is, in one way or another, waiting for some OS service to complete. 'strace' should provide you with timestamped information on what OS services were called, with which arguments, and how long did it take for them to return with results. 'strace' will leave you with a huge file (or a set of huge files, depending on the options you use), and going through them will take some time - but you'll most likely also find what causes the delay. Thanks, Juha. Actually Pieter suggested it a little while ago, and I've been trying to get some information out of strace. The best I can do is to put strace in front of the java command that's inside catalina.sh. That's the command that shows with ps -ef when Tomcat is running. BUT, I get nothing out of strace when I make page requests on a site, it just shows output during Tomcat startup. So, I've not figured out how to get strace to say what the JVM is during the delay. jstack has led us to a stalled File.exists() in one case, but we don't know what file it's looking for. And I'm not convinced that File.exists() is the only method that's stalling. Since this problem exists only on a production server, a server on which I must still serve at least two customer sites (due to DNS issues) in addition to our own and any others I put on there, I'm a bit restricted in terms of how much I can muck with it (not that I haven't brought those live sites down for awkward periods of time with the diagnosis I've attempted so far). I wish I had a test environment on another server that replicates this issue, but my other two servers run Tomcat perfectly fast, and since I don't understand what's causing the problem, I cannot make one of my other servers reproduce it. Another diagnostic problem is that undeploying a context with the Tomcat /manager app, and then starting it again, does NOT reset this problem - the response to a JSP request is immediate (provided it had been requested since the last Tomcat startup). This problem is only reset on a given JSP if I restart Tomcat entirely; I can reproduce it by creating fresh JSPs with new names and requesting them. But, clearly, the key diagnostic issue is finding out WHAT is going on during the delay that a JSP incurs when it is first requested of a given Tomcat instance. I've not been able to find out from strace. I'll give truss -f and truss -ff a try. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org