apache-commons

Java:Apache commons mail goes immediately to hotmail junk folder

Hello all Is there a way to make my email pass through these hotmail filters? In gmail the mails arrive in the inbox folder ...

No Commons Logging in Android?

I have a pretty big library I developed specifically for use in my Android Application. However business logic itself has no dependency on Android. To preserve that, I used Commons Logging throughout this library and it's respective JUnit tests (which I run in Eclipse). However now that I am starting to integrate it into an Activity w...

SimpleHttpConnectionManager being used incorrectly

SimpleHttpConnectionManager being used incorrectly. Be sure that HttpMethod.releaseConnection() is always called and that only one thread and/or method is using this connection manager at a time. Does Anyone know why this error shows up and is causes the files I want to download or to fail and retry or to download uncompleted Thank yo...

Get post parameter before upload

Hello! When I use Commons FileUpload the method parseRequest(request) uploads files and also reads additional post parameters. So I can get parameter values only after uploading the files. The problem is that I need those parameter values before uploading the files (one of the parameters is upload_path). Is there any way to get post pa...

Typesafe version of commons ServletFileUpload

Hi, I am using apache commons-fileupload 1.2.1. The Class ServletFileUpload provides type unsafe version of method parseRequest Does anyone know typesafe version of the same, if any? Thanks Jitendra ...

Apache httpclient makes lots of connections

I'm using apache httpclient 4.0 to connect to a video stream (motion jpeg) over http. Here's my code: DefaultHttpClient client; HttpParams params = new BasicHttpParams(); List<String> authpref = new ArrayList<String>(); authpref.add(AuthPolicy.DIGEST); authpref.add(AuthPolicy.BASIC); params.setParameter("http.auth.proxy-scheme-pref",...

PropertyPlaceholderConfigurer reads from XML File (Apache Commons Configuration)

Is there a possibility to configure the Spring PropertyPlaceholderConfigurer to read from properties.xml, via Apache Commons Configuration? ...

org.apache.commons.dbcp.DelegatingPreparedStatement is closed

org.apache.commons.dbcp.DelegatingPreparedStatement is closed Could i know in which situations this exception will come. I closed all result sets and prepared statements. How can i solve this problem. Code : public int UpdateMovementLines(List<MaterialRequestIssuanceVO> mlinelist,String projId,String documentno,String user){ ...

Apache commons fileupload FileItemIterator hasNext() returns false

Hi all, I'm using the apache commons fileupload stream api. But the FileItemIterator FileItemIterator iter = upload.getItemIterator(request); returns false in its hasNext() iter.hasNext() What is wrong with this? The code and the web part is as follows: protected void doPost(HttpServletRequest request, HttpServletResponse response) ...

Creating composite key for filtering data using Apache commons

Here is my problem I have a list of 'System Exceptions' and I need to select distinct values from the list based on two keys. So I am creating a compositeKey and storing it in a list as a string 'key1:key2' Is there a better approach to this ? Collection uniqueExceptions = CollectionUtils.select(allSubareaExceptions, new Predicat...

Get the integral part of a BigFraction, as a BigInteger

What is an easy way to get the integral part of a BigFraction as a BigInteger? Basically I want the same result that the intValue and longValue methods return but with arbitrary precision. I also want to avoid rounding so indirect conversion via a BigDecimal is not suitable. ...

Periodic Query or Other Implementation: Java and Http

Consider, several users are using my Java Application. I am using Http Common Apache to GET/POST from a Http Server to get various user data. There is a module in this client Application which triggers current Page no. of the Document (user1 opened). I want other Users(User2, User3,....UserN) to know the Page no. User1 opened. Should a...

Apache commons.net.ftpclient on Linux

I am using org.apache.commons.net.FTPClient to upload/download/list files using FTP. The server daemon is vsftpd running on CentOS 5.4, and the apache package is 2.0 It seems that all the mentioned operations perform well on the server (judging by the log vsftpd.log) where files are uploaded, the download command is received, so does th...

Upgrading commons DBCP from 1.2 to 1.4, should I be afraid?

I was wondering if there were any big known issues out there. After upgrading the jar in my project, everything compiled. I didn't really see anything in the release notes that made me shudder, but I want to double check. ...

Http Basic Authentication in Java using HttpClient?

I am trying to mimic the functionality of this curl command in Java: curl --basic --user username:password -d "" http://ipaddress/test/login I wrote the following using Commons HttpClient 3.0 but somehow ended up getting an 500 Internal Server Error from the server. Can someone tell me if I'm doing anything wrong? public class HttpBa...

Execute a piece of SQL on JDBC connection setup in Spring

I want to execute an SQL statement on setup of each database connection. I'm using Spring 2.0.2 and org.apache.commons.dbcp.BasicDataSource from Apache Commons DBCP 1.2.1. BasicDataSource seems to have property connectionInitSqls, but only in the newer version... anyone knows a way to set something like that in the older version? This i...

Upload to CXF restful web service

I'm trying to implement apache commons fileupload in my cxf restful web service. For some reason, ServletFileUpload.isMultipartContent(...) always returns false; I've checked the content-type via: httpServletRequest.getContentType() and it returns multipart/form-data as expected. Anyone know what is causing the isMultipartContent method ...

Validating for option fields using apache commons validation

Hello all, I'm using apache commons validation for validating my form.I have this case for which I'm not able to define the rule. I have 4 fields in the form, and the user has to fill in at least one before hitting the submit. How can I validate this? Thanks. Ravi ...

Apache DefaultHttpClient invocation results in "java.lang.RuntimeException: Stub!"

I'm dipping my toes into Android development. I have a project that will interface with a RESTful resource and I'm trying to figure out how to do a basic GET with params over HTTP. From everything I've read, the consensus seems to be favoring HTTPClient over HttpURLConnection. I've written a wrapper class with a method that takes care o...

Java: StringUtils.join on an ArrayList returns NoSuchMethodError Exception

Hello. I have an ArrayList that i would like to join with a delimiter of ',', i read in some answers here that StringUtils.join is a good option but the problem is that when i try to join an ArrayList i get the following error: java.lang.NoSuchMethodError: org.apache.commons.lang.StringUtils.join(Ljava/util/Collection;C)Ljava/lang/Stri...