问:
How to invoke an action in different controller from another controller
I've got a new ASP.NET MVC app I wrote using .NET 4.6.2. It's a simple app, just 1 page. However, a user had a problem today, so I started by trying to the values of the Message from the Exception object to use the Err.cshtml file in the Shared folder and Error controller. However, I've not used that before and a page I found to help with this doesn't take parameters passed it it. https://www.c-sharpcorner.com/UploadFile/618722/custom-error-page-in-Asp-Net-mvc/#:~:text=Custom%20Error%20Page%20in%20ASP.NET%20MVC%201%20First,an%20%5BHandleError%5D%20attribute%20to%20the%20Targeted%20Action%20Method.

So, then I thought I'd try creating another Error.cshtml file in the Error folder under Views, hoping it would still use the Error controller. However, that resulted in several other errors, depending upon how I specified the call to the RedirectToAction() method. If I specify the call like this: return RedirectToAction("Index", "Error", errText);, then it gives me a complains by giving me a HTTP 404 error. I really thought that would work, because the action name in the controller is Index. So, I tried using return RedirectToAction("Error", "Error", errText);, but that gives me a slightly different HTTP 404 errror.

I've searched for answers to this, but I either only find results of calling from one view to a controller or using ASP.NET Core. (I wish I could, but I cannot.) To complicate my problems, I cannot get to some of the results from my search because the results are on GitHub. And my employer is blocking GitHub.

Here's the code in my HomeController, which I'm having difficulties with:

        public ActionResult Index(SuggestedText suggestedText)
        {
            try
            {
                SendAnonymously.SuggestedTextToEmail(suggestedText.SuggestionToBeEmailed);
            }
            catch (Exception ex)
            {
                var errText = new ErrorText();
                errText.TextToDisplay = SendAnonymously.ReturnExceptions(ex);
                //return View("../Shared/Error", errText);
                return RedirectToAction("Index", "Error", errText);
            }

            return View(suggestedText);
        }
```
<p>The ErrorText class is very simple:</p>
<pre class="lang-cs prettyprint-override"><code>public class ErrorText
{
    public string TextToDisplay { get; set; }
}
</code>```

答:
You can use TempData in your case when you are doing a redirect to your Error view:

```<code>public ActionResult Index(SuggestedText suggestedText)
{
    try
    {
        SendAnonymously.SuggestedTextToEmail(suggestedText.SuggestionToBeEmailed);
    }
    catch (Exception ex)
    {
        var errText = new ErrorText();
        errText.TextToDisplay = SendAnonymously.ReturnExceptions(ex);
        //return View("../Shared/Error", errText);
        TempData["ErrorText"] = errText;
        //Redirect to Error view under Error Controller
        return RedirectToAction("Error", "Error");
    }

    return View(suggestedText);
}
</code>```

And then you can retrieve this value in Error method like this:

```<code>public ActionResult Error()
{
  ErrorText errText=new ErrorText();
  if(TempData["ErrorText"] !=null)
  {
     errText=TempData["ErrorText"] as ErrorText
  }

  return View(errText)
}
</code>```

Body:
I've got a new ASP.NET MVC app I wrote using .NET 4.6.2. It's a simple app, just 1 page. However, a user had a problem today, so I started by trying to the values of the Message from the Exception object to use the Err.cshtml file in the Shared folder and Error controller. However, I've not used that before and a page I found to help with this doesn't take parameters passed it it. https://www.c-sharpcorner.com/UploadFile/618722/custom-error-page-in-Asp-Net-mvc/#:~:text=Custom%20Error%20Page%20in%20ASP.NET%20MVC%201%20First,an%20%5BHandleError%5D%20attribute%20to%20the%20Targeted%20Action%20Method.

So, then I thought I'd try creating another Error.cshtml file in the Error folder under Views, hoping it would still use the Error controller. However, that resulted in several other errors, depending upon how I specified the call to the RedirectToAction() method. If I specify the call like this: return RedirectToAction("Index", "Error", errText);, then it gives me a complains by giving me a HTTP 404 error. I really thought that would work, because the action name in the controller is Index. So, I tried using return RedirectToAction("Error", "Error", errText);, but that gives me a slightly different HTTP 404 errror.

I've searched for answers to this, but I either only find results of calling from one view to a controller or using ASP.NET Core. (I wish I could, but I cannot.) To complicate my problems, I cannot get to some of the results from my search because the results are on GitHub. And my employer is blocking GitHub.

Here's the code in my HomeController, which I'm having difficulties with:

        public ActionResult Index(SuggestedText suggestedText)
        {
            try
            {
                SendAnonymously.SuggestedTextToEmail(suggestedText.SuggestionToBeEmailed);
            }
            catch (Exception ex)
            {
                var errText = new ErrorText();
                errText.TextToDisplay = SendAnonymously.ReturnExceptions(ex);
                //return View("../Shared/Error", errText);
                return RedirectToAction("Index", "Error", errText);
            }

            return View(suggestedText);
        }

The ErrorText class is very simple:

public class ErrorText
{
    public string TextToDisplay { get; set; }
}

Body:
You can use TempData in your case when you are doing a redirect to your Error view:

