问:
Unable to use the Selenium framework (pom.xml), after upgrading Firefox browser to 57.0

I am unable to use the Selenium framework (pom.xml), after upgrading Firefox browser to 57.0. Selenium - Oxygen 1

Below is the error:

```<code>log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to
host
127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
file\extensions\fxdriver@googlecode.com
</code>```

Note: I am able to run my script with .xml but unable to run same with pom.xml

Refer screenshot

Below is my POM class:

```<code>  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.justdial</groupId>
    <artifactId>WebApplicationFramework</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Evangelist</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.53.1</version>
        </dependency>
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>4.1.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <type>maven-plugin</type>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>[3.9,)</version>
        </dependency>
<dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>[3.9,)</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
            <version>[3.9,)</version>
        </dependency>

        <dependency><!-- This is required for Selenium -->
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>

        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.6.0</version>
        </dependency>

        <dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>22.0</version>
</dependency>

        <dependency><!--Might have to add mysql-connector-java-5.1.13-bin -->
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.35</version>
        </dependency>

        <dependency>
            <groupId>justdial</groupId>
            <artifactId>web-automation</artifactId>
            <version>1.0.0</version>
            <scope>system</scope>
            <systemPath>C:/Users/vaibhavsi/.m2/repository/justdial/web-
     automation/1.0.0/web-automation-1.0.0.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>2.2.1</version>
        </dependency>

    </dependencies>

    <!-- <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId> <configuration> <groups>${group.type}</groups>
        <properties> <property> <name>listener</name> <value>com.justdial.listener.CustomReporter,com.justdial.listener.CustomListener,com.justdial.listener.TestsListenerAdapter</value>
        </property> </properties> </configuration> </plugin> </plugins> </build> -->

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>

                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>Intlautomation.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <systemPropertyVariables>
                        <!-- Paramater execution environment "mvn test -
                             DsuiteFile=smoke.xml
                            -Denvironment=sandbox" -->
                        <environment>Staging</environment>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <configuration>
                    <filesets>
                        <fileset>

    <directory>src/test/java/org/justdial/log/Screenshots</directory>
                            <includes>
                                <include>**/*.*</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <fork>true</fork>
                    <executable>C:/Program
    Files/Java/jdk1.8.0_144/bin/javac.exe</executable>
                    <compilerVersion>1.8</compilerVersion>
                    <!-- <source>1.7</source> <target>1.7</target> -->
                </configuration>
            </plugin>

        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>

                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.5</version>
                </plugin>

             </plugins>
    </reporting>

</project>
</code>```

Adding scripts:

```<code>package com.justdial.International;

import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.io.IOException;
import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;

import org.justdial.appLib.ApplicationLibrary;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.justdial.base.TestBase;
import com.justdial.frame.Email;
import com.justdial.frame.ExcelReadWrite;
import com.justdial.urbanclap.UrbanClap;

public class IntlAutomation extends ApplicationLibrary{
    private static final String String = null;
    ExcelReadWrite exclwrdt=  new ExcelReadWrite();
    Email email = new Email();

    // Create excel sheet
    public IntlAutomation (){
        this.exclwrdt = exclwrdt;

    }
    @Test (priority = 1)
    public void USAutomation() throws InterruptedException, IOException  {
         WebDriver driver = null;
        exclwrdt.createFile();
        TestBase api = new TestBase();
        US_Home us = new US_Home(driver, exclwrdt);

//--------------------------------------------------------------------------------------------
    exclwrdt.createWorkSheet("Web_US_Home", 0);

/*  us.Proxy_Server("https://us.justdial.com/");
    exclwrdt.writeDataInBold("Proxy Server", "");*/

    //us.closeDriver();
    //exclwrdt.writeDataInBold("Proxy Server closed", "");

    us.jdpagelaunch("https://us.justdial.com/");
    exclwrdt.writeDataInBold("New York City", "");

/*  exclwrdt.writeDataInBold("Restaurants", "");
    us.restaurants ();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Doctors", "");
    us.Home_page();
    us.doctors();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Hotels", "");
    us.Home_page();
    us.Hotels();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Car dealers", "");
    us.Home_page();
    us.Car_Dealers();
    us.enterarea("New st");

    exclwrdt.writeDataInBold("Movies", "");
    us.Home_page();
    us.Movies();
    us.enterarea("New St");*/

    exclwrdt.writeDataInBold("Login", "");
    us.Home_page();
    us.Login();

    //exclwrdt.writeDataInBold("Freelisting", "");
    //us.Freelisting();

    //exclwrdt.writeDataInBold("Testimonials", "");
    //us.Home_page();
    //us.Testimonials();

    exclwrdt.writeDataInBold("Details_Page", "");
    us.Home_page();
    us.Details_page();
    us.Details_page_Tabs();

    //exclwrdt.writeDataInBold("Feedback", "");
    //us.Home_page();
    //us.Feedback();

    exclwrdt.writeDataInBold("Results Page", "");
    us.Home_page();
    us.resultpage0();
    }

    @Test (priority = 2)
    public void CAAutomation() throws InterruptedException, IOException  {
         WebDriver driver = null;
        exclwrdt.createFile();
        TestBase api = new TestBase();
        US_Home us = new US_Home(driver, exclwrdt);

        //--------------------------------------------------------------------------------------

        exclwrdt.createWorkSheet("Web_Canada_Home", 0);

        us.Proxy_Server("https://ca.justdial.com/");
        exclwrdt.writeDataInBold("Proxy Server", "");

        //us.closeDriver();
        //exclwrdt.writeDataInBold("Proxy Server closed", "");

        us.jdpagelaunch("https://ca.justdial.com/");
        exclwrdt.writeDataInBold("Toronto", "");

        /*exclwrdt.writeDataInBold("Restaurants", "");
        us.restaurants ();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Doctors", "");
        us.Home_page();
        us.doctors();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Hotels", "");
        us.Home_page();
        us.Hotels();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Car dealers", "");
        us.Home_page();
        us.Car_Dealers();
        us.enterarea("New st");*/

        exclwrdt.writeDataInBold("Movies", "");
        us.Home_page();
        us.Movies();
        us.enterarea("New st");

    /*  exclwrdt.writeDataInBold("Login", "");
        us.Home_page();
        us.Login();

        exclwrdt.writeDataInBold("Freelisting", "");
        us.Freelisting();

        exclwrdt.writeDataInBold("Testimonials", "");
        us.Home_page();
        us.Testimonials();

        //exclwrdt.writeDataInBold("Details_Page", "");
        //us.Home_page();
        //us.Details_page();
        //us.Details_page_Tabs();

        exclwrdt.writeDataInBold("Feedback", "");
        us.Home_page();
        us.Feedback();

        exclwrdt.writeDataInBold("Results Page", "");
        us.Home_page();
    us.resultpage0();*/
        }

//------------------------------------------------------------------------------------------------
@AfterTest(alwaysRun=true)

public void executeatlast() throws IOException, MessagingException
{
    exclwrdt.closeWrite();
    //email.main(null);
        // InternetAddress[] recepients = InternetAddress.parse("testingteam@justdial.com,bharatsharma@justdial.com");
        InternetAddress[] recepients = InternetAddress.parse("vaibhav.singh@justdial.com");
     email.sendMail("vaibhav.singh@justdial.com",recepients, ExcelReadWrite.FileName, exclwrdt.getTabs(),"International Automation Report");

}
}
</code>```

Note : I am working on a framework of selenium library.

Error Logs are as follow:

