问:
How to pass search parameter, into function that will search a c# collection
Assume I have a collection of the form:

```<code>List<Member> myMembers= new List<Member>()
{
    new Member(){ID=1,FirstName="John",LastName="Doe"},
    new Member(){ID=3,FirstName="Allan",LastName="Jones"},
    new Member(){ID=2,FirstName="Martin",LastName="Moe"},
    new Member(){ID=4,FirstName="Ludwig",LastName="Issac"}
};
</code>```

I can sort this list via FirstName by using:

```<code>myMembers.Sort((x, y) => x.FirstName.CompareTo(y.FirstName));
</code>```

I would like to do this inside of a function, so that I can pass the desired search parameter.  Something like:

```<code>public void sortCollection( parameter SearchTerm, List<Member> myCollection )
{
    myCollection ((x, y) => x.SearchTerm.CompareTo(y.FirstName));
}
</code>```

Obviously here, I cannot pass in the desired search field this way, but is it possible to do what I am asking?

答:
You can create a generic extension method for that and pass Func<T, TResult> delegate to it, which is used as key selector for built-in Sort method

public static void SortExt<T, TValue>(this List<T> collection, Func<T, TValue> selector)
{
    var comparer = Comparer<TValue>.Default;
    collection.Sort((x, y) => comparer.Compare(selector(x), selector(y)));
}
```

<p>Keep in mind that you should compare the same fields of compared objects. </p>

<p>Example of the usage</p>

<pre class="lang-cs prettyprint-override"><code>myMembers.SortExt(member => member.FirstName);
</code>```

If you want to compare the myMembers collection only, the declaration can be simplified

public static void SortExt<TValue>(this List<Member> members, Func<Member, TValue> selector)
{
    var comparer = Comparer<TValue>.Default;
    members.Sort((x, y) => comparer.Compare(selector(x), selector(y)));
}
```

<p>Another option is to introduce a <code>Comparison<T></code> delegate instance to store the logic of field comparison and pass it to the <code>Sort</code> method. Here you can specify any custom comparison that you want</p>

<pre class="lang-cs prettyprint-override"><code>Comparison<Member> comparison = (x, y) => x.FirstName.CompareTo(y.FirstName);
myMembers.Sort(comparison);
</code>```

Body:
Assume I have a collection of the form:

List<Member> myMembers= new List<Member>()
{
    new Member(){ID=1,FirstName="John",LastName="Doe"},
    new Member(){ID=3,FirstName="Allan",LastName="Jones"},
    new Member(){ID=2,FirstName="Martin",LastName="Moe"},
    new Member(){ID=4,FirstName="Ludwig",LastName="Issac"}
};

I can sort this list via FirstName by using:

myMembers.Sort((x, y) => x.FirstName.CompareTo(y.FirstName));

I would like to do this inside of a function, so that I can pass the desired search parameter.  Something like:

public void sortCollection( parameter SearchTerm, List<Member> myCollection )
{
    myCollection ((x, y) => x.SearchTerm.CompareTo(y.FirstName));
}

Obviously here, I cannot pass in the desired search field this way, but is it possible to do what I am asking?

Body:
You can create a generic extension method for that and pass Func<T, TResult> delegate to it, which is used as key selector for built-in Sort method

public static void SortExt<T, TValue>(this List<T> collection, Func<T, TValue> selector)
{
    var comparer = Comparer<TValue>.Default;
    collection.Sort((x, y) => comparer.Compare(selector(x), selector(y)));
}

Keep in mind that you should compare the same fields of compared objects.

Example of the usage

myMembers.SortExt(member => member.FirstName);

If you want to compare the myMembers collection only, the declaration can be simplified

public static void SortExt<TValue>(this List<Member> members, Func<Member, TValue> selector)
{
    var comparer = Comparer<TValue>.Default;
    members.Sort((x, y) => comparer.Compare(selector(x), selector(y)));
}

Another option is to introduce a Comparison<T> delegate instance to store the logic of field comparison and pass it to the Sort method. Here you can specify any custom comparison that you want

Comparison<Member> comparison = (x, y) => x.FirstName.CompareTo(y.FirstName);
myMembers.Sort(comparison);


来源: stackexchange

问:
How do i get data of each downloaded Workbook?
so i have the following macro, which downloads several workbooks from a company webpage. Now i want to extract Data out of every workbook, so during each loop, before moving to the download of the next workbook.
How do i do that ?
EDIT: Actually it doesnt matter if i download all the files first and then get the data or get the data of each file in its own loop.</p>

```<code>Sub Downloaden_Reviews()

Dim dlURL As String
Dim i As Range
Dim versch As String
Dim ordner As String

'Select Saving path
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select where to save"
.AllowMultiSelect = False
.InitialFileName = Application.DefaultFilePath

If .Show = -1 Then
ordner = .SelectedItems(1)
End If
End With
'Ende order

Application.ScreenUpdating = False

For Each i In ActiveSheet.Range("B1:B100")
If i = "" Then
End
End If

versch = i.Offset(0, -1)
dlURL = "URL of the webpage"

Dim HttpReq As Object
Set HttpReq = CreateObject("Microsoft.XMLHTTP")

HttpReq.Open "GET", dlURL, False
HttpReq.send

dlURL = HttpReq.responseBody
If HttpReq.Status = 200 Then
    Set oStrm = CreateObject("ADODB.Stream")
    oStrm.Open
    oStrm.Type = 1
    oStrm.Write HttpReq.responseBody
    oStrm.SaveToFile [ordner] & "\" & [i] & ".xlsm", 1 ' 1 = no overwrite, 2 = overwrite"
    oStrm.Close
End If
Next
</code>```