public ActionResult Index(SuggestedText suggestedText)
{
    try
    {
        SendAnonymously.SuggestedTextToEmail(suggestedText.SuggestionToBeEmailed);
    }
    catch (Exception ex)
    {
        var errText = new ErrorText();
        errText.TextToDisplay = SendAnonymously.ReturnExceptions(ex);
        //return View("../Shared/Error", errText);
        TempData["ErrorText"] = errText;
        //Redirect to Error view under Error Controller
        return RedirectToAction("Error", "Error");
    }

    return View(suggestedText);
}

And then you can retrieve this value in Error method like this:

public ActionResult Error()
{
  ErrorText errText=new ErrorText();
  if(TempData["ErrorText"] !=null)
  {
     errText=TempData["ErrorText"] as ErrorText
  }

  return View(errText)
}


来源: stackexchange

问:
How to avoid text being upside down after rotation with Matplotlib?
I am trying to place labels on an image with Matplotlib. I need to place labels in eight octilinear directions around a node, for which I am currently using the text function with rotation mode anchor.

However, with some angles, e.g. 180°, the label is left of the node as I want it to be, but the text is upside down as a result of the rotation. My workaround so far is to flip the text again using the upsidedown library:

```<code>ax.text(x + x_fac * SCALE / 10.0, y + y_fac * SCALE / 10.0, upsidedown.transform(stop_label),
        rotation=angle, rotation_mode='anchor')
</code>```

However, some characters are not displayed correctly when flipped. This is why I am searching for a better way to do this. Does someone have an idea?

答:
Check out horizontalalignment.

ax.text(0.5, 0.5, "Right", horizontalalignment="right", rotation=45, rotation_mode="anchor")
ax.text(0.5, 0.5, "Left", horizontalalignment="left", rotation=315, rotation_mode="anchor")
```

When right-aligned, text will be left of the node, so 180° become 0°. There is no need for upsidedown.

ContentLicense: CC BY-SA 4.0

Body:
I am trying to place labels on an image with Matplotlib. I need to place labels in eight octilinear directions around a node, for which I am currently using the text function with rotation mode anchor.

However, with some angles, e.g. 180°, the label is left of the node as I want it to be, but the text is upside down as a result of the rotation. My workaround so far is to flip the text again using the upsidedown library:

ax.text(x + x_fac * SCALE / 10.0, y + y_fac * SCALE / 10.0, upsidedown.transform(stop_label),
        rotation=angle, rotation_mode='anchor')

However, some characters are not displayed correctly when flipped. This is why I am searching for a better way to do this. Does someone have an idea?

Body:
Check out horizontalalignment.

ax.text(0.5, 0.5, "Right", horizontalalignment="right", rotation=45, rotation_mode="anchor")
ax.text(0.5, 0.5, "Left", horizontalalignment="left", rotation=315, rotation_mode="anchor")

When right-aligned, text will be left of the node, so 180° become 0°. There is no need for upsidedown.


问:
What modules/tools are available for drawing a graph from text/csv file in Perl or PHP?
I have to draw a graph in Perl or PHP. Can you show me any sample code to read from the text or CSV file and plot a graph or chart of pie?

Data would be like this sample in a CSV or text file:

```<code>01/01/2010  0
01/02/2010  1
01/03/2010  2
01/04/2010  3
</code>```

Another set of data in text file for chart

```<code>Column A 20
Column B 10
Column C 02
</code>```

I want to display the value for each column in my pie chart.

答: You could use google's charts api to generate an image from the data.</p>

ContentLicense: CC BY-SA 3.0

Body:
I have to draw a graph in Perl or PHP. Can you show me any sample code to read from the text or CSV file and plot a graph or chart of pie?

Data would be like this sample in a CSV or text file:

01/01/2010  0
01/02/2010  1
01/03/2010  2
01/04/2010  3

Another set of data in text file for chart

Column A 20
Column B 10
Column C 02

I want to display the value for each column in my pie chart.


问:
OS pod install error. Module glog cannot be installed
I'am trying to upgrade "react-native" from "0.50.4" to "0.55".

When I run pod install, i receive an error

```<code>checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking for arm-apple-darwin-gcc...  -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing: Unknown `--is-lightweight' option
Try `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b':
configure: error: C compiler cannot create executables
See `config.log' for more details

[!] Automatically assigning platform `ios` with version `8.0` on target `quanta_react` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
</code>```

I am a beginner in react-native and I can not make a pod install in my iOS project.
Thank you in advance.

答: I had the same issue but for a different reason and none of the above worked for me. After a lot of digging around, I found out that having installed coreutils, moreutils and gnu-sed and set them up to override the mac osx shipped utilities was the root of the problem.

Body:
I'am trying to upgrade "react-native" from "0.50.4" to "0.55".

When I run pod install, i receive an error

checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for arm-apple-darwin-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking for arm-apple-darwin-gcc...  -arch armv7 -isysroot
checking whether the C compiler works... no
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing: Unknown `--is-lightweight' option
Try `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
configure: error: in `/Users/MacBook/Library/Caches/CocoaPods/Pods/Release/glog/0.3.4-1de0b':
configure: error: C compiler cannot create executables
See `config.log' for more details

