问:
React UseState not being updated
I can't understand correctly how to update my useState. I'm receiving data via my Axios call so "applis" is not empty but it's the following that seems to stuck.

What I'm trying to do:

Receive the data from the first call containing the list of applications (Name, ID, and the number of APIs that this application has)

Take the ID of the applications to make a second call that will bring me the APIs for this application (thanks to the ID)

All this when the application is loaded (I have 19 applications and more than a hundred APIs)

I can display in my Accordions my different applications but in AccordionSummary, you can see that I can't get my API list for an application.

Either I have nothing (as in this post) or all the APIs are under an application to loop over and over again ...

Here is my code :

export default function documentationv2() {

    // Getteur - Setteur
    const [applis, setApplis] = useState([]);
    const [applicationSelect, setApplicationSelect] = useState([]);
    const [APIs, setAPIs] = useState([]);

    // Chargement
    const loadRessources = () => {
        axios.get('/api/documentation/application')
        .then((response) => {
            setApplis(response.data);
            console.log('LesApplications : ' + JSON.stringify(response.data))
            {applis.map((application) => (
                setApplicationSelect(application.IDAPPLI)
            ))}
            ListeAPI(applicationSelect);

        })
        .catch((error) => console.log(error));
    }

    const ListeAPI = (AppliID) => {
        console.log('SELECT : ' + AppliID)
        // console.log('ID : ' + AppliID)
        axios.get('/api/documentation/api?app_id=' + AppliID)
        .then((response) => {
            setAPIs(response.data)
            console.log('LesAPIS : ' + response.data)
        })
        {APIs.map((api, index) => (
            console.log('API : ' + api.api_uri)
        ))}
    }

    useEffect(() => {
        console.log('Chargement ....')
        loadRessources();
    }, [])

    // useEffect(() => {
    //     console.log('-> Application SELECT : ' + applicationSelect)
    //     axios.get('/api/documentation/api?app_id=' + 1)
    //     .then((response) => {
    //         setAPIs(response.data)
    //         console.log('-> APIs : ' + response.data)
    //     })
    // }, [applicationSelect])

    return (

            {/* -- BODY -- */}
            <Grid item className={classes.Body}>
                <Grid container className={classes.GridContainerBody}>
                    {applis.map((application, index) => (

                            <Grid item className={classes.GridItemLeftBody}>
                                <Accordion key={application.IDAPPLI} onChange={(event) => setApplicationSelect(application.NOMAPPLI)} className={classes.AccordionBody}>
                                    <AccordionSummary expandIcon={<IconButton className={classes.ButtonBodyShow} disableRipple={true}><ExpandMoreIcon/></IconButton>}>
                                        <Typography>
                                            {application.NOMAPPLI} - ({application.NBAPI})
                                        </Typography>
                                    </AccordionSummary>
                                    <AccordionDetails className={classes.AccordionDetailsApplication}>

                                        {/* {ListeAPI(application.IDAPPLI)} */}
                                        {/* {APIs.map((api, index) => (

                                                <Accordion key={index} className={classes.AccordionBody}>
                                                    <AccordionSummary expandIcon={<IconButton className={classes.ButtonBodyShow} disableRipple={true}><ExpandMoreIcon/></IconButton>}>

                                                            <Typography>
                                                                {api.api_uri}
                                                            </Typography>
                                                            <Typography>
                                                                {api.api_description}
                                                            </Typography>

                                                                <Chip
                                                                    style={{backgroundColor: "#06d6a0"}}
                                                                    label={api.api_version}
                                                                />
                                                                <Chip
                                                                    style={{backgroundColor: "#ffd166"}}
                                                                    label={api.api_response_type}
                                                                />

                                                                <Typography>
                                                                    Créé par {api.api_creation_user} le {api.api_date_creation}.
                                                                </Typography>
                                                                <Typography>
                                                                    Modifié par {api.api_maj_user} le {api.api_date_maj}.
                                                                </Typography>

                                                    </AccordionSummary>
                                                    <AccordionDetails>
                                                            <Typography>
                                                                Information
                                                            </Typography>
                                                    </AccordionDetails>
                                                </Accordion>

                                        ))} */}
                                    </AccordionDetails>
                                </Accordion>
                            </Grid>

                            <Grid item className={classes.GridItemRightbody}>

                                    <Tooltip title="Mot de passe" placement="top" arrow>
                                        <IconButton
                                            className={classes.ButtonHeader}
                                            disableRipple={true}
                                        >
                                            <LockIcon/>
                                        </IconButton>
                                    </Tooltip>

                                    <Tooltip title="Télécharger doc
                                    " placement="top" arrow>
                                        <IconButton
                                            className={classes.ButtonHeader}
                                            disableRipple={true}
                                        >
                                            <GetAppIcon/>
                                        </IconButton>
                                    </Tooltip>

                            </Grid>

                    ))}
                </Grid>
            </Grid>

        </Grid>
    )
}```
</div>
</div>
</p>
<p>What the different console.log tells me :</p>
```LesApplications : [{"NOMAPPLI" : "NameValue", "IDAPPLI" : "IdValue", "NBAPI" : "ValueCount"}, ...]

SELECT :

LesAPIS :
```

Could someone explain my mistake? It must be something with the useEffect not re-rendering ? I don't really understand everything here.

Sorry in advance if the title of my question does not seem clear

答:
setApplis is asyncronous, you can't call applis.map after setApplis because your applis isn't updated yet. You must call applis.map in useEffect with dependency on it. Then in second useEffect you call ListeAPI(applicationSelect) with actual applicationSelect array.

Example:

```<code> const loadRessources = () => {
        axios.get('/api/documentation/application')
        .then((response) => {
            setApplis(response.data);
            console.log('LesApplications : ' + JSON.stringify(response.data))
        })
        .catch((error) => console.log(error));
 }

  useEffect(() => {
    const arr = applis.map((application) => application.IDAPPLI);
    setApplicationSelect(arr);
  }, [applis]);

  useEffect(() => {
   applicationSelect.length && ListeAPI(applicationSelect);
  }, [applicationSelect]);

  useEffect(() => {
    loadRessources();
  }, [])
</code>```

Another example:

```<code> const ListeAPI = (AppliID) => {
    axios.get('/api/documentation/api?app_id=' + AppliID)
    .then((response) => {
        setAPIs(prev => [...prev, ...response.data])
        console.log('LesAPIS : ' + response.data)
    })
}

 const loadRessources = () => {
        axios.get('/api/documentation/application')
        .then((response) => {
            setApplis(response.data);
            console.log('LesApplications : ' + JSON.stringify(response.data))
        })
        .catch((error) => console.log(error));
 }

 useEffect(() => {
     applis.length && applis.forEach((application) => ListeAPI(application.IDAPPLI));
  }, [applis]);

  useEffect(() => {
    loadRessources();
  }, [])