```<code>log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
    Save changes
1512381676397   DeferredSave.webext.sc.lz4  DEBUG   Save changes
[Child 3944, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 3944, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1512381679408   DeferredSave.addons.json    DEBUG   Write succeeded
1512381679419   DeferredSave.webext.sc.lz4  DEBUG   Save changes
1512381679420   DeferredSave.webext.sc.lz4  DEBUG   Save changes
1512381679712   DeferredSave.webext.sc.lz4  DEBUG   Starting write
1512381679722   DeferredSave.webext.sc.lz4  DEBUG   Write succeeded
1512381680194   addons.xpi  INFO    Mapping fxdriver@googlecode.com to C:\Users\vaibhavsi\AppData\Local\Temp\anonymous2209326214180969524webdriver-profile\extensions\fxdriver@googlecode.com
1512381680194   addons.xpi  DEBUG   Ignoring file entry whose name is not a valid add-on ID: C:\Users\vaibhavsi\AppData\Local\Temp\anonymous2209326214180969524webdriver-profile\extensions\webdriver-staging
1512381680195   addons.xpi  DEBUG   Existing add-on fxdriver@googlecode.com in app-profile
1512381680196   addons.xpi  INFO    Mapping activity-stream@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\activity-stream@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping aushelper@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping e10srollout@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping firefox@getpocket.com to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1512381680197   addons.xpi  INFO    Mapping followonsearch@mozilla.com to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\followonsearch@mozilla.com.xpi
1512381680197   addons.xpi  INFO    Mapping formautofill@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\formautofill@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping onboarding@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\onboarding@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping screenshots@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\screenshots@mozilla.org.xpi
1512381680198   addons.xpi  INFO    Mapping shield-recipe-client@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\shield-recipe-client@mozilla.org.xpi
1512381680198   addons.xpi  INFO    Mapping webcompat@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1512381680200   addons.xpi  DEBUG   Existing add-on activity-stream@mozilla.org in app-system-defaults
1512381680200   addons.xpi  DEBUG   Existing add-on aushelper@mozilla.org in app-system-defaults
1512381680202   addons.xpi  DEBUG   Existing add-on e10srollout@mozilla.org in app-system-defaults
1512381680203   addons.xpi  DEBUG   Existing add-on firefox@getpocket.com in app-system-defaults
1512381680203   addons.xpi  DEBUG   Existing add-on followonsearch@mozilla.com in app-system-defaults
1512381680204   addons.xpi  DEBUG   Existing add-on formautofill@mozilla.org in app-system-defaults
1512381680204   addons.xpi  DEBUG   Existing add-on onboarding@mozilla.org in app-system-defaults
1512381680205   addons.xpi  DEBUG   Existing add-on screenshots@mozilla.org in app-system-defaults
1512381680206   addons.xpi  DEBUG   Existing add-on shield-recipe-client@mozilla.org in app-system-defaults
1512381680207   addons.xpi  DEBUG   Existing add-on webcompat@mozilla.org in app-system-defaults
1512381680208   addons.xpi  INFO    Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
1512381680210   addons.xpi  DEBUG   Existing add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1512381680211   addons.xpi  DEBUG   getInstallState changed: false, state: {}

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at com.justdial.International.US_Home.<init>(US_Home.java:25)
    at com.justdial.International.IntlAutomation.USAutomation(IntlAutomation.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    at org.testng.TestRunner.privateRun(TestRunner.java:771)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1032)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Dec 04, 2017 3:31:42 PM org.openqa.selenium.os.ProcessUtils killWinProcess
WARNING: Process refused to die after 10 seconds, and couldn't taskkill it
java.lang.NullPointerException: Unable to find executable for: taskkill
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:823)
    at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:62)
    at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:38)
    at org.openqa.selenium.os.WindowsUtils.killPID(WindowsUtils.java:178)
    at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:138)
    at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$200(UnixProcess.java:201)
    at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
    at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
    at org.openqa.selenium.firefox.FirefoxBinary.quit(FirefoxBinary.java:246)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.quit(NewProfileExtensionConnection.java:194)
    at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(FirefoxDriver.java:364)
    at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.java:310)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:122)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at com.justdial.International.US_Home.<init>(US_Home.java:25)
    at com.justdial.International.IntlAutomation.USAutomation(IntlAutomation.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    at org.testng.TestRunner.privateRun(TestRunner.java:771)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1032)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
</code>```

答:
I can see a couple of issues in your pom.xml. Can you update them as follows :

poi-ooxml

```<code><dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.9</version>
</dependency>
</code>```

poi-ooxml-schemas

```<code><dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml-schemas</artifactId>
    <version>3.9</version>
</dependency>
</code>```

Update :

These errors are harmless and logged because you have configured Apache Log4j in one of the modules in this project but not in this module. Hence you see these :

```<code>log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
</code>```

Your main error is :

```<code>org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
</code>```

The reason for this error is Mismatch between Selenium Client and Firefox Web Browser. As you are trying to use Firefox v57.0 try to use the recent version of Selenium Client i.e. v3.8.1 and GeckoDriver i.e. v0.19.1

Body:
I am unable to use the Selenium framework (pom.xml), after upgrading Firefox browser to 57.0. Selenium - Oxygen 1

Below is the error:

log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to
host
127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
file\extensions\fxdriver@googlecode.com

Note: I am able to run my script with .xml but unable to run same with pom.xml

Refer screenshot

Below is my POM class:

  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.justdial</groupId>
    <artifactId>WebApplicationFramework</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Evangelist</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.53.1</version>
        </dependency>
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>4.1.2</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.18.1</version>
            <type>maven-plugin</type>
        </dependency>
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>[3.9,)</version>
        </dependency>
<dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>[3.9,)</version>
        </dependency>

        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-schemas</artifactId>
            <version>[3.9,)</version>
        </dependency>

        <dependency>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
            <version>1.4.01</version>
        </dependency>

        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.jexcelapi</groupId>
            <artifactId>jxl</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.6.0</version>
        </dependency>

        <dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>22.0</version>
</dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.35</version>
        </dependency>

        <dependency>
            <groupId>justdial</groupId>
            <artifactId>web-automation</artifactId>
            <version>1.0.0</version>
            <scope>system</scope>
            <systemPath>C:/Users/vaibhavsi/.m2/repository/justdial/web-
     automation/1.0.0/web-automation-1.0.0.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>2.2.1</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>

                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>Intlautomation.xml</suiteXmlFile>
                    </suiteXmlFiles>
                    <systemPropertyVariables>

                        <environment>Staging</environment>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
                <configuration>
                    <filesets>
                        <fileset>

    <directory>src/test/java/org/justdial/log/Screenshots</directory>
                            <includes>
                                <include>**/*.*</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <fork>true</fork>
                    <executable>C:/Program
    Files/Java/jdk1.8.0_144/bin/javac.exe</executable>
                    <compilerVersion>1.8</compilerVersion>

                </configuration>
            </plugin>

        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>

                <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>2.5</version>
                </plugin>

             </plugins>
    </reporting>

</project>

Adding scripts:

package com.justdial.International;

import org.testng.annotations.Test;
import org.testng.annotations.Test;
import java.io.IOException;
import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;

import org.justdial.appLib.ApplicationLibrary;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import com.justdial.base.TestBase;
import com.justdial.frame.Email;
import com.justdial.frame.ExcelReadWrite;
import com.justdial.urbanclap.UrbanClap;

public class IntlAutomation extends ApplicationLibrary{
    private static final String String = null;
    ExcelReadWrite exclwrdt=  new ExcelReadWrite();
    Email email = new Email();

    // Create excel sheet
    public IntlAutomation (){
        this.exclwrdt = exclwrdt;

    }
    @Test (priority = 1)
    public void USAutomation() throws InterruptedException, IOException  {
         WebDriver driver = null;
        exclwrdt.createFile();
        TestBase api = new TestBase();
        US_Home us = new US_Home(driver, exclwrdt);

//--------------------------------------------------------------------------------------------
    exclwrdt.createWorkSheet("Web_US_Home", 0);

/*  us.Proxy_Server("https://us.justdial.com/");
    exclwrdt.writeDataInBold("Proxy Server", "");*/

    //us.closeDriver();
    //exclwrdt.writeDataInBold("Proxy Server closed", "");

    us.jdpagelaunch("https://us.justdial.com/");
    exclwrdt.writeDataInBold("New York City", "");