答:
I found the following code. Works for my case.</p>

```<code>Sub Aus_allen()
    Dim strDatei As String, strPfad As String, strTyp As String
    Dim wbX As Workbook, wksX As Worksheet, wksN As Worksheet
    Dim lngCount As Long
    Application.ScreenUpdating = False
    strPfad = "C:\Users\p\MakroTest\"                 'Pfad anpassen
    strTyp = "xlsm"                      'Dareityp anpassen
    Set wksN = ThisWorkbook.Sheets("Tabelle1")   'Zieltabelle
    strDatei = Dir(strPfad & "\*." & strTyp)
    Do Until strDatei = ""
        Set wbX = Workbooks.Open(strPfad & "\" & strDatei)
        Set wksX = wbX.Sheets(1)
        wksN.Cells(8, 5) = wksX.Cells(8, 5)
        wbX.Close False
        strDatei = Dir
    Loop
    Application.ScreenUpdating = True
End Sub

</code>```

ContentLicense: CC BY-SA 4.0

Body:
so i have the following macro, which downloads several workbooks from a company webpage. Now i want to extract Data out of every workbook, so during each loop, before moving to the download of the next workbook.
How do i do that ?
EDIT: Actually it doesnt matter if i download all the files first and then get the data or get the data of each file in its own loop.

Sub Downloaden_Reviews()

Dim dlURL As String
Dim i As Range
Dim versch As String
Dim ordner As String

'Select Saving path
With Application.FileDialog(msoFileDialogFolderPicker)
.Title = "Select where to save"
.AllowMultiSelect = False
.InitialFileName = Application.DefaultFilePath

If .Show = -1 Then
ordner = .SelectedItems(1)
End If
End With
'Ende order

Application.ScreenUpdating = False

For Each i In ActiveSheet.Range("B1:B100")
If i = "" Then
End
End If

versch = i.Offset(0, -1)
dlURL = "URL of the webpage"

Dim HttpReq As Object
Set HttpReq = CreateObject("Microsoft.XMLHTTP")

HttpReq.Open "GET", dlURL, False
HttpReq.send

dlURL = HttpReq.responseBody
If HttpReq.Status = 200 Then
    Set oStrm = CreateObject("ADODB.Stream")
    oStrm.Open
    oStrm.Type = 1
    oStrm.Write HttpReq.responseBody
    oStrm.SaveToFile [ordner] & "\" & [i] & ".xlsm", 1 ' 1 = no overwrite, 2 = overwrite"
    oStrm.Close
End If
Next

Body:
I found the following code. Works for my case.