</code>```

Example how to do correct APIs object sctructure:

```<code>const [APIs, setAPIs] = useState({});
const ListeAPI = (AppliID) => {
    axios.get('/api/documentation/api?app_id=' + AppliID)
    .then((response) => {
        setAPIs(prev => {
            return {
                ...prev,
                [AppliID]: response.data
            }
        })
    })
}
</code>```

JSX, then you can find needed api by applis id:

```<code>{applis.map((application, index) => (
    ...

    {APIs[application.IDAPPLI] && APIs[application.IDAPPLI].map((api, index) => (
        ...
</code>```

Title: React UseState not being updated

Body:
I can't understand correctly how to update my useState. I'm receiving data via my Axios call so "applis" is not empty but it's the following that seems to stuck.

What I'm trying to do:

Receive the data from the first call containing the list of applications (Name, ID, and the number of APIs that this application has)

Take the ID of the applications to make a second call that will bring me the APIs for this application (thanks to the ID)

All this when the application is loaded (I have 19 applications and more than a hundred APIs)

I can display in my Accordions my different applications but in AccordionSummary, you can see that I can't get my API list for an application.

Either I have nothing (as in this post) or all the APIs are under an application to loop over and over again ...

Here is my code :

export default function documentationv2() {

    // Getteur - Setteur
    const [applis, setApplis] = useState([]);
    const [applicationSelect, setApplicationSelect] = useState([]);
    const [APIs, setAPIs] = useState([]);

    // Chargement
    const loadRessources = () => {
        axios.get('/api/documentation/application')
        .then((response) => {
            setApplis(response.data);
            console.log('LesApplications : ' + JSON.stringify(response.data))
            {applis.map((application) => (
                setApplicationSelect(application.IDAPPLI)
            ))}
            ListeAPI(applicationSelect);

        })
        .catch((error) => console.log(error));
    }

    const ListeAPI = (AppliID) => {
        console.log('SELECT : ' + AppliID)
        // console.log('ID : ' + AppliID)
        axios.get('/api/documentation/api?app_id=' + AppliID)
        .then((response) => {
            setAPIs(response.data)
            console.log('LesAPIS : ' + response.data)
        })
        {APIs.map((api, index) => (
            console.log('API : ' + api.api_uri)
        ))}
    }

    useEffect(() => {
        console.log('Chargement ....')
        loadRessources();
    }, [])

    // useEffect(() => {
    //     console.log('-> Application SELECT : ' + applicationSelect)
    //     axios.get('/api/documentation/api?app_id=' + 1)
    //     .then((response) => {
    //         setAPIs(response.data)
    //         console.log('-> APIs : ' + response.data)
    //     })
    // }, [applicationSelect])

    return (

            {/* -- BODY -- */}
            <Grid item className={classes.Body}>
                <Grid container className={classes.GridContainerBody}>
                    {applis.map((application, index) => (

                            <Grid item className={classes.GridItemLeftBody}>
                                <Accordion key={application.IDAPPLI} onChange={(event) => setApplicationSelect(application.NOMAPPLI)} className={classes.AccordionBody}>
                                    <AccordionSummary expandIcon={<IconButton className={classes.ButtonBodyShow} disableRipple={true}><ExpandMoreIcon/></IconButton>}>
                                        <Typography>
                                            {application.NOMAPPLI} - ({application.NBAPI})
                                        </Typography>
                                    </AccordionSummary>
                                    <AccordionDetails className={classes.AccordionDetailsApplication}>

                                        {/* {ListeAPI(application.IDAPPLI)} */}
                                        {/* {APIs.map((api, index) => (

                                                <Accordion key={index} className={classes.AccordionBody}>
                                                    <AccordionSummary expandIcon={<IconButton className={classes.ButtonBodyShow} disableRipple={true}><ExpandMoreIcon/></IconButton>}>

                                                            <Typography>
                                                                {api.api_uri}
                                                            </Typography>
                                                            <Typography>
                                                                {api.api_description}
                                                            </Typography>

                                                                <Chip
                                                                    style={{backgroundColor: "#06d6a0"}}
                                                                    label={api.api_version}
                                                                />
                                                                <Chip
                                                                    style={{backgroundColor: "#ffd166"}}
                                                                    label={api.api_response_type}
                                                                />

                                                                <Typography>
                                                                    Créé par {api.api_creation_user} le {api.api_date_creation}.
                                                                </Typography>
                                                                <Typography>
                                                                    Modifié par {api.api_maj_user} le {api.api_date_maj}.
                                                                </Typography>

                                                    </AccordionSummary>
                                                    <AccordionDetails>
                                                            <Typography>
                                                                Information
                                                            </Typography>
                                                    </AccordionDetails>
                                                </Accordion>

                                        ))} */}
                                    </AccordionDetails>
                                </Accordion>
                            </Grid>

                            <Grid item className={classes.GridItemRightbody}>

                                    <Tooltip title="Mot de passe" placement="top" arrow>
                                        <IconButton
                                            className={classes.ButtonHeader}
                                            disableRipple={true}
                                        >
                                            <LockIcon/>
                                        </IconButton>
                                    </Tooltip>

                                    <Tooltip title="Télécharger doc
                                    " placement="top" arrow>
                                        <IconButton
                                            className={classes.ButtonHeader}
                                            disableRipple={true}
                                        >
                                            <GetAppIcon/>
                                        </IconButton>
                                    </Tooltip>

                            </Grid>

                    ))}
                </Grid>
            </Grid>

        </Grid>
    )
}

What the different console.log tells me :

LesApplications : [{"NOMAPPLI" : "NameValue", "IDAPPLI" : "IdValue", "NBAPI" : "ValueCount"}, ...]

SELECT :

LesAPIS :

Could someone explain my mistake? It must be something with the useEffect not re-rendering ? I don't really understand everything here.

Sorry in advance if the title of my question does not seem clear

Body:
setApplis is asyncronous, you can't call applis.map after setApplis because your applis isn't updated yet. You must call applis.map in useEffect with dependency on it. Then in second useEffect you call ListeAPI(applicationSelect) with actual applicationSelect array.

Example:

 const loadRessources = () => {
        axios.get('/api/documentation/application')
        .then((response) => {
            setApplis(response.data);
            console.log('LesApplications : ' + JSON.stringify(response.data))
        })
        .catch((error) => console.log(error));
 }

  useEffect(() => {
    const arr = applis.map((application) => application.IDAPPLI);
    setApplicationSelect(arr);
  }, [applis]);

  useEffect(() => {
   applicationSelect.length && ListeAPI(applicationSelect);
  }, [applicationSelect]);

  useEffect(() => {
    loadRessources();
  }, [])

Another example:

 const ListeAPI = (AppliID) => {
    axios.get('/api/documentation/api?app_id=' + AppliID)
    .then((response) => {
        setAPIs(prev => [...prev, ...response.data])
        console.log('LesAPIS : ' + response.data)
    })
}

 const loadRessources = () => {
        axios.get('/api/documentation/application')
        .then((response) => {
            setApplis(response.data);
            console.log('LesApplications : ' + JSON.stringify(response.data))
        })
        .catch((error) => console.log(error));
 }

 useEffect(() => {
     applis.length && applis.forEach((application) => ListeAPI(application.IDAPPLI));
  }, [applis]);

  useEffect(() => {
    loadRessources();
  }, [])

Example how to do correct APIs object sctructure:

const [APIs, setAPIs] = useState({});
const ListeAPI = (AppliID) => {
    axios.get('/api/documentation/api?app_id=' + AppliID)
    .then((response) => {
        setAPIs(prev => {
            return {
                ...prev,
                [AppliID]: response.data
            }
        })
    })
}

JSX, then you can find needed api by applis id:

{applis.map((application, index) => (
    ...

    {APIs[application.IDAPPLI] && APIs[application.IDAPPLI].map((api, index) => (
        ...


来源: stackexchange

问:
Show wait dialog on long running change event
I have a checkbox with a change event. When there is many data, the click on the checkbox does some background task which can take some time.

So the first thing I do is:

```<code>$chxSelectAll.on('change', function (e) {
            $('.loadingnew').show()
            ... Long running code here
}
</code>```

The problem is: The waiting spinner is only shown, when the change event completed the code. The code works outside or from console without problem. How can I force the show() before the code is running?

Best regards

答:
The waiting spinner is only shown, when the change event completed the code.

That means that the long-running task isn't in the background, it's in the foreground, tying up (blocking) the thread that's shared by the JavaScript code and the page display code.

You have two choices:

If possible, offload the long-running task to a web worker thread, so it's not running on the main UI thread, blocking page updates.

If that isn't possible, delay the start of the blocking code for about 60ms using setTimeout, so the browser has a chance to show the "loading" spinner before the code holds up the thread. Beware that the spinner may well not actually spin, but it will at least be visible.

Here's an example of #2:

```<code>$chxSelectAll.on('change', function (e) {
    $('.loadingnew').show()
    setTimeout(() => {
        ... Long running code here
    }, 60);
});
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I have a checkbox with a change event. When there is many data, the click on the checkbox does some background task which can take some time.

So the first thing I do is:

$chxSelectAll.on('change', function (e) {
            $('.loadingnew').show()
            ... Long running code here
}

The problem is: The waiting spinner is only shown, when the change event completed the code. The code works outside or from console without problem. How can I force the show() before the code is running?

Best regards

Body:
The waiting spinner is only shown, when the change event completed the code.

That means that the long-running task isn't in the background, it's in the foreground, tying up (blocking) the thread that's shared by the JavaScript code and the page display code.

You have two choices:

If possible, offload the long-running task to a web worker thread, so it's not running on the main UI thread, blocking page updates.

If that isn't possible, delay the start of the blocking code for about 60ms using setTimeout, so the browser has a chance to show the "loading" spinner before the code holds up the thread. Beware that the spinner may well not actually spin, but it will at least be visible.

Here's an example of #2:

$chxSelectAll.on('change', function (e) {
    $('.loadingnew').show()
    setTimeout(() => {
        ... Long running code here
    }, 60);
});


问:
can't install doom-modeline package on emacs
I'm new at emacs.
I'm trying to install doom-modeline using this command

```<code>M-x package-install RET doom-modeline RET
</code>```

but it seems to not be in the package list

My init.el looks like this:

```<code>(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
                   '(("melpa" ."https://melpa.org/packages/")
                     ("elpa" . "https://elpa.gnu.org/packages/")
                     ("org" . "https://orgmode.org/elpa/")))

(unless package--initialized
    (package-initialize))

(unless package-archive-contents
    (package-refresh-contents))

;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
    (package-install 'use-package))

(require 'use-package)
(setq use-package-always-ensure t)

;; Setup use-package
(unless (package-installed-p 'use-package)
    (package-refresh-contents)
    (package-install 'use-package))
(eval-when-compile
    (require 'use-package))
(setq use-package-always-ensure t)
</code>```

What can I do?

答:
I suspect you just need to do this:

M-x package-refresh-contents RET

And then try installing it again.

Failing that, check that you don't already have it installed, as package-install doesn't offer to install the things you already have.

Body:
I'm new at emacs.
I'm trying to install doom-modeline using this command

M-x package-install RET doom-modeline RET

but it seems to not be in the package list

My init.el looks like this:

(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives
                   '(("melpa" ."https://melpa.org/packages/")
                     ("elpa" . "https://elpa.gnu.org/packages/")
                     ("org" . "https://orgmode.org/elpa/")))

(unless package--initialized
    (package-initialize))

(unless package-archive-contents
    (package-refresh-contents))

;; Initialize use-package on non-Linux platforms
(unless (package-installed-p 'use-package)
    (package-install 'use-package))

(require 'use-package)
(setq use-package-always-ensure t)

;; Setup use-package
(unless (package-installed-p 'use-package)
    (package-refresh-contents)
    (package-install 'use-package))
(eval-when-compile
    (require 'use-package))
(setq use-package-always-ensure t)

What can I do?


问:
parse string to an array in Kotlin
How can I convert a string to an array of strings in Kotlin? To demonstrate, I have this:

```<code>val input_string = "[Hello, World]"
</code>```

I would like to convert it to ["Hello", "World"].

答:
Assuming that the array elements do not contain commas, you can do:

```<code>someString.removeSurrounding("[", "]")
    .takeIf(String::isNotEmpty) // this handles the case of "[]"
    ?.split(", ")
    ?: emptyList() // in the case of "[]"
</code>```

This will give you a List<String>. If you want an Array<String>:

```<code>someString.removeSurrounding("[", "]")
    .takeIf(String::isNotEmpty)
    ?.split(", ")
    ?.toTypedArray()
    ?: emptyArray()
</code>```

Title: parse string to an array in Kotlin

Body:
How can I convert a string to an array of strings in Kotlin? To demonstrate, I have this:

val input_string = "[Hello, World]"

I would like to convert it to ["Hello", "World"].

Body:
Assuming that the array elements do not contain commas, you can do:

someString.removeSurrounding("[", "]")
    .takeIf(String::isNotEmpty) // this handles the case of "[]"
    ?.split(", ")
    ?: emptyList() // in the case of "[]"

This will give you a List<String>. If you want an Array<String>:

someString.removeSurrounding("[", "]")
    .takeIf(String::isNotEmpty)
    ?.split(", ")
    ?.toTypedArray()
    ?: emptyArray()


问:
.net desktop app installation
I am creating a  C# .Net 4.0 desktop application for a client.  When I sent him the .msi files it requires administration privileges when trying to install.  I realize the reason why is because I am installing the application into the "Program Files" directory.

Is there a way to install an application into an area on the users machine that doesn't require them to install as Administrator?

I'm using .Net 4.0

答:
I have got around the administration privileges by adding the "User's Application Data Folder" by right clicking on "File System on Target Machine" and moved all files from the "Application Folder" into it. The setup still prompts for the install directory but it is ignored. Shortcuts can still be setup as normal.

It installs to the following directory on Win7 C:\Users\username\AppData\Roaming
Under xp it goes some where under documents and settings folder.

I asked the question why does google chrome not require permission and found that it installed to a slightly different folder C:\Users\username\AppData\Local\Google\Chrome\Application.

ContentLicense: CC BY-SA 3.0

Title: .net desktop app installation


问:
.NET Core Entity Framework stored procedures
I'm trying to port a ASP.NET 4.5 application to .NET Core and I have one real issue I can't seem to figure out.

My existing application executes stored procs which return a dataset with multiple datatables. The Entity Framework can automatically map the returned fields to my entity properties but only works with the first datatable in the dataset (naturally).

So I'm just trying to figure out if its at all possible to somehow intercept the model building process and use custom code to process the dataset and look into the other datatables to set entity fields.

I know I can use the normal way of executing the stored procedure directly using the SqlConnection but I'm wondering if the Entity Framework has some way to do this already.

答:
Plain ADO.NET Code would be as follows to consume the stored procedure. By using DataAdaptor:</p>
```<code>            DataSet dataSet = null;

            using (var context = new SampleContext())
            using (var command = context.Database.GetDbConnection().CreateCommand())
            {
                command.CommandText = "GetData";
                command.CommandType = CommandType.StoredProcedure;
                context.Database.OpenConnection();
                using (SqlDataAdapter adapter = new SqlDataAdapter())
                {
                    adapter.SelectCommand = command;

                    dataSet = new DataSet();
                    adapter.Fill(dataSet);
                    return dataSet;
                }
            }
</code>```

Body:
Plain ADO.NET Code would be as follows to consume the stored procedure. By using DataAdaptor:

            DataSet dataSet = null;

            using (var context = new SampleContext())
            using (var command = context.Database.GetDbConnection().CreateCommand())
            {
                command.CommandText = "GetData";
                command.CommandType = CommandType.StoredProcedure;
                context.Database.OpenConnection();
                using (SqlDataAdapter adapter = new SqlDataAdapter())
                {
                    adapter.SelectCommand = command;

                    dataSet = new DataSet();
                    adapter.Fill(dataSet);
                    return dataSet;
                }
            }


问:
Why is my JavaFX 17 Application not building with Gluon ? Logged as JNI / Reflection problem
I am following the documentation given by Gluon : here.

To try to make it simple I'll try to go straight to the point giving the milestones I got through, and where I'm stuck.

--------- ENVIRONNEMENT :

OS : Windows 10 x64

IDE : Eclipse, Version: 2021-12 (4.22.0)

JAVA : jdk17.0.1

JAVAFX : javafx-sdk-17.0.1

GraalVM : graalvm-svm-java17-windows-gluon-22.0.0.2-Final

Gluon plugin for Eclipse : 2.8.2

Visual Studio : 1.63.2 (with all required extensions as described in document)

Wix : 3.11.2.24516

--------- CONFIGURATION

Maven : apache-maven-3.8.4

Pom : Here is an screenshot of the first part of my POM which can be found here.

Environment Variables : JAVA_HOME + GRAALVM_HOME + MAVEN_HOME

--------- DONE :

JavaFX(v17) Application :

Running perfectly with direct RUN using regular JVM.

Running perfectly with javafx:compile as proposed in Gluon's documentation

--------- PROBLEM :

Impossible to get the Gluon goal "mvn gluonfx:build" or "gluonfx:build" to complete! Here is what I do :

As instructed to do here : "If you are running on Windows, you need to run all the GluonFX goals from a x64 terminal.", I open a "x64 Native Tools Command Prompt for VS 2022"

Navigated to my project folder where the POM is.

Runned the instruction mvn gluonfx:build. I also tried to follow the instruction suggesting to "open the Run Configurations… window and update the Goal to gluonfx:build and click Run". Both leads to a FAIL ! At the end of this post is the terminal report showing :

I do run with the option mentioned --allow-incomplete-classpath.

I do find the reported 'missing' cached_scope_id in the file jniconfig-x86_64-windows.json which is exactly on the mentioned path. Here is the file if needed.

I am trying since days to turn around everything, and searched the net for some clues... But no luck until now :-(... Can anyone help me sort this out please ?

PS. I do use an external DLL (yes, Windows only, but hey : we are trying here to make a NATIVE build, thus, in Windows ;-), should be ok); This DLL is JNI attached. I tried to play around with this as well... No luck.

--------- TERMINAL REPORT :

(Full log as mentioned, here)

```<code>D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler>mvn gluonfx:build
[INFO] Scanning for projects...
[INFO]
[INFO] --< com.plpr.application:gluon-mobile---single-view-project--allow-incomplete-classpath >--
[INFO] Building Gluon Mobile - Single View Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.8:build (default-cli) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[INFO] Scanning for projects...
[INFO]
[INFO] --< com.plpr.application:gluon-mobile---single-view-project--allow-incomplete-classpath >--
[INFO] Building Gluon Mobile - Single View Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> gluonfx-maven-plugin:1.0.8:compile (default-cli) > process-classes @ gluon-mobile---single-view-project--allow-incomplete-classpath >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< gluonfx-maven-plugin:1.0.8:compile (default-cli) < process-classes @ gluon-mobile---single-view-project--allow-incomplete-classpath <<<
[INFO]
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.8:compile (default-cli) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[lun. févr. 07 15:17:25 CET 2022][INFO] ==================== COMPILE TASK ====================
             _______  ___      __   __  _______  __    _
            |       ||   |    |  | |  ||       ||  |  | |
            |    ___||   |    |  | |  ||   _   ||   |_| |
            |   | __ |   |    |  |_|  ||  | |  ||       |
            |   ||  ||   |___ |       ||  |_|  ||  _    |
            |   |_| ||       ||       ||       || | |   |
            |_______||_______||_______||_______||_|  |__|

    Access to the latest docs, tips and tricks and more info on
    how to get support? Register your usage of Gluon Substrate now at

    https://gluonhq.com/activate

[lun. févr. 07 15:17:26 CET 2022][INFO] We will now compile your code for x86_64-microsoft-windows. This may take some time.
[lun. févr. 07 15:17:28 CET 2022][INFO] [SUB] Warning: Ignoring server-mode native-image argument --no-server.
[lun. févr. 07 15:17:30 CET 2022][INFO] [SUB] ========================================================================================================================
[lun. févr. 07 15:17:30 CET 2022][INFO] [SUB] GraalVM Native Image: Generating 'com.plpr.application.gluonapplication'...
[lun. févr. 07 15:17:30 CET 2022][INFO] [SUB] ========================================================================================================================
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] [1/7] Initializing...
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]                                                                                (4,2s @ 0,16GB)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Error: Error parsing JNI configuration in D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\jniconfig-x86_64-windows.json:
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Field java.net.Inet6Address.cached_scope_id not found. To allow unresolvable reflection configuration, use option --allow-incomplete-classpath
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option JNIConfigurationFiles.
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] com.oracle.svm.core.util.UserError$UserException: Error parsing JNI configuration in D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\jniconfig-x86_64-windows.json:
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Field java.net.Inet6Address.cached_scope_id not found. To allow unresolvable reflection configuration, use option --allow-incomplete-classpath
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option JNIConfigurationFiles.
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.core.util.UserError.abort(UserError.java:73)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.config.ConfigurationParserUtils.doParseAndRegister(ConfigurationParserUtils.java:135)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.config.ConfigurationParserUtils.lambda$parseAndRegisterConfigurations$1(ConfigurationParserUtils.java:86)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReferencePipeline$4$1.accept(ReferencePipeline.java:214)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.IntPipeline.reduce(IntPipeline.java:515)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.IntPipeline.sum(IntPipeline.java:473)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.config.ConfigurationParserUtils.parseAndRegisterConfigurations(ConfigurationParserUtils.java:88)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.jni.access.JNIAccessFeature.afterRegistration(JNIAccessFeature.java:128)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.lambda$setupNativeImage$14(NativeImageGenerator.java:802)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:74)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:802)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:534)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]                          0,1s (3,0% of total time) in 8 GCs | Peak RSS: 0,85GB | CPU load: 5,50
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Produced artifacts:
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]  D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\Gluon Mobile - Single View Project\com.plpr.application.gluonapplication.build_artifacts.txt
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] ========================================================================================================================
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Failed generating 'com.plpr.application.gluonapplication' after 2,3s.
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Error: Image build request failed with exit status 1
[lun. févr. 07 15:17:31 CET 2022][SEVERE] Process compile failed with result: 1
Check the log files under D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\log
And please check https://docs.gluonhq.com/ for more information.
[lun. févr. 07 15:17:31 CET 2022][INFO] Logging process [compile] to file: D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\log\process-compile-1644243451215.log
[lun. févr. 07 15:17:31 CET 2022][SEVERE] Compiling failed.
Check the log files under D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\log
And please check https://docs.gluonhq.com/ for more information.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.934 s
[INFO] Finished at: 2022-02-07T15:17:31+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.8:compile (default-cli) on project gluon-mobile---single-view-project--allow-incomplete-classpath: Compiling failed -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.723 s
[INFO] Finished at: 2022-02-07T15:17:31+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.8:build (default-cli) on project gluon-mobile---single-view-project--allow-incomplete-classpath: Error, gluonfx:build failed -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
</code>```

答:
José Pereda, which has an amazing 'Coding Blog' here, spotted that my plugin version was outdated.

He pointed out that there are 2 plugins used in the development process :

The IDE one, in my case Eclipse, which the latest as of 2022.02.08, is 2.8.2.

The 'POM' one, which was set by default to 1.0.8, and I had to set as 1.0.12.

That solved the problem described in my question. Here is a screenshot of the updated POM, which can be found here :

Another issue I found was my custom argument --allow-incomplete-classpath for the native build was set incorrectly. It has to be set in the 'POM' in the plugin/configuration section as follows (same POM referenced already) :

These 2 modifications allowed me to have a completed build, and my 'exe' file was created !

Body:
I am following the documentation given by Gluon : here.

To try to make it simple I'll try to go straight to the point giving the milestones I got through, and where I'm stuck.

--------- ENVIRONNEMENT :

OS : Windows 10 x64

IDE : Eclipse, Version: 2021-12 (4.22.0)

JAVA : jdk17.0.1

JAVAFX : javafx-sdk-17.0.1

GraalVM : graalvm-svm-java17-windows-gluon-22.0.0.2-Final

Gluon plugin for Eclipse : 2.8.2

Visual Studio : 1.63.2 (with all required extensions as described in document)

Wix : 3.11.2.24516

--------- CONFIGURATION

Maven : apache-maven-3.8.4

Pom : Here is an screenshot of the first part of my POM which can be found here.

Environment Variables : JAVA_HOME + GRAALVM_HOME + MAVEN_HOME

--------- DONE :

JavaFX(v17) Application :

Running perfectly with direct RUN using regular JVM.

Running perfectly with javafx:compile as proposed in Gluon's documentation

--------- PROBLEM :

Impossible to get the Gluon goal "mvn gluonfx:build" or "gluonfx:build" to complete! Here is what I do :

As instructed to do here : "If you are running on Windows, you need to run all the GluonFX goals from a x64 terminal.", I open a "x64 Native Tools Command Prompt for VS 2022"

Navigated to my project folder where the POM is.

Runned the instruction mvn gluonfx:build. I also tried to follow the instruction suggesting to "open the Run Configurations… window and update the Goal to gluonfx:build and click Run". Both leads to a FAIL ! At the end of this post is the terminal report showing :

I do run with the option mentioned --allow-incomplete-classpath.

I do find the reported 'missing' cached_scope_id in the file jniconfig-x86_64-windows.json which is exactly on the mentioned path. Here is the file if needed.

I am trying since days to turn around everything, and searched the net for some clues... But no luck until now :-(... Can anyone help me sort this out please ?

PS. I do use an external DLL (yes, Windows only, but hey : we are trying here to make a NATIVE build, thus, in Windows ;-), should be ok); This DLL is JNI attached. I tried to play around with this as well... No luck.

--------- TERMINAL REPORT :

(Full log as mentioned, here)

D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler>mvn gluonfx:build
[INFO] Scanning for projects...
[INFO]
[INFO] --< com.plpr.application:gluon-mobile---single-view-project--allow-incomplete-classpath >--
[INFO] Building Gluon Mobile - Single View Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.8:build (default-cli) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[INFO] Scanning for projects...
[INFO]
[INFO] --< com.plpr.application:gluon-mobile---single-view-project--allow-incomplete-classpath >--
[INFO] Building Gluon Mobile - Single View Project 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] >>> gluonfx-maven-plugin:1.0.8:compile (default-cli) > process-classes @ gluon-mobile---single-view-project--allow-incomplete-classpath >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< gluonfx-maven-plugin:1.0.8:compile (default-cli) < process-classes @ gluon-mobile---single-view-project--allow-incomplete-classpath <<<
[INFO]
[INFO]
[INFO] --- gluonfx-maven-plugin:1.0.8:compile (default-cli) @ gluon-mobile---single-view-project--allow-incomplete-classpath ---
[lun. févr. 07 15:17:25 CET 2022][INFO] ==================== COMPILE TASK ====================
             _______  ___      __   __  _______  __    _
            |       ||   |    |  | |  ||       ||  |  | |
            |    ___||   |    |  | |  ||   _   ||   |_| |
            |   | __ |   |    |  |_|  ||  | |  ||       |
            |   ||  ||   |___ |       ||  |_|  ||  _    |
            |   |_| ||       ||       ||       || | |   |
            |_______||_______||_______||_______||_|  |__|

    Access to the latest docs, tips and tricks and more info on
    how to get support? Register your usage of Gluon Substrate now at

    https://gluonhq.com/activate

[lun. févr. 07 15:17:26 CET 2022][INFO] We will now compile your code for x86_64-microsoft-windows. This may take some time.
[lun. févr. 07 15:17:28 CET 2022][INFO] [SUB] Warning: Ignoring server-mode native-image argument --no-server.
[lun. févr. 07 15:17:30 CET 2022][INFO] [SUB] ========================================================================================================================
[lun. févr. 07 15:17:30 CET 2022][INFO] [SUB] GraalVM Native Image: Generating 'com.plpr.application.gluonapplication'...
[lun. févr. 07 15:17:30 CET 2022][INFO] [SUB] ========================================================================================================================
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] [1/7] Initializing...
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]                                                                                (4,2s @ 0,16GB)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Error: Error parsing JNI configuration in D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\jniconfig-x86_64-windows.json:
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Field java.net.Inet6Address.cached_scope_id not found. To allow unresolvable reflection configuration, use option --allow-incomplete-classpath
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option JNIConfigurationFiles.
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] com.oracle.svm.core.util.UserError$UserException: Error parsing JNI configuration in D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\jniconfig-x86_64-windows.json:
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Field java.net.Inet6Address.cached_scope_id not found. To allow unresolvable reflection configuration, use option --allow-incomplete-classpath
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Verify that the configuration matches the schema described in the -H:PrintFlags=+ output for option JNIConfigurationFiles.
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.core.util.UserError.abort(UserError.java:73)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.config.ConfigurationParserUtils.doParseAndRegister(ConfigurationParserUtils.java:135)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.config.ConfigurationParserUtils.lambda$parseAndRegisterConfigurations$1(ConfigurationParserUtils.java:86)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReferencePipeline$4$1.accept(ReferencePipeline.java:214)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.IntPipeline.reduce(IntPipeline.java:515)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at java.base/java.util.stream.IntPipeline.sum(IntPipeline.java:473)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.config.ConfigurationParserUtils.parseAndRegisterConfigurations(ConfigurationParserUtils.java:88)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.jni.access.JNIAccessFeature.afterRegistration(JNIAccessFeature.java:128)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.lambda$setupNativeImage$14(NativeImageGenerator.java:802)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:74)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:802)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:534)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]   at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]                          0,1s (3,0% of total time) in 8 GCs | Peak RSS: 0,85GB | CPU load: 5,50
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] ------------------------------------------------------------------------------------------------------------------------
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Produced artifacts:
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB]  D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\Gluon Mobile - Single View Project\com.plpr.application.gluonapplication.build_artifacts.txt
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] ========================================================================================================================
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Failed generating 'com.plpr.application.gluonapplication' after 2,3s.
[lun. févr. 07 15:17:31 CET 2022][INFO] [SUB] Error: Image build request failed with exit status 1
[lun. févr. 07 15:17:31 CET 2022][SEVERE] Process compile failed with result: 1
Check the log files under D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\log
And please check https://docs.gluonhq.com/ for more information.
[lun. févr. 07 15:17:31 CET 2022][INFO] Logging process [compile] to file: D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\log\process-compile-1644243451215.log
[lun. févr. 07 15:17:31 CET 2022][SEVERE] Compiling failed.
Check the log files under D:\_DEV\_Eclipse_IDE\_Workspaces\PRIVATE\GluonMobile_PlaylistProfiler\target\gluonfx\x86_64-windows\gvm\log
And please check https://docs.gluonhq.com/ for more information.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  6.934 s
[INFO] Finished at: 2022-02-07T15:17:31+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.8:compile (default-cli) on project gluon-mobile---single-view-project--allow-incomplete-classpath: Compiling failed -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.723 s
[INFO] Finished at: 2022-02-07T15:17:31+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.gluonhq:gluonfx-maven-plugin:1.0.8:build (default-cli) on project gluon-mobile---single-view-project--allow-incomplete-classpath: Error, gluonfx:build failed -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


问:
Spring Boot App connection to Kafka with SSL
I have simple Spring Boot App and Kafka with working SSL connection (other apps, not Spring Boot, have successful connection).
I haven't access to kafka brokers properties.
My app is a client for kafka. And this app running in container inside kubernetes. My spring boot have access to keystore.p12, ca-cert, kafka.pem, kafka.key files (it's in directory inside container).

In configuration I use

```<code>spring.kafka.security.protocol=SSL
spring.kafka.ssl.protocol=SSL
spring.kafka.ssl.key-store-type=PKCS12
spring.kafka.ssl.key-store-location=file:///path/to/keystore.p12
spring.kafka.ssl.key-store-password=password
spring.kafka.ssl.trust-store-type=PKCS12
spring.kafka.ssl.trust-store-location=file:///path/to/keystore.p12 (it's the same file, and I think it's incorrect)
spring.kafka.ssl.trust-store-password=password

spring.kafka.properties.ssl.endpoint.identification.algorithm=
spring.kafka.enable.ssl.certificate.verification=false
</code>```

Everytime I receive ERROR

```<code>org.apache.kafka.common.errors.SslAuthenticationException: SSL handshake failed
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[?:?]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:349) ~[?:?]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:292) ~[?:?]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:287) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[?:?]
    at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
    at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
    at org.apache.kafka.common.network.SslTransportLayer.runDelegatedTasks(SslTransportLayer.java:430) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshakeUnwrap(SslTransportLayer.java:514) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.doHandshake(SslTransportLayer.java:368) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshake(SslTransportLayer.java:291) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:178) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.poll(Selector.java:481) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:551) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1389) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1320) [kafka-clients-3.0.0.jar!/:?]
    at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439) ~[?:?]
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[?:?]
    at sun.security.validator.Validator.validate(Validator.java:264) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:276) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:632) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[?:?]
    at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
    at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
    at org.apache.kafka.common.network.SslTransportLayer.runDelegatedTasks(SslTransportLayer.java:430) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshakeUnwrap(SslTransportLayer.java:514) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.doHandshake(SslTransportLayer.java:368) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshake(SslTransportLayer.java:291) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:178) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.poll(Selector.java:481) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:551) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1389) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1320) ~[kafka-clients-3.0.0.jar!/:?]
    at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[?:?]
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[?:?]
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) ~[?:?]
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434) ~[?:?]
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[?:?]
    at sun.security.validator.Validator.validate(Validator.java:264) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:276) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:632) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[?:?]
    at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
    at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
    at org.apache.kafka.common.network.SslTransportLayer.runDelegatedTasks(SslTransportLayer.java:430) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshakeUnwrap(SslTransportLayer.java:514) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.doHandshake(SslTransportLayer.java:368) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshake(SslTransportLayer.java:291) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:178) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.poll(Selector.java:481) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:551) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1389) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1320) ~[kafka-clients-3.0.0.jar!/:?]
    at java.lang.Thread.run(Thread.java:829) ~[?:?]
</code>```

I try different variations: only key store, only trust store, delete last two properties in config (endpoint.identification.algorithm and certificate.verification). Should I try to create truststore and import the certificates I have in container? I don't understand the right way for this.What is the right configuration and right way to use certificates I have?

答:
The problem was with wrong syntax of properties.
The right way to do it

```<code>spring.kafka.properties.ssl.keystore.type=PKCS12
spring.kafka.properties.ssl.keystore.location=/path/to/keystore.p12
spring.kafka.properties.ssl.keystore.password=password
spring.kafka.properties.ssl.truststore.type=PKCS12
spring.kafka.properties.ssl.truststore.location=/path/to/keystore.p12 (it's the same file, it's correct!!)
spring.kafka.properties.ssl.truststore.password=password
</code>```

And yes, it's absolutely acceptable to use the same p12 file both keystore and truststore.

Body:
I have simple Spring Boot App and Kafka with working SSL connection (other apps, not Spring Boot, have successful connection).
I haven't access to kafka brokers properties.
My app is a client for kafka. And this app running in container inside kubernetes. My spring boot have access to keystore.p12, ca-cert, kafka.pem, kafka.key files (it's in directory inside container).

In configuration I use

spring.kafka.security.protocol=SSL
spring.kafka.ssl.protocol=SSL
spring.kafka.ssl.key-store-type=PKCS12
spring.kafka.ssl.key-store-location=file:///path/to/keystore.p12
spring.kafka.ssl.key-store-password=password
spring.kafka.ssl.trust-store-type=PKCS12
spring.kafka.ssl.trust-store-location=file:///path/to/keystore.p12 (it's the same file, and I think it's incorrect)
spring.kafka.ssl.trust-store-password=password

spring.kafka.properties.ssl.endpoint.identification.algorithm=
spring.kafka.enable.ssl.certificate.verification=false

Everytime I receive ERROR

org.apache.kafka.common.errors.SslAuthenticationException: SSL handshake failed
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[?:?]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:349) ~[?:?]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:292) ~[?:?]
    at sun.security.ssl.TransportContext.fatal(TransportContext.java:287) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:654) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[?:?]
    at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
    at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
    at org.apache.kafka.common.network.SslTransportLayer.runDelegatedTasks(SslTransportLayer.java:430) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshakeUnwrap(SslTransportLayer.java:514) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.doHandshake(SslTransportLayer.java:368) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshake(SslTransportLayer.java:291) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:178) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.poll(Selector.java:481) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:551) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1389) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1320) [kafka-clients-3.0.0.jar!/:?]
    at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439) ~[?:?]
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[?:?]
    at sun.security.validator.Validator.validate(Validator.java:264) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:276) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:632) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[?:?]
    at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
    at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
    at org.apache.kafka.common.network.SslTransportLayer.runDelegatedTasks(SslTransportLayer.java:430) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshakeUnwrap(SslTransportLayer.java:514) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.doHandshake(SslTransportLayer.java:368) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshake(SslTransportLayer.java:291) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:178) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.poll(Selector.java:481) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:551) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1389) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1320) ~[kafka-clients-3.0.0.jar!/:?]
    at java.lang.Thread.run(Thread.java:829) ~[?:?]
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[?:?]
    at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[?:?]
    at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) ~[?:?]
    at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434) ~[?:?]
    at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[?:?]
    at sun.security.validator.Validator.validate(Validator.java:264) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:276) ~[?:?]
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:141) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:632) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[?:?]
    at sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[?:?]
    at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392) ~[?:?]
    at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1074) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1061) ~[?:?]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
    at sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1008) ~[?:?]
    at org.apache.kafka.common.network.SslTransportLayer.runDelegatedTasks(SslTransportLayer.java:430) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshakeUnwrap(SslTransportLayer.java:514) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.doHandshake(SslTransportLayer.java:368) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.SslTransportLayer.handshake(SslTransportLayer.java:291) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:178) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:543) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.common.network.Selector.poll(Selector.java:481) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:551) [kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1389) ~[kafka-clients-3.0.0.jar!/:?]
    at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1320) ~[kafka-clients-3.0.0.jar!/:?]
    at java.lang.Thread.run(Thread.java:829) ~[?:?]