/*  exclwrdt.writeDataInBold("Restaurants", "");
    us.restaurants ();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Doctors", "");
    us.Home_page();
    us.doctors();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Hotels", "");
    us.Home_page();
    us.Hotels();
    us.enterarea("New st");
    //us.resultpage();

    exclwrdt.writeDataInBold("Car dealers", "");
    us.Home_page();
    us.Car_Dealers();
    us.enterarea("New st");

    exclwrdt.writeDataInBold("Movies", "");
    us.Home_page();
    us.Movies();
    us.enterarea("New St");*/

    exclwrdt.writeDataInBold("Login", "");
    us.Home_page();
    us.Login();

    //exclwrdt.writeDataInBold("Freelisting", "");
    //us.Freelisting();

    //exclwrdt.writeDataInBold("Testimonials", "");
    //us.Home_page();
    //us.Testimonials();

    exclwrdt.writeDataInBold("Details_Page", "");
    us.Home_page();
    us.Details_page();
    us.Details_page_Tabs();

    //exclwrdt.writeDataInBold("Feedback", "");
    //us.Home_page();
    //us.Feedback();

    exclwrdt.writeDataInBold("Results Page", "");
    us.Home_page();
    us.resultpage0();
    }

    @Test (priority = 2)
    public void CAAutomation() throws InterruptedException, IOException  {
         WebDriver driver = null;
        exclwrdt.createFile();
        TestBase api = new TestBase();
        US_Home us = new US_Home(driver, exclwrdt);

        //--------------------------------------------------------------------------------------

        exclwrdt.createWorkSheet("Web_Canada_Home", 0);

        us.Proxy_Server("https://ca.justdial.com/");
        exclwrdt.writeDataInBold("Proxy Server", "");

        //us.closeDriver();
        //exclwrdt.writeDataInBold("Proxy Server closed", "");

        us.jdpagelaunch("https://ca.justdial.com/");
        exclwrdt.writeDataInBold("Toronto", "");

        /*exclwrdt.writeDataInBold("Restaurants", "");
        us.restaurants ();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Doctors", "");
        us.Home_page();
        us.doctors();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Hotels", "");
        us.Home_page();
        us.Hotels();
        us.enterarea("New st");
        //us.resultpage();

        exclwrdt.writeDataInBold("Car dealers", "");
        us.Home_page();
        us.Car_Dealers();
        us.enterarea("New st");*/

        exclwrdt.writeDataInBold("Movies", "");
        us.Home_page();
        us.Movies();
        us.enterarea("New st");

    /*  exclwrdt.writeDataInBold("Login", "");
        us.Home_page();
        us.Login();

        exclwrdt.writeDataInBold("Freelisting", "");
        us.Freelisting();

        exclwrdt.writeDataInBold("Testimonials", "");
        us.Home_page();
        us.Testimonials();

        //exclwrdt.writeDataInBold("Details_Page", "");
        //us.Home_page();
        //us.Details_page();
        //us.Details_page_Tabs();

        exclwrdt.writeDataInBold("Feedback", "");
        us.Home_page();
        us.Feedback();

        exclwrdt.writeDataInBold("Results Page", "");
        us.Home_page();
    us.resultpage0();*/
        }

//------------------------------------------------------------------------------------------------
@AfterTest(alwaysRun=true)

public void executeatlast() throws IOException, MessagingException
{
    exclwrdt.closeWrite();
    //email.main(null);
        // InternetAddress[] recepients = InternetAddress.parse("testingteam@justdial.com,bharatsharma@justdial.com");
        InternetAddress[] recepients = InternetAddress.parse("vaibhav.singh@justdial.com");
     email.sendMail("vaibhav.singh@justdial.com",recepients, ExcelReadWrite.FileName, exclwrdt.getTabs(),"International Automation Report");

}
}

Note : I am working on a framework of selenium library.

Error Logs are as follow:

log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
    Save changes
1512381676397   DeferredSave.webext.sc.lz4  DEBUG   Save changes
[Child 3944, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
[Child 3944, Chrome_ChildThread] WARNING: pipe error: 109: file z:/build/build/src/ipc/chromium/src/chrome/common/ipc_channel_win.cc, line 346
1512381679408   DeferredSave.addons.json    DEBUG   Write succeeded
1512381679419   DeferredSave.webext.sc.lz4  DEBUG   Save changes
1512381679420   DeferredSave.webext.sc.lz4  DEBUG   Save changes
1512381679712   DeferredSave.webext.sc.lz4  DEBUG   Starting write
1512381679722   DeferredSave.webext.sc.lz4  DEBUG   Write succeeded
1512381680194   addons.xpi  INFO    Mapping fxdriver@googlecode.com to C:\Users\vaibhavsi\AppData\Local\Temp\anonymous2209326214180969524webdriver-profile\extensions\fxdriver@googlecode.com
1512381680194   addons.xpi  DEBUG   Ignoring file entry whose name is not a valid add-on ID: C:\Users\vaibhavsi\AppData\Local\Temp\anonymous2209326214180969524webdriver-profile\extensions\webdriver-staging
1512381680195   addons.xpi  DEBUG   Existing add-on fxdriver@googlecode.com in app-profile
1512381680196   addons.xpi  INFO    Mapping activity-stream@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\activity-stream@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping aushelper@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\aushelper@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping e10srollout@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping firefox@getpocket.com to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1512381680197   addons.xpi  INFO    Mapping followonsearch@mozilla.com to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\followonsearch@mozilla.com.xpi
1512381680197   addons.xpi  INFO    Mapping formautofill@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\formautofill@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping onboarding@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\onboarding@mozilla.org.xpi
1512381680197   addons.xpi  INFO    Mapping screenshots@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\screenshots@mozilla.org.xpi
1512381680198   addons.xpi  INFO    Mapping shield-recipe-client@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\shield-recipe-client@mozilla.org.xpi
1512381680198   addons.xpi  INFO    Mapping webcompat@mozilla.org to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1512381680200   addons.xpi  DEBUG   Existing add-on activity-stream@mozilla.org in app-system-defaults
1512381680200   addons.xpi  DEBUG   Existing add-on aushelper@mozilla.org in app-system-defaults
1512381680202   addons.xpi  DEBUG   Existing add-on e10srollout@mozilla.org in app-system-defaults
1512381680203   addons.xpi  DEBUG   Existing add-on firefox@getpocket.com in app-system-defaults
1512381680203   addons.xpi  DEBUG   Existing add-on followonsearch@mozilla.com in app-system-defaults
1512381680204   addons.xpi  DEBUG   Existing add-on formautofill@mozilla.org in app-system-defaults
1512381680204   addons.xpi  DEBUG   Existing add-on onboarding@mozilla.org in app-system-defaults
1512381680205   addons.xpi  DEBUG   Existing add-on screenshots@mozilla.org in app-system-defaults
1512381680206   addons.xpi  DEBUG   Existing add-on shield-recipe-client@mozilla.org in app-system-defaults
1512381680207   addons.xpi  DEBUG   Existing add-on webcompat@mozilla.org in app-system-defaults
1512381680208   addons.xpi  INFO    Mapping {972ce4c6-7e08-4474-a285-3208198ce6fd} to C:\Users\vaibhavsi\AppData\Local\Mozilla Firefox\browser\extensions\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi
1512381680210   addons.xpi  DEBUG   Existing add-on {972ce4c6-7e08-4474-a285-3208198ce6fd} in app-global
1512381680211   addons.xpi  DEBUG   getInstallState changed: false, state: {}

    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:113)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at com.justdial.International.US_Home.<init>(US_Home.java:25)
    at com.justdial.International.IntlAutomation.USAutomation(IntlAutomation.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    at org.testng.TestRunner.privateRun(TestRunner.java:771)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1032)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Dec 04, 2017 3:31:42 PM org.openqa.selenium.os.ProcessUtils killWinProcess
WARNING: Process refused to die after 10 seconds, and couldn't taskkill it
java.lang.NullPointerException: Unable to find executable for: taskkill
    at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:823)
    at org.openqa.selenium.os.UnixProcess.<init>(UnixProcess.java:62)
    at org.openqa.selenium.os.CommandLine.<init>(CommandLine.java:38)
    at org.openqa.selenium.os.WindowsUtils.killPID(WindowsUtils.java:178)
    at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:138)
    at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$200(UnixProcess.java:201)
    at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
    at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:155)
    at org.openqa.selenium.firefox.FirefoxBinary.quit(FirefoxBinary.java:246)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.quit(NewProfileExtensionConnection.java:194)
    at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(FirefoxDriver.java:364)
    at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.java:310)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:122)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:216)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120)
    at com.justdial.International.US_Home.<init>(US_Home.java:25)
    at com.justdial.International.IntlAutomation.USAutomation(IntlAutomation.java:34)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:659)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:845)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1153)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
    at org.testng.TestRunner.privateRun(TestRunner.java:771)
    at org.testng.TestRunner.run(TestRunner.java:621)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:357)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:352)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:310)
    at org.testng.SuiteRunner.run(SuiteRunner.java:259)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1199)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1124)
    at org.testng.TestNG.run(TestNG.java:1032)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:295)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Body:
I can see a couple of issues in your pom.xml. Can you update them as follows :

poi-ooxml

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.9</version>
</dependency>

poi-ooxml-schemas

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml-schemas</artifactId>
    <version>3.9</version>
</dependency>

Update :

These errors are harmless and logged because you have configured Apache Log4j in one of the modules in this project but not in this module. Hence you see these :