Sub Aus_allen()
    Dim strDatei As String, strPfad As String, strTyp As String
    Dim wbX As Workbook, wksX As Worksheet, wksN As Worksheet
    Dim lngCount As Long
    Application.ScreenUpdating = False
    strPfad = "C:\Users\p\MakroTest\"                 'Pfad anpassen
    strTyp = "xlsm"                      'Dareityp anpassen
    Set wksN = ThisWorkbook.Sheets("Tabelle1")   'Zieltabelle
    strDatei = Dir(strPfad & "\*." & strTyp)
    Do Until strDatei = ""
        Set wbX = Workbooks.Open(strPfad & "\" & strDatei)
        Set wksX = wbX.Sheets(1)
        wksN.Cells(8, 5) = wksX.Cells(8, 5)
        wbX.Close False
        strDatei = Dir
    Loop
    Application.ScreenUpdating = True
End Sub


问:
ValueError: not enough values to unpack (expected 2, got 1) when trying to unpack dict in python for data labeling with pandas
I created a dictionary that label each api endpoint from my backend to a product group.
Currently I'm trying in python 3.7.6 to use this dictionary to further label all data in the csv that I get from NewRelic with data from all transactions (avg latency, request count, etc.).
The code is teh following:

```<code>response = requests.request(
        "GET", self.url,
        auth=(self.user, self.password)
    )
    with open(
            "data.csv",
            "w",
            encoding='utf8'
    ) as jfp:
        jfp.write(response.text)
    doc = pd.DataFrame(pd.read_csv(self.path, sep=";"))
    doc_dic = pd.Series(doc.ProductGroup.values, index=doc.Action).to_dict()
    resp = pd.DataFrame(pd.read_csv("data.csv", sep=","))
    for k, v in doc_dic:
        if k == resp.Action:
            resp.insert(0, "Product Group", v)
</code>```

but I'm getting the following error:

Traceback (most recent call last):

```<code>File "C:/Project/Dev/analytics/app/data.py", line 53, in <module>
    Data().csv_data()
  File "C:/Project/Dev/analytics/app/data.py", line 42, in csv_data
    for k, v in obj:
ValueError: not enough values to unpack (expected 2, got 1)
</code>```

In the dict obj, the keys are the api endpoint and the values are the product groups where each api endpoint belongs to.
The expected behaviour is, after comparing the dictionary with the csv file returned as response from the request, pandas inserting a column with the proper product group for each endpoint (index 0 for product group and index 1 for endpoints).
What can I do to get this output?

答: You need to do: for k, v in  doc_dic.items()

Body:
I created a dictionary that label each api endpoint from my backend to a product group.
Currently I'm trying in python 3.7.6 to use this dictionary to further label all data in the csv that I get from NewRelic with data from all transactions (avg latency, request count, etc.).
The code is teh following:

response = requests.request(
        "GET", self.url,
        auth=(self.user, self.password)
    )
    with open(
            "data.csv",
            "w",
            encoding='utf8'
    ) as jfp:
        jfp.write(response.text)
    doc = pd.DataFrame(pd.read_csv(self.path, sep=";"))
    doc_dic = pd.Series(doc.ProductGroup.values, index=doc.Action).to_dict()
    resp = pd.DataFrame(pd.read_csv("data.csv", sep=","))
    for k, v in doc_dic:
        if k == resp.Action:
            resp.insert(0, "Product Group", v)

but I'm getting the following error:

Traceback (most recent call last):

File "C:/Project/Dev/analytics/app/data.py", line 53, in <module>
    Data().csv_data()
  File "C:/Project/Dev/analytics/app/data.py", line 42, in csv_data
    for k, v in obj:
ValueError: not enough values to unpack (expected 2, got 1)

In the dict obj, the keys are the api endpoint and the values are the product groups where each api endpoint belongs to.
The expected behaviour is, after comparing the dictionary with the csv file returned as response from the request, pandas inserting a column with the proper product group for each endpoint (index 0 for product group and index 1 for endpoints).
What can I do to get this output?


问:
How can I make this construction simpler, like with classes or functions in python?
```<code>print(
    "1. Engine block \n"
    "2. Pistons \n"
    "3. Crankshaft \n"
    "4. Camshaft \n"
    "5. Cylinder head \n"
    "6. Connecting Rod \n"
)

part = int(input("Choose an engine part to show you details about it: "))

if part == 1:
    print("Engine block")
elif part == 2:
    print("Pistons")
elif part == 3:
    print("Crankshaft")
</code>```

I have 26 statements like these and I wonder if I can make it simpler with classes,

functions, lists or something I can't find a way??

答:
I would suggest using something like this:

```<code>def info_about(parts):
    info = list(parts.values())
    print("\n".join(f"{i+1}.\t\t{name}" for i, name in enumerate(parts)))

    print()
    while True:
        part = input("Choose an engine part to show you details about it: ")
        if not part.isnumeric():
            print("Please enter a valid number")
            continue

        part = int(part)
        if part > len(info) or part < 1:
            print("Please enter a valid number")
            continue
        break

    print(info[part-1])

parts = {
    "Engine block":         "Info about engine block",
    "Pistons":              "Info about pistons",
    "Crankshaft":           "Info about crankshaft",
    "Camshaft":             "Info about camshaft",
    "Cylinder head":        "Info about cylinder head",
    "Connecting Rod":       "Info about connecting rod",
}

info_about(parts)
</code>```

This now checks the input to ensure that it is valid - that it's numeric, and that it's between 1 and the number of parts.

Body:
print(
    "1. Engine block \n"
    "2. Pistons \n"
    "3. Crankshaft \n"
    "4. Camshaft \n"
    "5. Cylinder head \n"
    "6. Connecting Rod \n"
)

part = int(input("Choose an engine part to show you details about it: "))

if part == 1:
    print("Engine block")
elif part == 2:
    print("Pistons")
elif part == 3:
    print("Crankshaft")

I have 26 statements like these and I wonder if I can make it simpler with classes,

functions, lists or something I can't find a way??

Body:
I would suggest using something like this:

def info_about(parts):
    info = list(parts.values())
    print("\n".join(f"{i+1}.\t\t{name}" for i, name in enumerate(parts)))

    print()
    while True:
        part = input("Choose an engine part to show you details about it: ")
        if not part.isnumeric():
            print("Please enter a valid number")
            continue

        part = int(part)
        if part > len(info) or part < 1:
            print("Please enter a valid number")
            continue
        break

    print(info[part-1])

parts = {
    "Engine block":         "Info about engine block",
    "Pistons":              "Info about pistons",
    "Crankshaft":           "Info about crankshaft",
    "Camshaft":             "Info about camshaft",
    "Cylinder head":        "Info about cylinder head",
    "Connecting Rod":       "Info about connecting rod",
}

info_about(parts)

This now checks the input to ensure that it is valid - that it's numeric, and that it's between 1 and the number of parts.


问:
Android App Bundle build error: reserved file
The new app publishing format, the Android App Bundle, is an improved way to package your app. The Android App Bundle lets you more easily deliver a great experience in a smaller app size, allowing for the huge variety of Android devices available today. You don’t need to refactor your code to start benefiting from a smaller app.

I'm getting this error trying to build my app Android Bundle:

File 'root/AndroidManifest.xml' uses reserved file or directory name
  'AndroidManifest.xml'.

APK generation works fine.

This is my project file structure:

And this is my AndroidManifest.xml, located under {ProjectName}/app/src/main:

```<code><?xml version="1.0" encoding="utf-8"?>
            <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                package="com.XXXX.XXXX"
                android:installLocation="auto">

                <uses-permission android:name="android.permission.INTERNET" />
                <uses-permission android:name="android.permission.WAKE_LOCK" />
                <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

                <!-- These permissions are strongly recommended and will result in higher performance -->
                <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
                <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
                <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
                <uses-permission android:name="android.permission.VIBRATE" />

                <application
                    android:name="com.app.webview.Application"
                    android:allowBackup="true"
                    android:icon="@mipmap/ic_launcher"
                    android:label="@string/app_name"
                    android:supportsRtl="true"
                    android:theme="@style/AppTheme"
                    android:hardwareAccelerated="true">
                    <activity
                        android:name="com.app.webview.MainActivity"
                        android:configChanges="keyboardHidden|orientation|screenSize"
                        android:label="@string/app_name"
                        android:launchMode="singleTask">
                        <intent-filter>
                            <action android:name="android.intent.action.MAIN" />

                            <category android:name="android.intent.category.LAUNCHER" />
                        </intent-filter>

                        <!-- Universal APP Link -->
                        <intent-filter>
                            <action android:name="android.intent.action.VIEW" />

                            <category android:name="android.intent.category.DEFAULT" />
                            <category android:name="android.intent.category.BROWSABLE" />

                            <data android:scheme="http" />
                            <data android:scheme="https" />
                            <data android:host="@string/app_host" />
                        </intent-filter>
                    </activity>

                    <!-- Push -->
                    <!-- Services that handles incoming message -->
                    <service
                        android:name="com.app.webview.Providers.FCM.FcmListenerService">
                        <intent-filter>
                            <action android:name="com.google.firebase.MESSAGING_EVENT" />
                        </intent-filter>
                    </service>

                    <!-- Called if InstanceID token is updated -->
                    <!-- This may occur if the security of the previous token had been compromised -->
                    <service
                        android:name="com.app.webview.Providers.FCM.FcmInstanceIDListenerService"
                        android:exported="true">
                        <intent-filter>
                            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
                        </intent-filter>
                    </service>

                    <!-- Facebook Config -->
                    <meta-data
                        android:name="com.facebook.sdk.ApplicationId"
                        android:value="@string/id_facebook" />

                    <activity
                        android:name="com.facebook.FacebookActivity"
                        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
                        android:label="@string/app_name"
                        android:theme="@android:style/Theme.Translucent.NoTitleBar"
                        tools:replace="android:theme" />

                    <provider
                        android:name="com.facebook.FacebookContentProvider"
                        android:authorities="@string/facebook_provider"
                        android:exported="true"
                        tools:replace="android:authorities" />

                    <!-- Fabric -->
                    <meta-data
                        android:name="io.fabric.ApiKey"
                        android:value="XXXX" />
                </application>
            </manifest>
</code>```

答:
Late to answer but I was facing the same issue with slightly different scenario. I was not using the above mentioned facebook library but it was some other library, which I could not figure out because of less info by the build.

I had one sub module (say module1) which was including another library, which further had many dependencies. So I put,

```<code>packagingOptions {
        exclude 'AndroidManifest.xml'
}
</code>```

In the build.gradle of module1 and then the issue was resolved.

Just writing this answer to convey putting in app's build.gradle might not solve issue for all the cases.

Thanks a lot @Jason for showing the right direction.

Body:
The new app publishing format, the Android App Bundle, is an improved way to package your app. The Android App Bundle lets you more easily deliver a great experience in a smaller app size, allowing for the huge variety of Android devices available today. You don’t need to refactor your code to start benefiting from a smaller app.

I'm getting this error trying to build my app Android Bundle:

File 'root/AndroidManifest.xml' uses reserved file or directory name
  'AndroidManifest.xml'.

APK generation works fine.

This is my project file structure:

And this is my AndroidManifest.xml, located under {ProjectName}/app/src/main:

<?xml version="1.0" encoding="utf-8"?>
            <manifest xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                package="com.XXXX.XXXX"
                android:installLocation="auto">

                <uses-permission android:name="android.permission.INTERNET" />
                <uses-permission android:name="android.permission.WAKE_LOCK" />
                <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

                <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
                <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
                <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
                <uses-permission android:name="android.permission.VIBRATE" />

                <application
                    android:name="com.app.webview.Application"
                    android:allowBackup="true"
                    android:icon="@mipmap/ic_launcher"
                    android:label="@string/app_name"
                    android:supportsRtl="true"
                    android:theme="@style/AppTheme"
                    android:hardwareAccelerated="true">
                    <activity
                        android:name="com.app.webview.MainActivity"
                        android:configChanges="keyboardHidden|orientation|screenSize"
                        android:label="@string/app_name"
                        android:launchMode="singleTask">
                        <intent-filter>
                            <action android:name="android.intent.action.MAIN" />

                            <category android:name="android.intent.category.LAUNCHER" />
                        </intent-filter>

                        <intent-filter>
                            <action android:name="android.intent.action.VIEW" />

                            <category android:name="android.intent.category.DEFAULT" />
                            <category android:name="android.intent.category.BROWSABLE" />

                            <data android:scheme="http" />
                            <data android:scheme="https" />
                            <data android:host="@string/app_host" />
                        </intent-filter>
                    </activity>

                    <service
                        android:name="com.app.webview.Providers.FCM.FcmListenerService">
                        <intent-filter>
                            <action android:name="com.google.firebase.MESSAGING_EVENT" />
                        </intent-filter>
                    </service>

                    <service
                        android:name="com.app.webview.Providers.FCM.FcmInstanceIDListenerService"
                        android:exported="true">
                        <intent-filter>
                            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
                        </intent-filter>
                    </service>

                    <meta-data
                        android:name="com.facebook.sdk.ApplicationId"
                        android:value="@string/id_facebook" />

                    <activity
                        android:name="com.facebook.FacebookActivity"
                        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
                        android:label="@string/app_name"
                        android:theme="@android:style/Theme.Translucent.NoTitleBar"
                        tools:replace="android:theme" />

                    <provider
                        android:name="com.facebook.FacebookContentProvider"
                        android:authorities="@string/facebook_provider"
                        android:exported="true"
                        tools:replace="android:authorities" />

                    <meta-data
                        android:name="io.fabric.ApiKey"
                        android:value="XXXX" />
                </application>
            </manifest>

Body:
Late to answer but I was facing the same issue with slightly different scenario. I was not using the above mentioned facebook library but it was some other library, which I could not figure out because of less info by the build.

I had one sub module (say module1) which was including another library, which further had many dependencies. So I put,

packagingOptions {
        exclude 'AndroidManifest.xml'
}

In the build.gradle of module1 and then the issue was resolved.

Just writing this answer to convey putting in app's build.gradle might not solve issue for all the cases.

Thanks a lot @Jason for showing the right direction.


问:
xpath : Get data attribute / value
I want to extract  from a  website  some  product data with Xpath.
Unfortunatly , I don't get it. I am really blocked.

The URL  is the following :
https://www.fertighaus.de/haeuser/suche/

my xpath in Chrome is at the moment  : $x('//*[@id="SearchResultsPage"]/div[2]/div/div[2]/div[4]/div[2]/div1/div1/text()')

this  xpath give an array with an element, I need  a proper xpath  giving me the value of data of this element( price  of the house)  I circled it in yellow in the picture.  I guess it is a small change in this xpath....
If someone  could help me, it would be great. I am new with scraping and scrapy and it it  bite difficult

Thank you very much in advance

答:
My solution  was to inspect the all the networking  from  the JS (request mad by the js ). I discovered an API that I could use very easily  :).
In my  case Splash or  Selenium did not help . </p>