I try different variations: only key store, only trust store, delete last two properties in config (endpoint.identification.algorithm and certificate.verification). Should I try to create truststore and import the certificates I have in container? I don't understand the right way for this.What is the right configuration and right way to use certificates I have?

Body:
The problem was with wrong syntax of properties.
The right way to do it

spring.kafka.properties.ssl.keystore.type=PKCS12
spring.kafka.properties.ssl.keystore.location=/path/to/keystore.p12
spring.kafka.properties.ssl.keystore.password=password
spring.kafka.properties.ssl.truststore.type=PKCS12
spring.kafka.properties.ssl.truststore.location=/path/to/keystore.p12 (it's the same file, it's correct!!)
spring.kafka.properties.ssl.truststore.password=password

And yes, it's absolutely acceptable to use the same p12 file both keystore and truststore.


问:
Twitter API throws error : 'API' object has no attribute 'search'
The following code I wrote was intended to retweet tweets with  #programming. But, anything I run the code I get an error "search" object is not an attribute of the Twitter API. The error is posted below the code. Thanks

```<code>import tweepy
import time

# get api code and password(secret)
comsumers_key = '#########'
comsumers_secret = '######'

token_key = '#########'
token_secret = '###########'

auth = tweepy.OAuthHandler(comsumers_key,comsumers_secret)
auth.set_access_token(token_key, token_secret)

api = tweepy.API(auth)

hashtag = "programming"
tweetNum = 20
tweets = tweepy.Cursor(api.search, hashtag).items(tweetNum)

def bot1():
    for tweet in tweets:
        try:
            tweet.retweet()
            print("retweet")
            time.sleep(50)
        except tweepy.TweepError as e:
            print(e.reason)
            time.strftime(20)
bot1()

</code>```