log4j:WARN No appenders could be found for logger (Log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

Your main error is :

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

The reason for this error is Mismatch between Selenium Client and Firefox Web Browser. As you are trying to use Firefox v57.0 try to use the recent version of Selenium Client i.e. v3.8.1 and GeckoDriver i.e. v0.19.1


来源: stackexchange

问:
YouTube API V3 - Get recommended video for new feed
As YouTube official documentation about implement and immigrate to API V3, they said:

YouTube Data API (v2) functionality: Retrieve video recommendations

  The v3 API does not retrieve a list that only contains videos recommended for the current API user. However, you can use the v3 API to find recommended videos by calling the activities.list method and setting the home parameter value to true.

But now the parameter home has been deprecated too.
Currently, when I set the home parameter to true, I only retrieve the recently uploaded video in the channel: Popular video in YouTube. There are no video with snippet.type=recommendation at all.

I need to show recommended videos of authenticated user in new feed, but seem like this feature is completely deprecated by YouTube.
Anyone has solution for that?

Thanks first!

答:
You can retrieve them using the following API call:</p>

```<code>GET https://www.googleapis.com/youtube/v3/activitiespart=snippet%2CcontentDetails&channelId={channel—_Id}&maxResults=25&regionCode=tw&key={YOUR_API_KEY}
</code>```

ContentLicense: CC BY-SA 3.0

Body:
You can retrieve them using the following API call:

GET https://www.googleapis.com/youtube/v3/activitiespart=snippet%2CcontentDetails&channelId={channel—_Id}&maxResults=25&regionCode=tw&key={YOUR_API_KEY}


问:
mapping an array of objects and changing the value with on onClick in React
I'm trying to change the value of like within the cardArr objects while using a map() to list each obj.

Below is my code.
Current, it works, but every object shares the same counter since it's not calling from the object. I understand that I'm currently just calling the object property stored in state, but how do I edit the like in each object using a map function?

```<code>import React, { Component } from 'react';

const cardArr = [
{
    id: 1,
    text: "Hey this is a test.",
    img: " ",
    like: 0
},
{
    id: 2,
    text: "If this works I'll call it a day.",
    img: " ",
    like: 0
},
{
    id: 3,
    text: "I'll drink a lot of beer.",
    img: " ",
    like: 0
},
{
    id: 4,
    text: "Cheers",
    img: " ",
    like: 0

}
]

export class Card extends Component {
    constructor(props) {
    super(props);
    this.state = {
      like: 0,
      show: true
    };
     // this.handleClick = this.handleClick.bind(this);

  }

IncrementItem = () => {
    this.setState({ like: this.state.like + 1 });
}
DecreaseItem = () => {
    this.setState({ like: this.state.like - 1 });
}

// handleClick(e) {
//  e.preventDefault();
//  this.IncrementItem();
// }
// handleClick(e) {
//  e.preventDefault();
//  this.DecreaseItem();
// }

render() {

    const cardList = (cardArr.map((card) =>

        <ul>
            <li>
            <div key={card.id}>
                {card.text};
                <img src={card.img}/>
                <p>Like Button</p>
                <button onClick={this.handleClickAdd}>Like</button>
                <p>Dilike Button</p>
                <button onClick={this.DecreaseItem}>Disike</button>
                <p>Likes: {this.state.like}</p>
            </div>
            </li>
        </ul>
        ));

    return(
        <div id='card'>
            {cardList}
        </div>
    )
}
}
</code>```

答:
What about to make separation. Create an additional component for cardAddr. And move the render and like working logic to CardAddr component.

const cardArr = [
{
    id: 1,
    text: "Hey this is a test.",
    img: " ",
    like: 0
},
{
    id: 2,
    text: "If this works I'll call it a day.",
    img: " ",
    like: 0
},
{
    id: 3,
    text: "I'll drink a lot of beer.",
    img: " ",
    like: 0
},
{
    id: 4,
    text: "Cheers",
    img: " ",
    like: 0

}]

class CardAddr extends React.Component {
    constructor(props) {
    super(props);
    this.state = this.state = props.card;
  }

  IncrementItem = () => {
    this.setState({ like: this.state.like + 1 });
  }
  DecreaseItem = () => {
    this.setState({ like: this.state.like - 1 });
  }

  render() {
   return (

            {this.state.text}

Like Button

            <button onClick={this.IncrementItem}>Like</button>

Dilike Button

            <button onClick={this.DecreaseItem}>Disike</button>

Likes: {this.state.like}

    )
  }
}

class Card extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      show: true
    };
  }

render() {
    const cardList = (cardArr.map((card) =>

              <CardAddr card={card}/>

    ));

    return(

            {cardList}

    )
}
}

ReactDOM.render(
  <Card />,
  document.getElementById('container')
);```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<div id="container">

</div></code>```

Body:
I'm trying to change the value of like within the cardArr objects while using a map() to list each obj.

Below is my code.
Current, it works, but every object shares the same counter since it's not calling from the object. I understand that I'm currently just calling the object property stored in state, but how do I edit the like in each object using a map function?

import React, { Component } from 'react';

const cardArr = [
{
    id: 1,
    text: "Hey this is a test.",
    img: " ",
    like: 0
},
{
    id: 2,
    text: "If this works I'll call it a day.",
    img: " ",
    like: 0
},
{
    id: 3,
    text: "I'll drink a lot of beer.",
    img: " ",
    like: 0
},
{
    id: 4,
    text: "Cheers",
    img: " ",
    like: 0

}
]

export class Card extends Component {
    constructor(props) {
    super(props);
    this.state = {
      like: 0,
      show: true
    };
     // this.handleClick = this.handleClick.bind(this);

  }

IncrementItem = () => {
    this.setState({ like: this.state.like + 1 });
}
DecreaseItem = () => {
    this.setState({ like: this.state.like - 1 });
}

// handleClick(e) {
//  e.preventDefault();
//  this.IncrementItem();
// }
// handleClick(e) {
//  e.preventDefault();
//  this.DecreaseItem();
// }

render() {

    const cardList = (cardArr.map((card) =>

                {card.text};

Like Button

                <button onClick={this.handleClickAdd}>Like</button>

Dilike Button

                <button onClick={this.DecreaseItem}>Disike</button>

Likes: {this.state.like}

        ));

    return(

            {cardList}

    )
}
}

Body:
What about to make separation. Create an additional component for cardAddr. And move the render and like working logic to CardAddr component.

const cardArr = [
{
    id: 1,
    text: "Hey this is a test.",
    img: " ",
    like: 0
},
{
    id: 2,
    text: "If this works I'll call it a day.",
    img: " ",
    like: 0
},
{
    id: 3,
    text: "I'll drink a lot of beer.",
    img: " ",
    like: 0
},
{
    id: 4,
    text: "Cheers",
    img: " ",
    like: 0

}]

class CardAddr extends React.Component {
    constructor(props) {
    super(props);
    this.state = this.state = props.card;
  }

  IncrementItem = () => {
    this.setState({ like: this.state.like + 1 });
  }
  DecreaseItem = () => {
    this.setState({ like: this.state.like - 1 });
  }

  render() {
   return (
        <div key={this.state.id}>
            {this.state.text}
            <img src={this.state.img}/>
            <p>Like Button</p>
            <button onClick={this.IncrementItem}>Like</button>
            <p>Dilike Button</p>
            <button onClick={this.DecreaseItem}>Disike</button>
            <p>Likes: {this.state.like}</p>
        </div>
    )
  }
}

class Card extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      show: true
    };
  }

render() {
    const cardList = (cardArr.map((card) =>
        <ul key={card.id}>
            <li>
              <CardAddr card={card}/>
            </li>
        </ul>
    ));

    return(
        <div id='card'>
            {cardList}
        </div>
    )
}
}

ReactDOM.render(
  <Card />,
  document.getElementById('container')
);

<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<div id="container">

</div>


问:
didSelectRowAtIndexPath doesn't work on xCode 9
So I have to work on this really big project, it's still on objective C.

I was just ask to make a really small change (hide a button) so I did that and it's building fine and everything looks normal but then all of the tableView in the project won't react as in didSelectRowAtIndexPath is never called (scrolling work and the data are correctly displayed)

The only thing that changed compared to before is that I used xCode 9.

Now when I build it using xCode 8 it's working again so at least we can go ahead but I still am wondering what is happening.

I made a smaller project using exactly the same logic as the main project (the cell are custom, you can swipe etc)
and when I did it from scratch, it's working fine.

So I fell like it's more of an xCode bug/error than one with the code.
would someone have any idea ?

答:
Please check the following

It should be single selection

It should be interaction enabled

And check you have created any button on top of all layers which is targeting some other action.

Check it and reply.


问:
I use gson to serialize a java object, and set LongSerializationPolicy is LongSerializationPolicy.STRING, but I can't understand the result
I use gson to serialize a java object, and set LongSerializationPolicy.STRING to serialize Long field. Like this:

```<code>Gson gson = new GsonBuilder()
        .setLongSerializationPolicy(LongSerializationPolicy.STRING)
        .create();

Map<String, Long> resultMap = Maps.newHashMap();
resultMap.put("id", 123456789L);

JsonObject dataObj = new JsonObject();
dataObj,addProperty("id", 123456789L);

System.out.println(gson.toJson(resultMap));
System.out.println(gson.toJson(dataObj));
</code>```

and the result is:

```<code>{"id":"123456789"}
{"id":123456789}
</code>```

Why the result is different? The two results I expect are {"id":"123456789L"}

答: I believe that's because JsonObject adds your values as Map<String,JsonValue> and JsonValue extends Object, so when serializing whatever you put as your value will be parsed as a string.

ContentLicense: CC BY-SA 4.0

Body:
I use gson to serialize a java object, and set LongSerializationPolicy.STRING to serialize Long field. Like this:

Gson gson = new GsonBuilder()
        .setLongSerializationPolicy(LongSerializationPolicy.STRING)
        .create();

Map<String, Long> resultMap = Maps.newHashMap();
resultMap.put("id", 123456789L);

JsonObject dataObj = new JsonObject();
dataObj,addProperty("id", 123456789L);

System.out.println(gson.toJson(resultMap));
System.out.println(gson.toJson(dataObj));

and the result is:

{"id":"123456789"}
{"id":123456789}

Why the result is different? The two results I expect are {"id":"123456789L"}


问:
Do I generate a side effect?
I have the following function and want to know, if it generates a side effect:

```<code>  def build[F[_] : Monad : Foldable, A]
  (consumer: Consumer[String, String])(cb: Vector[KkConsumerRecord] => F[A])
  : KkConsumerThread = {
    val thread = delegate.newThread(() => {
      pool(consumer)(cb)
    })
    thread.setDaemon(true)
    KkConsumerThread(thread)
  }
</code>```

Inside the function, I create a thread but do not start it yet. That is mean for me, I do not generate any side effect yet. Am I right?

答:
You generate several side-effects here:

starting with more or less transparent thread.setDaemon(true), given that you do it only once (and it seems like no one reads false before you return KkConsumerThread)