Title: xpath : Get data attribute / value


问:
Spring boot creating beans error
I`v got error:

```org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionQueryController' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\controller\AuctionQueryController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [pl.bpo.archiwumallegro.services.AuctionService]: : Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
    at pl.bpo.archiwumallegro.ArchiwumAllegro.main(ArchiwumAllegro.java:15)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 18 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstracException in thread "main" tBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 32 common frames omitted
Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.util.Assert.isTrue(Assert.java:65)
    at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:89)
    at org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod.<init>(ElasticsearchQueryMethod.java:37)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery(ElasticsearchRepositoryFactory.java:97)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:408)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.jaorg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionQueryController' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\controller\AuctionQueryController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [pl.bpo.archiwumallegro.services.AuctionService]: : Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.Auctiva:237)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 43 common frames omitted

onIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
    at pl.bpo.archiwumallegro.ArchiwumAllegro.main(ArchiwumAllegro.java:15)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 18 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 32 more
Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.util.Assert.isTrue(Assert.java:65)
    at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:89)
    at org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod.<init>(ElasticsearchQueryMethod.java:37)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery(ElasticsearchRepositoryFactory.java:97)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:408)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 43 more
```

<p><strong>AuctionQueryController.java:</strong></p>

<p>code </p>

<p><strong>AuctionService.java:</strong></p>

<p>code</p>

<p><strong>AuctionIndexRepository.java:</strong></p>

<p>code</p>

<p>Yesterday everything was fine, it must be a small mistake but I can not identify. If you need to see a files to write I will add it.</p>

<p>Problem resolve in AuctionIndexRepository I think i musted clicked to generate method or something like this in netbeans beacause that method is unnecessary.</p>

<p>So AuctionIndexRepository should look like:</p>

```package pl.bpo.archiwumallegro.repositories;