[!] Automatically assigning platform `ios` with version `8.0` on target `quanta_react` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

I am a beginner in react-native and I can not make a pod install in my iOS project.
Thank you in advance.


问:
Customize uikit sliders' navigation icons
Instead of uikit default arrow navigation icons(< & >), I need to put my own image or icon. Like bellow image. Is it possible? If so please share.

this is my code

```<code><div class="uk-position-relative uk-visible-toggle uk-light" tabindex="-1" uk-slideshow>

<ul class="uk-slideshow-items">
    <li>
        <img src="images/photo.jpg" alt="" uk-cover>
    </li>
    <li>
        <img src="images/dark.jpg" alt="" uk-cover>
    </li>
    <li>
        <img src="images/light.jpg" alt="" uk-cover>
    </li>
</ul>

<a class="uk-position-center-left uk-position-small uk-hidden-hover" href="#" uk-slidenav-previous uk-slideshow-item="previous"></a>
<a class="uk-position-center-right uk-position-small uk-hidden-hover" href="#" uk-slidenav-next uk-slideshow-item="next"></a>
</code>```

答: You can add your icons to the uikit library in the project, and then rebuild(compile) the UI Kit. Have a look into the documentation of the uikit Custom icons. After that you should be able to use them like other uikit icons.</p>


问:
How can I add Signature Pad to my Rails App?
I'm trying to figure out how to add a signature pad field (from: https://github.com/szimek/signature_pad) in my Rails app but I have no idea how to implement it for MVC file structure in a Rails app. I don't even want to use a rails form, just html for this particular use case but I just CANNOT get the JS to work and it's incredibly frustrating.

I don't understand the documentation after the installation process via yarn. If anyone can help, I'd really appreciate it.

答: You should be able to install this by adding it to package.json. package.json is to Node what Gemfile is to Ruby.


问:
Session created by Tomcat
I am learning session with servlets and i read in the book that to create a session we need to call as below.

HttpSession session = request.getSession()

This causes the web container to create a session ID and send it back to client so that client can attach it with every subsequent request to the server. When i open developer tools in chrome under request headers in network tab i do see a cookie header.

Cookie: JSESSIONID=F92

Below is what i did in my login servlet

```<code>package shop;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

public class LoginServlet extends HttpServlet{

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        String uid = request.getParameter("uid");
        String password = request.getParameter("pwd");

        if(uid.equals("admin") && password.equals("admin"))
        {
            HttpSession session = request.getSession();
            System.out.println(session.getId());
            response.sendRedirect("shopping");
        }
        else
            response.getWriter().println("Invalid Credentials");
    }

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        this.doGet(request, response);
    }

}
</code>```

Index.jsp

```<code><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>shopping application</title>
</head>
<body style="background-color:cyan">
<div style="text-align:center">
<h3>Welcome to Mart</h3>
<form action="login" method="post" name="loginform">
    <div style="padding:2px;">
        <label for="uid">Username:</label>
        <input type="text" id="uid" name="uid">
    </div>
    <div style="padding:2px;">
        <label for="pwd">Password:</label>
        <input type="password" name="pwd" id="pwd">
    </div>

    <input type="submit" value="Login">
</form>
</div>
</body>
</html>
</code>```

My question is that even if i remove the getSession() call i still see the cookie in the network tab. Is there a default session associated with every request by tomcat?

答:
On Tomcat sessions are established lazily, when they are needed. There are basically a couple of situations where sessions are created:

if you call request.getSession() or request.getSession(true) a session is always established,

if you authenticate users against Tomcat's user database a session might be created depending on the authentication method. Most notably if you use form authentication (see this tutorial) a session is always established,

JSP pages create sessions unless you add the <%page session="false"%> directive (see Why set a JSP page session = "false" directive?).

Browsers remember cookies, so the presence of a JSESSIONID is not an indication of the presence of a session (it might be there from a previous test). To test for a presence of a session use request.getSession(false). For example:

   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      final boolean establishSession = req.getParameter("withSession") != null;
      try (final PrintWriter writer = resp.getWriter()) {
         final String requestedSessionId = req.getRequestedSessionId();
         final HttpSession possibleSession = req.getSession(establishSession);
         writer.append("I requested a session with id: ")//
               .append(requestedSessionId)
               .append("\nI have a session with id: ")
               .append(possibleSession != null ? possibleSession.getId() : null)
               .println();
      }
   }