delegate.newThread( registers new thread within JVM (assuming it creates a JVM thread): http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/Thread.java#393, so it might be seen in JConsole/JVisualVM/jstack as unstarted thread:

```<code>g.addUnstarted(); //adding thread to default THread group
... //a lot of other global mutable stuff
</code>```

See: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/Thread.java#327.

So, you should be careful about thread lifecycle (if you call it too often), especially if you do some other low-level stuff.

P.S. As far as I recall, creation of new thread also assigns a call-stack immediately (before start).

Title: Do I generate a side effect?

Body:
I have the following function and want to know, if it generates a side effect:

  def build[F[_] : Monad : Foldable, A]
  (consumer: Consumer[String, String])(cb: Vector[KkConsumerRecord] => F[A])
  : KkConsumerThread = {
    val thread = delegate.newThread(() => {
      pool(consumer)(cb)
    })
    thread.setDaemon(true)
    KkConsumerThread(thread)
  }

Inside the function, I create a thread but do not start it yet. That is mean for me, I do not generate any side effect yet. Am I right?

Body:
You generate several side-effects here:

starting with more or less transparent thread.setDaemon(true), given that you do it only once (and it seems like no one reads false before you return KkConsumerThread)

delegate.newThread( registers new thread within JVM (assuming it creates a JVM thread): http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/Thread.java#393, so it might be seen in JConsole/JVisualVM/jstack as unstarted thread:

g.addUnstarted(); //adding thread to default THread group
... //a lot of other global mutable stuff

See: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/Thread.java#327.

So, you should be careful about thread lifecycle (if you call it too often), especially if you do some other low-level stuff.

P.S. As far as I recall, creation of new thread also assigns a call-stack immediately (before start).


问:
Uploading file with ftp_nb_put to FTP server in PHP results in an empty destination file

Hello,
I'm doing a script to send files directly to a server by ftp protocol.
To do that, I use php ftp functions.

```<code>$conn_id = ftp_connect('XXXX.com', 21);

$login_result = ftp_login($conn_id, 'USER_XXXX', 'PWD_XXXX');
ftp_pasv($conn_id, true) or die("Cannot switch to passive mode");

if ((!$conn_id) || (!$login_result)) {
    die("Problem FTP connection !");
}

if (ftp_chdir($conn_id, 'SERVER_PATH')) {
    echo ftp_pwd($conn_id) . "\n";
} else {
    echo "Problem to change path\n";
}

ftp_nb_put($conn_id, $File, $localPath. $File, FTP_ASCII);

ftp_close($conn_id);
</code>```

No error is announced, but the file that arrives on my server is empty.

I forgot to precise, my file to upload is a big xlsx file.

答:
Your code is just wrong. You use non-blocking ftp_nb_put, as if it were blocking.

If you want a simple code, you have to use ftp_put.

If you really need a non-blocking code, you have to close the connection only after ftp_nb_continue reports FTP_FINISHED. See File uploaded with ftp_nb_put to FileZilla FTP server in PHP is corrupted.

Otherwise your current code will just close the connection at a moment the upload hardly even started.

The "sleep", suggested in comments, is (as mentioned there) just for a test, you cannot reliably use it in a real code.

Your second problem is that you are uploading binary .xlsx files in a text/ascii mode (FTP_ASCII). You have to use a binary mode (FTP_BINARY). The text/ascii mode will corrupt binary files. So even, if the upload finishes, the file will be corrupted.

This will work:

```<code>ftp_put($conn_id, $File, $localPath.$File, FTP_BINARY);
</code>```

Body:
Hello,
I'm doing a script to send files directly to a server by ftp protocol.
To do that, I use php ftp functions.

$conn_id = ftp_connect('XXXX.com', 21);

$login_result = ftp_login($conn_id, 'USER_XXXX', 'PWD_XXXX');
ftp_pasv($conn_id, true) or die("Cannot switch to passive mode");

if ((!$conn_id) || (!$login_result)) {
    die("Problem FTP connection !");
}

if (ftp_chdir($conn_id, 'SERVER_PATH')) {
    echo ftp_pwd($conn_id) . "\n";
} else {
    echo "Problem to change path\n";
}

ftp_nb_put($conn_id, $File, $localPath. $File, FTP_ASCII);

ftp_close($conn_id);

No error is announced, but the file that arrives on my server is empty.

I forgot to precise, my file to upload is a big xlsx file.

Body:
Your code is just wrong. You use non-blocking ftp_nb_put, as if it were blocking.

If you want a simple code, you have to use ftp_put.

If you really need a non-blocking code, you have to close the connection only after ftp_nb_continue reports FTP_FINISHED. See File uploaded with ftp_nb_put to FileZilla FTP server in PHP is corrupted.

Otherwise your current code will just close the connection at a moment the upload hardly even started.

The "sleep", suggested in comments, is (as mentioned there) just for a test, you cannot reliably use it in a real code.

Your second problem is that you are uploading binary .xlsx files in a text/ascii mode (FTP_ASCII). You have to use a binary mode (FTP_BINARY). The text/ascii mode will corrupt binary files. So even, if the upload finishes, the file will be corrupted.

This will work:

ftp_put($conn_id, $File, $localPath.$File, FTP_BINARY);


问:
Select rows which are not present in other table
I've got two postgresql tables:

table name     column names
-----------    ------------------------
login_log      ip | etc.
ip_location    ip | location | hostname | etc.
```

<p>I want to get every IP address from <code>login_log</code> which doesn't have a row in <code>ip_location</code>.<br>
I tried this query but it throws a syntax error.</p>

```SELECT login_log.ip
FROM login_log
WHERE NOT EXIST (SELECT ip_location.ip
                 FROM ip_location
                 WHERE login_log.ip = ip_location.ip)
```

<blockquote>
```ERROR: syntax error at or near "SELECT"
LINE 3: WHERE NOT EXIST (SELECT ip_location.ip`
```

I'm also wondering if this query (with adjustments to make it work) is the best performing query for this purpose.

答:
SELECT *
    FROM   testcases1 t
    WHERE  NOT EXISTS (
       SELECT 1

       FROM   executions1 i
       WHERE  t.tc_id = i.tc_id and t.pro_id=i.pro_id and pro_id=7 and version_id=5
       )  and pro_id=7 ;

Here testcases1 table contains all datas and executions1 table contains some data among testcases1 table. I am retrieving only the datas which are not present in exections1 table. ( and even I am giving some conditions inside that you can also give.) specify condition which should not be there in retrieving data should be inside brackets.

Body:
I've got two postgresql tables:

table name     column names
-----------    ------------------------
login_log      ip | etc.
ip_location    ip | location | hostname | etc.

I want to get every IP address from login_log which doesn't have a row in ip_location.

I tried this query but it throws a syntax error.

SELECT login_log.ip
FROM login_log
WHERE NOT EXIST (SELECT ip_location.ip
                 FROM ip_location
                 WHERE login_log.ip = ip_location.ip)

ERROR: syntax error at or near "SELECT"
LINE 3: WHERE NOT EXIST (SELECT ip_location.ip`

I'm also wondering if this query (with adjustments to make it work) is the best performing query for this purpose.


问:
Improve performance postgresql query
I have 3 tables: users, posts and likes. A post is called hot post if it has more than 5 likes within the first hour after post creation. The following is using to query for a list of hot posts. Can anyone help me to improve this query (how to index or rewrite it).

```<code>SELECT post.id,
       post.content,
       user.username,
       COUNT(like.id)
FROM posts AS post
   LEFT OUTER JOIN users AS user
      ON post.user_id = user.id
   INNER JOIN likes AS likes
      ON post.id = likes.post_id
         AND likes.created_at - INTERVAL '1 hour' < post.created_at
GROUP BY post.id, user.username
HAVING COUNT(like.id) >= 5
ORDER BY post.created_at DESC;
</code>```

答:
First, unless there really can be a post that does not belong to a user, use an inner join there.

Assuming that there is a good number of posts and likes, the best join strategy would be a merge join or a hash join, which PostgreSQL should choose automatically.

For a merge join, the following indexes might be helpful:

```<code>CREATE INDEX ON posts (id);
CREATE INDEX ON likes (post_id);
</code>```

No index could help with a hash join in this case.

If the planner chooses a nested loop join after all, it might be useful to rewrite the query to:

```<code>... AND likes.created_at < post.created_at + INTERVAL '1 hour'
</code>```

and create an index like

```<code>CREATE INDEX ON likes (post_id, created_at);
</code>```

Title: Improve performance postgresql query

Body:
I have 3 tables: users, posts and likes. A post is called hot post if it has more than 5 likes within the first hour after post creation. The following is using to query for a list of hot posts. Can anyone help me to improve this query (how to index or rewrite it).

SELECT post.id,
       post.content,
       user.username,
       COUNT(like.id)
FROM posts AS post
   LEFT OUTER JOIN users AS user
      ON post.user_id = user.id
   INNER JOIN likes AS likes
      ON post.id = likes.post_id
         AND likes.created_at - INTERVAL '1 hour' < post.created_at
GROUP BY post.id, user.username
HAVING COUNT(like.id) >= 5
ORDER BY post.created_at DESC;

Body:
First, unless there really can be a post that does not belong to a user, use an inner join there.

Assuming that there is a good number of posts and likes, the best join strategy would be a merge join or a hash join, which PostgreSQL should choose automatically.

For a merge join, the following indexes might be helpful:

CREATE INDEX ON posts (id);
CREATE INDEX ON likes (post_id);

No index could help with a hash join in this case.

If the planner chooses a nested loop join after all, it might be useful to rewrite the query to:

... AND likes.created_at < post.created_at + INTERVAL '1 hour'

and create an index like

CREATE INDEX ON likes (post_id, created_at);


问:
Extract archives to S3
I need to download zip archives, extract them and load to S3. I thought about using Lambda to handle downloading and unarchiving, but it has disk size limits.

What would be the best service to do this? I can't use my local machine, because I expect the job to run for several days.

答: One possible solution is : get a EC2 nano instance ( very very cheap ).. attach EBS volume.. write a small bash script which downloads file using wget/curl and the upload to S3 using AWS CLI</p>

Title: Extract archives to S3


问:
How to specify port for NodeJs application hosted in ElasticBeanStalk?
How does port in ElasticBeanStalk works?
I have a NodeJs/ExpressJS application which will be deployed in ElasticBeanStalk.

The ElasticBeanStalk has a load balancer used to attach SSL certificates.
Should i specify the port from my nodejs application?Can it be any port?
Or elastic beanstalk has some specific ports for this?
Can someone throw some lights on this?
I think the elastic bean stalk comes with a default infront of it. So is port specified in this?

答:
You should use process.env.PORT to get the port from environment variables.

Elastic Beanstalk will set it for you.

Externally port 80 will be opened and will be routed to the port configured on Elastic Beanstalk.

Your Load Balancer with SSL will probably forward traffic from port 443 to Elastic Beanstalk.

See more in these docs.


问:
Export a AVMutableVideoComposition using AVAssetWriter instead of AVAssetExportSession
I have a AVMutableVideoComposition and I want to export it to a video file.

Unfortunately, AVAssetExportSession doesn't make the cut because I need fine control over the output video settings (bitrate, keyframes, ...)

How can I extract the images from AVMutableVideoComposition to feed them to an AVAssetWriterInput ?

So far I looked into AVVideoCompositionRenderContext and AVAsynchronousVideoCompositionRequest but both seems like dead ends since I can't find an API to render my AVMutableComposition

答:
For now I assume this is impossible.

There is two workaround this limitation:

Give up on AVMutableVideoComposition and use AVAssetReader and AVAssetReaderTrackOutput.

=> This is what you should do if you just want to concat some videos.

Make it two passes. Export the video once with AVMutableVideoComposition then read and write again.

=> Not optimal, I can get away with it because my videos are so small.
=> Much easier to write if you have transforms, CIFilters, and other complex operations.

Hope I'll get around with a cleaner solution next time:


问:
How to separate a list into two different lists ?(Python2.7)
My current data is in the format of :

```<code>[  1982,      1, 108108,   5568],
[  1982,      2,  64488,   2433],
...,
[  2007,    498,   4341,    395],
[  2007,    499,   4328,    274],
[  2007,    500,   4323,   -118]]
</code>```

I want to put all of the data that is from 1982 into one list, and all of the data that is from 2007 into another list.

How would I do this?

答:
You could use a defaultdictdictionary to store the data, with the year as the key, and the data as the values:

```<code>from collections import defaultdict

l = [[1982, 1, 108108, 5568],
     [1982, 2, 64488, 2433],
     [2007, 498, 4341, 395],
     [2007, 499, 4328, 274],
     [2007, 500, 4323, -118]]

# create a dict of lists
data = defaultdict(list)

# go over each sublist in l
for lst in l:

    # the key is the first element in each list
    year = lst[0]

    # add the rest of the list to the value of the key
    data[year] += lst[1:]

>>> print(dict(data))
{1982: [1, 108108, 5568, 2, 64488, 2433], 2007: [498, 4341, 395, 499, 4328, 274, 500, 4323, -118]}

>>> print(data[1982])
[1, 108108, 5568, 2, 64488, 2433]

>>> print(data[2007])
[498, 4341, 395, 499, 4328, 274, 500, 4323, -118]

# here is where you can extract your two lists
>>> print(list(data.values()))
[[1, 108108, 5568, 2, 64488, 2433], [498, 4341, 395, 499, 4328, 274, 500, 4323, -118]]
</code>```

The benefit of this is that you can have multiple years stored.

Body:
My current data is in the format of :

[  1982,      1, 108108,   5568],
[  1982,      2,  64488,   2433],
...,
[  2007,    498,   4341,    395],
[  2007,    499,   4328,    274],
[  2007,    500,   4323,   -118]]

I want to put all of the data that is from 1982 into one list, and all of the data that is from 2007 into another list.

How would I do this?

Body:
You could use a defaultdictdictionary to store the data, with the year as the key, and the data as the values:

from collections import defaultdict

l = [[1982, 1, 108108, 5568],
     [1982, 2, 64488, 2433],
     [2007, 498, 4341, 395],
     [2007, 499, 4328, 274],
     [2007, 500, 4323, -118]]

# create a dict of lists
data = defaultdict(list)

# go over each sublist in l
for lst in l:

    # the key is the first element in each list
    year = lst[0]

    # add the rest of the list to the value of the key
    data[year] += lst[1:]

>>> print(dict(data))
{1982: [1, 108108, 5568, 2, 64488, 2433], 2007: [498, 4341, 395, 499, 4328, 274, 500, 4323, -118]}

>>> print(data[1982])
[1, 108108, 5568, 2, 64488, 2433]

>>> print(data[2007])
[498, 4341, 395, 499, 4328, 274, 500, 4323, -118]

# here is where you can extract your two lists
>>> print(list(data.values()))
[[1, 108108, 5568, 2, 64488, 2433], [498, 4341, 395, 499, 4328, 274, 500, 4323, -118]]

The benefit of this is that you can have multiple years stored.


问:
.htaccess redirect subfolder to HTTPS
I'm trying to write a RewriteRule for my .htaccess file. Specifically, whenever a user accesses a specific subdirectory, I would like it to Rewrite to force an HTTPS connection.

For example, whenever someone accesses: http://www.mydomain.com/subdirectory (and any other sub-directories of that "subdirectory").

I'd like it to rewrite to https://www.mydomain.com/subdirectory

I've tried the following, but it appears to create a loop:

```<code>RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mydomain.com/subdirectory/$1 [R=301,L]
</code>```

Also, this .htaccess file is placed in the root of my domain.

Any ideas on how to modify my RewriteRule?

Many Thanks!

答:
Try</p>

```<code>RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.mydomain.com/subdirectory/$1 [R=301,L]
</code>```

Title: .htaccess redirect subfolder to HTTPS

Body:
I'm trying to write a RewriteRule for my .htaccess file. Specifically, whenever a user accesses a specific subdirectory, I would like it to Rewrite to force an HTTPS connection.

For example, whenever someone accesses: http://www.mydomain.com/subdirectory (and any other sub-directories of that "subdirectory").

I'd like it to rewrite to https://www.mydomain.com/subdirectory

I've tried the following, but it appears to create a loop:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mydomain.com/subdirectory/$1 [R=301,L]

Also, this .htaccess file is placed in the root of my domain.

Any ideas on how to modify my RewriteRule?

Many Thanks!

Body:
Try

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.mydomain.com/subdirectory/$1 [R=301,L]

ContentLicense: CC BY-SA 2.5


问:
How to make overflow-y scroll without changing overflow-x to auto?
I know this is a duplicated question.

And below link is the answer the most nearest with my question that I've found.

CSS overflow-x: visible; and overflow-y: hidden; causing scrollbar issue

In this link, the W3C spec says:

The computed values of ‘overflow-x’ and ‘overflow-y’ are the same as
  their specified values, except that some combinations with ‘visible’
  are not possible: if one is specified as ‘visible’ and the other is
  ‘scroll’ or ‘auto’, then ‘visible’ is set to ‘auto’. The computed
  value of ‘overflow’ is equal to the computed value of ‘overflow-x’ if
  ‘overflow-y’ is the same; otherwise it is the pair of computed values
  of ‘overflow-x’ and ‘overflow-y’.

What I want to know is, are there any new solution of this.

The problem of mine is in this fiddle.

I made 'sidebar' class of 'BootStrap' simple in a fiddle of mine.

```<code>overflow-x: visible;
//overflow-y: scroll;
</code>```

You can see that I commented out 'overflow-y: scroll' of class '.panel' in css part.

In this case, 'hover' will work but 'scroll' won't.

When if I clear that comment out, 'hover' won't work but 'scroll' will.

What I wanna see is, 'hover' and 'scroll' working together.

Does anyone have any ways or ideas to fix this?

Or are there still no way to solve this problem?

答:
You could use jQuery so you will change the .panel overflow depending on the event.

Absolutely you will need a little of css hacks also,

See the updated JSfiddle.

Body:
I know this is a duplicated question.

And below link is the answer the most nearest with my question that I've found.

CSS overflow-x: visible; and overflow-y: hidden; causing scrollbar issue

In this link, the W3C spec says:

The computed values of ‘overflow-x’ and ‘overflow-y’ are the same as
  their specified values, except that some combinations with ‘visible’
  are not possible: if one is specified as ‘visible’ and the other is
  ‘scroll’ or ‘auto’, then ‘visible’ is set to ‘auto’. The computed
  value of ‘overflow’ is equal to the computed value of ‘overflow-x’ if
  ‘overflow-y’ is the same; otherwise it is the pair of computed values
  of ‘overflow-x’ and ‘overflow-y’.

What I want to know is, are there any new solution of this.

The problem of mine is in this fiddle.

I made 'sidebar' class of 'BootStrap' simple in a fiddle of mine.

overflow-x: visible;
//overflow-y: scroll;

You can see that I commented out 'overflow-y: scroll' of class '.panel' in css part.

In this case, 'hover' will work but 'scroll' won't.

When if I clear that comment out, 'hover' won't work but 'scroll' will.

What I wanna see is, 'hover' and 'scroll' working together.

Does anyone have any ways or ideas to fix this?

Or are there still no way to solve this problem?


问:
Image not displaying after move from PySide to PyQt5
I went from PySide to PyQt5 because I want to use some older code I have written and Python 3.5 does not support PySide anymore and PySide2 or Python 3.4 does not work for me either.

The last line in the code below used to get me the Example.JPG displayed. Now it does not seem to do anything for me with PyQt5

```<code>self.scene = QtWidgets.QGraphicsScene()
self.view = QtWidgets.QGraphicsView(self.scene)
layout.addWidget(self.view, 1, 0, 1, 0)
self.view.scale(0.15,0.15)
self.view.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.view.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.view.setTransformationAnchor(self.view.AnchorUnderMouse)
self.view.wheelEvent = self.scrollSelect
self.view.keyPressEvent = self.keypressed

self.fpimage = 'Example.JPG'
self.pixmap_item = QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(self.fpimage), None, self.scene)
</code>```

Giving a complete working set of code is a bit difficult since I can't use PySide anymore to confirm.

Is there a way to get the image show up again?

答:
I found the solution, in stead of this (worked with PySide):

```<code>self.pixmap_item = QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(self.fpimage), None, self.scene)
</code>```

i now have:

```<code>self.pixmap_item = QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(self.fpimage))
self.scene.addItem(self.pixmap_item)
</code>```

And it is displaying the picture in my QGraphicsScene with PyQt5.

Body:
I went from PySide to PyQt5 because I want to use some older code I have written and Python 3.5 does not support PySide anymore and PySide2 or Python 3.4 does not work for me either.

The last line in the code below used to get me the Example.JPG displayed. Now it does not seem to do anything for me with PyQt5

self.scene = QtWidgets.QGraphicsScene()
self.view = QtWidgets.QGraphicsView(self.scene)
layout.addWidget(self.view, 1, 0, 1, 0)
self.view.scale(0.15,0.15)
self.view.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.view.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.view.setTransformationAnchor(self.view.AnchorUnderMouse)
self.view.wheelEvent = self.scrollSelect
self.view.keyPressEvent = self.keypressed

self.fpimage = 'Example.JPG'
self.pixmap_item = QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(self.fpimage), None, self.scene)

Giving a complete working set of code is a bit difficult since I can't use PySide anymore to confirm.

Is there a way to get the image show up again?

Body:
I found the solution, in stead of this (worked with PySide):

self.pixmap_item = QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(self.fpimage), None, self.scene)

i now have:

self.pixmap_item = QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(self.fpimage))
self.scene.addItem(self.pixmap_item)

And it is displaying the picture in my QGraphicsScene with PyQt5.


问:
TestScheduler does not work (Kotlin + RxJava2 + mockito)
I wanted to write a unit test that will verify callInit method below. However, I've got null pointer exception where the line holds subscribe(. My question is how do I verify onnext and onerror conditions in a method such below?

```<code>override fun callInit() {
    val requestInit = RequestInit(os = "android", osVersion = deviceUtil.osVersion(),
        appVersion = deviceUtil.apiVersion())
    compositeDisposable.add(
        interactor.getInit(requestInit)
            .subscribe(
                {
                  view.hideProgress()
                  this.commercialLink = it.commercialLink
                  view.updateScreen()
                },
                { error -> view.onError(error) }
            )
    )
}
</code>```

Test method:

```<code> @Test
 fun should_update_commerciallink_AND_updateScreen_when_callInit() {
    val request = RequestInit("android", "version", "osversion")
    val responseInit = ResponseInit(false, false,
        "updatelink", "message", "useragreement", "commerciallink")

    whenever(deviceUtil.osVersion()).thenReturn("version")
    whenever(deviceUtil.apiVersion()).thenReturn("apiversion")
    whenever(interactor.getInit(request)).thenReturn(Observable.just(responseInit))

    presenter.callInit()

    testScheduler.triggerActions()
    verify(view).hideProgress()
    verify(view).updateScreen()
}
</code>```

EDIT

```<code>class SplashInteractor(private val initService: InitService,
    private val schedulerProvider: SchedulerProvider) : SplashContract.Interactor {

  override fun getInit(requestInit: SplashRequest.Init): Observable<SplashResponse.Init> {
    return initService.init(requestInit)
        .subscribeOn(schedulerProvider.io())
        .flatMap(funcErrorCheckAndTransform())
        .flatMap(funcVersionControl())
        .observeOn(schedulerProvider.ui())
  }

  override fun downloadCommercialVideo(commercialLink: String): Observable<File> {
    return initService.downloadCommercialLink(commercialLink)
        .subscribeOn(schedulerProvider.io())
        .flatMap(funcDownload(commercialLink))
        .observeOn(schedulerProvider.ui())
  }
}
</code>```

presenter test

```<code>  @Before
  fun setUp() {
    testScheduler = TestScheduler()
    interactor = SplashInteractor(initService, TestSchedulerProvider(testScheduler))

    presenter = SplashPresenter(contract, interactor, uriWrapper, compositeDisposable,
        cache, fileUtil, deviceUtil)
    spyPresenter = Mockito.spy(presenter)

  }
