Re: Load Balancer configuration guide
Using Folowing to test Load Balanacing > Os:Linux > apache 2.2.17 > mod_jk1.2.3/ AJP 1.3 > tomcat 5.5.27 > > with Above Setup i am able transfer load on tomcat instances.I am setting > test bed with 3 tomcat with (Max thread 500 on each,Individual tomcat able > to accept 400 concurent in long run). > > Now expecting Same through Load Balancer but getting error in long run > >:java.net.SocketException: Connection reset > > worker File Details:: > worker 1,worker2 and worker 3 created .Sample below > > <> > worker.list=balancer > > worker.list=worker3 > > worker.worker3.type=ajp13 > > worker.worker3.host=10.58.116.20 > > worker.worker3.port=8089 > > worker.worker3.lbfactor=1 > > worker.worker3.cachesize=10 > > worker.worker3.cache_timeout=600 > > > > worker.balancer.type=lb > > worker.balancer.balance_workers=worker1,worker2,worker3 > > #worker.balancer.lbfactor=1 > > worker.balancer.local_worker_only=1 > > worker.balancer.sticky_session=1 > <> > tomcat server.xml > > > enableLookups="false" redirectPort="8443" > > minProcessors="25" maxProcessors="1500" > > maxThreads="500" minSpareThreads="25" > > maxSpareThreads="75" protocol="AJP/1.3" /> > > > What are configuration Step to sync between tomcat and apache? > > How much Apache can handle load in above case(400 to 500[as each tomcat max > 500] OR 1000 to 1500[as 500*3=1500])? > > > > > >
Re: Working of Tomcat with MS Access
I think I have to have tomcat (.zip) rather than md5 package..just a moment...i will get back to you... On Sat, Apr 16, 2011 at 8:50 AM, Leo Donahue - PLANDEVX < leodona...@mail.maricopa.gov> wrote: > > > From: RAHUL RAJ [omrahulraj...@gmail.com] > Subject: Re: Working of Tomcat with MS Access > > >vista home basic. > >No, I can restart tomcat each time, by clicking the start/stop button. > > Did you try any of the suggestions André or I offered? > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Tomcat on a Linux virtual machine
Hi Darryl, Is the database also running on a VM? My experience with "problematic applications on VMs" hasn't been related to the application itself (Tomcat, BIND, Apache, etc.) but moreso whether they generate high volumes of local storage I/O (like a database using local disks). The impact this can have can also be magnified if your VM disks aren't properly aligned (a common mistake in many older VM deployments). The vendor should also be providing some form of justification for their statements. Depending on your virtualization platform of choice, there may be various utilities you can use to analyze the performance of the virtualization host itself to help narrow down where bottlenecks may be occurring. Regards, --Original Message-- From: Darryl Lewis To: Tomcat Users List ReplyTo: Tomcat Users List Subject: Tomcat on a Linux virtual machine Sent: Apr 15, 2011 23:18 I have an application (commercial) running on a virtual instance of Linux talking to a Postgres database. We are continually getting locks on the DB that are crashing the app. I think it's just bad programming on the suppliers side, but the supplier has latched onto the idea that it is because it is running on a virtual machine. Has any experienced any problems running Tomcat on a virtual machine similar to this? Sent from my BlackBerry device
RE: Tomcat on a Linux virtual machine
i was reading leos post about restarting tomcat with the same username that had read access to the referenced database the same idea will work for tomcat if you create your VM with same login as PGUSER password is stored in .pgpass file if memory serves hth Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > From: darryl.le...@unsw.edu.au > To: users@tomcat.apache.org > Date: Sat, 16 Apr 2011 13:18:49 +1000 > Subject: Tomcat on a Linux virtual machine > > I have an application (commercial) running on a virtual instance of Linux > talking to a Postgres database. > We are continually getting locks on the DB that are crashing the app. > I think it's just bad programming on the suppliers side, but the supplier has > latched onto the idea that it is because it is running on a virtual machine. > Has any experienced any problems running Tomcat on a virtual machine similar > to this?
RE: Working of Tomcat with MS Access
From: RAHUL RAJ [omrahulraj...@gmail.com] Subject: Re: Working of Tomcat with MS Access >vista home basic. >No, I can restart tomcat each time, by clicking the start/stop button. Did you try any of the suggestions André or I offered? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat on a Linux virtual machine
I have an application (commercial) running on a virtual instance of Linux talking to a Postgres database. We are continually getting locks on the DB that are crashing the app. I think it's just bad programming on the suppliers side, but the supplier has latched onto the idea that it is because it is running on a virtual machine. Has any experienced any problems running Tomcat on a virtual machine similar to this?
Re: Working of Tomcat with MS Access
vista home basic. No, I can restart tomcat each time, by clicking the start/stop button. On Sat, Apr 16, 2011 at 2:49 AM, Leo Donahue - PLANDEVX < leodona...@mail.maricopa.gov> wrote: > >-Original Message- > >From: RAHUL RAJ [mailto:omrahulraj...@gmail.com] > >Subject: Re: Working of Tomcat with MS Access > > > >you said: > > > >"You need to change that account to one that has access to your mdb. > >You > >can do that through the Services console. Or try starting Tomcat via > >the > >startup.bat file, that should launch Tomcat with the same account you've > >logged into your system with, which hopefully is the same account you > >need > >to for "Access". > >" > > > >I don't know how to do these...Can you explain for me? > > On Vista Home Basic... ? Uh... > > Start/Control Panel > Switch to Classic View > Find Administrative Tools/Services > > You're on your own after this, but in a nutshell.. you need to check the > properties of the "Tomcat Service" and see if you can change the way the > service "Logs On" > > What happens when you reboot your computer? Do you have to restart Tomcat > each time or is it still running after you reboot? > > > >Also startup.bat is not there in the specified directory. > Fine. By the way, I never specified a directory because no one here knows > how you've installed Tomcat 5.5.x > I'm very fond of version x myself. > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Working of Tomcat with MS Access
I am working on windows platform. I downloaded tomcat setup, md5(.exe) and installed it. On Sat, Apr 16, 2011 at 3:18 AM, André Warnier wrote: > >> Also startup.bat is not there in the specified directory. >>> >> > It is not there because you have downloaded and installed the "Tomcat > installer" version, and that one does not have a startup.bat file. > > > Stop your existing Tomcat service. > > Go back to the Tomcat website, and download the appropriate "zip" version > (32-bit or 64-bit, depending on what your Java version is. > (you can see that by typing "java -version" in a command window) > > Create a new directory on your PC (maybe call it "tomcat-zip") and unzip > the zip-file there. > > Then go to the /bin sub-directory, and type "startup.bat". > This will run this new Tomcat in the command window, under your own login > user-id. > Verify that it runs, with a browser, by accessing "http://localhost:8080";. > > Type CTRL-C in the tomcat command window to stop it. > > Then start modifying the configuration of this new Tomcat, to add what is > necessary to run you application. Do it one little bit at a time, and try > restarting Tomcat each time you modify something, so that if there is a > problem you know what you did wrong. > > When that all runs, then we'll tell you how to setup this new Tomcat as a > Windows Service. > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Working of Tomcat with MS Access
Also startup.bat is not there in the specified directory. It is not there because you have downloaded and installed the "Tomcat installer" version, and that one does not have a startup.bat file. Stop your existing Tomcat service. Go back to the Tomcat website, and download the appropriate "zip" version (32-bit or 64-bit, depending on what your Java version is. (you can see that by typing "java -version" in a command window) Create a new directory on your PC (maybe call it "tomcat-zip") and unzip the zip-file there. Then go to the /bin sub-directory, and type "startup.bat". This will run this new Tomcat in the command window, under your own login user-id. Verify that it runs, with a browser, by accessing "http://localhost:8080";. Type CTRL-C in the tomcat command window to stop it. Then start modifying the configuration of this new Tomcat, to add what is necessary to run you application. Do it one little bit at a time, and try restarting Tomcat each time you modify something, so that if there is a problem you know what you did wrong. When that all runs, then we'll tell you how to setup this new Tomcat as a Windows Service. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [cluster] standalone tomcat hijacks cluster session
Hi, Looks like this session hijacking is a jk phenomena. If I shut down the cluster member tr66 for example and make a standalone tomcat by teking out jvmRoute from the Engine tag and comment out the Cluster tag, and then bring it up then I can get to the SessionExample servlet in two ways. One is to go to it directly via port 8080 like: http://bml0066.yalepath.org:8080/examples/servlets/servlet/SessionExample then after adding some attributes I can see this: Session ID: E118555FBBC8EF040A916C24BFF52C1E Created: Fri Apr 15 16:53:12 EDT 2011 Last Accessed: Fri Apr 15 16:58:18 EDT 2011 The following data is in your session: tc2 = standalone s1 = tc66 standalone s3 = still standalone The other way is to get to the servlet via mod_jk, like: http://bml0066.yalepath.org/examples/servlets/servlet/SessionExample note that I am not using the reverse proxy in this case. Then mod_jk should go to the app in its own session based upon the workers.properties file. But it does not. It hijacks the session in the cluster and I can see this: Session ID: E8714E81BEC77E36D6A9B775A94832DA.tc65 Created: Fri Apr 15 16:47:22 EDT 2011 Last Accessed: Fri Apr 15 16:58:48 EDT 2011 The following data is in your session: s4 = tc65 hijacked tc66 standalone s2 = tc66 down tc65 up s1 = tc66 up tc65 up tc6 = tc65 up tc66 standalone s5 = tc65 hijacked tc66 standalone s6 = tc65 hijacked tc66 standalone s3 = tc65 up tc66 standalone and it surely interfere with the cluster session because when I get to the clustered session I see that the attribute valuse are changed based upon what was change the supposedly "standalone" hijacked session. To get to the clustered session I use the reverse proxy like http://bml0066.yalepath.org/tc/examples/servlets/servlet/SessionExample and I can see there this: Session ID: E8714E81BEC77E36D6A9B775A94832DA.tc65 Created: Fri Apr 15 16:47:22 EDT 2011 Last Accessed: Fri Apr 15 16:59:18 EDT 2011 The following data is in your session: s4 = tc65 hijacked tc66 standalone s2 = tc66 down tc65 up s7 = tc65 up tc66 standalone s1 = tc66 up tc65 up tc6 = tc65 up tc66 standalone s5 = tc65 hijacked tc66 standalone s6 = tc65 hijacked tc66 standalone s3 = tc65 up tc66 standalone all these lines with the word "hijacked" came when I tried to get to the "standalone" session via jk, that is via the URL: http://bml0066.yalepath.org/examples/servlets/servlet/SessionExample So the question is what configuration should I put into workers. properties or to theJkMont in httpd.conf, that when I do not use the reverse proxy and the tomcat is configured as standalone, it will not give me the clustered session from the clustered other tomcat of the other machine, but rather it passes the request to the non-clustered tomcat on machine indicated by the URL ? I see, when the reverse proxy is passing the request to one or the other machine the format of the URL is the same as if I enter it manually on the host of the non-clustered tomcat, so in reality I am not surprised to get the clustered session. What surprises me is that mod_jk is not realizing that some changes were made and the tomcat on the same machine is now not part of the cluster. Or, maybe there is some settings in memory that instructs mod_jk, that ignore the freshly started up standalone tomcat and act like that tomcat is not up yet and go to the tomcat that has the clustered session, and serve that to the user. Thanks ahead, János On Apr 15, 2011, at 1:09 PM, János Löbb wrote: > Hi > > Two machines bml0065 and bml0066. Both have OSX 10.6.6, Tomcat 7.0.10, > mod_jk 1.2.31, and httpd2.2.17. bml0065 is the reverse proxy. > > I am following this test plan with the > examples/servlets/servlet/SessionExample as the webapp. > > > Scenario - tc65, tc66 are running in a cluster. > > 1 Remove tc66 from a cluster while people are using the application. > - Shut down tc66 by logging into the machine as administrator and > issue the sudo /usr/local/tomcat/bin/shutdown.sh commad. > - sudo cp /usr/local/tomcat/conf/no-cluster.xml > /usr/local/conf/server.xml. > - Start up tc66 by issuing: sudo /usr/local/tomcat/bin/startup.sh > > > 2.Access it directly with > http://bml0066.yalepathorg/examples/servlets/servlet/SessionExample. Access > management console and stop/remove the application. Deploy a new version of > the application. > > > 3.Ask users to use an alternative link to that App. > - http://host/app > > > 4.Let it run for some time. > > > 5.Add this new application to the cluster in such a way that the new > application is now deployed > - Shut down tc66: sudo /usr/local/tomcat/bin/shutdown.sh > - sudo cp /usr/local/tomcat/conf/cluster.xml > /usr/local/conf/server.xml. > - Start up tomcat by issuing: sudo > /usr/local/tomcat/bin/startup.sh > > > 6.Take other tomcat tc65 out of the cluster. > -
RE: Working of Tomcat with MS Access
>-Original Message- >From: RAHUL RAJ [mailto:omrahulraj...@gmail.com] >Subject: Re: Working of Tomcat with MS Access > >you said: > >"You need to change that account to one that has access to your mdb. >You >can do that through the Services console. Or try starting Tomcat via >the >startup.bat file, that should launch Tomcat with the same account you've >logged into your system with, which hopefully is the same account you >need >to for "Access". >" > >I don't know how to do these...Can you explain for me? On Vista Home Basic... ? Uh... Start/Control Panel Switch to Classic View Find Administrative Tools/Services You're on your own after this, but in a nutshell.. you need to check the properties of the "Tomcat Service" and see if you can change the way the service "Logs On" What happens when you reboot your computer? Do you have to restart Tomcat each time or is it still running after you reboot? >Also startup.bat is not there in the specified directory. Fine. By the way, I never specified a directory because no one here knows how you've installed Tomcat 5.5.x I'm very fond of version x myself. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
you said: "You need to change that account to one that has access to your mdb. You can do that through the Services console. Or try starting Tomcat via the startup.bat file, that should launch Tomcat with the same account you've logged into your system with, which hopefully is the same account you need to for "Access". " I don't know how to do these...Can you explain for me? Also startup.bat is not there in the specified directory. On Sat, Apr 16, 2011 at 1:48 AM, Leo Donahue - PLANDEVX < leodona...@mail.maricopa.gov> wrote: > >-Original Message- > >From: RAHUL RAJ [mailto:omrahulraj...@gmail.com] > >Subject: Re: Working of Tomcat with MS Access > > > >Yes, it runs as a service. But how to know under what account does that > >service run? does it mean 'admin' or 'normal user' or 'system'? > >I made a system DSN for this...not the user DSN(Data Source Name) > >and I launched tomcat service by right click 'run as admin' > > I'm really surprised you have had as many responses to this thread as > you've had. > > Assuming you have Tomcat installed as a Windows service, usually the > default account that runs Tomcat as a Windows service is "Local System > Account". You need to change that account to one that has access to your > mdb. You can do that through the Services console. Or try starting Tomcat > via the startup.bat file, that should launch Tomcat with the same account > you've logged into your system with, which hopefully is the same account you > need to for "Access". > > The code you posted should work, although I can't understand what the > purpose of your assignment is. Don't get in the habit of using this code > for anything related to logging in, or anything else. > > If you must stay in the MS world, use SQL Express. > > try { >Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver"); > Connection con = > DriverManager.getConnection("jdbc:odbc:rahul","",""); > > Statement stmt = > con.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY); > String query = "Select whatever"; > > ResultSet rs = stmt.executeQuery(query); > > while(rs.next()){ > // do stuff >} >rs.close(); > stmt.close(); > con.close(); >} catch(SQLException ex) { > >} catch(java.lang.ClassNotFoundException jdbce) { > >} > >
RE: Working of Tomcat with MS Access
>-Original Message- >From: RAHUL RAJ [mailto:omrahulraj...@gmail.com] >Subject: Re: Working of Tomcat with MS Access > >Yes, it runs as a service. But how to know under what account does that >service run? does it mean 'admin' or 'normal user' or 'system'? >I made a system DSN for this...not the user DSN(Data Source Name) >and I launched tomcat service by right click 'run as admin' I'm really surprised you have had as many responses to this thread as you've had. Assuming you have Tomcat installed as a Windows service, usually the default account that runs Tomcat as a Windows service is "Local System Account". You need to change that account to one that has access to your mdb. You can do that through the Services console. Or try starting Tomcat via the startup.bat file, that should launch Tomcat with the same account you've logged into your system with, which hopefully is the same account you need to for "Access". The code you posted should work, although I can't understand what the purpose of your assignment is. Don't get in the habit of using this code for anything related to logging in, or anything else. If you must stay in the MS world, use SQL Express. try { Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:rahul","",""); Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY); String query = "Select whatever"; ResultSet rs = stmt.executeQuery(query); while(rs.next()){ // do stuff } rs.close(); stmt.close(); con.close(); } catch(SQLException ex) { } catch(java.lang.ClassNotFoundException jdbce) { }
RE: Found org.apache.catalina.filters.CSRF_NONCE
Hi Chris, It does not appear like I have access to HttpServletResponse. Damn. So if I did have access to that then I could just call response.encodeURL and everything would seriously just auto-magically work? Any other way, or Object, I can use in its place? I like your idea Chris of generating a new nonce and adding it to the cache. Trouble is that generateNonce() procedure from org.apache.catalina.filters.CsrfPreventionFilter is protected so I can't use that. Well, unless I subclass it of course. Is that what you were thinking? Cheers, Matt -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, April 15, 2011 3:49 PM To: Tomcat Users List Subject: Re: Found org.apache.catalina.filters.CSRF_NONCE -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mathew, On 4/15/2011 3:42 PM, Mathew Samuel wrote: > However the exception I received back was the following: > java.lang.ClassCastException: > org.apache.catalina.filters.CsrfPreventionFilter$LruCache cannot be > cast to java.lang.String > > Ok, now I know that the org.apache.catalina.filters.CSRF_NONCE is not > a String but something else. In the API description for > org.apache.catalina.filters.CsrfPreventionFilter.LruCache there is > only two methods: add and contains. Neither of which would help me > access the value of this CSRF_NONCE. Right: it's supposed to store nonces and let you look them up. There is a psuedo-current nonce for the request -- the one stored in the response wrapper object created by the CsrfPreventionFilter. > And maybe I'm going about this all wrong, and how this works, but what > I was thinking about doing was to grab what I had presumed to be a > value from the Attribute org.apache.catalina.filters.CSRF_NONCE and > ensure that value gets propagated so that when the XSLT does it's > transformation it will be there included with the link (we don't use > JSP). Do you have access to the response object (HttpServletResponse) itself? It would be far easier to call response.encodeURL and everything will work. > I am going about this correctly right? If so is there a value from > org.apache.catalina.filters.CSRF_NONCE that I should be able to > extract? Like the actual nonce value? Nope: it looks like it's an opaque store where the caller needs to know a priori what nonce will be used. If you are really desperate, you could just generate a new nonce and add it to the cache ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2ooTUACgkQ9CaO5/Lv0PBR+ACgohJQSP3FuIdObaRnVVZGD3kw 8VsAn0QdusmJGkAk6wwkWSU9/EL1eLL5 =JKIa -END PGP SIGNATURE- - 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: Found org.apache.catalina.filters.CSRF_NONCE
Well that's embarrassing. Thanks Chuck! In my own defense I had read his response and didn't really understand it so it swiftly left my mind. Then suddenly I could access that Attribute and now in hindsight his response makes sense to me. Feels like half the time I'm defending myself on this forum. But truly if it wasn't for all your contributions I would not have even progressed this far. Thank you. Cheers, Matt -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Friday, April 15, 2011 3:47 PM To: Tomcat Users List Subject: RE: Found org.apache.catalina.filters.CSRF_NONCE > From: Mathew Samuel [mailto:mathew.sam...@entrust.com] > Subject: Found org.apache.catalina.filters.CSRF_NONCE > now I know that the org.apache.catalina.filters.CSRF_NONCE is not a String > but something else. Actually, Konstantin told you that several hours ago: > > 1) ${session['org.apache.catalina.filters.CSRF_NONCE']} > > 2) The value of the above is some object (a cache) not a String. > > It cannot be used as a value. > > 3) c:url already takes care of the nonce, because it calls > > HttpServletResponse.encodeURL(..) Perhaps you should go back and read his complete response: http://marc.info/?l=tomcat-user&m=130287556712594&w=2 - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To 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: Found org.apache.catalina.filters.CSRF_NONCE
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mathew, On 4/15/2011 3:42 PM, Mathew Samuel wrote: > However the exception I received back was the following: > java.lang.ClassCastException: > org.apache.catalina.filters.CsrfPreventionFilter$LruCache cannot be > cast to java.lang.String > > Ok, now I know that the org.apache.catalina.filters.CSRF_NONCE is not > a String but something else. In the API description for > org.apache.catalina.filters.CsrfPreventionFilter.LruCache there is > only two methods: add and contains. Neither of which would help me > access the value of this CSRF_NONCE. Right: it's supposed to store nonces and let you look them up. There is a psuedo-current nonce for the request -- the one stored in the response wrapper object created by the CsrfPreventionFilter. > And maybe I'm going about this all wrong, and how this works, but > what I was thinking about doing was to grab what I had presumed to be > a value from the Attribute org.apache.catalina.filters.CSRF_NONCE and > ensure that value gets propagated so that when the XSLT does it's > transformation it will be there included with the link (we don't use > JSP). Do you have access to the response object (HttpServletResponse) itself? It would be far easier to call response.encodeURL and everything will work. > I am going about this correctly right? If so is there a value from > org.apache.catalina.filters.CSRF_NONCE that I should be able to > extract? Like the actual nonce value? Nope: it looks like it's an opaque store where the caller needs to know a priori what nonce will be used. If you are really desperate, you could just generate a new nonce and add it to the cache ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2ooTUACgkQ9CaO5/Lv0PBR+ACgohJQSP3FuIdObaRnVVZGD3kw 8VsAn0QdusmJGkAk6wwkWSU9/EL1eLL5 =JKIa -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] Working of Tomcat with MS Access
Oh, ok, that explains it better. I've "had to" deal w/ MS Access, more than I'd like, or out of pure cheapness on my part sometimes, but have amply dealt with Oracle (best IMO) and SQL Server. And no it's usually not. I absolutely have to have MS Access solutions here, based in our corp. world, for quick reporting modules for people. They're always tethered to our Oracle ODBC connections, and lately I've been dealing with one that's not really that nice! : ( -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, April 15, 2011 2:40 PM To: Tomcat Users List Subject: Re: [OT] Working of Tomcat with MS Access -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Barry, On 4/15/2011 3:11 PM, Propes, Barry L wrote: > Oh, ok - that's good. Although I'm not familiar with it, but will take > it under advisement. You could think of it as Java's answer to Access, except that I wouldn't want to be that demeaning of JavaDB (aka Apache Derby). It's transactional, which is I think more than you can say about MS Access files, but also file-based meaning that I think you can just copy a single file around and "move" the database. It's not usually that simple in the larger RDBMS world. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2onyoACgkQ9CaO5/Lv0PDgnACguZpmDV0+OLpe5poz7R8uhMS8 weIAn244//QAT/DvHhpEn3976U7cZJ7J =Gsw6 -END PGP SIGNATURE- - 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: Found org.apache.catalina.filters.CSRF_NONCE
> From: Mathew Samuel [mailto:mathew.sam...@entrust.com] > Subject: Found org.apache.catalina.filters.CSRF_NONCE > now I know that the org.apache.catalina.filters.CSRF_NONCE is not a String > but something else. Actually, Konstantin told you that several hours ago: > > 1) ${session['org.apache.catalina.filters.CSRF_NONCE']} > > 2) The value of the above is some object (a cache) not a String. > > It cannot be used as a value. > > 3) c:url already takes care of the nonce, > > because it calls HttpServletResponse.encodeURL(..) Perhaps you should go back and read his complete response: http://marc.info/?l=tomcat-user&m=130287556712594&w=2 - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Found org.apache.catalina.filters.CSRF_NONCE
Hi, Thanks for all the help. Looks like I was able to find org.apache.catalina.filters.CSRF_NONCE. I was so happy I could have cried. It was part of an HttpSession object that had an attribute of org.apache.catalina.filters.CSRF_NONCE. Not sure why I couldn't find it before but perhaps I was either checking the wrong HttpSession Object before or checking it at the wrong time or something. So now onto my next issue, I tried to so the following: String nonce = (String)session.getAttribute("org.apache.catalina.filters.CSRF_NONCE"); However the exception I received back was the following: java.lang.ClassCastException: org.apache.catalina.filters.CsrfPreventionFilter$LruCache cannot be cast to java.lang.String Ok, now I know that the org.apache.catalina.filters.CSRF_NONCE is not a String but something else. In the API description for org.apache.catalina.filters.CsrfPreventionFilter.LruCache there is only two methods: add and contains. Neither of which would help me access the value of this CSRF_NONCE. And maybe I'm going about this all wrong, and how this works, but what I was thinking about doing was to grab what I had presumed to be a value from the Attribute org.apache.catalina.filters.CSRF_NONCE and ensure that value gets propagated so that when the XSLT does it's transformation it will be there included with the link (we don't use JSP). I am going about this correctly right? If so is there a value from org.apache.catalina.filters.CSRF_NONCE that I should be able to extract? Like the actual nonce value? Cheers, Matt - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] Working of Tomcat with MS Access
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Barry, On 4/15/2011 3:11 PM, Propes, Barry L wrote: > Oh, ok - that's good. Although I'm not familiar with it, but will > take it under advisement. You could think of it as Java's answer to Access, except that I wouldn't want to be that demeaning of JavaDB (aka Apache Derby). It's transactional, which is I think more than you can say about MS Access files, but also file-based meaning that I think you can just copy a single file around and "move" the database. It's not usually that simple in the larger RDBMS world. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2onyoACgkQ9CaO5/Lv0PDgnACguZpmDV0+OLpe5poz7R8uhMS8 weIAn244//QAT/DvHhpEn3976U7cZJ7J =Gsw6 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Filters and JSP
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Bill, On 4/14/2011 8:11 PM, Bill Davidson wrote: > public MyResponseWrapper( HttpServletResponse response ) throws > IOException { > super(response); > myOutputStream = new MyOutputStream(response); > OutputStreamWriter osw = new > OutputStreamWriter(myOutputStream, response.getCharacterEncoding()); > printWriter = new PrintWriter(osw); > } My experience has been that handling cases where the servlet can call either response.getOutputStream or response.getWriter is a pain in the neck: you've got to be very careful to handle either scenario. Are any of your methods catching IOException and not logging them? > The problem seems to be that it only calls write(byte[], int, int) > once when it's a JSP. Regardless of the amount of data that the JSP /should/ be returning? > It will get called multiple times for a servlet but just > once for > the JSP. It's getting called with offset = 0 and len = 8192, and > that's about > how much output I get. My page is always truncated. If you remove your filter, does the page return the expected content to the client? If so, it's your filter that is broken :( > Obviously there is > some sort of buffered writer calling my write() routine. JSPs support (and probably always use) buffered output. It's not a surprise that you are getting a large amount of data in a single write() call... though if there were more than 8192 bytes of total content, I would expect that multiple write() calls would be made. > All of the output methods from ServletOutputStream are overridden and > logged, so I know what is getting called. Can you give us an example of a log dump during JSP evaluation? > Also, flush() gets called at the end for servlets but never gets called > for a JSP. A JSP is just a servlet that has been compiled from a JSP source, so they're really not that different. A difference I can think of is that many servlets might explicitly call flush() while a JSP-generated one does not, and Tomcat calls flush() before closing the stream. Since your filter has lost control /before/ Tomcat flushes and closes the stream back to the client, you may be missing this flush() call altogether. > Is there something I need to do in my JSP's? You could try disabling buffering, just to see if things improve. Your performance will suffer, of course. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2onQgACgkQ9CaO5/Lv0PCcUwCgmp9KnTDeti7Bd25gyy8LHjL4 ICwAn1FVokAtb1YRqwPpxoTRbKqKvk7a =6JRm -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Embbeded tomcat utilizing more CUP Usage.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rushikesh, On 4/15/2011 1:01 AM, Rushikesh.Pisal wrote: > While running two instance of embedded tomcat in our application the CPU > usage gets 100%. :( > We are using Tomcat 5.0.30 version. > I know Tomcat 5.X is bit old but it is very much danger for project to > replace at this point of time. That's too bad. You do know that Tomcat 5.0.x is no longer supported -- even for security updates? That could be dangerous, too... > Secondly , We are using only one servlet in our application,it just take > request n do some processing and send response. So there are no looping > which can hock the CPU. Are you sure? > If we remove calling of embeded tomcat from our application then CPU usage > also get reduced from 50% to 20% so . That seems like a lot to me, but you know your application better than I do. > It is sure that when I strat TOMCAT it is taking more CPU Usage. > Is there any steps/configuration to reduce CPU usage? Can you post all the code you use to embed Tomcat? Specifically, what do you do /after/ you call Tomcat's startup routines? > I have found some ways in some website i.e. maxThreads="50" > minSpareThreads="5" maxSpareThreads="20" acceptCount="100" > connectionTimeout="2000"/> > since embeded tomcat does not use server.xml file and I am not able to find > programmitical way to do this. These are all configured on the Connector that you create yourself. You can set these values before you add the Connector to Tomcat. Tomcat does not really use any CPU resource when no requests are being serviced. Seeing your code would be very helpful. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2omwMACgkQ9CaO5/Lv0PDxywCfXgvuGLEbe74nJWhHauSKt2kD EfUAoKObCJqyNfeWvse1C20V9BNsPmhF =SM7u -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to find session.org.apache.catalina.filters.CSRF_NONCE
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mathew, On 4/14/2011 9:58 AM, Mathew Samuel wrote: > So I do in fact have a reference to the HttpSession related to the > currently-running request. However I do a "getAttributeNames()" to it > but the Enumeration I get back is empty (i.e. non-null but empty so > that a "hasMoreElements()" call to the HttpSession object says > "false"). > > The "org.apache.catalina.filters.CSRF_NONCE" key should be an > attribute correct? Tomcat "hides" certain session attributes from the enumeration returned by getAttributeNames. It's possible that this is one of them. Can you try to query it directly? Check out the code for the filter to see how it's used: http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_12/java/org/apache/catalina/filters/CsrfPreventionFilter.java > Although it is quite likely that I'm doing something wrong as I > wouldn't figure that the Enumeration returned by > "getAttributeNames()" would be empty although a "getId()" call to the > HttpSession object is at least returning something so I know there is > an actual HttpSession object present anyways. That is definitely good. > So yeah should "org.apache.catalina.filters.CSRF_NONCE" be listed as > on of the attributes I would get back if a "getAttributeNames()" call > had been made to the HttpSession object? Maybe :) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2omVQACgkQ9CaO5/Lv0PBfeACgvIuY+KtmyJoBAwfh6knsmIyM CZMAn2ZD5OSJp+fWTjEyonAbK3rclxBH =bf/N -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Working of Tomcat with MS Access
Oh, ok - that's good. Although I'm not familiar with it, but will take it under advisement. -Original Message- From: Christopher Schultz [mailto:ch...@christopherschultz.net] Sent: Friday, April 15, 2011 2:03 PM To: Tomcat Users List Subject: Re: Working of Tomcat with MS Access -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Barry, On 4/15/2011 1:56 PM, Propes, Barry L wrote: > Like Jeff says, you can do this basically for no cost using both > Tomcat and mySQL. Even better, use JavaDB: it comes with Java and is pretty much guaranteed to work. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2olmwACgkQ9CaO5/Lv0PAFOwCgigjZqt/9QyFXXCg68L1A2cHk PpYAoKK3VzrDZhRZiKlbFiqsmurJHd2l =4sLQ -END PGP SIGNATURE- - 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: Working of Tomcat with MS Access
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Barry, On 4/15/2011 1:56 PM, Propes, Barry L wrote: > Like Jeff says, you can do this basically for no cost using both > Tomcat and mySQL. Even better, use JavaDB: it comes with Java and is pretty much guaranteed to work. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2olmwACgkQ9CaO5/Lv0PAFOwCgigjZqt/9QyFXXCg68L1A2cHk PpYAoKK3VzrDZhRZiKlbFiqsmurJHd2l =4sLQ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jeff, On 4/15/2011 11:11 AM, Jeff Hubbs wrote: > You do realize, I hope, that what you're proposing is akin to sourcing > parts for your jet engine from Fisher-Price? :) > MS Access is a desktop application that accesses files on disk. Java > apps running on Tomcat typically access an RDBMS over a network > connection via SQL statements and their responses. AFAIK there is not a > "server instantiation" of MS Access; While you're right, I believe that MS has an Access JDBC (or ODBC) driver that allows you to specify the file to open as part of the JDBC URL. It's kind of like using a CSV file as a database, though... Anyway, this is possible. He's just missing some configuration of some kind. I feel kind of fortunate that I have no past experience on which to draw to help the OP. Google for "read access database in Java" perhaps? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2olikACgkQ9CaO5/Lv0PB7IACglUXVRbvRHHNlcj6G98Ad2rjh kRgAn1s7RvlCRbcQiugCigDG9KqXGJF+ =lSz2 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
There is no startup.bat file in the directory u specified. In my system the directory path is C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin On Sat, Apr 16, 2011 at 12:14 AM, Angel Java Lopez wrote: > Rahul: > > Stop tomcat as a service. > Go to //bin > Run startup.bat > Try your app again. > > Only to discard user account/access problems. > > On Fri, Apr 15, 2011 at 3:13 PM, RAHUL RAJ > wrote: > > > running 'tomcat as standalone java program'? can u explain for me sir? > > > > 2011/4/15 Mikolaj Rydzewski > > > > > RAHUL RAJ wrote: > > > > > >> This is like a small assignment that has to be submitted urgently..so > I > > >> have > > >> to run away from the error! and tried with MS ACCESS. > > >> The jdbc program for access works perfect alone.. > > >> > > >> > > > So run tomcat as a 'standalone' java program - that means not as a > > service. > > > > > > > > > -- > > > Mikolaj Rydzewski > > > > > > > > > - > > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > > > > >
Re: Working of Tomcat with MS Access
Rahul: Stop tomcat as a service. Go to //bin Run startup.bat Try your app again. Only to discard user account/access problems. On Fri, Apr 15, 2011 at 3:13 PM, RAHUL RAJ wrote: > running 'tomcat as standalone java program'? can u explain for me sir? > > 2011/4/15 Mikolaj Rydzewski > > > RAHUL RAJ wrote: > > > >> This is like a small assignment that has to be submitted urgently..so I > >> have > >> to run away from the error! and tried with MS ACCESS. > >> The jdbc program for access works perfect alone.. > >> > >> > > So run tomcat as a 'standalone' java program - that means not as a > service. > > > > > > -- > > Mikolaj Rydzewski > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > >
Re: Working of Tomcat with MS Access
Yes of course...I did the same...then what to do with this error? Remember that Now I am working in ACCESS. code is not much different... On Sat, Apr 16, 2011 at 12:10 AM, Troy wrote: > I believe the drivers should be located in: YourApp/WEB-INF/lib/ > > > Troy > > > > > > > > > -Original Message- > From: RAHUL RAJ > To: Tomcat Users List > Sent: Fri, Apr 15, 2011 2:35 pm > Subject: Re: Working of Tomcat with MS Access > > > Thank you very much for your help! When I did with mysql, the corresponding > > jdbc driver is stored in /webapps/ROOT/lib directory in tomcat. > > > > On Fri, Apr 15, 2011 at 11:56 PM, Troy wrote: > > > > > I wrote a quick little jsp to access one of my db (a mysql) > > > > > > > > > <%@page contentType="text/html" pageEncoding="UTF-8"%> > > > <%@page import="java.sql.*" %> > > > > > "http://www.w3.org/TR/html4/loose.dtd";> > > > > > > > > > > > > > > >Test Connection > > > > > > > > > > > ><% > > >String name = ""; > > >Class.forName("com.mysql.jdbc.Driver"); > > >Connection conn = > > > DriverManager.getConnection("jdbc:mysql://localhost/dbName", "", > > > "XX"); > > >Statement stmt = conn.createStatement(); > > >String query = "select * from friends where id='1'"; > > >ResultSet rs = stmt.executeQuery(query); > > >while(rs.next()){ > > > name = rs.getString(3); > > >} > > > > > > %> > > > > > > <%= name %> > > > > > > > > > > > > > > > Worked like expected. I know this is not a java thread . . . but still > > > trying to help since it is a time sensitive matter. > > > Silly question, but are your jdbc drivers added to your library for the > web > > > app? I make this mistake ALL the time. > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > From: RAHUL RAJ > > > To: Tomcat Users List > > > Sent: Fri, Apr 15, 2011 1:59 pm > > > Subject: Re: Working of Tomcat with MS Access > > > > > > > > > ya...I did the same thing you told in mysql...but communications > Exception > > > > > > occured.. > > > > > > This is like a small assignment that has to be submitted urgently..so I > > > have > > > > > > to run away from the error! and tried with MS ACCESS. > > > > > > The jdbc program for access works perfect alone.. > > > > > > > > > > > > On Fri, Apr 15, 2011 at 11:19 PM, Troy wrote: > > > > > > > > > > > > > Raj, > > > > > > > > > > > > > > I think everyone is saying to take a look at this syntax: > > > > > > > > > > > > > > > > > > > > > >String url = "jdbc:odbc:rahul"; > > > > > > > >Connection con = DriverManager.getConnection(url, "", > > > ""); > > > > > > > > > > > > > > > > > > > > > I know that when I make this type of simple jdbc connection in mysql > the > > > > > > > syntax is: > > > > > > > > > > > > > > String url = "jdbc:mysql://localhost/dbName"; > > > > > > > Connection conn = DriverManager.getConnection(url, "", ""); > > > > > > > > > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > > > > > From: RAHUL RAJ > > > > > > > To: Tomcat Users List > > > > > > > Sent: Fri, Apr 15, 2011 1:31 pm > > > > > > > Subject: Re: Working of Tomcat with MS Access > > > > > > > > > > > > > > > > > > > > > I got communications exception when I did this with mysql...and no one > > > > > > > knows > > > > > > > > > > > > > > the reason perfectly...no response from mysql forum too... > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Fri, Apr 15, 2011 at 9:08 PM, Troy wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Raj; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > To all reading this response, this is my first response on this list > so > > > > > > > if > > > > > > > > > > > > > > > I get it a little wrong have patience. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > You may want to look at the light weight RDBMS mysql. It is free, > > > easily > > > > > > > > > > > > > > > installed and can be utilized with the companion Workbench to make > > > > > > > dealing > > > > > > > > > > > > > > > with the db very easy, a lot like the access interface. You will > have > > > > > > > good > > > > > > > > > > > > > > > driver support from the java end as well and a lot of documentation > and > > > > > > > > > > > > > > > tutorials to get you connected in your web app to your persistence > > > layer. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > mysql.com > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Just my two cents and an attempt to give back a little to the > > > community. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Re: Working of Tomcat with MS Access
I believe the drivers should be located in: YourApp/WEB-INF/lib/ Troy -Original Message- From: RAHUL RAJ To: Tomcat Users List Sent: Fri, Apr 15, 2011 2:35 pm Subject: Re: Working of Tomcat with MS Access Thank you very much for your help! When I did with mysql, the corresponding jdbc driver is stored in /webapps/ROOT/lib directory in tomcat. On Fri, Apr 15, 2011 at 11:56 PM, Troy wrote: > I wrote a quick little jsp to access one of my db (a mysql) > > > <%@page contentType="text/html" pageEncoding="UTF-8"%> > <%@page import="java.sql.*" %> >"http://www.w3.org/TR/html4/loose.dtd";> > > > > >Test Connection > > > ><% >String name = ""; >Class.forName("com.mysql.jdbc.Driver"); >Connection conn = > DriverManager.getConnection("jdbc:mysql://localhost/dbName", "", > "XX"); >Statement stmt = conn.createStatement(); >String query = "select * from friends where id='1'"; >ResultSet rs = stmt.executeQuery(query); >while(rs.next()){ > name = rs.getString(3); >} > > %> > > <%= name %> > > > > > Worked like expected. I know this is not a java thread . . . but still > trying to help since it is a time sensitive matter. > Silly question, but are your jdbc drivers added to your library for the web > app? I make this mistake ALL the time. > > Troy > > > > > > > > > > > -Original Message- > From: RAHUL RAJ > To: Tomcat Users List > Sent: Fri, Apr 15, 2011 1:59 pm > Subject: Re: Working of Tomcat with MS Access > > > ya...I did the same thing you told in mysql...but communications Exception > > occured.. > > This is like a small assignment that has to be submitted urgently..so I > have > > to run away from the error! and tried with MS ACCESS. > > The jdbc program for access works perfect alone.. > > > > On Fri, Apr 15, 2011 at 11:19 PM, Troy wrote: > > > > > Raj, > > > > > > I think everyone is saying to take a look at this syntax: > > > > > > > > > >String url = "jdbc:odbc:rahul"; > > > >Connection con = DriverManager.getConnection(url, "", > ""); > > > > > > > > > I know that when I make this type of simple jdbc connection in mysql the > > > syntax is: > > > > > > String url = "jdbc:mysql://localhost/dbName"; > > > Connection conn = DriverManager.getConnection(url, "", ""); > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > From: RAHUL RAJ > > > To: Tomcat Users List > > > Sent: Fri, Apr 15, 2011 1:31 pm > > > Subject: Re: Working of Tomcat with MS Access > > > > > > > > > I got communications exception when I did this with mysql...and no one > > > knows > > > > > > the reason perfectly...no response from mysql forum too... > > > > > > > > > > > > On Fri, Apr 15, 2011 at 9:08 PM, Troy wrote: > > > > > > > > > > > > > Raj; > > > > > > > > > > > > > > To all reading this response, this is my first response on this list so > > > if > > > > > > > I get it a little wrong have patience. > > > > > > > > > > > > > > You may want to look at the light weight RDBMS mysql. It is free, > easily > > > > > > > installed and can be utilized with the companion Workbench to make > > > dealing > > > > > > > with the db very easy, a lot like the access interface. You will have > > > good > > > > > > > driver support from the java end as well and a lot of documentation and > > > > > > > tutorials to get you connected in your web app to your persistence > layer. > > > > > > > > > > > > > > mysql.com > > > > > > > > > > > > > > Just my two cents and an attempt to give back a little to the > community. > > > > > > > > > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > > > > > From: RAHUL RAJ > > > > > > > To: users > > > > > > > Sent: Fri, Apr 15, 2011 6:05 am > > > > > > > Subject: Working of Tomcat with MS Access > > > > > > > > > > > > > > > > > > > > > Hello, > > > > > > > > > > > > > > I am working on building a jsp website with MS Access as > > > > > > > > > > > > > > database. When my login page is loaded on tomcat > > > > > > > > > > > > > > (localhost:8080/login.jsp), it shows the following error: > > > > > > > > > > > > > > > > > > > > > > > > > > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > > > > > > > > > > > > > > name not found and no default driver specified. > > > > > > > > > > > > > > > > > > > > > > > > > > > > The jdbc program
Re: Working of Tomcat with MS Access
Thank you very much for your help! When I did with mysql, the corresponding jdbc driver is stored in /webapps/ROOT/lib directory in tomcat. On Fri, Apr 15, 2011 at 11:56 PM, Troy wrote: > I wrote a quick little jsp to access one of my db (a mysql) > > > <%@page contentType="text/html" pageEncoding="UTF-8"%> > <%@page import="java.sql.*" %> >"http://www.w3.org/TR/html4/loose.dtd";> > > > > >Test Connection > > > ><% >String name = ""; >Class.forName("com.mysql.jdbc.Driver"); >Connection conn = > DriverManager.getConnection("jdbc:mysql://localhost/dbName", "", > "XX"); >Statement stmt = conn.createStatement(); >String query = "select * from friends where id='1'"; >ResultSet rs = stmt.executeQuery(query); >while(rs.next()){ > name = rs.getString(3); >} > > %> > > <%= name %> > > > > > Worked like expected. I know this is not a java thread . . . but still > trying to help since it is a time sensitive matter. > Silly question, but are your jdbc drivers added to your library for the web > app? I make this mistake ALL the time. > > Troy > > > > > > > > > > > -Original Message- > From: RAHUL RAJ > To: Tomcat Users List > Sent: Fri, Apr 15, 2011 1:59 pm > Subject: Re: Working of Tomcat with MS Access > > > ya...I did the same thing you told in mysql...but communications Exception > > occured.. > > This is like a small assignment that has to be submitted urgently..so I > have > > to run away from the error! and tried with MS ACCESS. > > The jdbc program for access works perfect alone.. > > > > On Fri, Apr 15, 2011 at 11:19 PM, Troy wrote: > > > > > Raj, > > > > > > I think everyone is saying to take a look at this syntax: > > > > > > > > > >String url = "jdbc:odbc:rahul"; > > > >Connection con = DriverManager.getConnection(url, "", > ""); > > > > > > > > > I know that when I make this type of simple jdbc connection in mysql the > > > syntax is: > > > > > > String url = "jdbc:mysql://localhost/dbName"; > > > Connection conn = DriverManager.getConnection(url, "", ""); > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > From: RAHUL RAJ > > > To: Tomcat Users List > > > Sent: Fri, Apr 15, 2011 1:31 pm > > > Subject: Re: Working of Tomcat with MS Access > > > > > > > > > I got communications exception when I did this with mysql...and no one > > > knows > > > > > > the reason perfectly...no response from mysql forum too... > > > > > > > > > > > > On Fri, Apr 15, 2011 at 9:08 PM, Troy wrote: > > > > > > > > > > > > > Raj; > > > > > > > > > > > > > > To all reading this response, this is my first response on this list so > > > if > > > > > > > I get it a little wrong have patience. > > > > > > > > > > > > > > You may want to look at the light weight RDBMS mysql. It is free, > easily > > > > > > > installed and can be utilized with the companion Workbench to make > > > dealing > > > > > > > with the db very easy, a lot like the access interface. You will have > > > good > > > > > > > driver support from the java end as well and a lot of documentation and > > > > > > > tutorials to get you connected in your web app to your persistence > layer. > > > > > > > > > > > > > > mysql.com > > > > > > > > > > > > > > Just my two cents and an attempt to give back a little to the > community. > > > > > > > > > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > > > > > From: RAHUL RAJ > > > > > > > To: users > > > > > > > Sent: Fri, Apr 15, 2011 6:05 am > > > > > > > Subject: Working of Tomcat with MS Access > > > > > > > > > > > > > > > > > > > > > Hello, > > > > > > > > > > > > > > I am working on building a jsp website with MS Access as > > > > > > > > > > > > > > database. When my login page is loaded on tomcat > > > > > > > > > > > > > > (localhost:8080/login.jsp), it shows the following error: > > > > > > > > > > > > > > > > > > > > > > > > > > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > > > > > > > > > > > > > > name not found and no default driver specified. > > > > > > > > > > > > > > > > > > > > > > > > > > > > The jdbc program alone is working perfectly, So There might not be > > > > > > > > > > > > > > problems due to Driver, Data source name, Database Tables or any > > > > > > > > > > > > > > other software version compatibilities. > > > > > > > > > > > > > > > > > > > > > > > > > > > > OS: Windows Vista Home Basic > > > > > > > > > > > > > > Tomcat Version: 5.5.x > > > > > > > > > > > > > > jdk version: 1.6 > > > > > > > > > > > > > > MS Access 2010 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > code is given below: > > > > > > > > > > > > > > > > > > > > > > > > > > > > <%@ pag
Re: Working of Tomcat with MS Access
I wrote a quick little jsp to access one of my db (a mysql) <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page import="java.sql.*" %> http://www.w3.org/TR/html4/loose.dtd";> Test Connection <% String name = ""; Class.forName("com.mysql.jdbc.Driver"); Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/dbName", "", "XX"); Statement stmt = conn.createStatement(); String query = "select * from friends where id='1'"; ResultSet rs = stmt.executeQuery(query); while(rs.next()){ name = rs.getString(3); } %> <%= name %> Worked like expected. I know this is not a java thread . . . but still trying to help since it is a time sensitive matter. Silly question, but are your jdbc drivers added to your library for the web app? I make this mistake ALL the time. Troy -Original Message- From: RAHUL RAJ To: Tomcat Users List Sent: Fri, Apr 15, 2011 1:59 pm Subject: Re: Working of Tomcat with MS Access ya...I did the same thing you told in mysql...but communications Exception occured.. This is like a small assignment that has to be submitted urgently..so I have to run away from the error! and tried with MS ACCESS. The jdbc program for access works perfect alone.. On Fri, Apr 15, 2011 at 11:19 PM, Troy wrote: > Raj, > > I think everyone is saying to take a look at this syntax: > > > >String url = "jdbc:odbc:rahul"; > >Connection con = DriverManager.getConnection(url, "", ""); > > > I know that when I make this type of simple jdbc connection in mysql the > syntax is: > > String url = "jdbc:mysql://localhost/dbName"; > Connection conn = DriverManager.getConnection(url, "", ""); > > Troy > > > > > > > > > > > -Original Message- > From: RAHUL RAJ > To: Tomcat Users List > Sent: Fri, Apr 15, 2011 1:31 pm > Subject: Re: Working of Tomcat with MS Access > > > I got communications exception when I did this with mysql...and no one > knows > > the reason perfectly...no response from mysql forum too... > > > > On Fri, Apr 15, 2011 at 9:08 PM, Troy wrote: > > > > > Raj; > > > > > > To all reading this response, this is my first response on this list so > if > > > I get it a little wrong have patience. > > > > > > You may want to look at the light weight RDBMS mysql. It is free, easily > > > installed and can be utilized with the companion Workbench to make > dealing > > > with the db very easy, a lot like the access interface. You will have > good > > > driver support from the java end as well and a lot of documentation and > > > tutorials to get you connected in your web app to your persistence layer. > > > > > > mysql.com > > > > > > Just my two cents and an attempt to give back a little to the community. > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > From: RAHUL RAJ > > > To: users > > > Sent: Fri, Apr 15, 2011 6:05 am > > > Subject: Working of Tomcat with MS Access > > > > > > > > > Hello, > > > > > > I am working on building a jsp website with MS Access as > > > > > > database. When my login page is loaded on tomcat > > > > > > (localhost:8080/login.jsp), it shows the following error: > > > > > > > > > > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > > > > > > name not found and no default driver specified. > > > > > > > > > > > > The jdbc program alone is working perfectly, So There might not be > > > > > > problems due to Driver, Data source name, Database Tables or any > > > > > > other software version compatibilities. > > > > > > > > > > > > OS: Windows Vista Home Basic > > > > > > Tomcat Version: 5.5.x > > > > > > jdk version: 1.6 > > > > > > MS Access 2010 > > > > > > > > > > > > > > > > > > code is given below: > > > > > > > > > > > > <%@ page language="java" import="java.sql.*" %> > > > > > > > > > > > > > > > > > > > > > > > > Enter your username : > > > > > > Enter your password : > > > > > > > > > > > > <% > > > > > >String usn = request.getParameter("username"); > > > > > >String pass = request.getParameter("password"); > > > > > > > > > > > >try{ > > > > > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > > > > > > String url = "jdbc:odbc:rahul"; > > > > > > Connection con = DriverManager.getConnection(url, "", > ""); > > > > > > Statement s = con.createStatement(); > > > > > > > > > > > > ResultSet rs = s.executeQuery("select * from customers"); > > > > > > while(rs.next()) > > >
Re: Working of Tomcat with MS Access
running 'tomcat as standalone java program'? can u explain for me sir? 2011/4/15 Mikolaj Rydzewski > RAHUL RAJ wrote: > >> This is like a small assignment that has to be submitted urgently..so I >> have >> to run away from the error! and tried with MS ACCESS. >> The jdbc program for access works perfect alone.. >> >> > So run tomcat as a 'standalone' java program - that means not as a service. > > > -- > Mikolaj Rydzewski > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Working of Tomcat with MS Access
RAHUL RAJ wrote: This is like a small assignment that has to be submitted urgently..so I have to run away from the error! and tried with MS ACCESS. The jdbc program for access works perfect alone.. So run tomcat as a 'standalone' java program - that means not as a service. -- Mikolaj Rydzewski - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
No I am in Windows mode. On Fri, Apr 15, 2011 at 11:26 PM, Propes, Barry L wrote: > Jeff has some really good points here, Rahul. > > I'm a guy who spent several years doing ASP development with both MS Access > and SQL Server over the web before getting into Java. > Even still, I didn't fathom trying to mess with MS Access with Java when I > was making that transition. I started with mySQL on my Windows desktop to > get started, but when I got access to our Oracle servers, went that route. > > Like Jeff says, you can do this basically for no cost using both Tomcat and > mySQL. > > Sure, it's command line, unlike MS Access, but you shouldn't have too much > trouble with it. Jeff, if he's using MS Access, he's probably not on Linux, > is he? > > > -Original Message- > From: Jeff Hubbs [mailto:jhubbsl...@att.net] > Sent: Friday, April 15, 2011 12:46 PM > To: Tomcat Users List > Subject: Re: Working of Tomcat with MS Access > > A beginner needs to at least begin with workable platforms and software. > PostgreSQL on Linux has a total software license cost of $0.00; your > barrier to entry with inappropriate software is considerably higher. > > On 4/15/11 1:35 PM, RAHUL RAJ wrote: > > Since I am a beginner, I have to start with some trial projects, > > right? I know this is nothing! and help me...pls answer to the > "question.". > > > > On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs wrote: > > > >> You do realize, I hope, that what you're proposing is akin to > >> sourcing parts for your jet engine from Fisher-Price? > >> > >> IMHO MS Access is not and never has been useful as a professional > >> database product. I'm not even sure if what you are proposing even > >> holds up in the looking-through-binoculars-from-the-big-end sense. > >> > >> MS Access is a desktop application that accesses files on disk. Java > >> apps running on Tomcat typically access an RDBMS over a network > >> connection via SQL statements and their responses. AFAIK there is > >> not a "server instantiation" of MS Access; in fact, part of the whole > >> point of MS Access as an ongoing product is that it acts as a > >> "gateway drug" to MS' SQL Server product, the transition to which > >> would be triggered by the inherent limitations (and, in my past > >> experience, persistent unaddressed bugs) of Access. > >> > >> I think you need to back up a bit and work toward getting your data > >> liberated from MS Access and ported into a proper RDBMS like > >> PostgreSQL or one of MS SQL Server, Oracle, IBM DB2, etc. if you feel > >> that money must be continually spent on software licenses for such. > >> Then you will be facing Java apps and Tomcat in a far more conventional > way. > >> > >> So, to sum up this and earlier responses: 1) Learn to code Java 2) > >> Understand real RDBMSses. > >> > >> - Jeff > >> > >> > >> On 4/15/11 6:04 AM, RAHUL RAJ wrote: > >> > >>> Hello, > >>> I am working on building a jsp website with MS Access as > >>> database. When my login page is loaded on tomcat > >>> (localhost:8080/login.jsp), it shows the following error: > >>> > >>> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > >>> name not found and no default driver specified. > >>> > >>> The jdbc program alone is working perfectly, So There might not be > >>> problems due to Driver, Data source name, Database Tables or any > >>> other software version compatibilities. > >>> > >>> OS: Windows Vista Home Basic > >>> Tomcat Version: 5.5.x > >>> jdk version: 1.6 > >>> MS Access 2010 > >>> > >>> > >>> code is given below: > >>> > >>> <%@ page language="java" import="java.sql.*" %> > >>> > >>> > >>> > >>> Enter your username : > > >>> Enter your password : > > >>> > >>> <% > >>> String usn = request.getParameter("username"); > >>> String pass = request.getParameter("password"); > >>> > >>> try{ > >>> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > >>> String url = "jdbc:odbc:rahul"; > >>> Connection con = DriverManager.getConnection(url, "", > ""); > >>> Statement s = con.createStatement(); > >>> > >>> ResultSet rs = s.executeQuery("select * from > customers"); > >>> while(rs.next()) > >>> { > >>>String u = rs.getString(1); > >>>String p = rs.getString(2); > >>>if(usn.equals(u)&& pass.equals(p)) > >>>{ > >>> out.println("login successfull"); > >>> } > >>>else > >>> { > >>>out.println("login failed"); > >>> } > >>> } > >>> } > >>> > >>> catch(Exception e) > >>> { > >>>out.println("Error"+e); > >>>} > >>> > >>> %> > >>> > >>> > >>> > >>> > >>>
Re: Working of Tomcat with MS Access
ya...I did the same thing you told in mysql...but communications Exception occured.. This is like a small assignment that has to be submitted urgently..so I have to run away from the error! and tried with MS ACCESS. The jdbc program for access works perfect alone.. On Fri, Apr 15, 2011 at 11:19 PM, Troy wrote: > Raj, > > I think everyone is saying to take a look at this syntax: > > > >String url = "jdbc:odbc:rahul"; > >Connection con = DriverManager.getConnection(url, "", ""); > > > I know that when I make this type of simple jdbc connection in mysql the > syntax is: > > String url = "jdbc:mysql://localhost/dbName"; > Connection conn = DriverManager.getConnection(url, "", ""); > > Troy > > > > > > > > > > > -Original Message- > From: RAHUL RAJ > To: Tomcat Users List > Sent: Fri, Apr 15, 2011 1:31 pm > Subject: Re: Working of Tomcat with MS Access > > > I got communications exception when I did this with mysql...and no one > knows > > the reason perfectly...no response from mysql forum too... > > > > On Fri, Apr 15, 2011 at 9:08 PM, Troy wrote: > > > > > Raj; > > > > > > To all reading this response, this is my first response on this list so > if > > > I get it a little wrong have patience. > > > > > > You may want to look at the light weight RDBMS mysql. It is free, easily > > > installed and can be utilized with the companion Workbench to make > dealing > > > with the db very easy, a lot like the access interface. You will have > good > > > driver support from the java end as well and a lot of documentation and > > > tutorials to get you connected in your web app to your persistence layer. > > > > > > mysql.com > > > > > > Just my two cents and an attempt to give back a little to the community. > > > > > > Troy > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -Original Message- > > > From: RAHUL RAJ > > > To: users > > > Sent: Fri, Apr 15, 2011 6:05 am > > > Subject: Working of Tomcat with MS Access > > > > > > > > > Hello, > > > > > > I am working on building a jsp website with MS Access as > > > > > > database. When my login page is loaded on tomcat > > > > > > (localhost:8080/login.jsp), it shows the following error: > > > > > > > > > > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > > > > > > name not found and no default driver specified. > > > > > > > > > > > > The jdbc program alone is working perfectly, So There might not be > > > > > > problems due to Driver, Data source name, Database Tables or any > > > > > > other software version compatibilities. > > > > > > > > > > > > OS: Windows Vista Home Basic > > > > > > Tomcat Version: 5.5.x > > > > > > jdk version: 1.6 > > > > > > MS Access 2010 > > > > > > > > > > > > > > > > > > code is given below: > > > > > > > > > > > > <%@ page language="java" import="java.sql.*" %> > > > > > > > > > > > > > > > > > > > > > > > > Enter your username : > > > > > > Enter your password : > > > > > > > > > > > > <% > > > > > >String usn = request.getParameter("username"); > > > > > >String pass = request.getParameter("password"); > > > > > > > > > > > >try{ > > > > > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > > > > > > String url = "jdbc:odbc:rahul"; > > > > > > Connection con = DriverManager.getConnection(url, "", > ""); > > > > > > Statement s = con.createStatement(); > > > > > > > > > > > > ResultSet rs = s.executeQuery("select * from customers"); > > > > > > while(rs.next()) > > > > > > { > > > > > > String u = rs.getString(1); > > > > > > String p = rs.getString(2); > > > > > > if(usn.equals(u) && pass.equals(p)) > > > > > > { > > > > > > out.println("login successfull"); > > > > > > } > > > > > > else > > > > > > { > > > > > > out.println("login failed"); > > > > > > } > > > > > > } > > > > > >} > > > > > > > > > > > >catch(Exception e) > > > > > >{ > > > > > > out.println("Error"+e); > > > > > > } > > > > > > > > > > > > %> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > > > > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > > > > > > > > > > > > > > > > > >
RE: Working of Tomcat with MS Access
Jeff has some really good points here, Rahul. I'm a guy who spent several years doing ASP development with both MS Access and SQL Server over the web before getting into Java. Even still, I didn't fathom trying to mess with MS Access with Java when I was making that transition. I started with mySQL on my Windows desktop to get started, but when I got access to our Oracle servers, went that route. Like Jeff says, you can do this basically for no cost using both Tomcat and mySQL. Sure, it's command line, unlike MS Access, but you shouldn't have too much trouble with it. Jeff, if he's using MS Access, he's probably not on Linux, is he? -Original Message- From: Jeff Hubbs [mailto:jhubbsl...@att.net] Sent: Friday, April 15, 2011 12:46 PM To: Tomcat Users List Subject: Re: Working of Tomcat with MS Access A beginner needs to at least begin with workable platforms and software. PostgreSQL on Linux has a total software license cost of $0.00; your barrier to entry with inappropriate software is considerably higher. On 4/15/11 1:35 PM, RAHUL RAJ wrote: > Since I am a beginner, I have to start with some trial projects, > right? I know this is nothing! and help me...pls answer to the "question.". > > On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs wrote: > >> You do realize, I hope, that what you're proposing is akin to >> sourcing parts for your jet engine from Fisher-Price? >> >> IMHO MS Access is not and never has been useful as a professional >> database product. I'm not even sure if what you are proposing even >> holds up in the looking-through-binoculars-from-the-big-end sense. >> >> MS Access is a desktop application that accesses files on disk. Java >> apps running on Tomcat typically access an RDBMS over a network >> connection via SQL statements and their responses. AFAIK there is >> not a "server instantiation" of MS Access; in fact, part of the whole >> point of MS Access as an ongoing product is that it acts as a >> "gateway drug" to MS' SQL Server product, the transition to which >> would be triggered by the inherent limitations (and, in my past >> experience, persistent unaddressed bugs) of Access. >> >> I think you need to back up a bit and work toward getting your data >> liberated from MS Access and ported into a proper RDBMS like >> PostgreSQL or one of MS SQL Server, Oracle, IBM DB2, etc. if you feel >> that money must be continually spent on software licenses for such. >> Then you will be facing Java apps and Tomcat in a far more conventional way. >> >> So, to sum up this and earlier responses: 1) Learn to code Java 2) >> Understand real RDBMSses. >> >> - Jeff >> >> >> On 4/15/11 6:04 AM, RAHUL RAJ wrote: >> >>> Hello, >>> I am working on building a jsp website with MS Access as >>> database. When my login page is loaded on tomcat >>> (localhost:8080/login.jsp), it shows the following error: >>> >>> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source >>> name not found and no default driver specified. >>> >>> The jdbc program alone is working perfectly, So There might not be >>> problems due to Driver, Data source name, Database Tables or any >>> other software version compatibilities. >>> >>> OS: Windows Vista Home Basic >>> Tomcat Version: 5.5.x >>> jdk version: 1.6 >>> MS Access 2010 >>> >>> >>> code is given below: >>> >>> <%@ page language="java" import="java.sql.*" %> >>> >>> >>> >>> Enter your username : >>> Enter your password : >>> >>> <% >>> String usn = request.getParameter("username"); >>> String pass = request.getParameter("password"); >>> >>> try{ >>> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); >>> String url = "jdbc:odbc:rahul"; >>> Connection con = DriverManager.getConnection(url, "", ""); >>> Statement s = con.createStatement(); >>> >>> ResultSet rs = s.executeQuery("select * from customers"); >>> while(rs.next()) >>> { >>>String u = rs.getString(1); >>>String p = rs.getString(2); >>>if(usn.equals(u)&& pass.equals(p)) >>>{ >>> out.println("login successfull"); >>> } >>>else >>> { >>>out.println("login failed"); >>> } >>> } >>> } >>> >>> catch(Exception e) >>> { >>>out.println("Error"+e); >>>} >>> >>> %> >>> >>> >>> >>> >>> >>> - 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 a
Re: Working of Tomcat with MS Access
Raj, I think everyone is saying to take a look at this syntax: >String url = "jdbc:odbc:rahul"; >Connection con = DriverManager.getConnection(url, "", ""); I know that when I make this type of simple jdbc connection in mysql the syntax is: String url = "jdbc:mysql://localhost/dbName"; Connection conn = DriverManager.getConnection(url, "", ""); Troy -Original Message- From: RAHUL RAJ To: Tomcat Users List Sent: Fri, Apr 15, 2011 1:31 pm Subject: Re: Working of Tomcat with MS Access I got communications exception when I did this with mysql...and no one knows the reason perfectly...no response from mysql forum too... On Fri, Apr 15, 2011 at 9:08 PM, Troy wrote: > Raj; > > To all reading this response, this is my first response on this list so if > I get it a little wrong have patience. > > You may want to look at the light weight RDBMS mysql. It is free, easily > installed and can be utilized with the companion Workbench to make dealing > with the db very easy, a lot like the access interface. You will have good > driver support from the java end as well and a lot of documentation and > tutorials to get you connected in your web app to your persistence layer. > > mysql.com > > Just my two cents and an attempt to give back a little to the community. > > Troy > > > > > > > > > > > -Original Message- > From: RAHUL RAJ > To: users > Sent: Fri, Apr 15, 2011 6:05 am > Subject: Working of Tomcat with MS Access > > > Hello, > > I am working on building a jsp website with MS Access as > > database. When my login page is loaded on tomcat > > (localhost:8080/login.jsp), it shows the following error: > > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > > name not found and no default driver specified. > > > > The jdbc program alone is working perfectly, So There might not be > > problems due to Driver, Data source name, Database Tables or any > > other software version compatibilities. > > > > OS: Windows Vista Home Basic > > Tomcat Version: 5.5.x > > jdk version: 1.6 > > MS Access 2010 > > > > > > code is given below: > > > > <%@ page language="java" import="java.sql.*" %> > > > > > > > > Enter your username : > > Enter your password : > > > > <% > >String usn = request.getParameter("username"); > >String pass = request.getParameter("password"); > > > >try{ > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > > String url = "jdbc:odbc:rahul"; > > Connection con = DriverManager.getConnection(url, "", ""); > > Statement s = con.createStatement(); > > > > ResultSet rs = s.executeQuery("select * from customers"); > > while(rs.next()) > > { > > String u = rs.getString(1); > > String p = rs.getString(2); > > if(usn.equals(u) && pass.equals(p)) > > { > > out.println("login successfull"); > > } > > else > > { > > out.println("login failed"); > > } > > } > >} > > > >catch(Exception e) > >{ > > out.println("Error"+e); > > } > > > > %> > > > > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > >
Re: Working of Tomcat with MS Access
Yes, it runs as a service. But how to know under what account does that service run? does it mean 'admin' or 'normal user' or 'system'? I made a system DSN for this...not the user DSN(Data Source Name) and I launched tomcat service by right click 'run as admin' On Fri, Apr 15, 2011 at 11:09 PM, Leo Donahue - PLANDEVX < leodona...@mail.maricopa.gov> wrote: > > >-Original Message- > >From: RAHUL RAJ [mailto:omrahulraj...@gmail.com] > >Sent: Friday, April 15, 2011 10:35 AM > >To: Tomcat Users List > >Subject: Re: Working of Tomcat with MS Access > > > >Since I am a beginner, I have to start with some trial projects, right? > >I > >know this is nothing! and help me...pls answer to the "question.". > > > > Mikolaj gave you a hint already. > > If your Tomcat runs as a service, under what account does that service run? > Does that account have access to your mdb? > > Did you create a user or system datasource on your computer with the name: > rahul > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Working of Tomcat with MS Access
A beginner needs to at least begin with workable platforms and software. PostgreSQL on Linux has a total software license cost of $0.00; your barrier to entry with inappropriate software is considerably higher. On 4/15/11 1:35 PM, RAHUL RAJ wrote: Since I am a beginner, I have to start with some trial projects, right? I know this is nothing! and help me...pls answer to the "question.". On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs wrote: You do realize, I hope, that what you're proposing is akin to sourcing parts for your jet engine from Fisher-Price? IMHO MS Access is not and never has been useful as a professional database product. I'm not even sure if what you are proposing even holds up in the looking-through-binoculars-from-the-big-end sense. MS Access is a desktop application that accesses files on disk. Java apps running on Tomcat typically access an RDBMS over a network connection via SQL statements and their responses. AFAIK there is not a "server instantiation" of MS Access; in fact, part of the whole point of MS Access as an ongoing product is that it acts as a "gateway drug" to MS' SQL Server product, the transition to which would be triggered by the inherent limitations (and, in my past experience, persistent unaddressed bugs) of Access. I think you need to back up a bit and work toward getting your data liberated from MS Access and ported into a proper RDBMS like PostgreSQL or one of MS SQL Server, Oracle, IBM DB2, etc. if you feel that money must be continually spent on software licenses for such. Then you will be facing Java apps and Tomcat in a far more conventional way. So, to sum up this and earlier responses: 1) Learn to code Java 2) Understand real RDBMSses. - Jeff On 4/15/11 6:04 AM, RAHUL RAJ wrote: Hello, I am working on building a jsp website with MS Access as database. When my login page is loaded on tomcat (localhost:8080/login.jsp), it shows the following error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The jdbc program alone is working perfectly, So There might not be problems due to Driver, Data source name, Database Tables or any other software version compatibilities. OS: Windows Vista Home Basic Tomcat Version: 5.5.x jdk version: 1.6 MS Access 2010 code is given below: <%@ page language="java" import="java.sql.*" %> Enter your username : Enter your password : <% String usn = request.getParameter("username"); String pass = request.getParameter("password"); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:rahul"; Connection con = DriverManager.getConnection(url, "", ""); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select * from customers"); while(rs.next()) { String u = rs.getString(1); String p = rs.getString(2); if(usn.equals(u)&& pass.equals(p)) { out.println("login successfull"); } else { out.println("login failed"); } } } catch(Exception e) { out.println("Error"+e); } %> - 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: Working of Tomcat with MS Access
>-Original Message- >From: RAHUL RAJ [mailto:omrahulraj...@gmail.com] >Sent: Friday, April 15, 2011 10:35 AM >To: Tomcat Users List >Subject: Re: Working of Tomcat with MS Access > >Since I am a beginner, I have to start with some trial projects, right? >I >know this is nothing! and help me...pls answer to the "question.". > Mikolaj gave you a hint already. If your Tomcat runs as a service, under what account does that service run? Does that account have access to your mdb? Did you create a user or system datasource on your computer with the name: rahul - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
Since I am a beginner, I have to start with some trial projects, right? I know this is nothing! and help me...pls answer to the "question.". On Fri, Apr 15, 2011 at 8:41 PM, Jeff Hubbs wrote: > You do realize, I hope, that what you're proposing is akin to sourcing > parts for your jet engine from Fisher-Price? > > IMHO MS Access is not and never has been useful as a professional database > product. I'm not even sure if what you are proposing even holds up in the > looking-through-binoculars-from-the-big-end sense. > > MS Access is a desktop application that accesses files on disk. Java apps > running on Tomcat typically access an RDBMS over a network connection via > SQL statements and their responses. AFAIK there is not a "server > instantiation" of MS Access; in fact, part of the whole point of MS Access > as an ongoing product is that it acts as a "gateway drug" to MS' SQL Server > product, the transition to which would be triggered by the inherent > limitations (and, in my past experience, persistent unaddressed bugs) of > Access. > > I think you need to back up a bit and work toward getting your data > liberated from MS Access and ported into a proper RDBMS like PostgreSQL or > one of MS SQL Server, Oracle, IBM DB2, etc. if you feel that money must be > continually spent on software licenses for such. Then you will be facing > Java apps and Tomcat in a far more conventional way. > > So, to sum up this and earlier responses: 1) Learn to code Java 2) > Understand real RDBMSses. > > - Jeff > > > On 4/15/11 6:04 AM, RAHUL RAJ wrote: > >> Hello, >> I am working on building a jsp website with MS Access as >> database. When my login page is loaded on tomcat >> (localhost:8080/login.jsp), it shows the following error: >> >> java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source >> name not found and no default driver specified. >> >> The jdbc program alone is working perfectly, So There might not be >> problems due to Driver, Data source name, Database Tables or any >> other software version compatibilities. >> >> OS: Windows Vista Home Basic >> Tomcat Version: 5.5.x >> jdk version: 1.6 >> MS Access 2010 >> >> >> code is given below: >> >> <%@ page language="java" import="java.sql.*" %> >> >> >> >>Enter your username : >>Enter your password : >> >> <% >> String usn = request.getParameter("username"); >>String pass = request.getParameter("password"); >> >>try{ >> Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); >> String url = "jdbc:odbc:rahul"; >> Connection con = DriverManager.getConnection(url, "", ""); >> Statement s = con.createStatement(); >> >> ResultSet rs = s.executeQuery("select * from customers"); >> while(rs.next()) >> { >> String u = rs.getString(1); >> String p = rs.getString(2); >> if(usn.equals(u)&& pass.equals(p)) >> { >> out.println("login successfull"); >> } >> else >>{ >> out.println("login failed"); >> } >>} >> } >> >>catch(Exception e) >>{ >> out.println("Error"+e); >> } >> >> %> >> >> >> >> >> - >> 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: Working of Tomcat with MS Access
Yes I already did , that you might think I should. Now I am trying with MS ACCESS...and new error came : SQLException: general error I didn't found any error in my sql syntax or jdbc code. jdbc code alone is working perfectly.. On Fri, Apr 15, 2011 at 9:02 PM, Angel Java Lopez wrote: > One question: > > You should have an ODBC declaration named "rahul". It is declared for your > user, or as a system odbc name? My guess, your Tomcat is running as a > service, or under other user (not your user), and ODBC "rahul" Data Source > name is only for your user. > > Is it the case? > > Did you solve the problem? How? > > Angel "Java" Lopez > http://www.ajlopez.com > http://twitter.com/ajlopez > > On Fri, Apr 15, 2011 at 7:04 AM, RAHUL RAJ > wrote: > > > Hello, > > I am working on building a jsp website with MS Access as > > database. When my login page is loaded on tomcat > > (localhost:8080/login.jsp), it shows the following error: > > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > > name not found and no default driver specified. > > > > The jdbc program alone is working perfectly, So There might not be > > problems due to Driver, Data source name, Database Tables or any > > other software version compatibilities. > > > > OS: Windows Vista Home Basic > > Tomcat Version: 5.5.x > > jdk version: 1.6 > > MS Access 2010 > > > > > > code is given below: > > > > <%@ page language="java" import="java.sql.*" %> > > > > > > > > Enter your username : > > Enter your password : > > > > <% > >String usn = request.getParameter("username"); > >String pass = request.getParameter("password"); > > > >try{ > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > > String url = "jdbc:odbc:rahul"; > > Connection con = DriverManager.getConnection(url, "", > ""); > > Statement s = con.createStatement(); > > > > ResultSet rs = s.executeQuery("select * from customers"); > > while(rs.next()) > > { > > String u = rs.getString(1); > > String p = rs.getString(2); > > if(usn.equals(u) && pass.equals(p)) > > { > > out.println("login successfull"); > > } > > else > > { > > out.println("login failed"); > > } > > } > >} > > > >catch(Exception e) > >{ > > out.println("Error"+e); > > } > > > > %> > > > > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > >
Re: Working of Tomcat with MS Access
I got communications exception when I did this with mysql...and no one knows the reason perfectly...no response from mysql forum too... On Fri, Apr 15, 2011 at 9:08 PM, Troy wrote: > Raj; > > To all reading this response, this is my first response on this list so if > I get it a little wrong have patience. > > You may want to look at the light weight RDBMS mysql. It is free, easily > installed and can be utilized with the companion Workbench to make dealing > with the db very easy, a lot like the access interface. You will have good > driver support from the java end as well and a lot of documentation and > tutorials to get you connected in your web app to your persistence layer. > > mysql.com > > Just my two cents and an attempt to give back a little to the community. > > Troy > > > > > > > > > > > -Original Message- > From: RAHUL RAJ > To: users > Sent: Fri, Apr 15, 2011 6:05 am > Subject: Working of Tomcat with MS Access > > > Hello, > > I am working on building a jsp website with MS Access as > > database. When my login page is loaded on tomcat > > (localhost:8080/login.jsp), it shows the following error: > > > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > > name not found and no default driver specified. > > > > The jdbc program alone is working perfectly, So There might not be > > problems due to Driver, Data source name, Database Tables or any > > other software version compatibilities. > > > > OS: Windows Vista Home Basic > > Tomcat Version: 5.5.x > > jdk version: 1.6 > > MS Access 2010 > > > > > > code is given below: > > > > <%@ page language="java" import="java.sql.*" %> > > > > > > > > Enter your username : > > Enter your password : > > > > <% > >String usn = request.getParameter("username"); > >String pass = request.getParameter("password"); > > > >try{ > > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > > String url = "jdbc:odbc:rahul"; > > Connection con = DriverManager.getConnection(url, "", ""); > > Statement s = con.createStatement(); > > > > ResultSet rs = s.executeQuery("select * from customers"); > > while(rs.next()) > > { > > String u = rs.getString(1); > > String p = rs.getString(2); > > if(usn.equals(u) && pass.equals(p)) > > { > > out.println("login successfull"); > > } > > else > > { > > out.println("login failed"); > > } > > } > >} > > > >catch(Exception e) > >{ > > out.println("Error"+e); > > } > > > > %> > > > > > > > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > > For additional commands, e-mail: users-h...@tomcat.apache.org > > > > > >
[cluster] standalone tomcat hijacks cluster session
Hi Two machines bml0065 and bml0066. Both have OSX 10.6.6, Tomcat 7.0.10, mod_jk 1.2.31, and httpd2.2.17. bml0065 is the reverse proxy. I am following this test plan with the examples/servlets/servlet/SessionExample as the webapp. Scenario - tc65, tc66 are running in a cluster. 1 Remove tc66 from a cluster while people are using the application. - Shut down tc66 by logging into the machine as administrator and issue the sudo /usr/local/tomcat/bin/shutdown.sh commad. - sudo cp /usr/local/tomcat/conf/no-cluster.xml /usr/local/conf/server.xml. - Start up tc66 by issuing: sudo /usr/local/tomcat/bin/startup.sh 2. Access it directly with http://bml0066.yalepathorg/examples/servlets/servlet/SessionExample. Access management console and stop/remove the application. Deploy a new version of the application. 3. Ask users to use an alternative link to that App. - http://host/app 4. Let it run for some time. 5. Add this new application to the cluster in such a way that the new application is now deployed - Shut down tc66: sudo /usr/local/tomcat/bin/shutdown.sh - sudo cp /usr/local/tomcat/conf/cluster.xml /usr/local/conf/server.xml. - Start up tomcat by issuing: sudo /usr/local/tomcat/bin/startup.sh 6. Take other tomcat tc65 out of the cluster. - Shut down tc65 by logging into the machine as administrator and issue the sudo /usr/local/tomcat/bin/shutdown.sh commad. - copy the /usr/local/tomcat/conf/no-cluster.xml to /usr/local/conf/server.xml. - Start up tomcat by issuing: sudo /usr/local/tomcat/bin/startup.sh 7. Deploy the new app on it while users seamlessly switch to tc66 8. Add tc65 back to the cluster. - Shut down tomcat: sudo /usr/local/tomcat/bin/shutdown.sh - sudo cp /usr/local/tomcat/conf/cluster.xml /usr/local/conf/server.xml. - Start up tomcat by issuing: sudo /usr/local/tomcat/bin/startup.sh 9. Now all apps are in sync on both tomcat instance. It works fine untill step 6. When I bring back tc65 as a standalone tomcat with no jvmRoute in its engine block and the Cluster tag is commented out, then when I try to access it via the URL: http://bml0065.yalepath.org/examples/servlets/servlet/SessionExample it hijacks the clustered session. Here is what is on the screen after adding two new session attribute with its value: Sessions Example Session ID: 480C796251BF44355C44FDB0EF4B5AFD.tc66 Created: Fri Apr 15 12:20:40 EDT 2011 Last Accessed: Fri Apr 15 12:44:04 EDT 2011 The following data is in your session: s4 = tc65 up tc66 still standalone s2 = still standalone s9 = tc65 standalone tc66 up s8 = tc65 down, tc66 up s1 = standalone s7 = tc65 down, tc66 up s5 = tc65 up tc66 down s6 = both are up s3 = tc65 up tc66 no cluster It should have come up without the .tc66 affix and with a different sessionid and should have just he s2 = still standalone s1 = standalone attribute names and values. I did not have this issue when tc66 was in its standalone mode. Compared it with the real clustered session accessed via the URL: http://bml0065.yalepath.org/tc/examples/servlets/servlet/SessionExample Session ID: 480C796251BF44355C44FDB0EF4B5AFD.tc66 Created: Fri Apr 15 12:20:40 EDT 2011 Last Accessed: Fri Apr 15 12:42:30 EDT 2011 The following data is in your session: s4 = tc65 up tc66 still standalone s2 = tc65 up tc66 down s9 = tc65 standalone tc66 up s8 = tc65 down, tc66 up s1 = standalone s7 = tc65 down, tc66 up s5 = tc65 up tc66 down s6 = both are up s3 = tc65 up tc66 no cluster Here is the reverse proxy config: ProxyRequests Off BalancerMember http://bml0065.yalepath.org loadfactor=10 BalancerMember http://bml0066.yalepath.org loadfactor=10 ProxySet lbmethod=bytraffic ProxyPass /tc/ balancer://pathCluster/ ProxyPassReverse/tc/ balancer://pathCluster/ ProxyPassReverseCookiePAth / / ProxyPassReverseCookieDomain/ / Thanks ahead, János - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
MySQL is indeed another good Open Source RDBMS; I would not call it "lightweight" in that it is used to power some mighty big Web apps, but the implementation does seem a little quaint. On 4/15/11 11:38 AM, Troy wrote: Raj; To all reading this response, this is my first response on this list so if I get it a little wrong have patience. You may want to look at the light weight RDBMS mysql. It is free, easily installed and can be utilized with the companion Workbench to make dealing with the db very easy, a lot like the access interface. You will have good driver support from the java end as well and a lot of documentation and tutorials to get you connected in your web app to your persistence layer. mysql.com Just my two cents and an attempt to give back a little to the community. Troy -Original Message- From: RAHUL RAJ To: users Sent: Fri, Apr 15, 2011 6:05 am Subject: Working of Tomcat with MS Access Hello, I am working on building a jsp website with MS Access as database. When my login page is loaded on tomcat (localhost:8080/login.jsp), it shows the following error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The jdbc program alone is working perfectly, So There might not be problems due to Driver, Data source name, Database Tables or any other software version compatibilities. OS: Windows Vista Home Basic Tomcat Version: 5.5.x jdk version: 1.6 MS Access 2010 code is given below: <%@ page language="java" import="java.sql.*" %> Enter your username : Enter your password : <% String usn = request.getParameter("username"); String pass = request.getParameter("password"); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:rahul"; Connection con = DriverManager.getConnection(url, "", ""); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select * from customers"); while(rs.next()) { String u = rs.getString(1); String p = rs.getString(2); if(usn.equals(u)&& pass.equals(p)) { out.println("login successfull"); } else { out.println("login failed"); } } } catch(Exception e) { out.println("Error"+e); } %> - 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: 'Parametrizing' context.xml?
> From: pzwedhhs [mailto:pzwed...@guerrillamailblock.com] > Subject: Re: 'Parametrizing' context.xml? > I still could not find out, how to access the variable in context.xml. Are you sure that the context.xml you're modifying is the one being used? If there's a element in conf/Catalina/[host]/[appName].xml, that will override the one in your webapp's META-INF/context.xml file. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: 'Parametrizing' context.xml?
Ok, adding a line in catalina.properties seems to set the value at least. It appears, when I call System.getProperties() inside the Java code. However, I still could not find out, how to access the variable in context.xml. Laicreparc_ wrote: > > Ok, I have added the line > > DBVAL=mydb_dev > > to catalina.properties. > > Now I define a Realm in my webabb's context.xml: > >driverName="org.postgresql.Driver" > connectionURL="jdbc:postgresql://myserver:5432/${DBVAL}" > connectionName="xxx" connectionPassword="yyy" > userTable="users" userRoleTable="roles" > userNameCol="name" userCredCol="pw" roleNameCol="role" > digest="MD5" /> > > However, in the logfiles I can find: > org.postgresql.util.PSQLException: FATAL: database "${DBVAL}" does not > exist > > It seems, that the parameter value was not replaced. > > What I would like to have is to define a Realm once in context.xml, that > will be used both on a development and on a productive server. The servers > define the actual name of the database (here "mydb_dev"), e.g. in > catalina.properties. > > > Christopher Schultz-2 wrote: >> >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Laicreparc, >> >> On 4/13/2011 11:38 AM, Laicreparc wrote: >>> How can the variable (i.e. here BPVAL be set)? E.g. in server.xml? >> >> Did you read the post? It says how to set those values. >> >>> Is really in context.xml? Looks more like web.xml to >>> me. >> >> I think it was just an example. Would you prefer > param="${BPVAL}" />? >> >> - -chris >> -BEGIN PGP SIGNATURE- >> Version: GnuPG v1.4.10 (MingW32) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ >> >> iEYEARECAAYFAk2mCvYACgkQ9CaO5/Lv0PAM/ACdHAmti7Wf11o5AUqivmk3iZtw >> VpsAoLv7NToDVbVThrVCRgO1KTlX21nt >> =g1qE >> -END PGP SIGNATURE- >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> >> > > -- View this message in context: http://old.nabble.com/%27Parametrizing%27-context.xml--tp26780552p31407341.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: ${user.home} and other server.xml tags accepted by Tomcat?
I have successfully managed to set a (not predefined) variable in catalina.properties by adding the line dbconf=mydb. When I call System.getProperties in the code of the web application, this variable appears. However, I would like to access this variable in context.xml inside the web application. More precisely, it should be used in the definition of a Realm, such as The syntax ${dbconf}, which I found in several forums on the net, did not work. Any hint? Bill Barker-2 wrote: > > As Konstantin has already pointed out, any value that you can get from > System.getProperty("...") will be used for substitution. And to expand on > Rainer's comment, these are available for substitution in web.xml as well. > This is a Tomcat-specific feature, so limits your ability to port to other > containers. There is currently no support for ${ENV.xxx}, it needs to be > a > Java property, not just an env variable. > > > "Maxim Veksler" wrote in message > news:b400c69a0809280848k4c588fa5v9353cfe1819f9...@mail.gmail.com... >> On Sun, Sep 28, 2008 at 2:37 PM, Rainer Jung >> wrote: >>> Maxim Veksler schrieb: Hello list, I'm looking for a way to make my tomcat configuration more dynamic without resorting to editing xm files. I considering doing this by using parameter substitution. I've seen from the SSL guide that tomcat will accept configurations like """${user.home}""". Is there a list, or a known set of these options that tomcat will read? Getting at least a reference to the cataline_home will be very helpful. p.s. I know from ant files that you can do ${env.SOMEVAL} to get the environment, sadly this does not work here. Is there an equivalent alternative ? >>> >>> The answer depends on the exact version you are using. All version 5.5 >>> and 6 Tomcats and recent version 4.1 Tomcat supports resolving >>> ${somevariable} in server.xml by looking at system properties >>> automatically. >>> >>> Some properties are set during Tomcat startup, like catalina.home and >>> catalina.base. Others you can set yourself by either adding to the >>> commandline "-Dsomevariable=somevalue" or adding to the end of >>> conf/catalina.properties. >>> >>> Not all config files aloow this. I think catalina.properties itself does >>> only allow for catalina.home and catalina.base and not general system >>> properties, log4j.properties allows general system properties, I'm not >>> sure about context.xml and web.xml at the moment (you could try). >>> >>> Be careful: system properties work, environment variables not. System >>> properties are often seen as a java equivalent of environment variables, >>> although those exist in java too. >>> >>> A common practise in a farms would be, to determine parts of the ports >>> to bind to in a startup script and to set them in server.xml by using >>> system properties, so the server.xml file in the whole farm can be kept >>> identical. >>> >> >> Hello Rainer, >> >> Thank you for the excellent pointers. >> >> >> Are you perhaps familiar with a programmatic / configurable method to >> output putting the full list of properties recognized by tomcat during >> Catalina start up ? >> >> >> Thank you, >> Maxim. >> >>> Regards, >>> >>> Rainer >>> >>> - >>> To start a new topic, e-mail: users@tomcat.apache.org >>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >>> For additional commands, e-mail: users-h...@tomcat.apache.org >>> >>> >> >> >> >> -- >> Cheers, >> Maxim Veksler >> >> "Free as in Freedom" - Do u GNU ? >> >> - >> To start a new topic, e-mail: users@tomcat.apache.org >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> > > > > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > > -- View this message in context: http://old.nabble.com/%24%7Buser.home%7D-and-other-server.xml-tags-accepted-by-Tomcat--tp19710754p31407328.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
Raj; To all reading this response, this is my first response on this list so if I get it a little wrong have patience. You may want to look at the light weight RDBMS mysql. It is free, easily installed and can be utilized with the companion Workbench to make dealing with the db very easy, a lot like the access interface. You will have good driver support from the java end as well and a lot of documentation and tutorials to get you connected in your web app to your persistence layer. mysql.com Just my two cents and an attempt to give back a little to the community. Troy -Original Message- From: RAHUL RAJ To: users Sent: Fri, Apr 15, 2011 6:05 am Subject: Working of Tomcat with MS Access Hello, I am working on building a jsp website with MS Access as database. When my login page is loaded on tomcat (localhost:8080/login.jsp), it shows the following error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The jdbc program alone is working perfectly, So There might not be problems due to Driver, Data source name, Database Tables or any other software version compatibilities. OS: Windows Vista Home Basic Tomcat Version: 5.5.x jdk version: 1.6 MS Access 2010 code is given below: <%@ page language="java" import="java.sql.*" %> Enter your username : Enter your password : <% String usn = request.getParameter("username"); String pass = request.getParameter("password"); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:rahul"; Connection con = DriverManager.getConnection(url, "", ""); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select * from customers"); while(rs.next()) { String u = rs.getString(1); String p = rs.getString(2); if(usn.equals(u) && pass.equals(p)) { out.println("login successfull"); } else { out.println("login failed"); } } } catch(Exception e) { out.println("Error"+e); } %> - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
One question: You should have an ODBC declaration named "rahul". It is declared for your user, or as a system odbc name? My guess, your Tomcat is running as a service, or under other user (not your user), and ODBC "rahul" Data Source name is only for your user. Is it the case? Did you solve the problem? How? Angel "Java" Lopez http://www.ajlopez.com http://twitter.com/ajlopez On Fri, Apr 15, 2011 at 7:04 AM, RAHUL RAJ wrote: > Hello, > I am working on building a jsp website with MS Access as > database. When my login page is loaded on tomcat > (localhost:8080/login.jsp), it shows the following error: > > java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source > name not found and no default driver specified. > > The jdbc program alone is working perfectly, So There might not be > problems due to Driver, Data source name, Database Tables or any > other software version compatibilities. > > OS: Windows Vista Home Basic > Tomcat Version: 5.5.x > jdk version: 1.6 > MS Access 2010 > > > code is given below: > > <%@ page language="java" import="java.sql.*" %> > > > > Enter your username : > Enter your password : > > <% >String usn = request.getParameter("username"); >String pass = request.getParameter("password"); > >try{ > Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); > String url = "jdbc:odbc:rahul"; > Connection con = DriverManager.getConnection(url, "", ""); > Statement s = con.createStatement(); > > ResultSet rs = s.executeQuery("select * from customers"); > while(rs.next()) > { > String u = rs.getString(1); > String p = rs.getString(2); > if(usn.equals(u) && pass.equals(p)) > { > out.println("login successfull"); > } > else > { > out.println("login failed"); > } > } >} > >catch(Exception e) >{ > out.println("Error"+e); > } > > %> > > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Working of Tomcat with MS Access
You do realize, I hope, that what you're proposing is akin to sourcing parts for your jet engine from Fisher-Price? IMHO MS Access is not and never has been useful as a professional database product. I'm not even sure if what you are proposing even holds up in the looking-through-binoculars-from-the-big-end sense. MS Access is a desktop application that accesses files on disk. Java apps running on Tomcat typically access an RDBMS over a network connection via SQL statements and their responses. AFAIK there is not a "server instantiation" of MS Access; in fact, part of the whole point of MS Access as an ongoing product is that it acts as a "gateway drug" to MS' SQL Server product, the transition to which would be triggered by the inherent limitations (and, in my past experience, persistent unaddressed bugs) of Access. I think you need to back up a bit and work toward getting your data liberated from MS Access and ported into a proper RDBMS like PostgreSQL or one of MS SQL Server, Oracle, IBM DB2, etc. if you feel that money must be continually spent on software licenses for such. Then you will be facing Java apps and Tomcat in a far more conventional way. So, to sum up this and earlier responses: 1) Learn to code Java 2) Understand real RDBMSses. - Jeff On 4/15/11 6:04 AM, RAHUL RAJ wrote: Hello, I am working on building a jsp website with MS Access as database. When my login page is loaded on tomcat (localhost:8080/login.jsp), it shows the following error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The jdbc program alone is working perfectly, So There might not be problems due to Driver, Data source name, Database Tables or any other software version compatibilities. OS: Windows Vista Home Basic Tomcat Version: 5.5.x jdk version: 1.6 MS Access 2010 code is given below: <%@ page language="java" import="java.sql.*" %> Enter your username : Enter your password : <% String usn = request.getParameter("username"); String pass = request.getParameter("password"); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:rahul"; Connection con = DriverManager.getConnection(url, "", ""); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select * from customers"); while(rs.next()) { String u = rs.getString(1); String p = rs.getString(2); if(usn.equals(u)&& pass.equals(p)) { out.println("login successfull"); } else { out.println("login failed"); } } } catch(Exception e) { out.println("Error"+e); } %> - 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: Problem with Apache Portable Runtime (APR) based Native library for Tomcat
2011/4/13 Jaroslav Fikker : > > You are right - my java is 32bit. So that is the probelm in compilation of > APR? > Java byte code is agnostic to CPU architecture, but native code should be for the same architecture as the Java runtime that loads it. You should either use 64-bit JRE with 64-bit library, or recompile the library as 32-bit. (*) Whether there are benefits in using 64-bit Java is a separate question. (*) I have never tried to build 32-bit apps on 64-bit Linux. Looking at what is written elsewhere my guess would be: CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32 ./configure Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Async servlet et Request.recycle problem
Konstantin Kolinko wrote: > > 2011/4/15 killbulle : >> >> Hi the list, >> i have a problem with asyncServlet with tomcat 7.0.11/.12 >> i have an async servlet who return a 400 , >> i'am pretty sure that i do the startAsync et async.complete are called, >> but >> when i follow the request flow in debugger, it seem that request.recycle >> is >> not called(coyoteAdapter.service) >> so following request are getting wrong mapping. >> Does i ' need to call another méthod in the async model ? >> Regards marc > Do you have a simple example (sample code) that reproduces your problem? > > not yet but i will do my best to isolate my problem et give it you a > sample !! > i'am using new tomcat7 BIO. > For the moment the only thing i can tell you is that after my > async.complete() > i 'am in the coyoteAdater.service:348 > and after my std retrun as i'am in async==true( in CoyoteAdapter.java:440) > it continue without recycle > the request(connector) > perhaps i miss a the cleaning path. > Regards > > What is configuration of your connectors? > > > > What connector implementation are you using? (bio vs nio vs apr). It > is displayed in the logs when Tomcat starts up, e.g. "Initializing > ProtocolHandler " + name. > > Best regards, > Konstantin Kolinko > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > > -- View this message in context: http://old.nabble.com/Async-servlet-et-Request.recycle-problem-tp31404432p31406283.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Working of Tomcat with MS Access
I know from previous experience that driver you show is horribly outdated, and horrible in general. I assume no credentials are needed to access the DB in the Connection object, con? Maybe I'm reading that incorrectly. Does the JDBC program connect to MS Access at all? -Original Message- From: RAHUL RAJ [mailto:omrahulraj...@gmail.com] Sent: Friday, April 15, 2011 5:05 AM To: users@tomcat.apache.org Subject: Working of Tomcat with MS Access Hello, I am working on building a jsp website with MS Access as database. When my login page is loaded on tomcat (localhost:8080/login.jsp), it shows the following error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The jdbc program alone is working perfectly, So There might not be problems due to Driver, Data source name, Database Tables or any other software version compatibilities. OS: Windows Vista Home Basic Tomcat Version: 5.5.x jdk version: 1.6 MS Access 2010 code is given below: <%@ page language="java" import="java.sql.*" %> Enter your username : Enter your password : <% String usn = request.getParameter("username"); String pass = request.getParameter("password"); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:rahul"; Connection con = DriverManager.getConnection(url, "", ""); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select * from customers"); while(rs.next()) { String u = rs.getString(1); String p = rs.getString(2); if(usn.equals(u) && pass.equals(p)) { out.println("login successfull"); } else { out.println("login failed"); } } } catch(Exception e) { out.println("Error"+e); } %> - 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: Async servlet et Request.recycle problem
2011/4/15 killbulle : > > Hi the list, > i have a problem with asyncServlet with tomcat 7.0.11/.12 > i have an async servlet who return a 400 , > i'am pretty sure that i do the startAsync et async.complete are called, but > when i follow the request flow in debugger, it seem that request.recycle is > not called(coyoteAdapter.service) > so following request are getting wrong mapping. > Does i ' need to call another méthod in the async model ? > Regards marc Do you have a simple example (sample code) that reproduces your problem? What is configuration of your connectors? What connector implementation are you using? (bio vs nio vs apr). It is displayed in the logs when Tomcat starts up, e.g. "Initializing ProtocolHandler " + name. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Trying to find session.org.apache.catalina.filters.CSRF_NONCE
2011/4/13 Mathew Samuel : > Hi, > > There's an JSP example line given, with respect to using CSRF (Cross-site > Request Forgery), that showed how one could access the CSRF nonce and include > it with a URL: > > < c:url var="url" value="/show" > < c:param name="id" value="0" / > < c:param > name="org.apache.catalina.filters.CSRF_NONCE" > value="${session.org.apache.catalina.filters.CSRF_NONCE}" / >< /c:url >< a > href="${show}">Show< /a > 1) ${session['org.apache.catalina.filters.CSRF_NONCE']} 2) The value of the above is some object (a cache) not a String. It cannot be used as a value. 3) c:url already takes care of the nonce, because it calls HttpServletResponse.encodeURL(..) (...) > > I've tried a few things and so far have been unsuccessful at retrieving this > value. Any help would be appreciated. If I login to the Tomcat Manager web application, a list of web applications is displayed. There click on the number in the "Sessions" column (for the manager webapp). There will be a list of sessions. Then click on the session id. There will be the "Session detail" page for a session. The "org.apache.catalina.filters.CSRF_NONCE" attribute does exist and is shown on that page. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Redirect from a domain to another (keeping the first one)
> From: amousset [mailto:aurelien.mous...@gmail.com] > Subject: Redirect from a domain to another (keeping the first one) > So, if I access http://domain2.com/wouhoo and > http://domain1.com/blabla/domain2/wouhoo > should be the same !! > How can I do that ? Try this: http://www.tuckey.org/urlrewrite/ - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
On Fri, 15 Apr 2011 17:01:05 +0530, RAHUL RAJ wrote: I know my code is not perfect. But I just want to resolve this error now. Can u say how to solve this? pls answer to the question.have u read my message completely? How do you run your tomcat - as a service? -- Mikolaj Rydzewski - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Working of Tomcat with MS Access
The code I gave is just a sample code, it might change afterwards..but before that, I need to resolve this error, sorry for your inconvenience... On 4/15/11, RAHUL RAJ wrote: > I know my code is not perfect. > But I just want to resolve this error now. Can u say how to solve > this? pls answer to the question.have u read my message > completely? > > On 4/15/11, Mikolaj Rydzewski wrote: >> >> On Fri, 15 Apr 2011 15:34:37 +0530, RAHUL RAJ >> wrote: >> >>> I am working on building a jsp website with MS Access as >>> database. >> >> I usually do not express my opinions about others code, but your is >> really the worst code sample I have ever seen... >> I know that everyone has its time to begin. But please use some good >> book to start with. >> >> 1. use newer tomcat >> 2. do not mix code and html >> 3. instantiate jdbc driver once >> 4. close jdbc connections (within finally block) after use >> 5. use where sql clause >> 6. use better database >> 7. perform username&password check only after form submission >> 8. use any framework/library to wrap jdbc calls >> 9. >> >> -- >> Mikolaj Rydzewski >> >> - >> 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: Working of Tomcat with MS Access
I know my code is not perfect. But I just want to resolve this error now. Can u say how to solve this? pls answer to the question.have u read my message completely? On 4/15/11, Mikolaj Rydzewski wrote: > > On Fri, 15 Apr 2011 15:34:37 +0530, RAHUL RAJ > wrote: > >> I am working on building a jsp website with MS Access as >> database. > > I usually do not express my opinions about others code, but your is > really the worst code sample I have ever seen... > I know that everyone has its time to begin. But please use some good > book to start with. > > 1. use newer tomcat > 2. do not mix code and html > 3. instantiate jdbc driver once > 4. close jdbc connections (within finally block) after use > 5. use where sql clause > 6. use better database > 7. perform username&password check only after form submission > 8. use any framework/library to wrap jdbc calls > 9. > > -- > Mikolaj Rydzewski > > - > 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: Working of Tomcat with MS Access
On Fri, 15 Apr 2011 15:34:37 +0530, RAHUL RAJ wrote: I am working on building a jsp website with MS Access as database. I usually do not express my opinions about others code, but your is really the worst code sample I have ever seen... I know that everyone has its time to begin. But please use some good book to start with. 1. use newer tomcat 2. do not mix code and html 3. instantiate jdbc driver once 4. close jdbc connections (within finally block) after use 5. use where sql clause 6. use better database 7. perform username&password check only after form submission 8. use any framework/library to wrap jdbc calls 9. -- Mikolaj Rydzewski - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Async servlet et Request.recycle problem
Hi the list, i have a problem with asyncServlet with tomcat 7.0.11/.12 i have an async servlet who return a 400 , i'am pretty sure that i do the startAsync et async.complete are called, but when i follow the request flow in debugger, it seem that request.recycle is not called(coyoteAdapter.service) so following request are getting wrong mapping. Does i ' need to call another méthod in the async model ? Regards marc -- View this message in context: http://old.nabble.com/Async-servlet-et-Request.recycle-problem-tp31404432p31404432.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Working of Tomcat with MS Access
Hello, I am working on building a jsp website with MS Access as database. When my login page is loaded on tomcat (localhost:8080/login.jsp), it shows the following error: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. The jdbc program alone is working perfectly, So There might not be problems due to Driver, Data source name, Database Tables or any other software version compatibilities. OS: Windows Vista Home Basic Tomcat Version: 5.5.x jdk version: 1.6 MS Access 2010 code is given below: <%@ page language="java" import="java.sql.*" %> Enter your username : Enter your password : <% String usn = request.getParameter("username"); String pass = request.getParameter("password"); try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url = "jdbc:odbc:rahul"; Connection con = DriverManager.getConnection(url, "", ""); Statement s = con.createStatement(); ResultSet rs = s.executeQuery("select * from customers"); while(rs.next()) { String u = rs.getString(1); String p = rs.getString(2); if(usn.equals(u) && pass.equals(p)) { out.println("login successfull"); } else { out.println("login failed"); } } } catch(Exception e) { out.println("Error"+e); } %> - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Redirect from a domain to another (keeping the first one)
Hi guys, Well, I deployed my war file in Tomcat on my server. And I've 2 domains on this server. Let's say domain1.com and domain2.com Well, domain1.com goes to http://my-ip-server:8080/myservlet So when I access domain1.com, everything is ok (myservlet is displayed) Now, I have a second domain which is domain2.com and I would like this domain2.com access http://my-ip-server:8080/myservlet/blabla/domain2 for example. So, if I access http://domain2.com/wouhoo and http://domain1.com/blabla/domain2/wouhoo should be the same !! How can I do that ? Thanks a lot !! Aurelien. -- View this message in context: http://old.nabble.com/Redirect-from-a-domain-to-another-%28keeping-the-first-one%29-tp31404362p31404362.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.x TEMP Directory
On Fri, Apr 15, 2011 at 09:52, Alexander Diedler wrote: > Hello everybody, > > Just a general question. Could it be a bottleneck, if we have millions of > .tmp Files in the Tomcat tmp Folder? If we startup the Tomcat, during a > period > 15m the are no response from the Tomcat, if we try to open > websites, hosted by the tomcat. > Attack the root of the problem: fix applications which forget to delete their temporary files after they have used them. -- Francis Galiegue ONE2TEAM Ingénieur système Mob : +33 (0) 683 877 875 Tel : +33 (0) 178 945 552 f...@one2team.com 40 avenue Raymond Poincaré 75116 Paris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat 6.0.x TEMP Directory
2011/4/15 Alexander Diedler : > Hello everybody, > > Just a general question. Could it be a bottleneck, if we have millions of > .tmp Files in the Tomcat tmp Folder? If we startup the Tomcat, during a > period > 15m the are no response from the Tomcat, if we try to open > websites, hosted by the tomcat. 1. It depends on your OS and your file system. Some are notoriously bad in handling a lot of files in a single directory. (Distributing the files across several subdirectories is the usual recipe against that). 2. If the file names should be unique the time to find a new name might require a loop of several tries, which can be costly. 3. Some random number generators may "hang" waiting on their entropy source. Anyway, the usual recipe when something hangs is to take several (three) thread dumps in a row separated by small time interval (several seconds), to see what goes on in the application. http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Tomcat 6.0.x TEMP Directory
Hello everybody, Just a general question. Could it be a bottleneck, if we have millions of .tmp Files in the Tomcat tmp Folder? If we startup the Tomcat, during a period > 15m the are no response from the Tomcat, if we try to open websites, hosted by the tomcat. Greetings Alexander Diedler smime.p7s Description: S/MIME cryptographic signature