```

Edit: I added the case of a JSP page creating sessions.

Title: Session created by Tomcat

Body:
I am learning session with servlets and i read in the book that to create a session we need to call as below.

HttpSession session = request.getSession()

This causes the web container to create a session ID and send it back to client so that client can attach it with every subsequent request to the server. When i open developer tools in chrome under request headers in network tab i do see a cookie header.

Cookie: JSESSIONID=F92

Below is what i did in my login servlet

package shop;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

public class LoginServlet extends HttpServlet{

    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        String uid = request.getParameter("uid");
        String password = request.getParameter("pwd");

        if(uid.equals("admin") && password.equals("admin"))
        {
            HttpSession session = request.getSession();
            System.out.println(session.getId());
            response.sendRedirect("shopping");
        }
        else
            response.getWriter().println("Invalid Credentials");
    }

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
        this.doGet(request, response);
    }

}

Index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>

<meta charset="ISO-8859-1">
<title>shopping application</title>

Welcome to Mart

<form action="login" method="post" name="loginform">

        Username:
        <input type="text" id="uid" name="uid">

        Password:
        <input type="password" name="pwd" id="pwd">

    <input type="submit" value="Login">
</form>

My question is that even if i remove the getSession() call i still see the cookie in the network tab. Is there a default session associated with every request by tomcat?

Body:
On Tomcat sessions are established lazily, when they are needed. There are basically a couple of situations where sessions are created:

if you call request.getSession() or request.getSession(true) a session is always established,

if you authenticate users against Tomcat's user database a session might be created depending on the authentication method. Most notably if you use form authentication (see this tutorial) a session is always established,

JSP pages create sessions unless you add the <%page session="false"%> directive (see Why set a JSP page session = "false" directive?).

Browsers remember cookies, so the presence of a JSESSIONID is not an indication of the presence of a session (it might be there from a previous test). To test for a presence of a session use request.getSession(false). For example:

   @Override
   protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
      final boolean establishSession = req.getParameter("withSession") != null;
      try (final PrintWriter writer = resp.getWriter()) {
         final String requestedSessionId = req.getRequestedSessionId();
         final HttpSession possibleSession = req.getSession(establishSession);
         writer.append("I requested a session with id: ")//
               .append(requestedSessionId)
               .append("\nI have a session with id: ")
               .append(possibleSession != null ? possibleSession.getId() : null)
               .println();
      }
   }

Edit: I added the case of a JSP page creating sessions.


问:
How do I use the For loop in Firebird?
Can someone explain to me the syntax of the For loop in Firebird?

Here is the code I have so far:

```<code>As
Declare variable Var1 integer;
begin
Insert into table1
-- Select query to insert some enteries in table 1 - Done successfully.
FOR SELECT table1.Column1 from table1 into :Var1
Do
Begin
Update tableabc.column1 = (select tablexyz. column1 from tablexyz where tablexyz.ID = :Var1) where tableabc.ID = :Var1
End
</code>```

Update : Thanks for giving it a try but i dont see any major difference between the query that i wrote and query included in answers. Although above query runs successfully at my end but when i see data in table there occurs no update.

Actually i was making a v.dumb mistake, i was executing alter stored procedure query - which runs successfully and i was assuming this would make the necessary changes. later i executed the stored procedure and it worked pefectly . Thanks all for sparing your time :) ..

答:
```<code>create procedure TEST
as
declare variable TMP integer;
begin
  for select one_f from one into :tmp
  do
  begin
      insert into two (two_f) values (:tmp);
  end
  suspend;
end
</code>```

For each row in table "one" execute the operator insert.
Tmp contains value of current row from table "one".

P.S. sorry for my english

Title: How do I use the For loop in Firebird?

Body:
Can someone explain to me the syntax of the For loop in Firebird?

Here is the code I have so far:

As
Declare variable Var1 integer;
begin
Insert into table1
-- Select query to insert some enteries in table 1 - Done successfully.
FOR SELECT table1.Column1 from table1 into :Var1
Do
Begin
Update tableabc.column1 = (select tablexyz. column1 from tablexyz where tablexyz.ID = :Var1) where tableabc.ID = :Var1
End

Update : Thanks for giving it a try but i dont see any major difference between the query that i wrote and query included in answers. Although above query runs successfully at my end but when i see data in table there occurs no update.

Actually i was making a v.dumb mistake, i was executing alter stored procedure query - which runs successfully and i was assuming this would make the necessary changes. later i executed the stored procedure and it worked pefectly . Thanks all for sparing your time :) ..

Body:
create procedure TEST
as
declare variable TMP integer;
begin
  for select one_f from one into :tmp
  do
  begin
      insert into two (two_f) values (:tmp);
  end
  suspend;
end

For each row in table "one" execute the operator insert.
Tmp contains value of current row from table "one".

P.S. sorry for my english


问:
SQL Error: ORA-00904 "SYS"."DBMS_CRYPTO"."HASH": invalid identifier error while updating a table in Oracle12C
Below is the update statement that i am trying to run

```<code>update
    IFTEST_DBF
set
    M_TEST_SIG=lower(sys.dbms_crypto.hash(utl_raw.cast_to_raw(replace(M_A||M_B||M_C||M_D||M_E||M_F,' ','')),3))
where
    M_TYPE='PRIMARY'
    and M_NEW='Y'