import org.springframework.data.elasticsearch.core.FacetedPage;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import pl.bpo.archiwumallegro.model.index.auctions.AuctionIndex;

public interface AuctionIndexRepository extends ElasticsearchRepository<AuctionIndex, Integer> {

}
```

Thanks for your interesting !

答:
it's probably because you've taken the wrong Pageable import,
check if your import is:
import org.springframework.data.domain.Pageable;

and not  Pageable from java.awt.print

ContentLicense: CC BY-SA 3.0

Title: Spring boot creating beans error

Body:
I`v got error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionQueryController' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\controller\AuctionQueryController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [pl.bpo.archiwumallegro.services.AuctionService]: : Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
    at pl.bpo.archiwumallegro.ArchiwumAllegro.main(ArchiwumAllegro.java:15)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 18 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstracException in thread "main" tBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 32 common frames omitted
Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.util.Assert.isTrue(Assert.java:65)
    at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:89)
    at org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod.<init>(ElasticsearchQueryMethod.java:37)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery(ElasticsearchRepositoryFactory.java:97)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:408)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.jaorg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionQueryController' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\controller\AuctionQueryController.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [pl.bpo.archiwumallegro.services.AuctionService]: : Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.Auctiva:237)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 43 common frames omitted

onIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:687)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:321)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:967)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:956)
    at pl.bpo.archiwumallegro.ArchiwumAllegro.main(ArchiwumAllegro.java:15)
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'auctionService' defined in file [C:\Users\AP_520\Desktop\paa_allek_query-layer\target\classes\pl\bpo\archiwumallegro\services\AuctionService.class]: Unsatisfied dependency expressed through constructor argument with index 1 of type [pl.bpo.archiwumallegro.repositories.AuctionIndexRepository]: : Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:749)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1139)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1042)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 18 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionIndexRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:813)
    at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
    ... 32 more
Caused by: java.lang.IllegalArgumentException: Paging query needs to have a Pageable parameter! Offending method public abstract org.springframework.data.elasticsearch.core.FacetedPage pl.bpo.archiwumallegro.repositories.AuctionIndexRepository.search(org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder)
    at org.springframework.util.Assert.isTrue(Assert.java:65)
    at org.springframework.data.repository.query.QueryMethod.<init>(QueryMethod.java:89)
    at org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod.<init>(ElasticsearchQueryMethod.java:37)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory$ElasticsearchQueryLookupStrategy.resolveQuery(ElasticsearchRepositoryFactory.java:97)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:408)
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:206)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:251)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:237)
    at org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean.afterPropertiesSet(ElasticsearchRepositoryFactoryBean.java:55)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
    ... 43 more

