问:
Webscrape data produces a workbook.close() error. How can I correct it?
I'm attempting to build a webscraper (as a side project) that pulls the reviews out of a hotels Google Reviews page and prints them to an Excel sheet. The page is infinite scrolling and indexes by 10 starting at 0. I've been using BeautifulSoup to this end. My code is as follows:

```<code>import requests
import xlsxwriter
from bs4 import BeautifulSoup

index = 0
reviewlist = []
while index <= 700:
    url = "https://www.google.com/async/reviewSort?vet=12ahUKEwibi8-45LriAhUXeisKHbROA6sQxyx6BAgBED0..i&ved=2ahUKEwibi8-45LriAhUXeisKHbROA6sQjit6BAgBEHw&rlz=1C1GCEB_enAU817AU817&yv=3&async=feature_id:0x6ad642b40a5fb91f%3A0xd4af4255ed578be2,review_source:All%20reviews,sort_by:qualityScore,start_index:{},is_owner:false,filter_text:,next_page_token:,_pms:s,_fmt:pc".format(index)
    response = requests.get(url)
    soup = BeautifulSoup(response.text, "html.parser")
    tenreviews = soup.findAll("span", {"jsl": "$t t-uvHqeLvCkgA;$x 0;"})
    reviewlist += tenreviews
    index += 10

# Export to Excel sheet
workbook = xlsxwriter.Workbook('doubletreereviews.xlsx')
worksheet = workbook.add_worksheet()

row = 0
for review in reviewlist:
    worksheet.write(row, 0, review)
    row += 1

workbook.close()
</code>```

When running my code, it produces the following TypeError.

```<code>TypeError: expected string or bytes-like object
</code>```

I've noticed that some elements will print normally while others will trigger the error. For example, if I replace the list with a specific single review by adding the below code before I attempt to export to an Excel sheet, it works, producing an Excel sheet with a single review in A1.

```<code>reviewlist = reviewlist[4]
</code>```

From this, I've deduced that it has something to do with the fact that review four of the list does not have a child / descendant (unsure if I am using this term correctly which I found in BeautifulSoups documentation) while other reviews do.

Would anyone be able to shed any light on this and help me correct it?

If there are any issues with my question, explanation, or code, feel free to let me know. I'm trying to learn as much as I can!

答:
TypeError: expected string or bytes-like object

because you are trying to write BeautifulSoup Tag object

```<code>worksheet.write(row, 0, review)
</code>```

where review is <class 'bs4.element.Tag'> instance.

review argument must be a string or a number, not Tag type.

Body:
I'm attempting to build a webscraper (as a side project) that pulls the reviews out of a hotels Google Reviews page and prints them to an Excel sheet. The page is infinite scrolling and indexes by 10 starting at 0. I've been using BeautifulSoup to this end. My code is as follows:

import requests
import xlsxwriter
from bs4 import BeautifulSoup

index = 0
reviewlist = []
while index <= 700:
    url = "https://www.google.com/async/reviewSort?vet=12ahUKEwibi8-45LriAhUXeisKHbROA6sQxyx6BAgBED0..i&ved=2ahUKEwibi8-45LriAhUXeisKHbROA6sQjit6BAgBEHw&rlz=1C1GCEB_enAU817AU817&yv=3&async=feature_id:0x6ad642b40a5fb91f%3A0xd4af4255ed578be2,review_source:All%20reviews,sort_by:qualityScore,start_index:{},is_owner:false,filter_text:,next_page_token:,_pms:s,_fmt:pc".format(index)
    response = requests.get(url)
    soup = BeautifulSoup(response.text, "html.parser")
    tenreviews = soup.findAll("span", {"jsl": "$t t-uvHqeLvCkgA;$x 0;"})
    reviewlist += tenreviews
    index += 10

# Export to Excel sheet
workbook = xlsxwriter.Workbook('doubletreereviews.xlsx')
worksheet = workbook.add_worksheet()

row = 0
for review in reviewlist:
    worksheet.write(row, 0, review)
    row += 1

workbook.close()

When running my code, it produces the following TypeError.

TypeError: expected string or bytes-like object

I've noticed that some elements will print normally while others will trigger the error. For example, if I replace the list with a specific single review by adding the below code before I attempt to export to an Excel sheet, it works, producing an Excel sheet with a single review in A1.

reviewlist = reviewlist[4]

From this, I've deduced that it has something to do with the fact that review four of the list does not have a child / descendant (unsure if I am using this term correctly which I found in BeautifulSoups documentation) while other reviews do.

Would anyone be able to shed any light on this and help me correct it?

If there are any issues with my question, explanation, or code, feel free to let me know. I'm trying to learn as much as I can!

Body:
TypeError: expected string or bytes-like object

because you are trying to write BeautifulSoup Tag object

worksheet.write(row, 0, review)

where review is <class 'bs4.element.Tag'> instance.

review argument must be a string or a number, not Tag type.


来源: stackexchange

问:
ternary operation on list-view is not working on nativescript
ternary operation on binding element on list view is not working.

https://play.nativescript.org/?template=play-js&id=xMm9oJ&v=2

```<code><FlexboxLayout flexDirection="row" class="list-group-item">
                <Image src="{{ imageSrc }}" class="thumb img-circle" />
                <Label text="{{ name = 'Spain' ? 'INDIA' : name }}" class="list-group-item-heading"
                    verticalAlignment="center" style="width: 60%" />
            </FlexboxLayout>
</code>```

```<code>countries: [
      { name: "Australia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/au.png" },
      { name: "Belgium", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/be.png" },
      { name: "Bulgaria", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/bg.png" },
      { name: "Canada", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ca.png" },
      { name: "Switzerland", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ch.png" },
      { name: "China", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/cn.png" },
      { name: "Czech Republic", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/cz.png" },
      { name: "Germany", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/de.png" },
      { name: "Spain", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/es.png" },
      { name: "Ethiopia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/et.png" },
      { name: "Croatia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/hr.png" },
      { name: "Hungary", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/hu.png" },
      { name: "Italy", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/it.png" },
      { name: "Jamaica", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/jm.png" },
      { name: "Romania", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ro.png" },
      { name: "Russia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ru.png" },
      { name: "United States", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/us.png" },
    ],

</code>```

i have tried  to show india instead of spain but i'm not succeed. if it is not possible then how to achieve it?

答: ternary operation will work based on condition. if it's result is true or false then it will work fine. so, one must be very careful when writing condition statement. since in the code instead of  == it is written  = . that's the reason it is not working.</p>

ContentLicense: CC BY-SA 4.0

Body:
ternary operation on binding element on list view is not working.

https://play.nativescript.org/?template=play-js&id=xMm9oJ&v=2

<FlexboxLayout flexDirection="row" class="list-group-item">
                <Image src="{{ imageSrc }}" class="thumb img-circle" />

            </FlexboxLayout>