error:

```<code>Traceback (most recent call last):
  File "/Users/sonter/tweetbot/bot1.py", line 48, in <module>
    tweets = tweepy.Cursor(api.search, hashtag).items(tweetNum)
AttributeError: 'API' object has no attribute 'search'
</code>```

答:
The Cursor expects a regular api method, but looking at its reference doc there is no search only, but :

search_30_day

search_full_archive

search_tweets

search_users

search_geo

Maybe you meant one of them ?

Body:
The following code I wrote was intended to retweet tweets with  #programming. But, anything I run the code I get an error "search" object is not an attribute of the Twitter API. The error is posted below the code. Thanks

import tweepy
import time

# get api code and password(secret)
comsumers_key = '#########'
comsumers_secret = '######'

token_key = '#########'
token_secret = '###########'

auth = tweepy.OAuthHandler(comsumers_key,comsumers_secret)
auth.set_access_token(token_key, token_secret)

api = tweepy.API(auth)

hashtag = "programming"
tweetNum = 20
tweets = tweepy.Cursor(api.search, hashtag).items(tweetNum)

def bot1():
    for tweet in tweets:
        try:
            tweet.retweet()
            print("retweet")
            time.sleep(50)
        except tweepy.TweepError as e:
            print(e.reason)
            time.strftime(20)