</code>```

Below is the error while i am updating a table in oracle12c , The same statement used to run very fine in oracle 11g but after migrating it to 12C , i am facing this issue. Am i missing something .

Error at Command Line : 6 Column : 22
Error report -
SQL Error: ORA-00904: "SYS"."DBMS_CRYPTO"."HASH": invalid identifier  00904. 00000 -  "%s: invalid identifier"
*Cause:

答:
The DBMS_CRYPTO is a package, which by default, is owned by SYS schema. So, before to use it, you have to grant the execute privilege to the user/schema you are going to use it, e.g.:

GRANT EXECUTE ON dbms_crypto TO "my_schema";

Body:
Below is the update statement that i am trying to run

update
    IFTEST_DBF
set
    M_TEST_SIG=lower(sys.dbms_crypto.hash(utl_raw.cast_to_raw(replace(M_A||M_B||M_C||M_D||M_E||M_F,' ','')),3))
where
    M_TYPE='PRIMARY'
    and M_NEW='Y'

Below is the error while i am updating a table in oracle12c , The same statement used to run very fine in oracle 11g but after migrating it to 12C , i am facing this issue. Am i missing something .

Error at Command Line : 6 Column : 22
Error report -
SQL Error: ORA-00904: "SYS"."DBMS_CRYPTO"."HASH": invalid identifier  00904. 00000 -  "%s: invalid identifier"
*Cause:


问:
No ServletContext set
Migrating from springboot 2.5.7 -> 2.6.1, class dependencies 2021.0.0

```<code>2021-12-07 14:30:46.374 [ ,] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
    at com.test.MyApplication.main(MyApplication.java:18)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
    ... 27 common frames omitted
Caused by: java.lang.IllegalStateException: No ServletContext set
    at org.springframework.util.Assert.state(Assert.java:76)
    at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.resourceHandlerMapping(WebMvcConfigurationSupport.java:591)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    ... 28 common frames omitted
</code>```

Was there a change that broke this?  I have @EnableWebSecurity, and some @RestControllers, but not sure what could be causing it.

答:
I'm getting the same error when trying to upgrade my spring-boot-app from 2.5.9 to 2.6.3

It does start when i exclude my SecurityConfigurer.

Any advice would be welcome.

I'm getting a longer stacktrace, starting from the springSecurityFilterChain, but it does seem to be related.

```<code>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcHandlerMappingIntrospector' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:414)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
at be.idewe.cobra.CobraBootApplication.main(CobraBootApplication.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcHandlerMappingIntrospector' defined in class path resource    [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 26 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcHandlerMappingIntrospector' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1160)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer$MvcCorsFilter.getMvcCorsFilter(CorsConfigurer.java:111)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer$MvcCorsFilter.access$000(CorsConfigurer.java:94)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer.getCorsFilter(CorsConfigurer.java:89)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer.configure(CorsConfigurer.java:67)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer.configure(CorsConfigurer.java:41)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.configure(AbstractConfiguredSecurityBuilder.java:349)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:303)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:285)
at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:83)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:305)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 27 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:671)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1308)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:378)
at org.springframework.web.servlet.handler.HandlerMappingIntrospector.initHandlerMappings(HandlerMappingIntrospector.java:226)
at org.springframework.web.servlet.handler.HandlerMappingIntrospector.afterPropertiesSet(HandlerMappingIntrospector.java:115)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 52 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 68 common frames omitted
Caused by: java.lang.IllegalStateException: No ServletContext set
at org.springframework.util.Assert.state(Assert.java:76)
at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.resourceHandlerMapping(WebMvcConfigurationSupport.java:591)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 69 common frames omitted
</code>```

Title: No ServletContext set

Body:
Migrating from springboot 2.5.7 -> 2.6.1, class dependencies 2021.0.0

2021-12-07 14:30:46.374 [ ,] ERROR o.s.boot.SpringApplication - Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
    at com.test.MyApplication.main(MyApplication.java:18)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
    ... 27 common frames omitted
Caused by: java.lang.IllegalStateException: No ServletContext set
    at org.springframework.util.Assert.state(Assert.java:76)
    at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.resourceHandlerMapping(WebMvcConfigurationSupport.java:591)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    ... 28 common frames omitted

Was there a change that broke this?  I have @EnableWebSecurity, and some @RestControllers, but not sure what could be causing it.

Body:
I'm getting the same error when trying to upgrade my spring-boot-app from 2.5.9 to 2.6.3

It does start when i exclude my SecurityConfigurer.

Any advice would be welcome.

I'm getting a longer stacktrace, starting from the springSecurityFilterChain, but it does seem to be related.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcHandlerMappingIntrospector' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:486)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:953)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:414)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)
at be.idewe.cobra.CobraBootApplication.main(CobraBootApplication.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcHandlerMappingIntrospector' defined in class path resource    [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 26 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mvcHandlerMappingIntrospector' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:213)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1160)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer$MvcCorsFilter.getMvcCorsFilter(CorsConfigurer.java:111)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer$MvcCorsFilter.access$000(CorsConfigurer.java:94)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer.getCorsFilter(CorsConfigurer.java:89)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer.configure(CorsConfigurer.java:67)
at org.springframework.security.config.annotation.web.configurers.CorsConfigurer.configure(CorsConfigurer.java:41)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.configure(AbstractConfiguredSecurityBuilder.java:349)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:303)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:285)
at org.springframework.security.config.annotation.web.builders.WebSecurity.performBuild(WebSecurity.java:83)
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:305)
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38)
at org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration.springSecurityFilterChain(WebSecurityConfiguration.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 27 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'resourceHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1352)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1195)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:582)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:671)
at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1308)
at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:378)
at org.springframework.web.servlet.handler.HandlerMappingIntrospector.initHandlerMappings(HandlerMappingIntrospector.java:226)
at org.springframework.web.servlet.handler.HandlerMappingIntrospector.afterPropertiesSet(HandlerMappingIntrospector.java:115)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1863)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1800)
... 52 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.HandlerMapping]: Factory method 'resourceHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: No ServletContext set
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 68 common frames omitted
Caused by: java.lang.IllegalStateException: No ServletContext set
at org.springframework.util.Assert.state(Assert.java:76)
at org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport.resourceHandlerMapping(WebMvcConfigurationSupport.java:591)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 69 common frames omitted


问:
How can we build a node project in Jenkins while referencing another node project?
We've got an application (Angular/node in GitLab) that has a corresponding freestyle build in Jenkins.  In the package.json, we need to reference a separately-built library of our own writing, also in GitLab.  Like this:

```<code>"dependencies": {
     "our-library": "git+ssh://git@ourcompany.com:2222/libraries/our-library.git#master"
}
</code>```

When we build the application in Jenkins, it pulls the source for our-library, which does not contain the generated lib files. The issue is that ideally we would not like to push the lib files generated by a local our-library build just so that the Jenkins build will be able to find what it needs for the application build. It's almost like we need to be able to reference the /lib folder in the Jenkins our-library workspace instead of referencing the source from GitLab, or something.

The fact that I need to ask this question gives me the feeling that we're going about this all wrong.  Any insight on how to build an app in Jenkins while referencing other node projects that we build as well?

Thanks a lot for any feedback!

答:
That looks like a source dependency, which means your Jenkins build needs to also build said dependencies (from its sources)

The other approach is binary dependency, where your package.json references a local dependency that you have copied (from a binary referential like Nexus, or from any other source you want, like a shared folder where you have put the generated libs).

See for instance "Local dependency in package.json".

Body:
We've got an application (Angular/node in GitLab) that has a corresponding freestyle build in Jenkins.  In the package.json, we need to reference a separately-built library of our own writing, also in GitLab.  Like this:

"dependencies": {
     "our-library": "git+ssh://git@ourcompany.com:2222/libraries/our-library.git#master"
}

When we build the application in Jenkins, it pulls the source for our-library, which does not contain the generated lib files. The issue is that ideally we would not like to push the lib files generated by a local our-library build just so that the Jenkins build will be able to find what it needs for the application build. It's almost like we need to be able to reference the /lib folder in the Jenkins our-library workspace instead of referencing the source from GitLab, or something.

The fact that I need to ask this question gives me the feeling that we're going about this all wrong.  Any insight on how to build an app in Jenkins while referencing other node projects that we build as well?

Thanks a lot for any feedback!


问:
How can I integrate fontawesome with nuxt.js?
I have been trying to use fontawesome icons inside nuxt.js, but whenever I run npm run dev I get this error ERROR in ./node_modules/@fortawesome/free-solid-svg-icons/index.es.js Module build failed: Error: ENOENT: no such file or directory

I think that the problem is there is not a free-solid-svg-icons directory, but when I tried to install it with npm, it didn't appear.

Can anybody help?

答:
Late but might help, create plugins folder if not created in root folder, add fontawesome.js file and import all the necessary icons, the sample file below;

```<code>import Vue from 'vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faUserSecret } from '@fortawesome/free-solid-svg-icons'
import { faBuilding } from '@fortawesome/free-regular-svg-icons'
import { faTwitter } from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