</code>```

答:
You have a typo in one of whenever statements:

```
<code>
    whenever(deviceUtil.apiVersion()).thenReturn("apiversion")
</code>
```

You have instructed to return "apiversion", but the actual request is declared in slightly another way:

```
<code>
    val request = RequestInit(..., ..., "osversion")
</code>
```

These two string are not equal, thus Mockito cannot return the Observable that you are expecting.

Change "osversion" to "apiversion".

Body:
I wanted to write a unit test that will verify callInit method below. However, I've got null pointer exception where the line holds subscribe(. My question is how do I verify onnext and onerror conditions in a method such below?

override fun callInit() {
    val requestInit = RequestInit(os = "android", osVersion = deviceUtil.osVersion(),
        appVersion = deviceUtil.apiVersion())
    compositeDisposable.add(
        interactor.getInit(requestInit)
            .subscribe(
                {
                  view.hideProgress()
                  this.commercialLink = it.commercialLink
                  view.updateScreen()
                },
                { error -> view.onError(error) }
            )
    )
}

Test method:

 @Test
 fun should_update_commerciallink_AND_updateScreen_when_callInit() {
    val request = RequestInit("android", "version", "osversion")
    val responseInit = ResponseInit(false, false,
        "updatelink", "message", "useragreement", "commerciallink")

    whenever(deviceUtil.osVersion()).thenReturn("version")
    whenever(deviceUtil.apiVersion()).thenReturn("apiversion")
    whenever(interactor.getInit(request)).thenReturn(Observable.just(responseInit))

    presenter.callInit()

    testScheduler.triggerActions()
    verify(view).hideProgress()
    verify(view).updateScreen()
}

EDIT

class SplashInteractor(private val initService: InitService,
    private val schedulerProvider: SchedulerProvider) : SplashContract.Interactor {

  override fun getInit(requestInit: SplashRequest.Init): Observable<SplashResponse.Init> {
    return initService.init(requestInit)
        .subscribeOn(schedulerProvider.io())
        .flatMap(funcErrorCheckAndTransform())
        .flatMap(funcVersionControl())
        .observeOn(schedulerProvider.ui())
  }

  override fun downloadCommercialVideo(commercialLink: String): Observable<File> {
    return initService.downloadCommercialLink(commercialLink)
        .subscribeOn(schedulerProvider.io())
        .flatMap(funcDownload(commercialLink))
        .observeOn(schedulerProvider.ui())
  }
}

presenter test

  @Before
  fun setUp() {
    testScheduler = TestScheduler()
    interactor = SplashInteractor(initService, TestSchedulerProvider(testScheduler))

    presenter = SplashPresenter(contract, interactor, uriWrapper, compositeDisposable,
        cache, fileUtil, deviceUtil)
    spyPresenter = Mockito.spy(presenter)

  }

Body:
You have a typo in one of whenever statements:

    whenever(deviceUtil.apiVersion()).thenReturn("apiversion")

You have instructed to return "apiversion", but the actual request is declared in slightly another way:

    val request = RequestInit(..., ..., "osversion")

These two string are not equal, thus Mockito cannot return the Observable that you are expecting.

Change "osversion" to "apiversion".


问:
Xamarin forms : DisplayAlert not working
Dears,

I am using DisplayAlert in my project for displaying no internet connection alert. Unfortunately, it is not working.

It working fine in another part. I don't know the reason why it behaves like this.

My code:

```<code>            if (Utility.IsInternet())
            {
               UserTweetsList();
            }
            else
             {
                Debug.WriteLine("Enter no internet block");
               DisplayAlert("Alert", "No internet connection", "Ok");
             }