bot1()

error:

Traceback (most recent call last):
  File "/Users/sonter/tweetbot/bot1.py", line 48, in <module>
    tweets = tweepy.Cursor(api.search, hashtag).items(tweetNum)
AttributeError: 'API' object has no attribute 'search'


问:
Is there any Excel function that can copy column's (first row's) name if the value matches?
I can't figure out a function that would automatically copy the first row value if the value on another rows matches 1. I would need the red dates to be automated.

Any advice would be very appreciated, thank you!

Excel problem

答:
You can do it with

```<code>=INDIRECT(ADDRESS(1; MATCH(1;E2:ZZ2)+4))
</code>```

The inner MATCH searched for "1" in the given array (from E2 to ZZ2). The "+4" is there, because you are beginning to search in column E (=5) and MATCH returns the column within your array.

The ADDRESS takes the first row and the column found by MATCH.

The INDIRECT returns the value of the given ADDRESS.

If you copy this formula down the rows, the search array (E2:ZZ2) is automatically adjusted to search the corresponding row.

Body:
You can do it with

=INDIRECT(ADDRESS(1; MATCH(1;E2:ZZ2)+4))

The inner MATCH searched for "1" in the given array (from E2 to ZZ2). The "+4" is there, because you are beginning to search in column E (=5) and MATCH returns the column within your array.

