Managing password updates in Commons-DBCP
Hello Commons-Users, The issue we are having is that we are implementing a policy forcing database account password changes every 90 days. Our DataSource implementation class uses the SharedPoolDataSource (from commons-dbcp) in managing its PooledConnections. Unfortunately, it appears that SharedPoolDataSource maps the user/password info using the user name. If the user's password changes and the old user/password info is already in the Map, a test in the SharedPoolDataSource prevents client apps from getting a connection on the user. Also the Map object is private to SharedPoolDataSource, and simply implementing our own version of SharedPoolDataSource will not work, since there's a ton of package level classes being used. Can anyone provide a straight-forward method to replacing the expired username/password mapping such that a SharedPoolDataSource may recognize/replace the new account password? Thank you for any suggestions. Scott Stevens - Do you Yahoo!? Yahoo! Small Business - Try our new resources site!
[transaction.locking] Modify the behaviour of the ReadWriteUpgradeLockManager
Hi, In the documentation I find that while an upgrade lock is held, it is possible for read locks to be obtained, and when the request is made to upgrade to a write lock, the lock manager prevents additional read locks until the write lock can be acquired. I don't understand why when the upgrade lock is granted, it is possible to obtain read locks ? Is there a reason to keep accepting read locks when you already know (because there is a upgrade lock on the data) that the data will be updated soon ? The behaviour that I want for my lock manager is following. To modify a data, you must obtain an upgrade lock if there is already read locks on the data and then to transform the upgrade lock in write lock when all the readers ended. When the upgrade lock is granted no more read locks could be granted. Is it possible to implements this behaviour using the ReadWriteUpgradeLockManager ? For the moment I implements the transformation of an upgrade lock in a write lock when all readers finished. public class LockManager { public static ReadWriteUpgradeLockManager mRWULockManager; public LockManager() { mRWULockManager = new ReadWriteUpgradeLockManager (new PrintWriterLogger(new PrintWriter(System.out), Locking, false) , mRWULockManager.DEFAULT_TIMEOUT); } public static void readDemand(Thread aOwnerId, Interval1D aIntervalToLock) { mRWULockManager.readLock(aOwnerId, aIntervalToLock); } public static void writeDemand(Thread aOwnerId, Interval1D aIntervalToLock) { if(mRWULockManager.tryWriteLock(aOwnerId, aIntervalToLock) == false) { upgradeDemand(aIntervalToLock, aOwnerId); synchronized(aIntervalToLock) { try aIntervalToLock.wait(); writeDemand(aOwnerId, aIntervalToLock); } catch (Exception e) {} } } } /** * Traitement d'une demande d'un lock Upgrade * @param aOwnerId Thread Identifiant du demandeur * @param aIntervalToLock Interval1D Intervalle à verrouiller */ public static void upgradeDemand(Interval1D aIntervalToLock, Thread aOwnerId) { if(PDOM.TRACE) System.out.println(LM: Upgrade Demand); mRWULockManager.tryUpgradeLock(aOwnerId, aIntervalToLock); } /** * Relacher un lock * @param aIntervalToUnlock Interval1D * @param aOwnerId Thread */ public static void release(Interval1D aIntervalToUnlock, Thread aOwnerId) { if(PDOM.TRACE) System.out.println(LM: Release + aOwnerId + + aIntervalToUnlock); synchronized(aIntervalToUnlock) { mRWULockManager.release(aOwnerId, aIntervalToUnlock); aIntervalToUnlock.notifyAll(); if(PDOM.TRACE) System.out.println(LM: Il devrait repartir ); } } In this sense the write lock becomes preferred over all other locks when it gets upgraded from a upgrade lock. Preferred means that if it has to wait and others wait as well it will be served before all other none preferred locking requests. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] The wisdom of Albert (was Chain: too damn buggy to be out of sandbox)
http://rescomp.stanford.edu/~cheshire/EinsteinQuotes.html http://home.att.net/~quotations/einstein.html http://www.quotationspage.com/quotes/Albert_Einstein/ http://www.tc.umn.edu/~burc0050/quotes_einstein.html http://www.cersanmystical.org/Quotes%20of%20Einstein-1.htm I admit I couldn't find an actual citation, probably on the 2nd or 3rd page of Google results... but, if it's not a real quote at least EVERYONE seems to be making the same mistake :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, March 31, 2005 1:28 am, Dakota Jack said: I know that people have said Einstein said this. Does anyone have a real citation to prove it? This does not sound like Einstein. This sounds like a list-geek. Jack On Wed, 30 Mar 2005 13:27:32 -0800, Craig McClanahan [EMAIL PROTECTED] wrote: On Wed, 30 Mar 2005 14:24:03 -0300, Vinicius Caldeira Carvalho [EMAIL PROTECTED] wrote: Einstein used to say : Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. Well I guess I fit right in to it. Sorry, no bugs, just dumb user and stressed manager complaining about the deadline. Im trully sorry We've all been there at least once :-). Good luck! Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
commons attribures: Inheritable
Hi all, I've got a question about the usage of org.apache.commons.attributes.Inheritable. I specify an attribute for the method in interface and I want that attribute to apply to the method in the implementing class. For example: interface ISome { /** @@Permission(WRITE) */ void someMethod(); } class CSome { public void someMethod() { ... } } Now when I call Attributes.getAttribute() for CSome.someMethod I expect it to return permission attribute specified in ISome. Is it achievable with org.apache.commons.attributes.Inheritable ? I made my Permission class (which represents attribute) to extend Inheritable but it didn't work. Any help would be appreciated. Vitali. --- !! Boss'! ! http://news.tut.by/50282.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] The wisdom of Albert (was Chain: too damn buggy to be out of sandbox)
Seneca said: [w]hen in Rome, do as the Romans do. When not in Rome, do as the Romans do. You know what this has been taken to mean. EVERYONE makes the same mistake frequently. That is kind of the nature of EVERYONE. The book In Praise of Folly, which actually is taken to be in praise of folly by EVERYONE, was written by Erasmus in grief over the beheading of his friend, Thomas More by Henry VIII. Peter Nannius wrote: Erasmus the glory of our times, lived in the heart of More, More, the sole light of Britian, lived in the heart of Erasmus. The one exchanged life with the other; each lived a life not his own. It is no marvel that with the death of More, Erasmus wished for death, unwilling to live longer. The title word folly is a Latin pun for More and the title actually means In Praise of More, who was recognized as one of the most if not the most erudite (certainly no friend of folly) man in extant Christiandom. Now EVERYONE thinks that the book is in praise of the simple life and, indeed, folly. Plato's The Republic (whose actual title is The City - politeia) is a careful _reductio ad absurdum_ of the idea of a perfect city that suspiciously sounds like the hated Sparta (Socrates took hemlock rather than leave Athens, remember) but this has not stopped EVERYONE from forgetting the admonition in that book to hide behind the walls until the political winds have died down and from deciding that the book attempts to do the opposite, i.e. posit a perfect society based on Spartan principles. EVERYONE takes the New Testament, a book slabbed together and retrofitted from multifarious sources to meet the political ends of Emporer Constantine and his toady Eusebius to be the Word of God itself. EVERYONE also says the Lords Prayer in public, which aside from being an obviously later addition to the Book of Matthew was cautioned by Jesus to be used only in private. EVERYONE is not a good source. EVERYONE is a particulary bad source on the Internet, the home of fluff and deception for small personal triumphs. There, now you have it. ///;-) Jack On Thu, 31 Mar 2005 09:02:07 -0500 (EST), Frank W. Zammetti [EMAIL PROTECTED] wrote: http://rescomp.stanford.edu/~cheshire/EinsteinQuotes.html http://home.att.net/~quotations/einstein.html http://www.quotationspage.com/quotes/Albert_Einstein/ http://www.tc.umn.edu/~burc0050/quotes_einstein.html http://www.cersanmystical.org/Quotes%20of%20Einstein-1.htm I admit I couldn't find an actual citation, probably on the 2nd or 3rd page of Google results... but, if it's not a real quote at least EVERYONE seems to be making the same mistake :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, March 31, 2005 1:28 am, Dakota Jack said: I know that people have said Einstein said this. Does anyone have a real citation to prove it? This does not sound like Einstein. This sounds like a list-geek. Jack On Wed, 30 Mar 2005 13:27:32 -0800, Craig McClanahan [EMAIL PROTECTED] wrote: On Wed, 30 Mar 2005 14:24:03 -0300, Vinicius Caldeira Carvalho [EMAIL PROTECTED] wrote: Einstein used to say : Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe. Well I guess I fit right in to it. Sorry, no bugs, just dumb user and stressed manager complaining about the deadline. Im trully sorry We've all been there at least once :-). Good luck! Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [commons-logging] Problem renaming logfiles
Good morning, I had the same problem before on a test environment (Tomcat running locally on a Winbugs XP machine)...every day the same problem. At that moment, being to damn stressed, I try the same code on a Linux box, and no problem at all renaming. To solve the problem in my test environment, I install WinM2K Professional. In conclusion, I think the problem is more related with OS, than Tomcat thought. Alfredo Ledezma Meléndez. Costumer Record Management Consultor Externo de Sistemas de Atención a Clientes RadioMovil DIPSA, S. A. de C. V. Ejército Nacional No. 488, Col. Anahuac, C.P. 11570 México D.F. -Original Message- From: Jeroen Verhagen [mailto:[EMAIL PROTECTED] Sent: Thursday, March 31, 2005 1:53 AM To: commons-user@jakarta.apache.org Subject:[commons-logging] Problem renaming logfiles Hi all, I using commons-logging with log4j in my webapp. I'm using a DailyRollingFileAppender and every morning when I start developping I get the following message in my Tomcat console: log4j:ERROR Failed to rename [logfile.txt] to ... I did some investigation using the handle utility from www.sys-internals.com and found that after a redeploy of my webapp, Tomcat is keeping open multiple handles to the same logfile probably causing the rename problem. If I restart Tomcat it has only one handle to logfile as expected until I redeploy again etc. Can someone please tell me what's causing this? I'm using Tomcat 5.0.19 with commons-logging 1.0.3 in its common/lib dir to also use commons-logging for Tomcat. In every class I declare a Log like this: private static Log logger = LogFactory.getLog(MyClass.class); I tried calling LogFactory.releaseAll() from the webapps ContextListener.contextDestroyed() and giving the webapp its own commons-logging.jar but that didn't help. Thanks for any help and regards, Jeroen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Digester] Problem with XML rule definiton.
I was using Eclipse as the development enviroment, so that could be doing it, but I have done reflection with it before, and it worked both in the jar file and the environment. Sincerely, Silas Snider Reid Pinchback wrote: It sounds like one of two things: 1) in the jar'd configuration something is missing from the classpath 2) in the jar'd configuration you aren't using the same type of classloaders as you are in the non-jar'd configuration (e.g. not just jar vs non-jar, but jar-in-webapp vs unjarred-standalone-app). --- Silas Snider [EMAIL PROTECTED] wrote: Dear List: I am having problems with Digester. I am using it to parse the XML returned by Amazon's Web Services. __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[HttpClient] HttpClient and sendRedirect problem
Hi!! I am using HttpClient to post xml files from my servlet to a JSP/servlet. My application is designed in such a way that have a big XML which I parse and get smaller XMLs and loop through them posting each smaller XML to a JSP. This part works fine. Now, after I post the XML to my JSP/Servlet I want to do a response.sendRedirect within the JSP/Servlet to another URL where I do some processing and then want the control to return to where it has been posting the XML file from, i.e. return the control back to the servlet which does the posting. But once I post the XML to the JSP/Servlet using HttpClient response.sendRedirect doesn't seem to be redirecting me to the other JSP. Any help?? Thanks, Swati __ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [betwixt] projects using betwixt, request for adding me to the list
committed. (may take a while for the mirrors to sync.) glad to here that you've managed to put Betwixt to good use. on the subject of translations i18n and globalization (as the IBMers like to call it), i've had an itch for some time to mix commons-resources and JEXL into scriptable localization. never seem to be able to find the energy... sigh/ - robert On Tue, 2005-03-29 at 14:33 +0200, Christoph Gaffga (triplemind.com) wrote: hi, I just saw the page http://jakarta.apache.org/commons/betwixt/powered.html and would like to be added to it. We, triplemind.com, are an Application Service Provider for touristic booking and information systems, mainly accommodations. It's a Three Tier App, MySQL as the backend DB, JBoss in the middle and for the Webservices and Tomcat/Cocoon for the web frontend. We use the betwixt transformer we contributed to cocoon to output the results of operations from the EJBs to XML. After that parsing it via XSLT. At the moment the app in production only in german language, but translation to english, french, spanish and italian is on the way. Some reference sites rendered on our servers are e.g. www.unterkunft.de, www.apartments.de, www.urlaubstage.de, www.ferienwohnung.com and many more. With about 400.000 pages rendered each day, the betwixt transformer is called around (estimated) one up to two Mio. times a day, and betwixt seems to have good perfomace/stability. Would be nice to see a link like the following: Project: Triplemind Vacation Homes (Commercial) linked to http://www.triplemind.com Overview: An Application Service for touristic information systems using Betwixt to convert business logic output to XML for tranformation to websites. References for the App are a href=http://www.unterkunft.de;Unterkunft.de/a and a href=http://www.apartments.de;Apartments.de/a. regards, Christoph Gaffga [EMAIL PROTECTED] P.S.: Sorry, my english is somehow broken today, got up to early. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [transaction.locking] Modify the behaviour of the ReadWriteUpgradeLockManager
Hmmm, not quite sure that I get this all right, but to me it seems you describe the simple read/write locks (without the upgrade step). Is that possible? If so you could simply use the ReadWriteLockManager. Oliver On Thu, 31 Mar 2005 14:34:24 +0200, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, In the documentation I find that while an upgrade lock is held, it is possible for read locks to be obtained, and when the request is made to upgrade to a write lock, the lock manager prevents additional read locks until the write lock can be acquired. I don't understand why when the upgrade lock is granted, it is possible to obtain read locks ? Is there a reason to keep accepting read locks when you already know (because there is a upgrade lock on the data) that the data will be updated soon ? The behaviour that I want for my lock manager is following. To modify a data, you must obtain an upgrade lock if there is already read locks on the data and then to transform the upgrade lock in write lock when all the readers ended. When the upgrade lock is granted no more read locks could be granted. Is it possible to implements this behaviour using the ReadWriteUpgradeLockManager ? For the moment I implements the transformation of an upgrade lock in a write lock when all readers finished. public class LockManager { public static ReadWriteUpgradeLockManager mRWULockManager; public LockManager() { mRWULockManager = new ReadWriteUpgradeLockManager (new PrintWriterLogger(new PrintWriter(System.out), Locking, false) , mRWULockManager.DEFAULT_TIMEOUT); } public static void readDemand(Thread aOwnerId, Interval1D aIntervalToLock) { mRWULockManager.readLock(aOwnerId, aIntervalToLock); } public static void writeDemand(Thread aOwnerId, Interval1D aIntervalToLock) { if(mRWULockManager.tryWriteLock(aOwnerId, aIntervalToLock) == false) { upgradeDemand(aIntervalToLock, aOwnerId); synchronized(aIntervalToLock) { try aIntervalToLock.wait(); writeDemand(aOwnerId, aIntervalToLock); } catch (Exception e) {} } } } /** * Traitement d'une demande d'un lock Upgrade * @param aOwnerId Thread Identifiant du demandeur * @param aIntervalToLock Interval1D Intervalle à verrouiller */ public static void upgradeDemand(Interval1D aIntervalToLock, Thread aOwnerId) { if(PDOM.TRACE) System.out.println(LM: Upgrade Demand); mRWULockManager.tryUpgradeLock(aOwnerId, aIntervalToLock); } /** * Relacher un lock * @param aIntervalToUnlock Interval1D * @param aOwnerId Thread */ public static void release(Interval1D aIntervalToUnlock, Thread aOwnerId) { if(PDOM.TRACE) System.out.println(LM: Release + aOwnerId + + aIntervalToUnlock); synchronized(aIntervalToUnlock) { mRWULockManager.release(aOwnerId, aIntervalToUnlock); aIntervalToUnlock.notifyAll(); if(PDOM.TRACE) System.out.println(LM: Il devrait repartir ); } } In this sense the write lock becomes preferred over all other locks when it gets upgraded from a upgrade lock. Preferred means that if it has to wait and others wait as well it will be served before all other none preferred locking requests. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dbcp] Help! getting AbstractMethodError
I am unable to figure out why I am getting this following exception. When I do a brand new installation, everything works, but on our QA server installing on top of existing tomcat, and as a part of existing web application, it throws the exception. Any help will be appreciated. Thanks and Regards, Rumpa Giri 2005-03-30 17:09:32 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.AbstractMethodError at org.apache.commons.dbcp.DelegatingResultSet.getClob(DelegatingResultSet.java :529) at org.apache.commons.dbcp.DelegatingResultSet.getClob(DelegatingResultSet.java :529) at net.sf.hibernate.type.ClobType.get(ClobType.java:32) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53) at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66) at net.sf.hibernate.loader.Loader.hydrate(Loader.java:686) at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:627) at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:586) at net.sf.hibernate.loader.Loader.getRow(Loader.java:501) at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:213) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader .java:133) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:415) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2130) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2000) at net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1936) at com.hfc.dao.AbstractDAO.find(Unknown Source) at com.hfc.ui.context.FSRViewContext.getCSRResponse(Unknown Source) at org.apache.jsp.electronic.csr.input.fsr_jsp._jspService(fsr_jsp.java:77) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 98) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at com.hfc.hibernate.HibernateFilter.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext Valve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:296) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:372) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:694) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:626) at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:807) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:644) at java.lang.Thread.run(Thread.java:534) -- No virus found in this
[PortletFileUpload] class compiling error
I would appreciate some assistance in creating a JSR 168 compliant File Upload Portlet. I have downloaded the 1.1-dev JAR from the commons website (Nightly build) but seem to be having problems compiling. My (trimmed) code is as follows: ... import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.portlet.PortletFileUpload; ... private String processUpload(ActionRequest request, ActionResponse response) { String txt = ; File tmpDir = new File(D:\\Temp\\Upload); DiskFileItemFactory dfif = new DiskFileItemFactory(10240, tmpDir); ... PortletFileUpload pfu = new PortletFileUpload(dfif); ... try { List fileItems = pfu.parseRequest(request); Iterator iter = fileItems.iterator(); while (iter.hasNext()) { FileItem item = (FileItem)iter.next(); if (item.isFormField()) { // Input text field txt += FIELD NAME: + item.getFieldName + br; txt += VALUE: + item.getString() + brbr; } else { // Uploaded file txt += FIELD NAME: + item.getFieldName() + br; txt += FILE SIZE: + item.getSize() + brbr; } } } catch (FileUploadException fue) { txt += File Upload Exception: + fue + br; } catch (Exception e) { txt += Exception: + e + br; } ... } ... The error message I receive is: com\lcltd\raleigh\jsr168\WCMTools.java:139: cannot access javax.servlet.http.HttpServletRequest file javax\servlet\http\HttpServletRequest.class not found List fileItems = pfu.parseRequest(request); ^ 1 error I have struggled to find what I am doing wrong and have seen plenty of references to the HttpServletRequest version (1.0) on Google, but nothing for a Portlet code example version. What have I missed? :) Do I need to write additional code for one of these classes - is this class and other classes in the package unfinished? Does anyone have any example (working) snippets? Any help you could provide would be greatly appreciated. Cheers, Pete.
RE: [PortletFileUpload] class compiling error
That's because it isn't a servlet - it's a portlet. Are these files really necessary? It uses the ActionRequest object, rather than an HttpServletRequest object - which are very different in a Portal Server. I have been struggling with this all day and have still not progressed very far. Has anyone managed to upload a file through a Portlet (JSR 168) or is this not possible? Cheers, Pete. -Original Message- From: Alfredo Ledezma Melendez [mailto:[EMAIL PROTECTED] Sent: 31 March 2005 22:29 To: [EMAIL PROTECTED] Subject: RE: [PortletFileUpload] class compiling error I think the problem is the classpath value. Check that you have tools.jar and servlet.jar in it. Regards, Alfredo Ledezma Melendez. Costumer Record Management Consultor Externo de Sistemas de Atencion a Clientes RadioMovil DIPSA, S. A. de C. V. Ejercito Nacional No. 488, Col. Anahuac, C.P. 11570 Mexico D.F. -Original Message- From: Pete Raleigh [mailto:[EMAIL PROTECTED] Sent: Thursday, March 31, 2005 2:09 PM To: commons-user@jakarta.apache.org Subject: [PortletFileUpload] class compiling error I would appreciate some assistance in creating a JSR 168 compliant File Upload Portlet. I have downloaded the 1.1-dev JAR from the commons website (Nightly build) but seem to be having problems compiling. My (trimmed) code is as follows: ... import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.portlet.PortletFileUpload; ... private String processUpload(ActionRequest request, ActionResponse response) { String txt = ; File tmpDir = new File(D:\\Temp\\Upload); DiskFileItemFactory dfif = new DiskFileItemFactory(10240, tmpDir); ... PortletFileUpload pfu = new PortletFileUpload(dfif); ... try { List fileItems = pfu.parseRequest(request); Iterator iter = fileItems.iterator(); while (iter.hasNext()) { FileItem item = (FileItem)iter.next(); if (item.isFormField()) { // Input text field txt += FIELD NAME: + item.getFieldName + br; txt += VALUE: + item.getString() + brbr; } else { // Uploaded file txt += FIELD NAME: + item.getFieldName() + br; txt += FILE SIZE: + item.getSize() + brbr; } } } catch (FileUploadException fue) { txt += File Upload Exception: + fue + br; } catch (Exception e) { txt += Exception: + e + br; } ... } ... The error message I receive is: com\lcltd\raleigh\jsr168\WCMTools.java:139: cannot access javax.servlet.http.HttpServletRequest file javax\servlet\http\HttpServletRequest.class not found List fileItems = pfu.parseRequest(request); ^ 1 error I have struggled to find what I am doing wrong and have seen plenty of references to the HttpServletRequest version (1.0) on Google, but nothing for a Portlet code example version. What have I missed? :) Do I need to write additional code for one of these classes - is this class and other classes in the package unfinished? Does anyone have any example (working) snippets? Any help you could provide would be greatly appreciated. Cheers, Pete. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [PortletFileUpload] class compiling error
Please check http://jakarta.apache.org/commons/fileupload/dependencies.html Regards, Alfredo Ledezma Melendez. Costumer Record Management Consultor Externo de Sistemas de Atencion a Clientes RadioMovil DIPSA, S. A. de C. V. Ejercito Nacional No. 488, Col. Anahuac, C.P. 11570 Mexico D.F. -Original Message- From: Pete Raleigh [mailto:[EMAIL PROTECTED] Sent: Thursday, March 31, 2005 3:36 PM To: commons-user@jakarta.apache.org Subject: RE: [PortletFileUpload] class compiling error That's because it isn't a servlet - it's a portlet. Are these files really necessary? It uses the ActionRequest object, rather than an HttpServletRequest object - which are very different in a Portal Server. I have been struggling with this all day and have still not progressed very far. Has anyone managed to upload a file through a Portlet (JSR 168) or is this not possible? Cheers, Pete. -Original Message- From: Alfredo Ledezma Melendez [mailto:[EMAIL PROTECTED] Sent: 31 March 2005 22:29 To: [EMAIL PROTECTED] Subject: RE: [PortletFileUpload] class compiling error I think the problem is the classpath value. Check that you have tools.jar and servlet.jar in it. Regards, Alfredo Ledezma Melendez. Costumer Record Management Consultor Externo de Sistemas de Atencion a Clientes RadioMovil DIPSA, S. A. de C. V. Ejercito Nacional No. 488, Col. Anahuac, C.P. 11570 Mexico D.F. -Original Message- From: Pete Raleigh [mailto:[EMAIL PROTECTED] Sent: Thursday, March 31, 2005 2:09 PM To: commons-user@jakarta.apache.org Subject: [PortletFileUpload] class compiling error I would appreciate some assistance in creating a JSR 168 compliant File Upload Portlet. I have downloaded the 1.1-dev JAR from the commons website (Nightly build) but seem to be having problems compiling. My (trimmed) code is as follows: ... import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.portlet.PortletFileUpload; ... private String processUpload(ActionRequest request, ActionResponse response) { String txt = ; File tmpDir = new File(D:\\Temp\\Upload); DiskFileItemFactory dfif = new DiskFileItemFactory(10240, tmpDir); ... PortletFileUpload pfu = new PortletFileUpload(dfif); ... try { List fileItems = pfu.parseRequest(request); Iterator iter = fileItems.iterator(); while (iter.hasNext()) { FileItem item = (FileItem)iter.next(); if (item.isFormField()) { // Input text field txt += FIELD NAME: + item.getFieldName + br; txt += VALUE: + item.getString() + brbr; } else { // Uploaded file txt += FIELD NAME: + item.getFieldName() + br; txt += FILE SIZE: + item.getSize() + brbr; } } } catch (FileUploadException fue) { txt += File Upload Exception: + fue + br; } catch (Exception e) { txt += Exception: + e + br; } ... } ... The error message I receive is: com\lcltd\raleigh\jsr168\WCMTools.java:139: cannot access javax.servlet.http.HttpServletRequest file javax\servlet\http\HttpServletRequest.class not found List fileItems = pfu.parseRequest(request); ^ 1 error I have struggled to find what I am doing wrong and have seen plenty of references to the HttpServletRequest version (1.0) on Google, but nothing for a Portlet code example version. What have I missed? :) Do I need to write additional code for one of these classes - is this class and other classes in the package unfinished? Does anyone have any example (working) snippets? Any help you could provide would be greatly appreciated. Cheers, Pete. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dbcp] Help! getting AbstractMethodError
You should make a list of differences between you new system and the QA setup. Start with VM version, global tomcat jars (including dbcp version) and application specific ones. In this specific case check the database driver jar, make sure you use the same jar everywhere. If you find the sulotion please add it to the wiki FAQ page or let us know. -- Dirk Rumpa Giri wrote: I am unable to figure out why I am getting this following exception. When I do a brand new installation, everything works, but on our QA server installing on top of existing tomcat, and as a part of existing web application, it throws the exception. Any help will be appreciated. Thanks and Regards, Rumpa Giri 2005-03-30 17:09:32 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception java.lang.AbstractMethodError at org.apache.commons.dbcp.DelegatingResultSet.getClob(DelegatingResultSet.java :529) at org.apache.commons.dbcp.DelegatingResultSet.getClob(DelegatingResultSet.java :529) at net.sf.hibernate.type.ClobType.get(ClobType.java:32) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62) at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53) at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66) at net.sf.hibernate.loader.Loader.hydrate(Loader.java:686) at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:627) at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:586) at net.sf.hibernate.loader.Loader.getRow(Loader.java:501) at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:213) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:281) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader .java:133) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:911) at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:931) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59) at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51) at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:415) at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2130) at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:2000) at net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1936) at com.hfc.dao.AbstractDAO.find(Unknown Source) at com.hfc.ui.context.FSRViewContext.getCSRResponse(Unknown Source) at org.apache.jsp.electronic.csr.input.fsr_jsp._jspService(fsr_jsp.java:77) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 98) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:810) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at com.hfc.hibernate.HibernateFilter.doFilter(Unknown Source) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:186) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContext Valve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117 ) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContex t.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:296) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:372) at
Re: [transaction.locking] Modify the behaviour of the ReadWriteUpgradeLockManager
Hi, Selon Oliver Zeigermann [EMAIL PROTECTED]: Hmmm, not quite sure that I get this all right, but to me it seems you describe the simple read/write locks (without the upgrade step). Is that possible? If so you could simply use the ReadWriteLockManager. My lock manager has not exactly the same behaviour as the ReadWriteLockManager and I think looks more like the ReadWriteUpgardeLockManager. I will try to explain what I want to do ;o) In my case : * Read access requires a shared lock (S). * Write access requires an exclusive lock (X). * An upgrade lock (U) supports read with (potential) write access and prevents further shared locks (S) for the same object. An upgrade lock (U) can be converted to an exclusive lock (X) after the release of the existing shared locks or back to a shared lock if no update action is needed (time out). So, the difference is when I have an upgrade lock on a data, it is impossible to obtain shared locks, but locks that are already granted keep going on. With the exclusive lock no other locks can be obtained or exist on the same data. I expect it's more clear? Is it possible to transform the ReadWriteUpgradeLockManager to obtain this ? Thanks for your help, Mel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]