AuctionQueryController.java:

code

AuctionService.java:

code

AuctionIndexRepository.java:

code

Yesterday everything was fine, it must be a small mistake but I can not identify. If you need to see a files to write I will add it.

Problem resolve in AuctionIndexRepository I think i musted clicked to generate method or something like this in netbeans beacause that method is unnecessary.

So AuctionIndexRepository should look like:

package pl.bpo.archiwumallegro.repositories;

import org.springframework.data.elasticsearch.core.FacetedPage;
import org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import pl.bpo.archiwumallegro.model.index.auctions.AuctionIndex;

public interface AuctionIndexRepository extends ElasticsearchRepository<AuctionIndex, Integer> {

}

Thanks for your interesting !


问:
Working with file directories and variables
I have a program that I want to make more dynamic. The current setup is literally typing everything out.

I would like the program to work with a for loop (any other suggestions would be great). My goal is to loop through a specific file that has sub-directories and get the name of each folder (sub-directory),  then get the name of the files within the sub-directory.

To put this in a file string:
C:\Folder 1\Folder 2\File name

From the above, I would like to get the value of Folder 2 and File name.

My code so far:

```<code>for sub_dir in os.listdir(r"C:\Folder 1\"):
    DIR = r'' + sub_dir
    files_found = len([name for name in os.listdir(DIR) if os.path.isfile(os.path.join(DIR, name))])
    if(files_found > 0):
        for files in os.listdir(sub_dir):
            file_name = os.path.splitext(files)[0]
</code>```

I get the error --> FileNotFoundError: [WinError 3] The system cannot find the path specified: Folder 2

I appreciate your efforts to help.

答:
Have a look at os.walk()

It recursively traverses a file tree, returning a list of all directories and files within a directory at each step.

Body:
I have a program that I want to make more dynamic. The current setup is literally typing everything out.

I would like the program to work with a for loop (any other suggestions would be great). My goal is to loop through a specific file that has sub-directories and get the name of each folder (sub-directory),  then get the name of the files within the sub-directory.

To put this in a file string:
C:\Folder 1\Folder 2\File name

From the above, I would like to get the value of Folder 2 and File name.

My code so far:

for sub_dir in os.listdir(r"C:\Folder 1\"):
    DIR = r'' + sub_dir
    files_found = len([name for name in os.listdir(DIR) if os.path.isfile(os.path.join(DIR, name))])
    if(files_found > 0):
        for files in os.listdir(sub_dir):
            file_name = os.path.splitext(files)[0]

I get the error --> FileNotFoundError: [WinError 3] The system cannot find the path specified: Folder 2

I appreciate your efforts to help.


问:
Is there any method to change the icon for the imshow() window?
That's the default cv2.imshow() window icon:

I'm finishing up a basic project, but want to make it look cleaner by changing the window icon that is displayed. I know it can be done with Tkinter windows, but I wanted to see if there was a more direct way to do it with just the OpenCV library.

答:
You can't do that using only OpenCV. Its High-level GUI only supports minimal functionality, cf. the detailed description:

While OpenCV was designed for use in full-scale applications and can be used within functionally rich UI frameworks (such as Qt*, WinForms*, or Cocoa*) or without any UI at all, sometimes there it is required to try functionality quickly and visualize the results. This is what the HighGUI module has been designed for.

It provides easy interface to:

Create and manipulate windows that can display images and "remember" their content (no need to handle repaint events from OS).

Add trackbars to the windows, handle simple mouse events as well as keyboard commands.

"Manipulating" windows is limited to naming, moving, resizing them.

(From my personal point of view, OpenCV windows are just for prototyping, nothing you'd use in production.)

Hope that helps!


问:
How to print different text on more than one image using jimp in node js?
I want to create a gift card to send many email with different text, I am using the below logic its work to print but overwrite with previous one image gengerated.</p>

```<code>            Jimp.read(fileName)
            .then(function (image) {
                loadedImage1 = image;
                return Jimp.loadFont(Jimp.FONT_SANS_16_BLACK);
            })
            .then(font => {

                console.log('[][][', emailData);
                var paths = [];
                for(let i=0; i< Object.keys(emailData['recipient']).length; i++){
                    var receipentName = "Hello "+emailData['recipient'][i].name+', ';
                    loadedImages[i]= Object.assign(loadedImage1);
                    loadedImages[i].print(font, 220, 400, header, 500);
                    loadedImages[i].print(font, 220, 440, venue, 500);

                    loadedImages[i].print(font, 220, 460, location, 500);
                    loadedImages[i].print(font, 220, 520, receipentName, 500);
                    loadedImages[i].print(font, 220, 580, message, 500);
                    //loadedImage.print(font, 10, 30, imageCaption);
                    var path= basePath + '/invitation/' + bookingId + '/' + bookingId+i + '.jpg';
                    //let fullPath = config.BASE_URL + '/uploads/invitation/' + bookingId + '/' + bookingId+i + '.jpg';
                    paths[i] = path;
                    loadedImages[i].write(path);
                }
                res.status(200).json({
                    data: {
                        paths: paths,
                        path: path, //config.BASE_URL + '/uploads/invitation/' + bookingId + '/' + bookingId + '.jpg',
                        bookingData: detail,
                        restaurantDetails: restaurantDetails
                    },
                    status: 1,
                    msg: "Notes data"
                });

            })
            .catch(function (err) {
                console.error(err);
            });
</code>```

答:
The correct syntax for Object.assign is:

```<code>Object.assign(target, ...sources)
</code>```

In your case the correct usage would be:

```<code>loadedImages[i]= Object.assign({}, loadedImage1);
</code>```

Body:
I want to create a gift card to send many email with different text, I am using the below logic its work to print but overwrite with previous one image gengerated.

            Jimp.read(fileName)
            .then(function (image) {
                loadedImage1 = image;
                return Jimp.loadFont(Jimp.FONT_SANS_16_BLACK);
            })
            .then(font => {

                console.log('[][][', emailData);
                var paths = [];
                for(let i=0; i< Object.keys(emailData['recipient']).length; i++){
                    var receipentName = "Hello "+emailData['recipient'][i].name+', ';
                    loadedImages[i]= Object.assign(loadedImage1);
                    loadedImages[i].print(font, 220, 400, header, 500);
                    loadedImages[i].print(font, 220, 440, venue, 500);

                    loadedImages[i].print(font, 220, 460, location, 500);
                    loadedImages[i].print(font, 220, 520, receipentName, 500);
                    loadedImages[i].print(font, 220, 580, message, 500);
                    //loadedImage.print(font, 10, 30, imageCaption);
                    var path= basePath + '/invitation/' + bookingId + '/' + bookingId+i + '.jpg';
                    //let fullPath = config.BASE_URL + '/uploads/invitation/' + bookingId + '/' + bookingId+i + '.jpg';
                    paths[i] = path;
                    loadedImages[i].write(path);
                }
                res.status(200).json({
                    data: {
                        paths: paths,
                        path: path, //config.BASE_URL + '/uploads/invitation/' + bookingId + '/' + bookingId + '.jpg',
                        bookingData: detail,
                        restaurantDetails: restaurantDetails
                    },
                    status: 1,
                    msg: "Notes data"
                });

            })
            .catch(function (err) {
                console.error(err);
            });

Body:
The correct syntax for Object.assign is:

Object.assign(target, ...sources)

In your case the correct usage would be:

loadedImages[i]= Object.assign({}, loadedImage1);


问:
errors in django tests
im trying to run the following test but im not sure why its not working since when tests are ran a test db is created and that means that the newly created item gets an id of 1 but im still getting an error that no object matches the query

model

```<code>from django.db import models

# Create your models here.

class Post(models.Model):
    text = models.TextField()

    def __str__(self):
        return self.text[:50]

</code>```

tests

```<code>from django.test import TestCase

from .models import Post

# Create your tests here.

class PostModelTest(TestCase):

    def setup(self):
        post = Post.objects.create(text="just a test")

    def test_text_content(self):
        post = Post.objects.get(id=1)
        expected_obect_name = f'{post.text}'
        self.assertEqual(expected_obect_name, 'just a test')

</code>```

here's the error

答:
First of all you should name method setUp not setup. It's case-sensetive. But it's probably will not solve your problem, since django doesn't reset auto id for each TestCase class. So if you have another test case with same code the error will happened again. To solve it you need to save post id as e.g. self.post_id and use it in test methods instead of 1:

```<code>class PostModelTest(TestCase):

    def setUp(self):
        post = Post.objects.create(text="just a test")
        self.post_id = post.pk

    def test_text_content(self):
        post = Post.objects.get(id=self.post_id)
        expected_obect_name = f'{post.text}'
    self.assertEqual(expected_obect_name, 'just a test')
</code>```

Title: errors in django tests

Body:
im trying to run the following test but im not sure why its not working since when tests are ran a test db is created and that means that the newly created item gets an id of 1 but im still getting an error that no object matches the query

model

from django.db import models

# Create your models here.

class Post(models.Model):
    text = models.TextField()

    def __str__(self):
        return self.text[:50]

tests

from django.test import TestCase

from .models import Post

# Create your tests here.

class PostModelTest(TestCase):

    def setup(self):
        post = Post.objects.create(text="just a test")

    def test_text_content(self):
        post = Post.objects.get(id=1)
        expected_obect_name = f'{post.text}'
        self.assertEqual(expected_obect_name, 'just a test')

here's the error

Body:
First of all you should name method setUp not setup. It's case-sensetive. But it's probably will not solve your problem, since django doesn't reset auto id for each TestCase class. So if you have another test case with same code the error will happened again. To solve it you need to save post id as e.g. self.post_id and use it in test methods instead of 1:

class PostModelTest(TestCase):

    def setUp(self):
        post = Post.objects.create(text="just a test")
        self.post_id = post.pk

    def test_text_content(self):
        post = Post.objects.get(id=self.post_id)
        expected_obect_name = f'{post.text}'
    self.assertEqual(expected_obect_name, 'just a test')


问:
How do I fix memory allocation problem with pandas?
little background, I've inherited a piece of code in company that is written in Python, which I don't really know, the code is combining few pre-downloaded Excel reports into one using pandas. I keep running into Memory Allocation Error:

MemoryError: Unable to allocate 368. MiB for an array with shape (17, 5668350) and data type object

This is the code that gives me the error:

```<code>dfCC = dfVendNew.merge(dfVendOld[['SAP ID', 'Cost ctr']], on='SAP ID', how='left')
</code>```

I am stuck on this point unable to progress further. I've tried changing the paging size on Windows but it did not help. I suspect that it is related to my computer settings since this script is running on the other machines without a hitch.

I would greatly appreciate any help.

答:
You can try processing and merging the dataframes in chunks, here is my attempt:

```<code>all_data = pd.DataFrame()
new = dfVendNew
old = dfVendOld[['SAP ID', 'Cost ctr']]
    for sap_id in np.array_split(new['SAP ID'].unique(), 10):
         new_chunk = new[new['SAP ID'].isin(sap_id)]
         old_chunk = old[old['SAP ID'].isin(sap_id)]
         merged = new_chunk.merge(old_chunk, on='SAP ID', how='left')
         all_data = pd.concat([merged, all_data], ignore_index=True, sort=False)

        del new_chunk
        del old_chunk
        del merged

    return all_data
</code>```

First you get unique SAP ID's of your new dataframe, then you create 10 different lists of SAP ID's, then you split both new and old dataframes based on those lists. Merge each chunk and del to relieve your memory.

Body:
little background, I've inherited a piece of code in company that is written in Python, which I don't really know, the code is combining few pre-downloaded Excel reports into one using pandas. I keep running into Memory Allocation Error:

MemoryError: Unable to allocate 368. MiB for an array with shape (17, 5668350) and data type object

This is the code that gives me the error:

dfCC = dfVendNew.merge(dfVendOld[['SAP ID', 'Cost ctr']], on='SAP ID', how='left')

I am stuck on this point unable to progress further. I've tried changing the paging size on Windows but it did not help. I suspect that it is related to my computer settings since this script is running on the other machines without a hitch.

I would greatly appreciate any help.

Body:
You can try processing and merging the dataframes in chunks, here is my attempt:

all_data = pd.DataFrame()
new = dfVendNew
old = dfVendOld[['SAP ID', 'Cost ctr']]
    for sap_id in np.array_split(new['SAP ID'].unique(), 10):
         new_chunk = new[new['SAP ID'].isin(sap_id)]
         old_chunk = old[old['SAP ID'].isin(sap_id)]
         merged = new_chunk.merge(old_chunk, on='SAP ID', how='left')
         all_data = pd.concat([merged, all_data], ignore_index=True, sort=False)

        del new_chunk
        del old_chunk
        del merged

    return all_data

First you get unique SAP ID's of your new dataframe, then you create 10 different lists of SAP ID's, then you split both new and old dataframes based on those lists. Merge each chunk and del to relieve your memory.


问:
Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead
How to fix Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "show" problem?

my SnackbarComponent.vue:

```<code><template>
  <v-snackbar
    v-model="show"
    :top="pinY === 'top'"
    :right="pinX === 'right'"
    :bottom="pinY === 'bottom'"
    :left="pinX === 'left'"
    :color="variant"
    :timeout="timeout"
    :vertical="mode === 'vertical'"
    :multi-line="mode === 'multi-line'"
  >
    {{ message }}
    <v-btn fab @click="show = false" color="transparent" depressed>
      close
    </v-btn>
  </v-snackbar>
</template>
<script>
export default {
  props: {
    show: {
      type: Boolean,
      required: true,
      default: false
    },
  },
  data() {
    return {

    }
  }
}
</script>
</code>```

答:
The issue here is in the line below. A property should not be updated in the child component:

```<code><v-btn fab @click="show = false" color="transparent" depressed>
</code>```

So what I suggest is to create a new variable by connecting it to the prop and do what ever we need after as below :

```<code><template>
    <v-snackbar v-model="showModal"
                :top="pinY === 'top'"
                :right="pinX === 'right'"
                :bottom="pinY === 'bottom'"
                :left="pinX === 'left'"
                :color="variant"
                :timeout="timeout"
                :vertical="mode === 'vertical'"
                :multi-line="mode === 'multi-line'">
        {{ message }}
        <v-btn fab @click="hideModal" color="transparent" depressed>
            close
        </v-btn>
    </v-snackbar>
</template>
<script>
    export default {
        props: {
            show: {
                type: Boolean,
                required: true,
                default: false
            },
        },
        data() {
            return {
                showModal: this.show /*The local variable added and referred in v-snackbar */
            }
        },
        methods: {
            /*New method to hide the snackbar, you could still be using inline
              coding and replace the prop by the new variable*/
            hideModal() {
                this.showModal = false;
            }
        }
    }
</script>
</code>```

Body:
How to fix Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "show" problem?

my SnackbarComponent.vue:

<template>
  <v-snackbar
    v-model="show"
    :top="pinY === 'top'"
    :right="pinX === 'right'"
    :bottom="pinY === 'bottom'"
    :left="pinX === 'left'"
    :color="variant"
    :timeout="timeout"
    :vertical="mode === 'vertical'"
    :multi-line="mode === 'multi-line'"
  >
    {{ message }}
    <v-btn fab @click="show = false" color="transparent" depressed>
      close
    </v-btn>
  </v-snackbar>
</template>

Body:
The issue here is in the line below. A property should not be updated in the child component:

<v-btn fab @click="show = false" color="transparent" depressed>

So what I suggest is to create a new variable by connecting it to the prop and do what ever we need after as below :

<template>
    <v-snackbar v-model="showModal"
                :top="pinY === 'top'"
                :right="pinX === 'right'"
                :bottom="pinY === 'bottom'"
                :left="pinX === 'left'"
                :color="variant"
                :timeout="timeout"
                :vertical="mode === 'vertical'"
                :multi-line="mode === 'multi-line'">
        {{ message }}
        <v-btn fab @click="hideModal" color="transparent" depressed>
            close
        </v-btn>
    </v-snackbar>
</template>
<script>
    export default {
        props: {
            show: {
                type: Boolean,
                required: true,
                default: false
            },
        },
        data() {
            return {
                showModal: this.show /*The local variable added and referred in v-snackbar */
            }
        },
        methods: {
            /*New method to hide the snackbar, you could still be using inline
              coding and replace the prop by the new variable*/
            hideModal() {
                this.showModal = false;
            }
        }
    }
</script>