The ADDRESS takes the first row and the column found by MATCH.

The INDIRECT returns the value of the given ADDRESS.

If you copy this formula down the rows, the search array (E2:ZZ2) is automatically adjusted to search the corresponding row.


问:
React find 3 highest values in an array
Hello I have been trying to find the highest value in my constantly changing array. What I need is to have an array that changes acording to input (which I have) and a table that shows the  three highest values of that array and changes along with the array values. I used the Math.max, but I always get NaN as my answer.
This is my code:

```<code>   const array = [
    Weighted1,
    Weighted2,
    Weighted3,
    Weighted4,
    Weighted5,
    Weighted6,
    Weighted7,
    Weighted8,
    Weighted9,
    Weighted10,
    Weighted11,
    Weighted12,
  ];

  const [First, setFirst] = useState("");
  const [Second, setSecond] = useState("");
  const [Third, setThird] = useState("");

  /*
  useEffect(() => {
    setFirst(Math.max(array));
  }, [array]);
  useEffect(() => {
    setSecond(array.splice(array.indexOf(one), 1), Math.max(array));
  }, [array, one]);
  useEffect(() => {
    setThird(array.splice(array.indexOf(Second), 1));
  }, [array, Second]);
*/
</code>```

Mytable has these two tipes of values, one is the weighted (all those zeros) and the other is the names I want to be displayed depending on the weighted next to it.
enter image description here