library.add(faUserSecret,faTwitter,faBuilding)

Vue.component('fai', FontAwesomeIcon)
</code>```

integrate the icons through nuxt.config.js, sample below;

```<code>plugins: [
  { src: '@/plugins/fontawesome.js', mode: 'client' }
]
</code>```

Using the icons? see the sample below;

```<code><div>
 <fai :icon="['fab', 'twitter']" />
</div>
</code>```

Few things to Note;

<fai... /> is the component name, can name anything, needs to decide the name during component creation - Vue.component('fai', FontAwesomeIcon)

you import as faTwitter but you use as twitter, ommit fa and twitter starts small letter. If faUserSecret, then ommit fa and use user-secret.

Find vue-fontawesome full reference below;
https://github.com/FortAwesome/vue-fontawesome

Body:
Late but might help, create plugins folder if not created in root folder, add fontawesome.js file and import all the necessary icons, the sample file below;

import Vue from 'vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faUserSecret } from '@fortawesome/free-solid-svg-icons'
import { faBuilding } from '@fortawesome/free-regular-svg-icons'
import { faTwitter } from '@fortawesome/free-brands-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

library.add(faUserSecret,faTwitter,faBuilding)

Vue.component('fai', FontAwesomeIcon)

integrate the icons through nuxt.config.js, sample below;

plugins: [
  { src: '@/plugins/fontawesome.js', mode: 'client' }
]

Using the icons? see the sample below;

<div>
 <fai :icon="['fab', 'twitter']" />
</div>

Few things to Note;

<fai... /> is the component name, can name anything, needs to decide the name during component creation - Vue.component('fai', FontAwesomeIcon)

you import as faTwitter but you use as twitter, ommit fa and twitter starts small letter. If faUserSecret, then ommit fa and use user-secret.

Find vue-fontawesome full reference below;
https://github.com/FortAwesome/vue-fontawesome


问:
Vue and Javascript
[1]Can not import?

I wanna link a js file with Vue imported on it to a html.
Is seems the html is linking correctly the script.js under the script tag but the javascript file cant understand Vue so the html cant do so.
Im very inexperienced, it is basic help.

答:
import Vue in index.html

```<code><head>
  <script type="importmap">
      {
        "imports": {
          "vue": "/lib/vue.esm.browser.js_2.6.11/vue.esm-browser.js",
          "vue-multiselect":"/lib/vue-multiselect/vue-multiselect.esm.min.js",
          "SingleFileComponent":"/js/SingleFileComponent.js",
          "MultiSelectComponent":"/js/MultiSelectComponent.js"
        }
      }
    </script>