</code>```

Code enters the else block and print the "Enter no internet block" in the output, but not displaying the alert message.

What are the possible reasons for this?

Thanks in advance....

答:
Please try the below code:</p>

```<code>Device.BeginInvokeOnMainThread(async () =>
{
    await DisplayAlert("Alert", "No internet connection", "Ok");
});
</code>```

Body:
Dears,

I am using DisplayAlert in my project for displaying no internet connection alert. Unfortunately, it is not working.

It working fine in another part. I don't know the reason why it behaves like this.

My code:

            if (Utility.IsInternet())
            {
               UserTweetsList();
            }
            else
             {
                Debug.WriteLine("Enter no internet block");
               DisplayAlert("Alert", "No internet connection", "Ok");
             }

Code enters the else block and print the "Enter no internet block" in the output, but not displaying the alert message.

What are the possible reasons for this?

Thanks in advance....

Body:
Please try the below code:

Device.BeginInvokeOnMainThread(async () =>
{
    await DisplayAlert("Alert", "No internet connection", "Ok");
});


问:
Material Angular card display
I have a gallery of images and I would like to display them in a polaroid card-based system spanning multiple rows and columns. The problem I'm facing relates to the layout of the image. When images are both portrait and landscape, the mat-card attribute for the landscape ones gets bloated up to match the size of the portrait ones. How can I have a naturally filling system where the mat-card is adaptable to the width/height ratio of the image?

HTML:

                <mat-card *ngFor="let postcard of postcards let index = index" >

                </mat-card>

```
<p>CSS:</p>
<pre class="lang-css prettyprint-override"><code>    .postcards {
        max-width: 320px;
    }
</code>```

Current view:

And this is what I would like to achieve:

Thank you!

答:
I know my respond will be see as weird but i think that float left might be you are searching for ( yeah i hate float myself )

But if you get rid of all the flex stuff of your example and add margin directly on mat-card

```<code><div class="mat-elevation-z0" *ngIf="postcards != null">
      <mat-card *ngFor="let postcard of postcards let index = index" >
              <img mat-card-image src="{{postcard.img}}" alt="{{postcard.postcard_id}}" class="postcards" (click)="display_postcard(index)">
      </mat-card>
</div>

mat-card {
   margin: 1rem;
   float: left;
}
</code>```

Your card will try to fit in the available space. But of course this will not be a perfect match for all cases. But i think its the better css-only solution you can found.

Title: Material Angular card display

Body:
I have a gallery of images and I would like to display them in a polaroid card-based system spanning multiple rows and columns. The problem I'm facing relates to the layout of the image. When images are both portrait and landscape, the mat-card attribute for the landscape ones gets bloated up to match the size of the portrait ones. How can I have a naturally filling system where the mat-card is adaptable to the width/height ratio of the image?

HTML:

                <mat-card *ngFor="let postcard of postcards let index = index" >

                </mat-card>

CSS:

    .postcards {
        max-width: 320px;
    }

Current view:

And this is what I would like to achieve:

Thank you!

Body:
I know my respond will be see as weird but i think that float left might be you are searching for ( yeah i hate float myself )

But if you get rid of all the flex stuff of your example and add margin directly on mat-card

<div class="mat-elevation-z0" *ngIf="postcards != null">
      <mat-card *ngFor="let postcard of postcards let index = index" >
              <img mat-card-image src="{{postcard.img}}" alt="{{postcard.postcard_id}}" class="postcards" (click)="display_postcard(index)">
      </mat-card>
</div>

mat-card {
   margin: 1rem;
   float: left;
}

Your card will try to fit in the available space. But of course this will not be a perfect match for all cases. But i think its the better css-only solution you can found.


问:
How do I retrieve all the database's tables columns hive
I want to fetch all databases and its related tables and columns information. Obviously I can do it from metastore. But I don't have access to it . So is there any other way instead of querying each database one by one.</p>

答:
You should be able to run the following commands. I guess you could script it up to run across all databases and all tables</p>

```<code>SHOW DATABASES;
SHOW TABLES;
DESCRIBE <table_name>;
</code>```

Body:
You should be able to run the following commands. I guess you could script it up to run across all databases and all tables

SHOW DATABASES;
SHOW TABLES;
DESCRIBE <table_name>;