答:
You can use your useEffect() to listens to the changing input and sort the array via: Array.sort(). After this you can set your use last 3 items in that array as your values.

```<code>  useEffect(() => {
    const sortedArray = yourInputArray.sort();
    setFirst(sortedArray[sortedArray.length - 1])
    setSecond(sortedArray[sortedArray.length - 2])
    setThird(sortedArray[sortedArray.length - 3])
  }, [yourInputArray]);
</code>```

A better approach would be storing your input values as a sorted array and using that directly in the component.

```<code>const [sortedArray, setSortedArray] = useState();

useEffect(() => {
  setSortedArray(yourInputArray.sort());
}, [yourInputArray]);

{sortedArray && (
  <>
    <p>1: {sortedArray[sortedArray.length - 1]}</p>
    <p>2: {sortedArray[sortedArray.length - 2]}</p>
    <p>3: {sortedArray[sortedArray.length - 3]}</p>
  <>
)}
</code>```

Title: React find 3 highest values in an array

Body:
Hello I have been trying to find the highest value in my constantly changing array. What I need is to have an array that changes acording to input (which I have) and a table that shows the  three highest values of that array and changes along with the array values. I used the Math.max, but I always get NaN as my answer.
This is my code:

   const array = [
    Weighted1,
    Weighted2,
    Weighted3,
    Weighted4,
    Weighted5,
    Weighted6,
    Weighted7,
    Weighted8,
    Weighted9,
    Weighted10,
    Weighted11,
    Weighted12,
  ];

  const [First, setFirst] = useState("");
  const [Second, setSecond] = useState("");
  const [Third, setThird] = useState("");

  /*
  useEffect(() => {
    setFirst(Math.max(array));
  }, [array]);
  useEffect(() => {
    setSecond(array.splice(array.indexOf(one), 1), Math.max(array));
  }, [array, one]);
  useEffect(() => {
    setThird(array.splice(array.indexOf(Second), 1));
  }, [array, Second]);
*/

Mytable has these two tipes of values, one is the weighted (all those zeros) and the other is the names I want to be displayed depending on the weighted next to it.
enter image description here

