Tag Archives: apache

FTPClient How to get around org.apache.commons.net.io.CopyStreamException: IOException caught while copying

Questions: I am trying to upload a .zip File with my Java application to an FTP server using the Apache Commons Net FTPSClient. <pre><code>import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.UUID; import org.apache.commons.net.ftp.FTP; import org.apache.commons.net.ftp.FTPSClient; public class FTPUploader { /** * Zips the source file first and then uploads it to the ftp… Read More »

Error in connection with Apache Phoenix

Questions: I am trying to connect with Apache Phoenix using Java API with the below code: public class SampleHbasePhoenixConnection { static final String DB_URL = “jdbc:phoenix:hbaseServer:hbasePort:/”; public static void main(String args[]) throws Exception { Connection conn = null; Statement st = null; try { Class.forName(“org.apache.phoenix.jdbc.PhoenixDriver”); System.out.println(“Connecting to database..”); conn = DriverManager.getConnection(DB_URL); System.out.println(“Creating statement…”); st =… Read More »

Multiple apache vhost behind SSH tunnel

Questions: I have a local (home) web server (behind NAT, Firewall..) I’m accessing using a ssh tunnel with a VPS. On my local machine : ssh user@vps -nNT -o ServerAliveInterval=30 -R 8085:localhost:80 Let’s say I want example.com to be hosted on my local server, so I have in the VPS apache example.com.conf file : ProxyPass… Read More »

Reading CSV file using Apache Commons

Questions: I want to retrieve CSV file data from two files but in Nested format Here is three files containing server information and getting it into hashmap ipReader = new FileReader(SAMPLE_CSV_FILE_PATH); Iterable<CSVRecord> csvRecord = CSVFormat.DEFAULT .withFirstRecordAsHeader() .parse(ipReader); hardwareReader=new FileReader(SAMPLE_CSV_FILE_PATH01); Iterable<CSVRecord> csvRecord01 = CSVFormat.DEFAULT .withFirstRecordAsHeader() .parse(hardwareReader); utilizationReader=new FileReader(SAMPLE_CSV_FILE_PATH02); Iterable<CSVRecord> csvRecord02 = CSVFormat.DEFAULT .withFirstRecordAsHeader() .parse(utilizationReader); for(CSVRecord record:… Read More »

Apache camel kafka component fail to serialize header after update from 2.21.1 to 2.21.2

Questions: After I update the apache camel from version 2.21.1 to 2.21.2 I am getting the follow error: due Magic v1 does not support record headers I see at https://github.com/apache/camel/blob/master/components/camel-kafka/src/main/docs/kafka-component.adoc that in version 2.22 all headers are serialized to the topic, I don’t know why. I set up severals headers on the router, And I… Read More »

Apache cxf port generic creation

Questions: In my project I have to create some Soap web service clients I’m using apache cxf to create the ports and consume the web services I notice that the port creation I’m duplicating a lot of code so I create an abstract class like this public abstract class WebServiceConsumerPort<P>{ protected Class<P> port; private static… Read More »

java.lang.UnsatisfiedLinkError: org.apache.hadoop.io.nativeio.NativeIO$Windows.createFileWithMode0(Ljava/lang/String;JJJI)Ljava/io/FileDescriptor

Questions: I have a Spark project that used to work lately . the project gets a CSV , and add two fields to it then it outputs with saveasTextfile() the content of a JavaPairRdd. my Spark version is : 2.3.0 my java version : 1.8 the project runs in an Eclipse IDE under windows 10.… Read More »

Apache HttpClient execute method without Host port number

Questions: We are creating a reverse proxy application in java which just forwards requests to downstream systems and gets response and sends it back to UI. For this we started using Apache HttpClient library. Http client execute works perfectly when we configure like below. It is handling all requests (GET,POST,PUT,DELETE). It was made on generic… Read More »