countries: [
      { name: "Australia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/au.png" },
      { name: "Belgium", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/be.png" },
      { name: "Bulgaria", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/bg.png" },
      { name: "Canada", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ca.png" },
      { name: "Switzerland", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ch.png" },
      { name: "China", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/cn.png" },
      { name: "Czech Republic", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/cz.png" },
      { name: "Germany", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/de.png" },
      { name: "Spain", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/es.png" },
      { name: "Ethiopia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/et.png" },
      { name: "Croatia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/hr.png" },
      { name: "Hungary", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/hu.png" },
      { name: "Italy", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/it.png" },
      { name: "Jamaica", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/jm.png" },
      { name: "Romania", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ro.png" },
      { name: "Russia", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/ru.png" },
      { name: "United States", imageSrc: "https://play.nativescript.org/dist/assets/img/flags/us.png" },
    ],

i have tried  to show india instead of spain but i'm not succeed. if it is not possible then how to achieve it?


问:
How to properly add an object to a list when the list is a custom class object?
I get a null reference exception when I try to add a region to the list and have no idea what I'm doing wrong. I simply can't figure it and I've done this a million times.</p>

```<code>public List<Region> regions;

public class Region
{
    public int x_size;
    public int y_size;

    public enum terrain
    {
        desert,
        lowlands,
        crater,
        city
    };

    public terrain ground;
}

private void NewRegion()
{
    Region thisRegion = new Region();
    thisRegion.x_size = Random.Range(25, 50);
    thisRegion.y_size = Random.Range(25, 50);
    thisRegion.ground = Region.terrain.desert;
    regions.Add(thisRegion);
}
</code>```

答:
The regions list is null, you can't add anything to it. In Start() do:

```<code>regions = new List<Region> ();
</code>```

Body:
I get a null reference exception when I try to add a region to the list and have no idea what I'm doing wrong. I simply can't figure it and I've done this a million times.

public List<Region> regions;

public class Region
{
    public int x_size;
    public int y_size;

    public enum terrain
    {
        desert,
        lowlands,
        crater,
        city
    };

    public terrain ground;
}

private void NewRegion()
{
    Region thisRegion = new Region();
    thisRegion.x_size = Random.Range(25, 50);
    thisRegion.y_size = Random.Range(25, 50);
    thisRegion.ground = Region.terrain.desert;
    regions.Add(thisRegion);
}

Body:
The regions list is null, you can't add anything to it. In Start() do:

regions = new List<Region> ();


问:
How to got Session working in Laravel 5.8
In Laravel 5.8 session is not working.

.env setting:
SESSION_DRIVER=file

Controller file index() function :

$request->session()->put('prediction','xyz');

I first set session and then try to get it to other function show() in the controller.

echo $request->session()->get('prediction');exit;

But that is not working it got blank.

Kernel.php

<?php

 protected $middlewareGroups = [
    'web' => [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        \Illuminate\Session\Middleware\StartSession::class,
        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
        \App\Http\Middleware\VerifyCsrfToken::class,
        \Illuminate\Routing\Middleware\SubstituteBindings::class,
    ],

    'api' => [
        'throttle:60,1',
        'bindings',
    ],
];
```

答:
don't know why its not working sometimes in Laravel 5.8 but there is solution how it works for me in similar situation

```<code><?php
    session()->put('login_user' , $user);
    session()->save();
</code>```

issue occurs when your SESSION_DRIVER=file in .env file and session file is not updating accordingly.

Body:
don't know why its not working sometimes in Laravel 5.8 but there is solution how it works for me in similar situation

<?php
    session()->put('login_user' , $user);
    session()->save();

issue occurs when your SESSION_DRIVER=file in .env file and session file is not updating accordingly.


问:
Power BI dumping/printing variable in Python Visual script

Introduction

I am using Power BI desktop and noticed some limitations on the pre-made graph models like the Line Graph. That's why I am trying to make a graph using Python Visuals. I am familiar with Python but I am not familiar with the Python Visual module in Power BI. Currently I am trying to make a simple Line Graph with this module.

I verified that I can draw a graph using Python Visuals (using matplotlib.pyplot) with some of my variables

```<code># dataset = pandas.DataFrame(User field, Tag, Value, Resultaat, Timestamp)
# dataset = dataset.drop_duplicates()

import matplotlib.pyplot as plt

x = dataset.Timestamp
y = dataset.Value

plt.plot(x, y, 'ro')
plt.show()
</code>```

However I am unable to plot some of my variables

For example I have the following two variables:

User field (timestamp)

Resultaat (int)

And I want to plot these two values.

```<code>x = dataset['User Field']
y = dataset.Resultaat

plt.plot(x, y, 'ro')
plt.show()
</code>```

Unfortunately the code shown above does not create a working graph. I want to know what is going wrong. That's why I would like to print the variable dataset['User field'].

Question

Is it possible to debug a value in Python Visuals? Can I dump/print a variable like print(dataset['User field']) to see if the data of this variable is correct?

答:
I was not able to print the values in the Python editor in Power BI. However it's possible to edit the code that is used Power BI in an external editor.

When clicking on the export button a Python script is being generated and automatically opened in your default editor for Python files. All the variables from Power BI are exported to a CSV file. The automatically generated Python script reads these values.

Because a Python script is generated and can be used outside of Power BI all the Python functionalities can be used. This includes printing variables.

```<code># Prolog - Auto Generated #
import os, matplotlib.pyplot, uuid, pandas

os.chdir(u'C:/Users/Fakeuser/PythonEditorWrapper_886e059e-ab5c-423e-a20b-a224ee311990')
dataset = pandas.read_csv('input_df_d776f9db-be3f-4120-90f8-d9abe5c31964.csv')
matplotlib.pyplot.figure(figsize=(5.55555555555556,4.16666666666667))
matplotlib.pyplot.show = lambda args=None,kw=None: matplotlib.pyplot.savefig(str(uuid.uuid1()))

# dataset = pandas.DataFrame(User field, Tag, Value, Resultaat, Timestamp)
# dataset = dataset.drop_duplicates()

import matplotlib.pyplot as plt

tags = set(dataset['Tag'])
print(tags)
</code>```

Body:
Introduction

I am using Power BI desktop and noticed some limitations on the pre-made graph models like the Line Graph. That's why I am trying to make a graph using Python Visuals. I am familiar with Python but I am not familiar with the Python Visual module in Power BI. Currently I am trying to make a simple Line Graph with this module.

I verified that I can draw a graph using Python Visuals (using matplotlib.pyplot) with some of my variables

# dataset = pandas.DataFrame(User field, Tag, Value, Resultaat, Timestamp)
# dataset = dataset.drop_duplicates()

import matplotlib.pyplot as plt

x = dataset.Timestamp
y = dataset.Value

plt.plot(x, y, 'ro')
plt.show()

However I am unable to plot some of my variables

For example I have the following two variables:

User field (timestamp)

Resultaat (int)

And I want to plot these two values.

x = dataset['User Field']
y = dataset.Resultaat

plt.plot(x, y, 'ro')
plt.show()

Unfortunately the code shown above does not create a working graph. I want to know what is going wrong. That's why I would like to print the variable dataset['User field'].

Question

Is it possible to debug a value in Python Visuals? Can I dump/print a variable like print(dataset['User field']) to see if the data of this variable is correct?

Body:
I was not able to print the values in the Python editor in Power BI. However it's possible to edit the code that is used Power BI in an external editor.

When clicking on the export button a Python script is being generated and automatically opened in your default editor for Python files. All the variables from Power BI are exported to a CSV file. The automatically generated Python script reads these values.

Because a Python script is generated and can be used outside of Power BI all the Python functionalities can be used. This includes printing variables.

# Prolog - Auto Generated #
import os, matplotlib.pyplot, uuid, pandas

os.chdir(u'C:/Users/Fakeuser/PythonEditorWrapper_886e059e-ab5c-423e-a20b-a224ee311990')
dataset = pandas.read_csv('input_df_d776f9db-be3f-4120-90f8-d9abe5c31964.csv')
matplotlib.pyplot.figure(figsize=(5.55555555555556,4.16666666666667))
matplotlib.pyplot.show = lambda args=None,kw=None: matplotlib.pyplot.savefig(str(uuid.uuid1()))

# dataset = pandas.DataFrame(User field, Tag, Value, Resultaat, Timestamp)
# dataset = dataset.drop_duplicates()

import matplotlib.pyplot as plt

tags = set(dataset['Tag'])
print(tags)


问:
HttpSession, session.getAttribute(), problem
I have a problem related to Java servlet sessions. I don't understand why the getAttribute() function of the session object is used before setAttribute(); Here is the code:

```<code>Vector buylist=(Vector)session.getAttribute("Register");
if (action.equals("del")) {
String del = request.getParameter("deli");
int d = (new Integer(del)).intValue();
buylist.removeElementAt(d);
}
session.setAttribute("Register", buylist);
</code>```

Thanks.

答:
This code intends to save back the modified vector represented by Register session attribute.
However you dont need to set the attribute back even after some elements are removed or added because its the reference anyways thats stored in session and any changes to it are essentially being applied to the same object.

ContentLicense: CC BY-SA 3.0

Body:
I have a problem related to Java servlet sessions. I don't understand why the getAttribute() function of the session object is used before setAttribute(); Here is the code:

Vector buylist=(Vector)session.getAttribute("Register");
if (action.equals("del")) {
String del = request.getParameter("deli");
int d = (new Integer(del)).intValue();
buylist.removeElementAt(d);
}
session.setAttribute("Register", buylist);

Thanks.


问:
Formula to check time spent on a task referencing minimum time allowed and a variable that will extend the minimum, if present
Looking for an excel formula that can verify time spent on task meets minimum requirements

We have objects that we monitor that have different monitoring times allowed, based on their size.  Each monitoring machine has a different "response time".  If the monitoring returns a value higher than 9, the size based minimum time, plus an additional twice the response time must be spent.  Each machine has 2 different probe lengths, and the lengths affect the response time.  Monitoring is usually done with one, and if the second is used instead, a comment that includes "EXT" will be entered.  I'd like to set up a sheet with formulas that will perform all of these checks.  We have a sheet set up with a formula that checks the time based minimum and if the value of 9 is exceeded, but the response time and if they use the second probe need to be entered manually.  All of the data comes from a couple of different sheets in the same workbook. The formula was written by someone else and it's way beyond what I know how to do.

```<code>=IF(M13>9,IF(P13="","", IF(K13="V", ($A$4+(INDEX('Minimum Visual Inspection Times'!$A$2:$P$15, MATCH(C13,'Minimum Visual Inspection Times'!$A$1:$A$15,TRUE), MATCH(D13,'Minimum Visual Inspection Times'!$A$2:$P$2,))))/(60*60*24), (($A$3+$A$2*2)+(INDEX('Minimum M21 Screening Times'!$A$2:$P$17, MATCH(C13,'Minimum M21 Screening Times'!$A$2:$A$17,TRUE), MATCH(D13,'Minimum M21 Screening Times'!$A$2:$P$2,))))/(60*60*24))),IF(P13="","", IF(K13="V", ($A$4+(INDEX('Minimum Visual Inspection Times'!$A$2:$P$15, MATCH(C13,'Minimum Visual Inspection Times'!$A$1:$A$15,TRUE), MATCH(D13,'Minimum Visual Inspection Times'!$A$2:$P$2,))))/(60*60*24), (($A$3)+(INDEX('Minimum M21 Screening Times'!$A$2:$P$17, MATCH(C13,'Minimum M21 Screening Times'!$A$2:$A$17,TRUE), MATCH(D13,'Minimum M21 Screening Times'!$A$2:$P$2,))))/(60*60*24))))
</code>```

答:
So, every result is multiplied by "60*60*24" so take that outside all the IF() statements and replace with 86400.

Then consider that you have M13 and D13 getting results via index/match, so put those into fixed cells somewhere and just call the results into the IF() statements which will reduce the length.

Once you have that working then any further parts might be easier to implement.

Body:
Looking for an excel formula that can verify time spent on task meets minimum requirements

We have objects that we monitor that have different monitoring times allowed, based on their size.  Each monitoring machine has a different "response time".  If the monitoring returns a value higher than 9, the size based minimum time, plus an additional twice the response time must be spent.  Each machine has 2 different probe lengths, and the lengths affect the response time.  Monitoring is usually done with one, and if the second is used instead, a comment that includes "EXT" will be entered.  I'd like to set up a sheet with formulas that will perform all of these checks.  We have a sheet set up with a formula that checks the time based minimum and if the value of 9 is exceeded, but the response time and if they use the second probe need to be entered manually.  All of the data comes from a couple of different sheets in the same workbook. The formula was written by someone else and it's way beyond what I know how to do.

=IF(M13>9,IF(P13="","", IF(K13="V", ($A$4+(INDEX('Minimum Visual Inspection Times'!$A$2:$P$15, MATCH(C13,'Minimum Visual Inspection Times'!$A$1:$A$15,TRUE), MATCH(D13,'Minimum Visual Inspection Times'!$A$2:$P$2,))))/(60*60*24), (($A$3+$A$2*2)+(INDEX('Minimum M21 Screening Times'!$A$2:$P$17, MATCH(C13,'Minimum M21 Screening Times'!$A$2:$A$17,TRUE), MATCH(D13,'Minimum M21 Screening Times'!$A$2:$P$2,))))/(60*60*24))),IF(P13="","", IF(K13="V", ($A$4+(INDEX('Minimum Visual Inspection Times'!$A$2:$P$15, MATCH(C13,'Minimum Visual Inspection Times'!$A$1:$A$15,TRUE), MATCH(D13,'Minimum Visual Inspection Times'!$A$2:$P$2,))))/(60*60*24), (($A$3)+(INDEX('Minimum M21 Screening Times'!$A$2:$P$17, MATCH(C13,'Minimum M21 Screening Times'!$A$2:$A$17,TRUE), MATCH(D13,'Minimum M21 Screening Times'!$A$2:$P$2,))))/(60*60*24))))


问:
How to scroll to the bottom of a UITableView on the iPhone without seeing the scroll
I have a UITableView that is populated with cells of variable height. I would like the table to scroll to the bottom when the view is pushed into view.

I currently have the following function:

```<code>[self.table scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];
</code>```

I'm using autolayout, dynamic table cells and UITableViewAutomaticDimension as row height. I set estimatedRowHeight = 100

The above code works fine in viewDidLoad however this has the unfortunate side effect of displaying the top of the table when the view first appears and then jumping to the bottom. I would prefer it if the table view could be scrolled to the bottom before it appears.

Please note: I'm loading data from core data.

Any guidance would be much appreciated, even if it's just a case of telling me what I have is all that is possible.

答:
Theoretically, the order of the calls is correct: viewDidLoad should be called before the view is rendered, so the only thing that comes to my mind is that probably scrollToRowAtIndexPath:atScrollPosition:animated: is asynchronous. Maybe there's something you can do with UIScrollViewDelegate (remember, UITableView inherits from UIScrollView) - https://developer.apple.com/documentation/uikit/uiscrollviewdelegate?language=objc

Maybe you can do something like hiding the view on onLoad and showing it on scrollViewDidScroll:. I don't have time to test and paste a snippet but... maybe it helps :) Good luck!

Body:
I have a UITableView that is populated with cells of variable height. I would like the table to scroll to the bottom when the view is pushed into view.

I currently have the following function:

[self.table scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:NO];

I'm using autolayout, dynamic table cells and UITableViewAutomaticDimension as row height. I set estimatedRowHeight = 100

The above code works fine in viewDidLoad however this has the unfortunate side effect of displaying the top of the table when the view first appears and then jumping to the bottom. I would prefer it if the table view could be scrolled to the bottom before it appears.

Please note: I'm loading data from core data.

Any guidance would be much appreciated, even if it's just a case of telling me what I have is all that is possible.


问:
How to Append Arrray List Data Into Text File
Below is the code.

I want to add the Array List Data into Text File.At this time it Inserts the data but when i add new data it overwrites the previous data and just add new one so i want that it will ask that you want that the data already exists you want to overwrite or append if data do not exist it simply append to the file.

```<code>using (TextWriter writer = File.CreateText(@"C:\Users\Precision\Desktop\testing\data.txt"))
{
    foreach (var obj in dirList)
    {
        writer.WriteLine(obj);
    }
}

Console.WriteLine("Record Saved Successfully...");
</code>```

答:
Try this...</p>

```<code>        string outFile = @"C:\Temp\test.txt";
        bool isAppend = true;

        ArrayList dirList = new ArrayList();
        dirList.Add("foo");
        dirList.Add("bar");
        dirList.Add("baz");

        if(File.Exists(outFile))
        {
            Console.WriteLine("Output file already exists...");
            Console.WriteLine("Type 'x' to overwrite or any other to append.");
            ConsoleKeyInfo cki = Console.ReadKey();
            isAppend = (cki.Key != ConsoleKey.X);
        }

        using (StreamWriter writer = new StreamWriter(outFile, isAppend))
        {
            foreach (var obj in dirList)
            {
                writer.WriteLine(obj);
            }
        }
</code>```

Body:
Below is the code.

I want to add the Array List Data into Text File.At this time it Inserts the data but when i add new data it overwrites the previous data and just add new one so i want that it will ask that you want that the data already exists you want to overwrite or append if data do not exist it simply append to the file.

using (TextWriter writer = File.CreateText(@"C:\Users\Precision\Desktop\testing\data.txt"))
{
    foreach (var obj in dirList)
    {
        writer.WriteLine(obj);
    }
}

Console.WriteLine("Record Saved Successfully...");

Body:
Try this...

        string outFile = @"C:\Temp\test.txt";
        bool isAppend = true;

        ArrayList dirList = new ArrayList();
        dirList.Add("foo");
        dirList.Add("bar");
        dirList.Add("baz");

        if(File.Exists(outFile))
        {
            Console.WriteLine("Output file already exists...");
            Console.WriteLine("Type 'x' to overwrite or any other to append.");
            ConsoleKeyInfo cki = Console.ReadKey();
            isAppend = (cki.Key != ConsoleKey.X);
        }

        using (StreamWriter writer = new StreamWriter(outFile, isAppend))
        {
            foreach (var obj in dirList)
            {
                writer.WriteLine(obj);
            }
        }


问:
How to tell heroku to use rails 3 and ruby 1.9.2 for a newly created app?
I created a new app on my machine using rvm ruby1.9.2p0 and rails 3.0.1, and did the following:

```<code>rails new -J -d mysql appname
git init
git add .
git commit
heroku create
</code>```

and the app is created. but when i do:

```<code>heroku rake db:create --trace
</code>```

I get:

```<code>Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql2", "database"=>"app_production", "pool"=>5, "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock"}, charset: utf8, collation: utf8_unicode_ci
(in /app)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create
</code>```

and when i do:
    heroku rake db:migrate --trace, then the trace has lines like:

```<code>/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in
</code>```

which shows it is using ruby 1.8 instead of ruby 1.9.2

How can I create a database on my heroku app and make it use ruby 1.9.2p0?

答:
The problem is not the Ruby or Rails version.

The problem here is that you are trying to use MySQL while Heroku only supports PostgreSQL.

In this page you can find the instructions to migrate to a different Heroku stack.

Body:
I created a new app on my machine using rvm ruby1.9.2p0 and rails 3.0.1, and did the following:

rails new -J -d mysql appname
git init
git add .
git commit
heroku create

and the app is created. but when i do:

heroku rake db:create --trace

I get:

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8", "username"=>"root", "adapter"=>"mysql2", "database"=>"app_production", "pool"=>5, "password"=>nil, "socket"=>"/var/run/mysqld/mysqld.sock"}, charset: utf8, collation: utf8_unicode_ci
(in /app)
** Invoke db:create (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create

and when i do:
    heroku rake db:migrate --trace, then the trace has lines like:

/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in

which shows it is using ruby 1.8 instead of ruby 1.9.2

How can I create a database on my heroku app and make it use ruby 1.9.2p0?


问:
Different issues with the Workbook_Open event
After some research on the internet and on Stackoverflow, I'm stuck on some elements about the functionning of the event : Workbook_Open (which will surely seems simple to you).

I wrote the following code :

```<code>Public Sub Workbook_Open()

' Désactivation des évènements
Application.EnableEvents = False

' Put the back color of a button to red
' line 1
 CB1.BackColor = &HC0&

' Modify the RowHeight of a line
' line 2
 ThisWorkbook.Worksheets("Search").Rows("12:12").RowHeight = 800

' Réactive l'évènement
Application.EnableEvents = True

End Sub
</code>```

Precisions:

CB1 is the name of a button implanted on an excel sheet called "Search"

I have two different problems :

Problem n°1 :

Excel doesn't seem to recongnize the CB1 variable outside of a code written on the "Search" sheet. I don't understand why. Is the variable CB1 not supposed to be available for all the code of the Workbook ?

Problem n°2

I simply do not see why Line 2 doesn't work.
Even when I write it in another procedure that I call afterwards.

Anyone can give me a suggestions ?

Best regards and thanks !

答:
Your code should look something like this:

```<code>Public Sub Workbook_Open()

' Désactivation des évènements
Application.EnableEvents = False

' Put the back color of a button to red
' line 1
'sheet specification a requirement
 Sheets("Search").CB1.BackColor = &HC0&

' Modify the RowHeight of a line
' line 2
' maximum row height is 409
Sheets("Search").Rows(12).RowHeight = 409

' Réactive l'évènement
Application.EnableEvents = True

End Sub
</code>```

Please see the following link for maximum row height in Excel: https://support.office.com/en-ie/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3

Body:
After some research on the internet and on Stackoverflow, I'm stuck on some elements about the functionning of the event : Workbook_Open (which will surely seems simple to you).

I wrote the following code :

Public Sub Workbook_Open()

' Désactivation des évènements
Application.EnableEvents = False

' Put the back color of a button to red
' line 1
 CB1.BackColor = &HC0&

' Modify the RowHeight of a line
' line 2
 ThisWorkbook.Worksheets("Search").Rows("12:12").RowHeight = 800

' Réactive l'évènement
Application.EnableEvents = True

End Sub

Precisions:

CB1 is the name of a button implanted on an excel sheet called "Search"

I have two different problems :

Problem n°1 :

Excel doesn't seem to recongnize the CB1 variable outside of a code written on the "Search" sheet. I don't understand why. Is the variable CB1 not supposed to be available for all the code of the Workbook ?

Problem n°2

I simply do not see why Line 2 doesn't work.
Even when I write it in another procedure that I call afterwards.

Anyone can give me a suggestions ?

Best regards and thanks !

Body:
Your code should look something like this:

Public Sub Workbook_Open()

' Désactivation des évènements
Application.EnableEvents = False

' Put the back color of a button to red
' line 1
'sheet specification a requirement
 Sheets("Search").CB1.BackColor = &HC0&

' Modify the RowHeight of a line
' line 2
' maximum row height is 409
Sheets("Search").Rows(12).RowHeight = 409

' Réactive l'évènement
Application.EnableEvents = True

End Sub

Please see the following link for maximum row height in Excel: https://support.office.com/en-ie/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3


问:
Create a fake webcam stream for Firefox
I want to create a fake webcam stream for Firefox. At the moment I have the desired capability media.navigator.streams.fake but I'm not sure how to get a specific video file to play.

How can I do this?

答:
If you want to play a specific file with firefox, I think you will have to simulate a webcam on your instance (with v4l2loopback for example), and then play your file on the virtual webcam with smthing like ffmpeg.
With selenium, you will also have to update your firefox profile for allowing access to your fake webcam.</p>

Title: Create a fake webcam stream for Firefox


问:
Hibernate Search java spring, searching only entities that have ids as specified
I have a problem when i want to search in entities that have specific ids. I have fullTextQuery that i execute, it works all fine, bud when i want to say

ONLY SEARCH IN THESE ENTITIES (List of ids provided) :

```<code>+(title:slovakia~2 leadText:slovakia~2 body:slovakia~2 software:slovakia~2) +verified:true +eid:(113 | 112 | 3)
</code>```

Then i get 0 results, these entities are indexed and persisted, all should be working fine, yet it doesnt return any results.

Here is The entity property defined :

```<code>@Id
@GeneratedValue
@Field(name = "eid")
@FieldBridge(impl = LongBridge.class)
private long id;
</code>```

I have tried, Without field bridge, with TermVector.YES and also without any additional @Field.. annotation. All results either exception or just no results.

What is a proper way of searching in specific IDs?

For instance here is the working query:

Creation of query looks like this :

```<code>    return Optional.of(getQueryBuilder()
            .keyword()
            .onField("eid")
            .matching(stringBuilder.toString())
            .createQuery());
</code>```

答:
From the little experience i have had with hibernate-search, only Ranges seem to work well with intenger and long fields. In your example here, i expect the following query should work just fine:

```<code>QueryBuilder qb = getQueryBuilder();
BooleanJunction<?> idJunction = qb.bool();
 bool.must(NumericRangeQuery.newLongRange("eid", Long.valueOf(eid), Long.valueOf(eid), true, true).createQuery();
</code>```

In this case, the Boxed Long.valueOf() is optional if the values being supplied are Long values already.

Body:
I have a problem when i want to search in entities that have specific ids. I have fullTextQuery that i execute, it works all fine, bud when i want to say

ONLY SEARCH IN THESE ENTITIES (List of ids provided) :

+(title:slovakia~2 leadText:slovakia~2 body:slovakia~2 software:slovakia~2) +verified:true +eid:(113 | 112 | 3)

Then i get 0 results, these entities are indexed and persisted, all should be working fine, yet it doesnt return any results.

Here is The entity property defined :

@Id
@GeneratedValue
@Field(name = "eid")
@FieldBridge(impl = LongBridge.class)
private long id;

I have tried, Without field bridge, with TermVector.YES and also without any additional @Field.. annotation. All results either exception or just no results.

What is a proper way of searching in specific IDs?

For instance here is the working query:

Creation of query looks like this :

    return Optional.of(getQueryBuilder()
            .keyword()
            .onField("eid")
            .matching(stringBuilder.toString())
            .createQuery());

Body:
From the little experience i have had with hibernate-search, only Ranges seem to work well with intenger and long fields. In your example here, i expect the following query should work just fine:

QueryBuilder qb = getQueryBuilder();
BooleanJunction<?> idJunction = qb.bool();
 bool.must(NumericRangeQuery.newLongRange("eid", Long.valueOf(eid), Long.valueOf(eid), true, true).createQuery();

In this case, the Boxed Long.valueOf() is optional if the values being supplied are Long values already.


问:
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing with microservices
I am new to the microservices + Spring Boot combinations and getting the below error while running the code from the link: https://github.com/sqshq/PiggyMetrics . Please guide me what is the nissue ?

```java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:110) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89) ~[spring-cloud-context-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:640) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:343) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at com.piggymetrics.statistics.StatisticsApplication.main(StatisticsApplication.java:34) [classes/:na]
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://config:8888/statistics-service/default": config; nested exception is java.net.UnknownHostException: config
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:607) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:130) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:81) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    ... 7 common frames omitted
Caused by: java.net.UnknownHostException: config
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_144]
    at sun.net.NetworkClient.doConnect(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.<init>(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) ~[na:1.8.0_144]
    at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:80) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:93) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$BasicAuthorizationInterceptor.intercept(ConfigServicePropertySourceLocator.java:179) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:85) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:69) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:596) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    ... 11 common frames omitted

2017-09-09 19:19:34.861  INFO 4968 --- [           main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/C:/Learnings/micro-services/PiggyMetrics/statistics-service/target/classes/, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-security/1.3.5.RELEASE/spring-boot-starter-security-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.5.RELEASE/spring-boot-starter-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot/1.3.5.RELEASE/spring-boot-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.5.RELEASE/spring-boot-autoconfigure-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-aop/4.2.6.RELEASE/spring-aop-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-config/4.0.4.RELEASE/spring-security-config-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-web/4.0.4.RELEASE/spring-security-web-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-expression/4.2.6.RELEASE/spring-expression-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-config/1.1.0.RELEASE/spring-cloud-starter-config-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter/1.1.0.RELEASE/spring-cloud-starter-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-context/1.1.0.RELEASE/spring-cloud-context-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-rsa/1.0.1.RELEASE/spring-security-rsa-1.0.1.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.47/bcpkix-jdk15on-1.47.jar, file:/C:/Users/pashtikar/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.47/bcprov-jdk15on-1.47.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-config-client/1.1.0.RELEASE/spring-cloud-config-client-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.6/jackson-annotations-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.6/jackson-databind-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.6/jackson-core-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/oauth/spring-security-oauth2/2.0.9.RELEASE/spring-security-oauth2-2.0.9.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-beans/4.2.6.RELEASE/spring-beans-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-context/4.2.6.RELEASE/spring-context-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-webmvc/4.2.6.RELEASE/spring-webmvc-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-core/4.0.4.RELEASE/spring-security-core-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.5.RELEASE/spring-boot-starter-web-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.5.RELEASE/spring-boot-starter-tomcat-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.33/tomcat-embed-core-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.33/tomcat-embed-el-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.33/tomcat-embed-logging-juli-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.33/tomcat-embed-websocket-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.5.RELEASE/spring-boot-starter-validation-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar, file:/C:/Users/pashtikar/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/C:/Users/pashtikar/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/classmate/1.1.0/classmate-1.1.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-web/4.2.6.RELEASE/spring-web-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-feign/1.1.0.RELEASE/spring-cloud-starter-feign-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-core/1.1.0.RELEASE/spring-cloud-netflix-core-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-commons/1.1.0.RELEASE/spring-cloud-commons-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-crypto/4.0.4.RELEASE/spring-security-crypto-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-core/8.16.2/feign-core-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/jvnet/animal-sniffer-annotation/1.0/animal-sniffer-annotation-1.0.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-slf4j/8.16.2/feign-slf4j-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-hystrix/8.16.2/feign-hystrix-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-ribbon/1.1.0.RELEASE/spring-cloud-starter-ribbon-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon/2.1.5/ribbon-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-transport/2.1.5/ribbon-transport-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-codec-http/4.0.27.Final/netty-codec-http-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-codec/4.0.27.Final/netty-codec-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-handler/4.0.27.Final/netty-handler-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-transport-native-epoll/4.0.27.Final/netty-transport-native-epoll-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-common/4.0.27.Final/netty-common-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-buffer/4.0.27.Final/netty-buffer-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-transport/4.0.27.Final/netty-transport-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-core/2.1.5/ribbon-core-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-httpclient/2.1.5/ribbon-httpclient-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-commons-util/0.1.1/netflix-commons-util-0.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-loadbalancer/2.1.5/ribbon-loadbalancer-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxjava/1.1.5/rxjava-1.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-archaius/1.1.0.RELEASE/spring-cloud-starter-archaius-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/archaius/archaius-core/0.7.4/archaius-core-0.7.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar, file:/C:/Users/pashtikar/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar, file:/C:/Users/pashtikar/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-eureka/1.1.0.RELEASE/spring-cloud-starter-eureka-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/1.1.0.RELEASE/spring-cloud-netflix-eureka-client-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/eureka/eureka-client/1.4.6/eureka-client-1.4.6.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/C:/Users/pashtikar/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/C:/Users/pashtikar/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/servo/servo-core/0.10.1/servo-core-0.10.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/servo/servo-internal/0.10.1/servo-internal-0.10.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/inject/guice/4.0/guice-4.0.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator-api/1.12.10/governator-api-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/eureka/eureka-core/1.4.6/eureka-core-1.4.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-core/1.10.30/aws-java-sdk-core-1.10.30.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-ec2/1.10.30/aws-java-sdk-ec2-1.10.30.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-autoscaling/1.9.3/aws-java-sdk-autoscaling-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-sts/1.9.3/aws-java-sdk-sts-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-route53/1.9.3/aws-java-sdk-route53-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator/1.12.10/governator-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator-core/1.12.10/governator-core-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar, file:/C:/Users/pashtikar/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-eureka/2.1.5/ribbon-eureka-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/thoughtworks/xstream/xstream/1.4.2/xstream-1.4.2.jar, file:/C:/Users/pashtikar/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/C:/Users/pashtikar/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-data-mongodb/1.3.5.RELEASE/spring-boot-starter-data-mongodb-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/mongodb/mongo-java-driver/2.13.3/mongo-java-driver-2.13.3.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/data/spring-data-mongodb/1.8.4.RELEASE/spring-data-mongodb-1.8.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-tx/4.2.6.RELEASE/spring-tx-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/data/spring-data-commons/1.11.4.RELEASE/spring-data-commons-1.11.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.21/jcl-over-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.3.5.RELEASE/spring-boot-starter-actuator-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-actuator/1.3.5.RELEASE/spring-boot-actuator-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-bus-amqp/1.1.0.RELEASE/spring-cloud-starter-bus-amqp-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-stream-rabbit/1.0.0.RELEASE/spring-cloud-starter-stream-rabbit-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream-binder-rabbit/1.0.0.RELEASE/spring-cloud-stream-binder-rabbit-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream-codec/1.0.0.RELEASE/spring-cloud-stream-codec-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-amqp/1.3.5.RELEASE/spring-boot-starter-amqp-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/amqp/spring-rabbit/1.5.6.RELEASE/spring-rabbit-1.5.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/amqp/spring-amqp/1.5.6.RELEASE/spring-amqp-1.5.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/rabbitmq/http-client/1.0.0.RELEASE/http-client-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/rabbitmq/amqp-client/3.5.7/amqp-client-3.5.7.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-amqp/4.2.5.RELEASE/spring-integration-amqp-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-jmx/4.2.5.RELEASE/spring-integration-jmx-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.1.0.RELEASE/spring-cloud-bus-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-core/4.2.5.RELEASE/spring-integration-core-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-hystrix-stream/1.1.0.RELEASE/spring-cloud-netflix-hystrix-stream-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.5.RELEASE/spring-boot-starter-logging-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/ch/qos/logback/logback-core/1.1.7/logback-core-1.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/jul-to-slf4j/1.7.21/jul-to-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.21/log4j-over-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream/1.0.0.RELEASE/spring-cloud-stream-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-messaging/4.2.6.RELEASE/spring-messaging-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-tuple/1.0.0.RELEASE/spring-tuple-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/esotericsoftware/kryo-shaded/3.0.3/kryo-shaded-3.0.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/esotericsoftware/minlog/1.3.0/minlog-1.3.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-tuple/1.0.0.RELEASE/spring-integration-tuple-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/retry/spring-retry/1.1.2.RELEASE/spring-retry-1.1.2.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/hystrix/hystrix-core/1.5.2/hystrix-core-1.5.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.7/HdrHistogram-2.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar]
```

答:
I got something similar, an 500 internal error from a micro service! No cause given.

I looked at the config server, for the service my application was attempting to contact.  It had given a parse error when attempting to read a yml file at start up, with the result the entire process was hanging.

So if you get an error, look in the logging data from your config server, there might be some extra information there.

Body:
I am new to the microservices + Spring Boot combinations and getting the below error while running the code from the link: https://github.com/sqshq/PiggyMetrics . Please guide me what is the nissue ?

java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:110) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:89) ~[spring-cloud-context-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:640) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.createAndRefreshContext(SpringApplication.java:343) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1191) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1180) [spring-boot-1.3.5.RELEASE.jar:1.3.5.RELEASE]
    at com.piggymetrics.statistics.StatisticsApplication.main(StatisticsApplication.java:34) [classes/:na]
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "http://config:8888/statistics-service/default": config; nested exception is java.net.UnknownHostException: config
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:607) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:557) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:475) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.getRemoteEnvironment(ConfigServicePropertySourceLocator.java:130) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator.locate(ConfigServicePropertySourceLocator.java:81) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    ... 7 common frames omitted
Caused by: java.net.UnknownHostException: config
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_144]
    at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_144]
    at sun.net.NetworkClient.doConnect(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.openServer(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.<init>(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.http.HttpClient.New(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source) ~[na:1.8.0_144]
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source) ~[na:1.8.0_144]
    at org.springframework.http.client.SimpleBufferingClientHttpRequest.executeInternal(SimpleBufferingClientHttpRequest.java:80) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:93) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.cloud.config.client.ConfigServicePropertySourceLocator$BasicAuthorizationInterceptor.intercept(ConfigServicePropertySourceLocator.java:179) ~[spring-cloud-config-client-1.1.0.RELEASE.jar:1.1.0.RELEASE]
    at org.springframework.http.client.InterceptingClientHttpRequest$InterceptingRequestExecution.execute(InterceptingClientHttpRequest.java:85) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.InterceptingClientHttpRequest.executeInternal(InterceptingClientHttpRequest.java:69) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:596) ~[spring-web-4.2.6.RELEASE.jar:4.2.6.RELEASE]
    ... 11 common frames omitted

2017-09-09 19:19:34.861  INFO 4968 --- [           main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/C:/Learnings/micro-services/PiggyMetrics/statistics-service/target/classes/, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-security/1.3.5.RELEASE/spring-boot-starter-security-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.5.RELEASE/spring-boot-starter-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot/1.3.5.RELEASE/spring-boot-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.5.RELEASE/spring-boot-autoconfigure-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/yaml/snakeyaml/1.16/snakeyaml-1.16.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-aop/4.2.6.RELEASE/spring-aop-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-config/4.0.4.RELEASE/spring-security-config-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-web/4.0.4.RELEASE/spring-security-web-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-expression/4.2.6.RELEASE/spring-expression-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-config/1.1.0.RELEASE/spring-cloud-starter-config-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter/1.1.0.RELEASE/spring-cloud-starter-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-context/1.1.0.RELEASE/spring-cloud-context-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-rsa/1.0.1.RELEASE/spring-security-rsa-1.0.1.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.47/bcpkix-jdk15on-1.47.jar, file:/C:/Users/pashtikar/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.47/bcprov-jdk15on-1.47.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-config-client/1.1.0.RELEASE/spring-cloud-config-client-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.6.6/jackson-annotations-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.6.6/jackson-databind-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.6.6/jackson-core-2.6.6.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/oauth/spring-security-oauth2/2.0.9.RELEASE/spring-security-oauth2-2.0.9.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-beans/4.2.6.RELEASE/spring-beans-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-core/4.2.6.RELEASE/spring-core-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-context/4.2.6.RELEASE/spring-context-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-webmvc/4.2.6.RELEASE/spring-webmvc-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-core/4.0.4.RELEASE/spring-security-core-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/commons-codec/commons-codec/1.9/commons-codec-1.9.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.13/jackson-mapper-asl-1.9.13.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.13/jackson-core-asl-1.9.13.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-web/1.3.5.RELEASE/spring-boot-starter-web-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/1.3.5.RELEASE/spring-boot-starter-tomcat-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/8.0.33/tomcat-embed-core-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/8.0.33/tomcat-embed-el-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-logging-juli/8.0.33/tomcat-embed-logging-juli-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/8.0.33/tomcat-embed-websocket-8.0.33.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-validation/1.3.5.RELEASE/spring-boot-starter-validation-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar, file:/C:/Users/pashtikar/.m2/repository/javax/validation/validation-api/1.1.0.Final/validation-api-1.1.0.Final.jar, file:/C:/Users/pashtikar/.m2/repository/org/jboss/logging/jboss-logging/3.3.0.Final/jboss-logging-3.3.0.Final.jar, file:/C:/Users/pashtikar/.m2/repository/com/fasterxml/classmate/1.1.0/classmate-1.1.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-web/4.2.6.RELEASE/spring-web-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-feign/1.1.0.RELEASE/spring-cloud-starter-feign-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-core/1.1.0.RELEASE/spring-cloud-netflix-core-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-commons/1.1.0.RELEASE/spring-cloud-commons-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/security/spring-security-crypto/4.0.4.RELEASE/spring-security-crypto-4.0.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-core/8.16.2/feign-core-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/jvnet/animal-sniffer-annotation/1.0/animal-sniffer-annotation-1.0.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-slf4j/8.16.2/feign-slf4j-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/feign/feign-hystrix/8.16.2/feign-hystrix-8.16.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-ribbon/1.1.0.RELEASE/spring-cloud-starter-ribbon-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon/2.1.5/ribbon-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-transport/2.1.5/ribbon-transport-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-codec-http/4.0.27.Final/netty-codec-http-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-codec/4.0.27.Final/netty-codec-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-handler/4.0.27.Final/netty-handler-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-transport-native-epoll/4.0.27.Final/netty-transport-native-epoll-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-common/4.0.27.Final/netty-common-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-buffer/4.0.27.Final/netty-buffer-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/io/netty/netty-transport/4.0.27.Final/netty-transport-4.0.27.Final.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-core/2.1.5/ribbon-core-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-httpclient/2.1.5/ribbon-httpclient-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-commons-util/0.1.1/netflix-commons-util-0.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-loadbalancer/2.1.5/ribbon-loadbalancer-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/io/reactivex/rxjava/1.1.5/rxjava-1.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-archaius/1.1.0.RELEASE/spring-cloud-starter-archaius-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/archaius/archaius-core/0.7.4/archaius-core-0.7.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar, file:/C:/Users/pashtikar/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar, file:/C:/Users/pashtikar/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-eureka/1.1.0.RELEASE/spring-cloud-starter-eureka-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/1.1.0.RELEASE/spring-cloud-netflix-eureka-client-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/eureka/eureka-client/1.4.6/eureka-client-1.4.6.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/C:/Users/pashtikar/.m2/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/C:/Users/pashtikar/.m2/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/servo/servo-core/0.10.1/servo-core-0.10.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/servo/servo-internal/0.10.1/servo-internal-0.10.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/apache/httpcomponents/httpcore/4.4.4/httpcore-4.4.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/inject/guice/4.0/guice-4.0.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator-api/1.12.10/governator-api-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/eureka/eureka-core/1.4.6/eureka-core-1.4.6.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-core/1.10.30/aws-java-sdk-core-1.10.30.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-ec2/1.10.30/aws-java-sdk-ec2-1.10.30.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-autoscaling/1.9.3/aws-java-sdk-autoscaling-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-sts/1.9.3/aws-java-sdk-sts-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/amazonaws/aws-java-sdk-route53/1.9.3/aws-java-sdk-route53-1.9.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator/1.12.10/governator-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/governator/governator-core/1.12.10/governator-core-1.12.10.jar, file:/C:/Users/pashtikar/.m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar, file:/C:/Users/pashtikar/.m2/repository/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar, file:/C:/Users/pashtikar/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/ribbon/ribbon-eureka/2.1.5/ribbon-eureka-2.1.5.jar, file:/C:/Users/pashtikar/.m2/repository/com/thoughtworks/xstream/xstream/1.4.2/xstream-1.4.2.jar, file:/C:/Users/pashtikar/.m2/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/C:/Users/pashtikar/.m2/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-data-mongodb/1.3.5.RELEASE/spring-boot-starter-data-mongodb-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/mongodb/mongo-java-driver/2.13.3/mongo-java-driver-2.13.3.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/data/spring-data-mongodb/1.8.4.RELEASE/spring-data-mongodb-1.8.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-tx/4.2.6.RELEASE/spring-tx-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/data/spring-data-commons/1.11.4.RELEASE/spring-data-commons-1.11.4.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.21/jcl-over-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-actuator/1.3.5.RELEASE/spring-boot-starter-actuator-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-actuator/1.3.5.RELEASE/spring-boot-actuator-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-bus-amqp/1.1.0.RELEASE/spring-cloud-starter-bus-amqp-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-starter-stream-rabbit/1.0.0.RELEASE/spring-cloud-starter-stream-rabbit-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream-binder-rabbit/1.0.0.RELEASE/spring-cloud-stream-binder-rabbit-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream-codec/1.0.0.RELEASE/spring-cloud-stream-codec-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-amqp/1.3.5.RELEASE/spring-boot-starter-amqp-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/amqp/spring-rabbit/1.5.6.RELEASE/spring-rabbit-1.5.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/amqp/spring-amqp/1.5.6.RELEASE/spring-amqp-1.5.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/rabbitmq/http-client/1.0.0.RELEASE/http-client-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/rabbitmq/amqp-client/3.5.7/amqp-client-3.5.7.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-amqp/4.2.5.RELEASE/spring-integration-amqp-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-jmx/4.2.5.RELEASE/spring-integration-jmx-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-bus/1.1.0.RELEASE/spring-cloud-bus-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-core/4.2.5.RELEASE/spring-integration-core-4.2.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-netflix-hystrix-stream/1.1.0.RELEASE/spring-cloud-netflix-hystrix-stream-1.1.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.5.RELEASE/spring-boot-starter-logging-1.3.5.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/ch/qos/logback/logback-core/1.1.7/logback-core-1.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/jul-to-slf4j/1.7.21/jul-to-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.21/log4j-over-slf4j-1.7.21.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/cloud/spring-cloud-stream/1.0.0.RELEASE/spring-cloud-stream-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-messaging/4.2.6.RELEASE/spring-messaging-4.2.6.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/spring-tuple/1.0.0.RELEASE/spring-tuple-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/esotericsoftware/kryo-shaded/3.0.3/kryo-shaded-3.0.3.jar, file:/C:/Users/pashtikar/.m2/repository/com/esotericsoftware/minlog/1.3.0/minlog-1.3.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/integration/spring-integration-tuple/1.0.0.RELEASE/spring-integration-tuple-1.0.0.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/org/springframework/retry/spring-retry/1.1.2.RELEASE/spring-retry-1.1.2.RELEASE.jar, file:/C:/Users/pashtikar/.m2/repository/com/netflix/hystrix/hystrix-core/1.5.2/hystrix-core-1.5.2.jar, file:/C:/Users/pashtikar/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.7/HdrHistogram-2.1.7.jar, file:/C:/Users/pashtikar/.m2/repository/com/google/guava/guava/18.0/guava-18.0.jar, file:/C:/Users/pashtikar/.m2/repository/org/objenesis/objenesis/2.1/objenesis-2.1.jar, file:/C:/Users/pashtikar/.m2/repository/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar]


问:
How lead my NextJS app to accept otf and ttf fonts?
I'm working with NextJS, when I build my app my console returns me:

ModuleParseError: Module parse failed: Unexpected character '' (1:0)
  You may need an appropriate loader to handle this file type.

I'm wondering what going's wrong since I have build a custom webpack's configuration.

Here my next.config.js:

```<code>module.exports={
  exportPathMap: () => ({
      "/": {page: '/'}
  })
}

const config = {
  cssModules: true,
  module:{
    rules:[
      {
        test:/\.(png|jpg|woff|svg|eot|ttf|woff2|otf)$/,
        loader:'url-loader?limit=8192&name=images/[name].[ext]'

        }
    ]
  }

}

// config.module.rules.push(

//   );

const   withCss =   require('@zeit/next-css');
const   withImages  =   require('next-images');
module.exports  =   withImages(withCss(config));
</code>```

I have tried to launch my app with a css precising the nature of my font format vie format("opentype") and without it, but both fail:

```<code>@font-face {
    font-family: Moonlight;
    src: url(../assets/choiceFonts/Moonlights_on_the_Beach.ttf);
}

@font-face {
    font-family: Nenuphar;
    src: url(../assets/choiceFonts/Nenuphar_of_Venus.otf) format("opentype");
}

@font-face {
    font-family: Prida;
    src: url(../assets/choiceFonts/Prida01.otf) format("opentype");
}
</code>```

Any hint would be great,
thanks

答:
I used the following dependencies

npm install next-fonts

My next.config.js looked like this

```<code> const withFonts = require('next-fonts');

 module.exports = withFonts({
    enableSvg: true,
    webpack(config, options) {
      return config;
    }
 });
</code>```

Body:
I'm working with NextJS, when I build my app my console returns me:

ModuleParseError: Module parse failed: Unexpected character '' (1:0)
  You may need an appropriate loader to handle this file type.

I'm wondering what going's wrong since I have build a custom webpack's configuration.

Here my next.config.js:

module.exports={
  exportPathMap: () => ({
      "/": {page: '/'}
  })
}

const config = {
  cssModules: true,
  module:{
    rules:[
      {
        test:/\.(png|jpg|woff|svg|eot|ttf|woff2|otf)$/,
        loader:'url-loader?limit=8192&name=images/[name].[ext]'

        }
    ]
  }

}

// config.module.rules.push(

//   );

const   withCss =   require('@zeit/next-css');
const   withImages  =   require('next-images');
module.exports  =   withImages(withCss(config));

I have tried to launch my app with a css precising the nature of my font format vie format("opentype") and without it, but both fail:

@font-face {
    font-family: Moonlight;
    src: url(../assets/choiceFonts/Moonlights_on_the_Beach.ttf);
}

@font-face {
    font-family: Nenuphar;
    src: url(../assets/choiceFonts/Nenuphar_of_Venus.otf) format("opentype");
}

@font-face {
    font-family: Prida;
    src: url(../assets/choiceFonts/Prida01.otf) format("opentype");
}

Any hint would be great,
thanks

Body:
I used the following dependencies

npm install next-fonts

My next.config.js looked like this

 const withFonts = require('next-fonts');

 module.exports = withFonts({
    enableSvg: true,
    webpack(config, options) {
      return config;
    }
 });