Body:
You can use your useEffect() to listens to the changing input and sort the array via: Array.sort(). After this you can set your use last 3 items in that array as your values.

  useEffect(() => {
    const sortedArray = yourInputArray.sort();
    setFirst(sortedArray[sortedArray.length - 1])
    setSecond(sortedArray[sortedArray.length - 2])
    setThird(sortedArray[sortedArray.length - 3])
  }, [yourInputArray]);

A better approach would be storing your input values as a sorted array and using that directly in the component.

const [sortedArray, setSortedArray] = useState();

useEffect(() => {
  setSortedArray(yourInputArray.sort());
}, [yourInputArray]);

{sortedArray && (
  <>
    <p>1: {sortedArray[sortedArray.length - 1]}</p>
    <p>2: {sortedArray[sortedArray.length - 2]}</p>
    <p>3: {sortedArray[sortedArray.length - 3]}</p>
  <>
)}


问:
MySQL: Extract all Keys from a nested JSON String
In addition to this answer is it possible to extract nested keys in a simple way?
Example:

```<code>{
  "a": value,
  "b": {
    "c": value
    "d": {
      "e": value
   }
  }
}
</code>```

Expected output: ['a', 'b.c', 'b.d.e']
What I have tried:

```<code> SELECT
 f.`id` AS `field_name`

 FROM table t,
    JSON_TABLE(
         JSON_KEYS(t.`column`, '$.b'),
         '$[*]' COLUMNS(
           `id` VARCHAR(191) PATH '$'
         )
     ) AS t
</code>```

but that would only show me one of the nested keys and skip the outer

Body:
In addition to this answer is it possible to extract nested keys in a simple way?
Example:

{
  "a": value,
  "b": {
    "c": value
    "d": {
      "e": value
   }
  }
}

Expected output: ['a', 'b.c', 'b.d.e']
What I have tried:

 SELECT
 f.`id` AS `field_name`

 FROM table t,
    JSON_TABLE(
         JSON_KEYS(t.`column`, '$.b'),
         '$[*]' COLUMNS(
           `id` VARCHAR(191) PATH '$'
         )
     ) AS t

but that would only show me one of the nested keys and skip the outer

Body:
SELECT JSON_SEARCH(val, 'all', 'value') result
FROM test;

| result                      |
| :-------------------------- |
| ["$.a", "$.b.c", "$.b.d.e"] |

db<>fiddle here


问:
How to use facebook signup and login or connect into my asp.net site?
can any one give me a best example site URL to using how to use facebook connect or facebook signup into my site or facebook login with asp.net site?

actually my requirement is that when i registered into my asp.net site by using facebook at that time we want to get facebook user's username (emailid) from facebook and firstname and last name also with user image.

答:
You can do this with the Javascript SDK on your web page.

The following solution uses the xocialCore plugin available here.  You can actually just extract the first two functions from this plugin as they provide the necessary functions for this.

https://github.com/xocialhost/jquery.xocialCore.js/blob/master/jquery.xocialCore.js

First you'll need to create and configure a facebook application.  Make sure you fill in the website information with your URL/Domain.

On your registration page make sure you've included jQuery and then the above plugin.

Create a button on your page like:

```<code><button id="fbLoginButton">Login</button>
</code>```

and then implement the following code:

```<code>$.xcInitFacebook({appId:'yourFBappId',callback:function(){

   $('#fbLoginButton').click(function(event){

      event.preventDefault();

      $.xcFbLogin({permissions:'manage_pages, offline_access, email',callback:function(){

            FB.getLoginStatus(function(response) {

                var fbUrl='https://graph.facebook.com/'+response.authResponse.userID+
                          '?fields=email,first_name,last_name,picture'+
                           '&access_token='+response.authResponse.accessToken;

        $.getJSON(fbUrl,function(data){
                     //Pass the return data information to your Registration/Login system
                });

            });

      } });

   });

} });
</code>```

The response back from the Facebook server should be something like:

```<code>{
 "email": "emailid\u0040domain.com",
 "first_name": "fName",
 "last_name": "lName",
 "id": "12345",
 "picture": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/49860_12345_8441_q.jpg"
}
</code>```

You'd obviously want to take this farther where you'd check to see if the user was already logged in and then show the login button or not but this should get you the requested user info.

Body:
You can do this with the Javascript SDK on your web page.

The following solution uses the xocialCore plugin available here.  You can actually just extract the first two functions from this plugin as they provide the necessary functions for this.

https://github.com/xocialhost/jquery.xocialCore.js/blob/master/jquery.xocialCore.js

First you'll need to create and configure a facebook application.  Make sure you fill in the website information with your URL/Domain.

On your registration page make sure you've included jQuery and then the above plugin.

Create a button on your page like:

<button id="fbLoginButton">Login</button>

and then implement the following code:

$.xcInitFacebook({appId:'yourFBappId',callback:function(){

   $('#fbLoginButton').click(function(event){

      event.preventDefault();

      $.xcFbLogin({permissions:'manage_pages, offline_access, email',callback:function(){

            FB.getLoginStatus(function(response) {

                var fbUrl='https://graph.facebook.com/'+response.authResponse.userID+
                          '?fields=email,first_name,last_name,picture'+
                           '&access_token='+response.authResponse.accessToken;

        $.getJSON(fbUrl,function(data){
                     //Pass the return data information to your Registration/Login system
                });

            });

      } });

   });

} });

The response back from the Facebook server should be something like:

{
 "email": "emailid\u0040domain.com",
 "first_name": "fName",
 "last_name": "lName",
 "id": "12345",
 "picture": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/49860_12345_8441_q.jpg"
}

You'd obviously want to take this farther where you'd check to see if the user was already logged in and then show the login button or not but this should get you the requested user info.


问:
How do I remove the CS0649 compiler warning when I add a custom attribute?
Goal: To remove the compiler warning 'CS0649' (field is never assigned to) when I use my custom attribute.

I have a custom attribute (code below is just examples):

```<code>[AttributeUsage(AttributeTargets.Field)]
public class MyCustomAttribute : Attribute { }
</code>```

I then use that attribute on a field:

```<code>[MyCustom]
private readonly SomeType someType;
</code>```

My application will auto fill someType with a value so we don't need to worry about initializing it.

I will still get a squiggly line in Visual Studio under someType and the warning message "Field "someType" is never assigned to, and will always have it's default value null."

Is there an attribute or other means that I can add to MyCustomAttribute that will remove this compiler warning?

NOTE: I do not want to have to modify the field or type the field is within further.  I simply want to add the attribute and the warning go away.

答:
In case you are using Rider or Resharper, you can use MeansImplicitUseAttribute on your custom attribute:</p>
```<code>[MeansImplicitUse(ImplicitUseKindFlags.Assign)]
[AttributeUsage(AttributeTargets.Field)]
public class MyCustomAttribute : Attribute { }
</code>```

Body:
Goal: To remove the compiler warning 'CS0649' (field is never assigned to) when I use my custom attribute.

I have a custom attribute (code below is just examples):

[AttributeUsage(AttributeTargets.Field)]
public class MyCustomAttribute : Attribute { }

I then use that attribute on a field:

[MyCustom]
private readonly SomeType someType;

My application will auto fill someType with a value so we don't need to worry about initializing it.

I will still get a squiggly line in Visual Studio under someType and the warning message "Field "someType" is never assigned to, and will always have it's default value null."

Is there an attribute or other means that I can add to MyCustomAttribute that will remove this compiler warning?

NOTE: I do not want to have to modify the field or type the field is within further.  I simply want to add the attribute and the warning go away.

Body:
In case you are using Rider or Resharper, you can use MeansImplicitUseAttribute on your custom attribute:

[MeansImplicitUse(ImplicitUseKindFlags.Assign)]
[AttributeUsage(AttributeTargets.Field)]
public class MyCustomAttribute : Attribute { }