</head>
</code>```

create anchor in index.html

```<code><div id="app">
    <multi-select-component></multi-select-component>
</div>

<div id="single">
    <single-file-component></single-file-component>
</div>

<script type="module">
      import { createApp } from 'vue'
      import VueMultiselect from 'vue-multiselect'
      import SingleFileComponent from "SingleFileComponent";
      import MultiSelectComponent from "MultiSelectComponent"

      createApp({
        components: {
           MultiSelectComponent
         }
      })
      .component('multiselect', VueMultiselect)
      .mount('#app')

      createApp({
         components: {
            SingleFileComponent
          }
      })
      .mount('#single')
</script>
</code>```

create single-file-component in SingleFileComponent.js

```<code>export default {
    template: `
      <div>
      <h1>Single-file JavaScript Component</h1>
      <p>{{ message }}</p>
      </div>
    `,
    data() {
        return {
            message: 'Oh hai from the component'
        }
    },
}
</code>```

create multi-select-component in MultiSelectComponent.js

```<code>export default {
    template: `
      <multiselect v-model="value" :options="options"></multiselect>
      <label>{{ value }}</label>`,
    data() {
        return {
            value: null, options: ['list', 'of', 'options']
        }
    }
}
</code>```

Title: Vue and Javascript

Body:
import Vue in index.html

<head>
  <script type="importmap">
      {
        "imports": {
          "vue": "/lib/vue.esm.browser.js_2.6.11/vue.esm-browser.js",
          "vue-multiselect":"/lib/vue-multiselect/vue-multiselect.esm.min.js",
          "SingleFileComponent":"/js/SingleFileComponent.js",
          "MultiSelectComponent":"/js/MultiSelectComponent.js"
        }
      }
    </script>
</head>

create anchor in index.html

<div id="app">
    <multi-select-component></multi-select-component>
</div>

<div id="single">
    <single-file-component></single-file-component>
</div>

<script type="module">
      import { createApp } from 'vue'
      import VueMultiselect from 'vue-multiselect'
      import SingleFileComponent from "SingleFileComponent";
      import MultiSelectComponent from "MultiSelectComponent"

      createApp({
        components: {
           MultiSelectComponent
         }
      })
      .component('multiselect', VueMultiselect)
      .mount('#app')

      createApp({
         components: {
            SingleFileComponent
          }
      })
      .mount('#single')
</script>

create single-file-component in SingleFileComponent.js

export default {
    template: `
      <div>
      <h1>Single-file JavaScript Component</h1>
      <p>{{ message }}</p>
      </div>
    `,
    data() {
        return {
            message: 'Oh hai from the component'
        }
    },
}

create multi-select-component in MultiSelectComponent.js

export default {
    template: `
      <multiselect v-model="value" :options="options"></multiselect>
      <label>{{ value }}</label>`,
    data() {
        return {
            value: null, options: ['list', 'of', 'options']
        }
    }
}


问:
mapsjs-core.js:27 Uncaught TypeError: Cannot read properties of undefined (reading '0')
I need help

I work with the here map api I try to display the contours around a city and I have this as an error

```<code>const shape = res.response.isoline[0].component[0].shape.map(z => z.split(','));
</code>```

here is the complete piece of code

const requestIsolineShape = options => {
const params = {
'mode': fastest;${options.mode};traffic:enabled,
'start': geo!${options.center.lat},${options.center.lng},
'range': options.range,
'rangetype': options.rangeType,
'departure': ${options.date}T${options.time}:00,
};

return new Promise((resolve, reject) => {
router.calculateIsoline(
params,
res => {
const shape = res.response.isoline[0].component[0].shape.map(z => z.split(','));
resolve( shape );
},
err => reject(err)
);
});
} ;

答:
Please double check in console(Network tab) of browser which parameters are sent to Routing isoline service and check the response.

It seems are you using Routing API v7.2 then please play with playground on https://refclient.ext.here.com/ - click there on "New Tab +"

Better solution if you switch to new version 8 of Routing API and use this service which direct integrated to JS API: https://developer.here.com/documentation/maps/3.1.30.7/api_reference/H.service.RoutingService8.html#calculateIsoline

Example:

```<code>let routingParams = {
 'routingMode': 'fast',
 'transportMode': 'car',
 'origin':'52.5,13.4',
 'range[type]': 'time',
 'range[values]': '900',
};

// Define a callback function to process the routing response
let onResult = function(result) {
  if (result.isolines.length) {
    result.isolines[0].polygons.forEach((polygon) => {
        // Create a linestring to use as a point source for the isoline
        const linestring = H.geo.LineString.fromFlexiblePolyline(polygon.outer);

        // Create a polygon and a marker representing the isoline
        const isolinePolygon = new H.map.Polygon(linestring, {
          style: { strokeColor: 'blue', lineWidth: 3 }
        });

        // Create a marker for the start point
        const isolineCenter = new H.map.Marker(result.departure.place.location);

        // Add the polygon and marker to the map
        map.addObjects([isolinePolygon, isolineCenter]);

        // Center and zoom the map so that the whole isoline polygon is
        // in the viewport
        map.getViewModel().setLookAtData({bounds: isolinePolygon.getBoundingBox()});
    });
  }
};

// Assumption: the platform is instantiated.
// Get an instance of the routing service
let router = platform.getRoutingService(null, 8);

// Call the Isoline Routing API to calculate an isoline
router.calculateIsoline(
  routingParams,
  onResult,
  console.error
);
</code>```

Playground for v8: https://demo.routing.ext.here.com/

Body:
I need help

I work with the here map api I try to display the contours around a city and I have this as an error

const shape = res.response.isoline[0].component[0].shape.map(z => z.split(','));

here is the complete piece of code

const requestIsolineShape = options => {
const params = {
'mode': fastest;${options.mode};traffic:enabled,
'start': geo!${options.center.lat},${options.center.lng},
'range': options.range,
'rangetype': options.rangeType,
'departure': ${options.date}T${options.time}:00,
};

return new Promise((resolve, reject) => {
router.calculateIsoline(
params,
res => {
const shape = res.response.isoline[0].component[0].shape.map(z => z.split(','));
resolve( shape );
},
err => reject(err)
);
});
} ;

Body:
Please double check in console(Network tab) of browser which parameters are sent to Routing isoline service and check the response.

It seems are you using Routing API v7.2 then please play with playground on https://refclient.ext.here.com/ - click there on "New Tab +"

Better solution if you switch to new version 8 of Routing API and use this service which direct integrated to JS API: https://developer.here.com/documentation/maps/3.1.30.7/api_reference/H.service.RoutingService8.html#calculateIsoline

Example:

let routingParams = {
 'routingMode': 'fast',
 'transportMode': 'car',
 'origin':'52.5,13.4',
 'range[type]': 'time',
 'range[values]': '900',
};

// Define a callback function to process the routing response
let onResult = function(result) {
  if (result.isolines.length) {
    result.isolines[0].polygons.forEach((polygon) => {
        // Create a linestring to use as a point source for the isoline
        const linestring = H.geo.LineString.fromFlexiblePolyline(polygon.outer);

        // Create a polygon and a marker representing the isoline
        const isolinePolygon = new H.map.Polygon(linestring, {
          style: { strokeColor: 'blue', lineWidth: 3 }
        });

        // Create a marker for the start point
        const isolineCenter = new H.map.Marker(result.departure.place.location);

        // Add the polygon and marker to the map
        map.addObjects([isolinePolygon, isolineCenter]);

        // Center and zoom the map so that the whole isoline polygon is
        // in the viewport
        map.getViewModel().setLookAtData({bounds: isolinePolygon.getBoundingBox()});
    });
  }
};

// Assumption: the platform is instantiated.
// Get an instance of the routing service
let router = platform.getRoutingService(null, 8);

// Call the Isoline Routing API to calculate an isoline
router.calculateIsoline(
  routingParams,
  onResult,
  console.error
);

Playground for v8: https://demo.routing.ext.here.com/


问:
“Strip Debug Symbols During Copy” and “Strip Linked Product” difference on xCode

What is a difference between “Strip Debug Symbols During Copy” and “Strip Linked Product” options?

What does it mean if “Strip Debug Symbols During Copy” = YES and “Strip Linked Product” = NO?

Is it possible to upload an application to the App Store with symbolicated data on the separate .dsym file (not on the binary)?

答:
from apple documentation:

Strip Debug Symbols During Copy

Description: Boolean value. Specifies whether copied binaries are stripped of debugging symbols.

```<code>Values:
YES: Copied binaries are stripped of debugging symbols. This does not cause the binary produced by the linker to be stripped. Use "Strip Linked Product" to have the linker strip the binary.
NO: Copied binaries are not stripped of debugging symbols
Default value: NO
</code>```

Strip Linked Product

Description: Boolean value. Specifies whether to strip symbol information from the binary.

```<code>Values:
YES: Strips the generated binary when the prerequisite is met.
NO: Does not strip the generated binary.
Default value: NO
</code>```

https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html

Body:
from apple documentation:

Strip Debug Symbols During Copy

Description: Boolean value. Specifies whether copied binaries are stripped of debugging symbols.

Values:
YES: Copied binaries are stripped of debugging symbols. This does not cause the binary produced by the linker to be stripped. Use "Strip Linked Product" to have the linker strip the binary.
NO: Copied binaries are not stripped of debugging symbols
Default value: NO

Strip Linked Product

Description: Boolean value. Specifies whether to strip symbol information from the binary.

Values:
YES: Strips the generated binary when the prerequisite is met.
NO: Does not strip the generated binary.
Default value: NO

https://developer.apple.com/library/archive/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html