问:
Unable to find valid certification path to requested target I/O error on GET request PKIX path building failed
Configuration file:

```<code>@Configuration
public class CustomConfiguration {

    @Bean
    public RestTemplate restTemplate() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException,
            CertificateException, MalformedURLException, IOException {

        SSLContext sslContext = new SSLContextBuilder()
                .loadTrustMaterial(new URL("file:src/main/resources/B2B_CORAL_COMPUTERS.p12"), "0642".toCharArray()).build();
        SSLConnectionSocketFactory sslConFactory = new SSLConnectionSocketFactory(sslContext);

        CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(sslConFactory).build();
        ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
        RestTemplate restTemplate = new RestTemplate(requestFactory);

        return restTemplate;

    }
</code>```

Service method:

```<code>
@Autowired
private RestTemplate restTemplate;

public ApiResponse callKimtech() throws URISyntaxException, MalformedURLException {
    String response = restTemplate.getForObject("https://b2b.kimtec.rs/B2BService/HTTP/Product/GetProductsAvailability.aspx", String.class);

return new ApiSuccess(response);

</code>```

LOG:

```<code>2022-12-08 13:38:25.384 ERROR 10268 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://b2b.kimtec.rs/B2BService/HTTP/Product/GetProductsAvailability.aspx": PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target] with root cause

sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[na:na]
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[na:na]
    at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) ~[na:na]
    at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434) ~[na:na]
    at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[na:na]
    at java.base/sun.security.validator.Validator.validate(Validator.java:264) ~[na:na]
    at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231) ~[na:na]
    at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) ~[na:na]
    at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638) ~[na:na]
    at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[na:na]
    at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[na:na]
    at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396) ~[na:na]
    at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480) ~[na:na]
    at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458) ~[na:na]
    at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201) ~[na:na]
    at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1505) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1420) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426) ~[na:na]
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.13.jar:4.5.13]
    at org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:87) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:776) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:334) ~[spring-web-5.3.10.jar:5.3.10]
    at coral.coralshop.soap.CallSoapServices.callKimtech(CallSoapServices.java:111) ~[classes/:na]
    at coral.coralshop.controller.SoapServicesController.callService(SoapServicesController.java:27) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) ~[tomcat-embed-core-9.0.53.jar:4.0.FR]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.53.jar:4.0.FR]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.53.jar:9.0.53]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationFilter.doFilterInternal(BearerTokenAuthenticationFilter.java:137) ~[spring-security-oauth2-resource-server-5.5.2.jar:5.5.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
... .

</code>```

Hello,
I am trying to connect my springboot application with one soap service using RestTemplate.
Soap service is using .p12 certificate for security. Client sent me certificate with password which i gave to constructor of this method

```<code>.loadTrustMaterial(new URL("file:src/main/resources/B2B_CORAL_COMPUTERS.p12"), "****".toCharArray()).build();
</code>```

the problem is that when i call end point that calls soap service it returns me: Unable to find valid certification path to requested target.

Body:
Configuration file:

@Configuration
public class CustomConfiguration {

    @Bean
    public RestTemplate restTemplate() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException,
            CertificateException, MalformedURLException, IOException {

        SSLContext sslContext = new SSLContextBuilder()
                .loadTrustMaterial(new URL("file:src/main/resources/B2B_CORAL_COMPUTERS.p12"), "0642".toCharArray()).build();
        SSLConnectionSocketFactory sslConFactory = new SSLConnectionSocketFactory(sslContext);

        CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(sslConFactory).build();
        ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
        RestTemplate restTemplate = new RestTemplate(requestFactory);

        return restTemplate;

    }

Service method:

@Autowired
private RestTemplate restTemplate;

public ApiResponse callKimtech() throws URISyntaxException, MalformedURLException {
    String response = restTemplate.getForObject("https://b2b.kimtec.rs/B2BService/HTTP/Product/GetProductsAvailability.aspx", String.class);

return new ApiSuccess(response);

LOG:

2022-12-08 13:38:25.384 ERROR 10268 --- [nio-8080-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://b2b.kimtec.rs/B2BService/HTTP/Product/GetProductsAvailability.aspx": PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target] with root cause

sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141) ~[na:na]
    at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126) ~[na:na]
    at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297) ~[na:na]
    at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434) ~[na:na]
    at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306) ~[na:na]
    at java.base/sun.security.validator.Validator.validate(Validator.java:264) ~[na:na]
    at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:231) ~[na:na]
    at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) ~[na:na]
    at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:638) ~[na:na]
    at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:473) ~[na:na]
    at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:369) ~[na:na]
    at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396) ~[na:na]
    at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480) ~[na:na]
    at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458) ~[na:na]
    at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:201) ~[na:na]
    at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1505) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1420) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455) ~[na:na]
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426) ~[na:na]
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:436) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:384) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.13.jar:4.5.13]
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.13.jar:4.5.13]
    at org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:87) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:66) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:776) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:334) ~[spring-web-5.3.10.jar:5.3.10]
    at coral.coralshop.soap.CallSoapServices.callKimtech(CallSoapServices.java:111) ~[classes/:na]
    at coral.coralshop.controller.SoapServicesController.callService(SoapServicesController.java:27) ~[classes/:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
    at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:655) ~[tomcat-embed-core-9.0.53.jar:4.0.FR]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.10.jar:5.3.10]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:764) ~[tomcat-embed-core-9.0.53.jar:4.0.FR]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.53.jar:9.0.53]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162) ~[tomcat-embed-core-9.0.53.jar:9.0.53]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:121) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:105) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationFilter.doFilterInternal(BearerTokenAuthenticationFilter.java:137) ~[spring-security-oauth2-resource-server-5.5.2.jar:5.5.2]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.3.10.jar:5.3.10]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89) ~[spring-security-web-5.5.2.jar:5.5.2]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336) ~[spring-security-web-5.5.2.jar:5.5.2]
... .

Hello,
I am trying to connect my springboot application with one soap service using RestTemplate.
Soap service is using .p12 certificate for security. Client sent me certificate with password which i gave to constructor of this method

.loadTrustMaterial(new URL("file:src/main/resources/B2B_CORAL_COMPUTERS.p12"), "****".toCharArray()).build();

the problem is that when i call end point that calls soap service it returns me: Unable to find valid certification path to requested target.


来源: stackexchange

问:
LocationManager gets called multiple times on app startup
So I am dealing with an issue where the LocationManager file that I have, and the didUpdateLocations function, is being called multiple times on application startup and I can't figure out what is causing it.

So I have the following LocationManager:

```<code>import Foundation
import CoreLocation
import MapKit

final class LocationManager: NSObject, ObservableObject, CLLocationManagerDelegate {

    @Published var userLocation: CLLocation?
    @Published var defaultRegion: MKCoordinateRegion?
    @objc static let getInstance = LocationManager()
    private let locationManager = CLLocationManager()

    override init() {
        super.init()
        locationManager.delegate = self
        log.info("\n : (LocationManager) - Initialize Location Services inside init()")
    }

    func startUpdatingLocation() {
      locationManager.delegate = self
      locationManager.requestWhenInUseAuthorization()
      locationManager.startUpdatingLocation()
    }

    func requestLocation() {
        locationManager.requestLocation()
    }

    func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        guard let location = locations.last else { return }
        DispatchQueue.main.async {
            self.userLocation = location
            log.info("\n : (LocationManager) - Setup new location as: \(location)")
            self.defaultRegion = MKCoordinateRegion(center: location.coordinate, span: USER_LOCATION_SPAN)
            log.info("\n : (LocationManager) - Setup default region as \(location.coordinate.latitude) and \(location.coordinate.longitude).")
            self.locationManager.stopUpdatingLocation()
            log.info("\n : (LocationManager) - Stop updating the location.")
        }
    }
}
</code>```

Then I am utilizing it in two separate view files called MapUIView and MapUIView2 and I have the following object in both:

@ObservedObject var locationManager = LocationManager.getInstance

This causes the DispatchQueue.main.async inside didUpdateLocations to run through twice on application start - Is this normal behavior or is it possible to have the didUpdateLocations to run just once, but handle multiple views?

ContentLicense: CC BY-SA 4.0

Body:
So I am dealing with an issue where the LocationManager file that I have, and the didUpdateLocations function, is being called multiple times on application startup and I can't figure out what is causing it.

So I have the following LocationManager:

import Foundation
import CoreLocation
import MapKit

final class LocationManager: NSObject, ObservableObject, CLLocationManagerDelegate {

    @Published var userLocation: CLLocation?
    @Published var defaultRegion: MKCoordinateRegion?
    @objc static let getInstance = LocationManager()
    private let locationManager = CLLocationManager()

    override init() {
        super.init()
        locationManager.delegate = self
        log.info("\n : (LocationManager) - Initialize Location Services inside init()")
    }

    func startUpdatingLocation() {
      locationManager.delegate = self
      locationManager.requestWhenInUseAuthorization()
      locationManager.startUpdatingLocation()
    }

    func requestLocation() {
        locationManager.requestLocation()
    }

    func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
        guard let location = locations.last else { return }
        DispatchQueue.main.async {
            self.userLocation = location
            log.info("\n : (LocationManager) - Setup new location as: \(location)")
            self.defaultRegion = MKCoordinateRegion(center: location.coordinate, span: USER_LOCATION_SPAN)
            log.info("\n : (LocationManager) - Setup default region as \(location.coordinate.latitude) and \(location.coordinate.longitude).")
            self.locationManager.stopUpdatingLocation()
            log.info("\n : (LocationManager) - Stop updating the location.")
        }
    }
}

Then I am utilizing it in two separate view files called MapUIView and MapUIView2 and I have the following object in both:

@ObservedObject var locationManager = LocationManager.getInstance

This causes the DispatchQueue.main.async inside didUpdateLocations to run through twice on application start - Is this normal behavior or is it possible to have the didUpdateLocations to run just once, but handle multiple views?


问:
Cypress and Laravel - cy.refreshDatabase() results in a timeout
I am adding Cypress to a large monorepo. I am using:

 "laracasts/cypress": "^3.0", and
"cypress": "^12.0.1",

I have followed the installation instructions in the laracasts cypress package found here:

https://github.com/laracasts/cypress

I have replaced the generated example.cy.js file with:

```<code>describe('Example Test', () => {
    before(() => {
        cy.refreshDatabase();
   })

   ... some other bits that aren't hit
});
</code>```

I have database called cypress_testing set in my cypress env file.

When I run this file, it hangs before returning:

```<code>cy.request() timed out waiting 30000ms for a response from your server.

The request we sent was:

Method: POST
URL: http://localhost:3000/cypress/artisan

No response was received within the timeout.
</code>```

There are no laravel logs, no console logs - just this timeout error. In cypress config file, I have:

```<code>const threeMinutesInMiliseconds = 180000;

module.exports = defineConfig({
    chromeWebSecurity: false,
    retries: 2,
    defaultCommandTimeout: threeMinutesInMiliseconds,
    responsetimeout: threeMinutesInMiliseconds,
    requestTimeout: threeMinutesInMiliseconds,
</code>```

Has anyone else encountered this while working with Laravel/Vue and Cypress?

Body:
I am adding Cypress to a large monorepo. I am using:

 "laracasts/cypress": "^3.0", and
"cypress": "^12.0.1",

I have followed the installation instructions in the laracasts cypress package found here:

https://github.com/laracasts/cypress

I have replaced the generated example.cy.js file with:

describe('Example Test', () => {
    before(() => {
        cy.refreshDatabase();
   })

   ... some other bits that aren't hit
});

I have database called cypress_testing set in my cypress env file.

When I run this file, it hangs before returning:

cy.request() timed out waiting 30000ms for a response from your server.

The request we sent was:

Method: POST
URL: http://localhost:3000/cypress/artisan

No response was received within the timeout.

There are no laravel logs, no console logs - just this timeout error. In cypress config file, I have:

const threeMinutesInMiliseconds = 180000;

module.exports = defineConfig({
    chromeWebSecurity: false,
    retries: 2,
    defaultCommandTimeout: threeMinutesInMiliseconds,
    responsetimeout: threeMinutesInMiliseconds,
    requestTimeout: threeMinutesInMiliseconds,

Has anyone else encountered this while working with Laravel/Vue and Cypress?


问:
Auto-create propertys getter and setter for class elements
I'm searching for a way to write less sameish looking code and I'm not sure if there is a solution for this. So far I tried using Visual Studio Snippets, but that was not as helpful as needed. I would love to have C-Style Macros for this, or even better using C# language features.

Here is what I'm currently working on and the problem I have with it:

I'm writing full feature tests for an embedded device with a Web-UI in C#. I'm using Selenium to interact with the UI and have written some small classes to interact with custom input elements. The UI has many pages on which different controls are visible and naturally I created a class for each page and added all the input element classes for each controllable element.

This looks something like this (input element would be the Switch and ValueInput class):

public class SomePage : Page
{
    protected const string id = "page_id";

    #region ContentControls
    protected Switch time_limit_enable;
    protected ValueInput time_limit;
    // and more ...
    #endregion

    internal SomePage() : base(id) { }

    protected override void Init()
    {
        time_limit_enable = new Switch("time_limit_enable_id");
        time_limit = new ValueInput("time_limit_id");
        // and more ...
    }

    #region GetterSetter
    public bool TimeLimitEnable
    {
        get => time_limit_enable.State;
        set
        {
            if (time_limit_enable.State != value)
                time_limit_enable.Toggle();
        }
    }

    public string TimeLimit
    {
        get => time_limit.Text;
        set => time_limit.Text = value;
    }

    // and more ...
    #endregion
}
```

While this example page is small, the real pages have a lot more elements often of the same type (Switch, ValueInput, and more). The only thing that I want to specify is the element class, the id of the element, and the name. Some element classes have a template parameter as well. So basically the construction of the element. Is there some way to automate everything else?
Meaning:

creating a protected element

Initializing it in the Init() function

Adding a property getter and setter, named like the element in CamelCase. This property template would be different for different element classes.

Possible solutions:

Make the element class directly public readonly. Sounds ok, but then I would expose the different interfaces to the test side. I like that every property can be read and read directly with =. I could implement this in each element class though.

I could write a Code generator to do this, but that would be overkill. I'm probably looking at this from the wrong angle.

I could hack C-Style macros in c#, but that's just wrong.

I feel a little bit lost in the weeds. The solution is probably straightforward and obvious.

Body:
I'm searching for a way to write less sameish looking code and I'm not sure if there is a solution for this. So far I tried using Visual Studio Snippets, but that was not as helpful as needed. I would love to have C-Style Macros for this, or even better using C# language features.

Here is what I'm currently working on and the problem I have with it:

I'm writing full feature tests for an embedded device with a Web-UI in C#. I'm using Selenium to interact with the UI and have written some small classes to interact with custom input elements. The UI has many pages on which different controls are visible and naturally I created a class for each page and added all the input element classes for each controllable element.

This looks something like this (input element would be the Switch and ValueInput class):

public class SomePage : Page
{
    protected const string id = "page_id";

    #region ContentControls
    protected Switch time_limit_enable;
    protected ValueInput time_limit;
    // and more ...
    #endregion

    internal SomePage() : base(id) { }

    protected override void Init()
    {
        time_limit_enable = new Switch("time_limit_enable_id");
        time_limit = new ValueInput("time_limit_id");
        // and more ...
    }

    #region GetterSetter
    public bool TimeLimitEnable
    {
        get => time_limit_enable.State;
        set
        {
            if (time_limit_enable.State != value)
                time_limit_enable.Toggle();
        }
    }

    public string TimeLimit
    {
        get => time_limit.Text;
        set => time_limit.Text = value;
    }

    // and more ...
    #endregion
}

While this example page is small, the real pages have a lot more elements often of the same type (Switch, ValueInput, and more). The only thing that I want to specify is the element class, the id of the element, and the name. Some element classes have a template parameter as well. So basically the construction of the element. Is there some way to automate everything else?
Meaning:

creating a protected element

Initializing it in the Init() function

Adding a property getter and setter, named like the element in CamelCase. This property template would be different for different element classes.

Possible solutions:

Make the element class directly public readonly. Sounds ok, but then I would expose the different interfaces to the test side. I like that every property can be read and read directly with =. I could implement this in each element class though.

I could write a Code generator to do this, but that would be overkill. I'm probably looking at this from the wrong angle.

I could hack C-Style macros in c#, but that's just wrong.

I feel a little bit lost in the weeds. The solution is probably straightforward and obvious.


问:
JWT authorization on spring security is throwing 403 Forbidden request
I am working on spring security with JWT. i am getting 403 forbidden error.

The OncePerRequest filter for my jwt token is as

```<code>protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {

    String authHeader = request.getHeader("Authorization");
    if(authHeader!=null && !authHeader.equals("") && authHeader.startsWith("Bearer")){
        String jwt = authHeader.substring(7);

        if (jwt == null || jwt.isEmpty()){
            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid JWT token in bearer header");
        } else {
            try{
                String username = jwtUtil.validateTokenAndRetrieveSubject(jwt);

                UserDetails userDetails = myUserDetailsService.loadUserByUsername(username);

                UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
                        username,
                        userDetails.getPassword(),
                        userDetails.getAuthorities()
                );

                if (SecurityContextHolder.getContext().getAuthentication() == null){
                    SecurityContextHolder.getContext().setAuthentication(authenticationToken);
                }

                System.out.println("this is from JWTFILTER -> " + username);

            }catch (Exception e ){
                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid JWT token: " +e);
            }
        }
     }
    filterChain.doFilter(request,response);
</code>```

and my JWTUtil for token generation and validation.

```<code>    @Component
public class JWTUtil {
    @Value("${jwt-secret}")
    private String SECRET_KEY;

    @Value("${jwt-issuer}")
    private String issuer;

    @Value("${jwt-claim}")
    private String UserName;

    public String generateToken(String username) throws IllegalArgumentException, JWTCreationException{
        return JWT.create()
                .withClaim(UserName, username)
                .withIssuedAt(new Date(System.currentTimeMillis()))
//                .withExpiresAt(new Date(System.currentTimeMillis()/1000 + 3600 ))
                .withIssuer(issuer)
                .sign(Algorithm.HMAC256(SECRET_KEY));
    }

    public String validateTokenAndRetrieveSubject(String token) throws JWTVerificationException{
        JWTVerifier verifier = JWT.require(Algorithm.HMAC256(SECRET_KEY))
                .withIssuer(issuer)
                .build();
        DecodedJWT jwt = verifier.verify(token);

        return jwt.getClaim(UserName).asString();
    }
}
</code>```

and MyUserDetailsService. I don't have password for the user in my microservice so i am sending my username again org.springframework.security.core.userdetails.User().

```<code>@Component
public class MyUserDetailsService implements UserDetailsService {
    @Autowired private UserRepo userRepo;
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        Optional<User> userResource = userRepo.findUserByNameEquals(username);

        if (!userResource.isPresent())
            throw new UsernameNotFoundException("Could not found this username = " + username);

        User user = userResource.get();

        return new org.springframework.security.core.userdetails.User(
                username,
                user.getName(),
                Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER"))
        );
    }
}
</code>```

and at the last the SecurityConfig in which i am using my custom authenticationEntryPoint.

```<code>@Component
@EnableWebSecurity
@AllArgsConstructor
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig {
    @Autowired private MyUserDetailsService uds;
    @Autowired private JWTFilter jwtFilter;
    private MyAuthenticationEntryPoint myAuthenticationEntryPoint;
    @Bean
    protected SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception{
        httpSecurity.csrf().disable().httpBasic().disable()
                .cors()
                .and()
                .authorizeHttpRequests()
                .antMatchers("/api/user/**").permitAll()
                .antMatchers("/api/symbol/**").hasRole("ROLE_USER")
                .and().userDetailsService(uds)
                .exceptionHandling()
                .authenticationEntryPoint(myAuthenticationEntryPoint)
                .and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and().formLogin().disable();

        httpSecurity.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class);

        return httpSecurity.build();
    }
    @Bean
    public PasswordEncoder passwordEncoder (){
        return new BCryptPasswordEncoder();
    }
    @Bean
    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception{
        return authenticationConfiguration.getAuthenticationManager();
    }
}
</code>```

its my first time working on jwt so i have no idea about the issue.

Body:
I am working on spring security with JWT. i am getting 403 forbidden error.

The OncePerRequest filter for my jwt token is as

protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {

    String authHeader = request.getHeader("Authorization");
    if(authHeader!=null && !authHeader.equals("") && authHeader.startsWith("Bearer")){
        String jwt = authHeader.substring(7);

        if (jwt == null || jwt.isEmpty()){
            response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid JWT token in bearer header");
        } else {
            try{
                String username = jwtUtil.validateTokenAndRetrieveSubject(jwt);

                UserDetails userDetails = myUserDetailsService.loadUserByUsername(username);

                UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(
                        username,
                        userDetails.getPassword(),
                        userDetails.getAuthorities()
                );

                if (SecurityContextHolder.getContext().getAuthentication() == null){
                    SecurityContextHolder.getContext().setAuthentication(authenticationToken);
                }

                System.out.println("this is from JWTFILTER -> " + username);

            }catch (Exception e ){
                response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Invalid JWT token: " +e);
            }
        }
     }
    filterChain.doFilter(request,response);

and my JWTUtil for token generation and validation.

    @Component
public class JWTUtil {
    @Value("${jwt-secret}")
    private String SECRET_KEY;

    @Value("${jwt-issuer}")
    private String issuer;

    @Value("${jwt-claim}")
    private String UserName;

    public String generateToken(String username) throws IllegalArgumentException, JWTCreationException{
        return JWT.create()
                .withClaim(UserName, username)
                .withIssuedAt(new Date(System.currentTimeMillis()))
//                .withExpiresAt(new Date(System.currentTimeMillis()/1000 + 3600 ))
                .withIssuer(issuer)
                .sign(Algorithm.HMAC256(SECRET_KEY));
    }

    public String validateTokenAndRetrieveSubject(String token) throws JWTVerificationException{
        JWTVerifier verifier = JWT.require(Algorithm.HMAC256(SECRET_KEY))
                .withIssuer(issuer)
                .build();
        DecodedJWT jwt = verifier.verify(token);

        return jwt.getClaim(UserName).asString();
    }
}

and MyUserDetailsService. I don't have password for the user in my microservice so i am sending my username again org.springframework.security.core.userdetails.User().

@Component
public class MyUserDetailsService implements UserDetailsService {
    @Autowired private UserRepo userRepo;
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        Optional<User> userResource = userRepo.findUserByNameEquals(username);

        if (!userResource.isPresent())
            throw new UsernameNotFoundException("Could not found this username = " + username);

        User user = userResource.get();

        return new org.springframework.security.core.userdetails.User(
                username,
                user.getName(),
                Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER"))
        );
    }
}

and at the last the SecurityConfig in which i am using my custom authenticationEntryPoint.

@Component
@EnableWebSecurity
@AllArgsConstructor
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig {
    @Autowired private MyUserDetailsService uds;
    @Autowired private JWTFilter jwtFilter;
    private MyAuthenticationEntryPoint myAuthenticationEntryPoint;
    @Bean
    protected SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception{
        httpSecurity.csrf().disable().httpBasic().disable()
                .cors()
                .and()
                .authorizeHttpRequests()
                .antMatchers("/api/user/**").permitAll()
                .antMatchers("/api/symbol/**").hasRole("ROLE_USER")
                .and().userDetailsService(uds)
                .exceptionHandling()
                .authenticationEntryPoint(myAuthenticationEntryPoint)
                .and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and().formLogin().disable();

        httpSecurity.addFilterBefore(jwtFilter, UsernamePasswordAuthenticationFilter.class);

        return httpSecurity.build();
    }
    @Bean
    public PasswordEncoder passwordEncoder (){
        return new BCryptPasswordEncoder();
    }
    @Bean
    public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception{
        return authenticationConfiguration.getAuthenticationManager();
    }
}

its my first time working on jwt so i have no idea about the issue.


问:
Flutter PHP MYSQL - Http post convert list of numbers as a string from flutter, to list of numbers as integers on PHP API for mysql query
I know there are too many related questions to the title, but so many answers out there didn't help me achieve what i'm trying to do.

I am trying to execute the following code example on mysql:

```<code>SELECT * FROM users
WHERE user_id in (1, 2, 3, 4)
</code>```

The ids are dynamic and it is passed from flutter to PHP Api. So in flutter, my list is like this:

```<code>listOfIds = [1, 2, 3, 4]; //This is dynamic
stringIds = listOfIds.join(","); //Output will be "1,2,3,4"
</code>```

I then pass it to my PHP APi using the following code:

```<code>var response = await http.post(
      Uri.parse('example'),
      headers: {'Accept': 'application/json'},
      body: {
        'ids': stringIds, //has to be converted to string
      },
    );
</code>```

And my php api is like this:

```<code>$ids = $_POST['ids'];

$sql = "SELECT * FROM users WHERE user_id in ('".$ids."') ";
</code>```

So now, the issue here is that the query is doing

```<code>where user_id in ("1, 2, 3, 4")
</code>```

All I need to do is remove the quotes which is converting from string to int.

I tried the following:

```<code>$intIds = implode(',', $ids);

$intIds = array_map('interval', explode(',', $ids));

$intIds = array_map('interval', json_decode($ids, true));
</code>```

and everything in Convert a comma-delimited string into array of integers?

But nothing is working for the sql query i am trying to execute

Body:
I know there are too many related questions to the title, but so many answers out there didn't help me achieve what i'm trying to do.

I am trying to execute the following code example on mysql:

SELECT * FROM users
WHERE user_id in (1, 2, 3, 4)

The ids are dynamic and it is passed from flutter to PHP Api. So in flutter, my list is like this:

listOfIds = [1, 2, 3, 4]; //This is dynamic
stringIds = listOfIds.join(","); //Output will be "1,2,3,4"

I then pass it to my PHP APi using the following code:

var response = await http.post(
      Uri.parse('example'),
      headers: {'Accept': 'application/json'},
      body: {
        'ids': stringIds, //has to be converted to string
      },
    );

And my php api is like this:

$ids = $_POST['ids'];

$sql = "SELECT * FROM users WHERE user_id in ('".$ids."') ";

So now, the issue here is that the query is doing

where user_id in ("1, 2, 3, 4")

All I need to do is remove the quotes which is converting from string to int.

I tried the following:

$intIds = implode(',', $ids);

$intIds = array_map('interval', explode(',', $ids));

$intIds = array_map('interval', json_decode($ids, true));

and everything in Convert a comma-delimited string into array of integers?

But nothing is working for the sql query i am trying to execute


问:
Overlapping hints and suggestions in vscode
Suggestions and hints are getting overlapped in vscode jupyter notebook as shown below:

I want autocomplete suggestions box at the bottom and the documentation related to function at the top. I don't know what to do.


问:
Bitmap color everything non transparent
I am very unfamiliar with image processing and i more or less need to remove the background of an image and then color everything else remaining with a random color.

I've managed to succesfully remove the background and turn it transparrent however i now need to color everything else remaining.

Here is the image before i make it transparrent and the result afterwards.
Now i simply need to color everything that is remaining however i have zero clue how would be able to do that.

Any help would be much appreciated.

Title: Bitmap color everything non transparent


问:
Embedded C# in C++ using mono cannot find System.dll
I'm trying to embed C# scripts into my C++ Game Engine Project, so I followed this example which uses mono: gist-link. The code itself runs fine, I can access the methods of the class, but I have a throw whenever I try to call the Console.WriteLine() function. It seems I can't use System functions inside my scripts.

Here is the log for the throw for the function:

Dog.cs:

```<code>public class Dog
{
    static public void Type()
    {
        Console.WriteLine("a Dog!");
    }

    ...
}
</code>```

Error log:

```<code>Running the static method: Dog:Type()

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
  at Interop+Sys..cctor () [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.Directory.Exists (System.String path) [0x0001e] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver.SearchTerminfo (System.String term) [0x00044] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver..ctor (System.String term) [0x0004b] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver..cctor () [0x0004d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.Console..cctor () [0x0007d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at Dog.Type () [0x00000] in <f155b242589444d6a2f6baf230b1c326>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
  at Interop+Sys..cctor () [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.Directory.Exists (System.String path) [0x0001e] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver.SearchTerminfo (System.String term) [0x00044] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver..ctor (System.String term) [0x0004b] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver..cctor () [0x0004d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.Console..cctor () [0x0007d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at Dog.Type () [0x00000] in <f155b242589444d6a2f6baf230b1c326>:0
</code>```

In this throw I get that System.DllNotFoundException was called, but I have called

```<code>    mono_set_dirs("/usr/lib/", "/etc/");
</code>```

to set mono to find the dlls at /usr/lib/mono/4.5/.
The dll is there so I don't understand.

I am running this on Ubuntu 22.04 LTS, I have mono installed locally and linked to my project using the .so file.

I have tried moving the System.dll from /usr/lib/mono/4.5/ to my repository and link it manually, but that didn't change anything.

To call manually I did:

```<code>mono_domain_assembly_open(domain, "System.dll");
</code>```

Body:
I'm trying to embed C# scripts into my C++ Game Engine Project, so I followed this example which uses mono: gist-link. The code itself runs fine, I can access the methods of the class, but I have a throw whenever I try to call the Console.WriteLine() function. It seems I can't use System functions inside my scripts.

Here is the log for the throw for the function:

Dog.cs:

public class Dog
{
    static public void Type()
    {
        Console.WriteLine("a Dog!");
    }

    ...
}

Error log:

Running the static method: Dog:Type()

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
  at Interop+Sys..cctor () [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.Directory.Exists (System.String path) [0x0001e] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver.SearchTerminfo (System.String term) [0x00044] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver..ctor (System.String term) [0x0004b] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver..cctor () [0x0004d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.Console..cctor () [0x0007d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at Dog.Type () [0x00000] in <f155b242589444d6a2f6baf230b1c326>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Console' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.ConsoleDriver' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
  at Interop+Sys..cctor () [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath, Interop+ErrorInfo& errorInfo) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.FileSystem.DirectoryExists (System.ReadOnlySpan`1[T] fullPath) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.IO.Directory.Exists (System.String path) [0x0001e] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver.SearchTerminfo (System.String term) [0x00044] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.TermInfoDriver..ctor (System.String term) [0x0004b] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver.CreateTermInfoDriver (System.String term) [0x00000] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.ConsoleDriver..cctor () [0x0004d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at System.Console.SetupStreams (System.Text.Encoding inputEncoding, System.Text.Encoding outputEncoding) [0x00007] in <de882a77e7c14f8ba5d298093dde82b2>:0
  at System.Console..cctor () [0x0007d] in <de882a77e7c14f8ba5d298093dde82b2>:0
   --- End of inner exception stack trace ---
  at Dog.Type () [0x00000] in <f155b242589444d6a2f6baf230b1c326>:0

In this throw I get that System.DllNotFoundException was called, but I have called

    mono_set_dirs("/usr/lib/", "/etc/");

to set mono to find the dlls at /usr/lib/mono/4.5/.
The dll is there so I don't understand.

I am running this on Ubuntu 22.04 LTS, I have mono installed locally and linked to my project using the .so file.

I have tried moving the System.dll from /usr/lib/mono/4.5/ to my repository and link it manually, but that didn't change anything.

To call manually I did:

mono_domain_assembly_open(domain, "System.dll");


问:
Can deserialize accept further parameter?
Usually this is how I created objects

```<code>Public Shared Function createBasicSimpleOrder(ammountOfQuoteCurrencyBeingOrdered As Decimal, priceInBasecoin As Decimal, Base As String, Quote As String, exchangeObject As ExchangesClass, isSellingInsteadOfBuying As Boolean, customIdentifier As String) As BasicSimpleOrder
    Dim exchangeString = exchangeObject.ExchangeStringName
    Dim a = New BasicSimpleOrder(ammountOfQuoteCurrencyBeingOrdered, priceInBasecoin, Base, Quote, exchangeString, isSellingInsteadOfBuying, customIdentifier)
    a.initializeComplexObjects(exchangeObject)
    Return a
End Function
</code>```

Basically one of the parameter is an object

```<code>exchangeObject As ExchangesClass
</code>```

That is the only non primitive Object that is a member of BasicSimpleOrder
So after I set up the primitive Public Read Only properties, I called this function.

```<code>Public Sub initializeComplexObjects(exchangeObject As ExchangesClass)
    _exchangeObject = exchangeObject
    If exchangeObject Is Nothing Then Exit Sub
    Dim mark = CoinClass.MarketBaseQuoted(exchangeObject.ExchangeStringName, Base, Quote)
    If mark Is Nothing Then Exit Sub
    setMarket(mark)
End Sub
</code>```

Now say I want to deserialize

I then do

```<code>gridOrderOldState = Newtonsoft.Json.JsonConvert.DeserializeObject(Of futureStateForGrid)(settingsFromBefore)
</code>```

Basically futureStateForGrid is a class that contain some derived class of BasicSimpleOrder

For that DeserializeObject to work I already set a constructor

```<code>Protected Sub New(ammountOfQuoteCurrencyBeingOrdered As Decimal, priceInBasecoin As Decimal, Base As String, Quote As String, exchangeString As String, isSellingInsteadOfBuying As Boolean, customIdentifier As String)
    _ammountOfQuoteCurrencyBeingOrdered = ammountOfQuoteCurrencyBeingOrdered
    _Base = Base
    _Quote = Quote
    _priceInBasecoin = priceInBasecoin
    _exchangeString = exchangeString
    _isSellingInsteadOfBuying = isSellingInsteadOfBuying
    _customIdentifier = customIdentifier
    'initializeType0(ammountOfQuoteCurrencyBeingOrdered, priceInBasecoin, Base, Quote, exchangeString, isSellingInsteadOfBuying, customIdentifier)
End Sub
</code>```

The problem is if I use DeserializeObject, I cannot run initializeComplexObjects(exchangeObject As ExchangesClass)

That's because my new (constructor) function does not accept exchangeObject as ExchangeClass as parameter.

If Protected Sub New accept exchangeObject as ExchangeClass  as a parameter, newtonsoft won't know which object should be put on parameter. After all ExchangeClass is a complex object and not a primitive type. Hence, they're not really there.

So how can I set the exchangeObject as parameter so the constructor know?

Body:
Usually this is how I created objects

Public Shared Function createBasicSimpleOrder(ammountOfQuoteCurrencyBeingOrdered As Decimal, priceInBasecoin As Decimal, Base As String, Quote As String, exchangeObject As ExchangesClass, isSellingInsteadOfBuying As Boolean, customIdentifier As String) As BasicSimpleOrder
    Dim exchangeString = exchangeObject.ExchangeStringName
    Dim a = New BasicSimpleOrder(ammountOfQuoteCurrencyBeingOrdered, priceInBasecoin, Base, Quote, exchangeString, isSellingInsteadOfBuying, customIdentifier)
    a.initializeComplexObjects(exchangeObject)
    Return a
End Function

Basically one of the parameter is an object

exchangeObject As ExchangesClass

That is the only non primitive Object that is a member of BasicSimpleOrder
So after I set up the primitive Public Read Only properties, I called this function.

Public Sub initializeComplexObjects(exchangeObject As ExchangesClass)
    _exchangeObject = exchangeObject
    If exchangeObject Is Nothing Then Exit Sub
    Dim mark = CoinClass.MarketBaseQuoted(exchangeObject.ExchangeStringName, Base, Quote)
    If mark Is Nothing Then Exit Sub
    setMarket(mark)
End Sub

Now say I want to deserialize

I then do

gridOrderOldState = Newtonsoft.Json.JsonConvert.DeserializeObject(Of futureStateForGrid)(settingsFromBefore)

Basically futureStateForGrid is a class that contain some derived class of BasicSimpleOrder

For that DeserializeObject to work I already set a constructor

Protected Sub New(ammountOfQuoteCurrencyBeingOrdered As Decimal, priceInBasecoin As Decimal, Base As String, Quote As String, exchangeString As String, isSellingInsteadOfBuying As Boolean, customIdentifier As String)
    _ammountOfQuoteCurrencyBeingOrdered = ammountOfQuoteCurrencyBeingOrdered
    _Base = Base
    _Quote = Quote
    _priceInBasecoin = priceInBasecoin
    _exchangeString = exchangeString
    _isSellingInsteadOfBuying = isSellingInsteadOfBuying
    _customIdentifier = customIdentifier
    'initializeType0(ammountOfQuoteCurrencyBeingOrdered, priceInBasecoin, Base, Quote, exchangeString, isSellingInsteadOfBuying, customIdentifier)
End Sub

The problem is if I use DeserializeObject, I cannot run initializeComplexObjects(exchangeObject As ExchangesClass)

That's because my new (constructor) function does not accept exchangeObject as ExchangeClass as parameter.

If Protected Sub New accept exchangeObject as ExchangeClass  as a parameter, newtonsoft won't know which object should be put on parameter. After all ExchangeClass is a complex object and not a primitive type. Hence, they're not really there.

So how can I set the exchangeObject as parameter so the constructor know?


问:
Why ajax method returning output in incorrect format in ASP.NET using C# and jQuery
I'm returning the simple JSON output using a jQuery Ajax method from an aspx.cs page using [WebMethod] and the output is not returning properly below is my code

```<code>using System.Web.Services;

[WebMethod]
public static string Chart_Symbols()
{
    string myJsonResponse = "";

    try
    {
        myJsonResponse = "[{\"symbol\":\"AARTIIND\",\"full_name\":\"NSE:AARTIIND\",\"description\":\"AARTI INDUSTRIES LTD\",\"exchange\":\"NSE\",\"ticker\":\"AARTIIND\",\"TYPE\":\"stock\"}]";
    }
    catch (Exception ex)
    {
        throw ex;
    }

    return myJsonResponse;
}
</code>```

From that [WebMethod], I'm getting this output:

This is my jQuery Ajax method:

```<code>//Calling Method
$(document).ready(function () {
    var res = FetchingServiceData();
    alert(res);
});

//Returning output using Ajax method
function FetchingServiceData() {

    var res = $.ajax({

        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "TV_Chart.aspx/Chart_Symbols",
        dataType: "json",
        data: "{}",
        success: function (data) { },
        async: false,
        error: function (err) {
            console.log("eror is ==> "+err);
        }

    }).responseText;//.then(res => res.json()).then(symbols => {
    //    console.log("chart_symbol :- " + JSON.parse(symbols));
    //    return JSON.parse(symbols);
    //});

     // res = res.replace("{\"d\":\"[{", "[{");
     // res = res.replace("}]\"}", "}]");
     // res = res.replace("\\", "");
     // res = res.replace("\\", "");

     // return JSON.stringify(res);
     // return JSON.parse(res);

     return res;
}
</code>```

Once I execute the project Ajax method returning the output like this

```<code>{"d":"[{\"symbol\":\"AARTIIND\",\"full_name\":\"NSE:AARTIIND\",\"description\":\"AARTI INDUSTRIES LTD\",\"exchange\":\"NSE\",\"ticker\":\"AARTIIND\",\"TYPE\":\"stock\"}]"}
</code>```

Image output:

But my output should come like this only:

```<code>var res = [{ "symbol": "AARTIIND", "full_name": "NSE:AARTIIND", "description": "AARTI INDUSTRIES LTD", "exchange": "NSE", "ticker": "AARTIIND", "TYPE": "stock" }];
</code>```

Why am I not getting the correct format in the output from my Ajax method?

Can you suggest what my mistake is?

I'm assuming this point: using res = res.replace("",""); is not a good practice.

Body:
I'm returning the simple JSON output using a jQuery Ajax method from an aspx.cs page using [WebMethod] and the output is not returning properly below is my code

using System.Web.Services;

[WebMethod]
public static string Chart_Symbols()
{
    string myJsonResponse = "";

    try
    {
        myJsonResponse = "[{\"symbol\":\"AARTIIND\",\"full_name\":\"NSE:AARTIIND\",\"description\":\"AARTI INDUSTRIES LTD\",\"exchange\":\"NSE\",\"ticker\":\"AARTIIND\",\"TYPE\":\"stock\"}]";
    }
    catch (Exception ex)
    {
        throw ex;
    }

    return myJsonResponse;
}

From that [WebMethod], I'm getting this output:

This is my jQuery Ajax method:

//Calling Method
$(document).ready(function () {
    var res = FetchingServiceData();
    alert(res);
});

//Returning output using Ajax method
function FetchingServiceData() {

    var res = $.ajax({

        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "TV_Chart.aspx/Chart_Symbols",
        dataType: "json",
        data: "{}",
        success: function (data) { },
        async: false,
        error: function (err) {
            console.log("eror is ==> "+err);
        }

    }).responseText;//.then(res => res.json()).then(symbols => {
    //    console.log("chart_symbol :- " + JSON.parse(symbols));
    //    return JSON.parse(symbols);
    //});

     // res = res.replace("{\"d\":\"[{", "[{");
     // res = res.replace("}]\"}", "}]");
     // res = res.replace("\\", "");
     // res = res.replace("\\", "");

     // return JSON.stringify(res);
     // return JSON.parse(res);

     return res;
}

Once I execute the project Ajax method returning the output like this

{"d":"[{\"symbol\":\"AARTIIND\",\"full_name\":\"NSE:AARTIIND\",\"description\":\"AARTI INDUSTRIES LTD\",\"exchange\":\"NSE\",\"ticker\":\"AARTIIND\",\"TYPE\":\"stock\"}]"}

Image output:

But my output should come like this only:

var res = [{ "symbol": "AARTIIND", "full_name": "NSE:AARTIIND", "description": "AARTI INDUSTRIES LTD", "exchange": "NSE", "ticker": "AARTIIND", "TYPE": "stock" }];

Why am I not getting the correct format in the output from my Ajax method?

Can you suggest what my mistake is?

I'm assuming this point: using res = res.replace("",""); is not a good practice.


问:
pyserial access com port on remote computer via IP
I am trying to access a serial device on a network computer. The device is connected via USB-Serial cable and is assigned COM8 port.

I tried to use:

```<code>import serial
ser = serial.serial_for_url("socket://10.10.10.152:///dev/ttyCOM8")
</code>```

Which is wrong. I am pretty sure serail_for_url will only accept port number. But I am not sure how to go about that.

Body:
I am trying to access a serial device on a network computer. The device is connected via USB-Serial cable and is assigned COM8 port.

I tried to use:

import serial
ser = serial.serial_for_url("socket://10.10.10.152:///dev/ttyCOM8")

Which is wrong. I am pretty sure serail_for_url will only accept port number. But I am not sure how to go about that.


问:
Vue: Pinia state property doesn't update in component with node-forge
I read the other stackoverflow questions but does not help. I use pinia=2.0.27. I could extend the example if neccessary.

I have a component with a button with a spinner.

```<code><template>
  ....
  <button
    type="submit"
    class="btn btn-primary"
    :disabled="loading ? true : false"
    @click="submitForm"
  >
    <span
      v-show="loading"
      class="spinner-border spinner-border-sm"
      role="status"
      aria-hidden="true"
    />
    <span v-show="loading"> Wait </span>
    <span v-show="!loading">
      Create certificate
    </span>
  </button>
  ....
</template>
<script setup>
import { storeToRefs } from "pinia";
import { useUserStore } from "@/store/UserStore";

const { loading } = storeToRefs(useUserStore());
</script>
<script>
export default {
  async submitForm() {
    try {
      await useUserStore().createCertificate();
    } catch (error) {
       console.log(error);
    }
  },
};
</script>
</code>```

This is the pinia store:

```<code>import { defineStore } from "pinia";
import forge from "node-forge";

export const useUserStore = defineStore({
  id: "UserStore",
  state: () => {
    return {
      loading: false,
    };
  },
  actions: {
     async createCertificate() {
       this.loading = true;
       try {
         const keys = forge.pki.rsa.generateKeyPair(2048);
       } catch (error) {
         console.log(error);
       } finally {
         this.loading = false;
       }
    },
  },
});
</code>```

The problem is, that the doStuff function already runs and the loading property is still false inside the component and the spinner is very late visible.

Body:
I read the other stackoverflow questions but does not help. I use pinia=2.0.27. I could extend the example if neccessary.

I have a component with a button with a spinner.

<template>
  ....
  <button
    type="submit"
    class="btn btn-primary"
    :disabled="loading ? true : false"
    @click="submitForm"
  >

     Wait

      Create certificate

  </button>
  ....
</template>

This is the pinia store:

import { defineStore } from "pinia";
import forge from "node-forge";

export const useUserStore = defineStore({
  id: "UserStore",
  state: () => {
    return {
      loading: false,
    };
  },
  actions: {
     async createCertificate() {
       this.loading = true;
       try {
         const keys = forge.pki.rsa.generateKeyPair(2048);
       } catch (error) {
         console.log(error);
       } finally {
         this.loading = false;
       }
    },
  },
});

The problem is, that the doStuff function already runs and the loading property is still false inside the component and the spinner is very late visible.


问:
Laravel Routes using Middleware with an OR in list of Middleware or other method
I am using the Spatie permission and roles package for Laravel.  I wanted to try and check the permission and roles in my web routes.php file in Route Groups, but that doesn't seem to work because the Auth::user() does't have the Spatie functions attached in the routes.  That must happen somewhere else.  I say that because I get a call to member function on NULL.

What I am currently doing is something like this:

```<code>Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {

        Route::post('/Reports/getallhl7_reports', [ReportsController::class, 'getallhl7_reports'])->name('getallhl7_reports');
        Route::post('emailReport', [UtilitiesController::class, 'emailReport'])->name('emailReport');
});
</code>```

and then in the Controllers checking the permissions and roles like:

```<code>protected function getallhl7_reports(Request $request) {

    if (Auth::user()->can('provider_data') || Auth::user()->can('staff_data')) {
        return Reports::getallhl7_reports($request->input('StudyInstanceUID'));
    }
}
</code>```

What I might want to do is to check the permissions in the routes or routes groups instead of in the Controller, but like I said the Spatie functions are not available in the Route Groups (After the Group, but before the Route) for some reason, and using an OR in the Middleware seems to be problematic.  You can check for permissions in the Group, but I think that is an AND and not an OR, like:

```<code> Route::group(['middleware' => ['auth:sanctum','verified', 'permission:provider_data', 'permission:staff_data']], function () {
</code>```

It isn't clear to me how I could check permissions using this format:

```<code>Route::post('emailReport', [UtilitiesController::class, 'emailReport'])->name('emailReport');
</code>```

by modifying it with something to verify some set of permissions before invoking the Controller.

Body:
I am using the Spatie permission and roles package for Laravel.  I wanted to try and check the permission and roles in my web routes.php file in Route Groups, but that doesn't seem to work because the Auth::user() does't have the Spatie functions attached in the routes.  That must happen somewhere else.  I say that because I get a call to member function on NULL.

What I am currently doing is something like this:

Route::group(['middleware' => ['auth:sanctum', 'verified']], function () {

        Route::post('/Reports/getallhl7_reports', [ReportsController::class, 'getallhl7_reports'])->name('getallhl7_reports');
        Route::post('emailReport', [UtilitiesController::class, 'emailReport'])->name('emailReport');
});

and then in the Controllers checking the permissions and roles like:

protected function getallhl7_reports(Request $request) {

    if (Auth::user()->can('provider_data') || Auth::user()->can('staff_data')) {
        return Reports::getallhl7_reports($request->input('StudyInstanceUID'));
    }
}

What I might want to do is to check the permissions in the routes or routes groups instead of in the Controller, but like I said the Spatie functions are not available in the Route Groups (After the Group, but before the Route) for some reason, and using an OR in the Middleware seems to be problematic.  You can check for permissions in the Group, but I think that is an AND and not an OR, like:

 Route::group(['middleware' => ['auth:sanctum','verified', 'permission:provider_data', 'permission:staff_data']], function () {

It isn't clear to me how I could check permissions using this format:

Route::post('emailReport', [UtilitiesController::class, 'emailReport'])->name('emailReport');

by modifying it with something to verify some set of permissions before invoking the Controller.


问:
ERROR: Trying to bundle file but it doesn't exist with adminjs/adminbro
I have an api with adminjs and upload feature with aws s3 that is working correctly when i run locally. But when deployed on vercel i get the following error:

```<code>t.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
Legacy server listening...
2022-12-08T12:33:06.859Z    undefined   ERROR   Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"ConfigurationError: \\n    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist\\n    More information can be found at: https://docs.adminjs.co/AdminJS.html%5Cn    ","reason":{"errorType":"ConfigurationError","errorMessage":"\\n    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist\\n    More information can be found at: https://docs.adminjs.co/AdminJS.html%5Cn    ","name":"ConfigurationError","stack":\["ConfigurationError: ","    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist","    More information can be found at: https://docs.adminjs.co/AdminJS.html%22,%22    ","    at Function.resolveFilePath (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:108:11)","    at ComponentLoader.\__unsafe_addWithoutChecks (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:52:46)","    at Function.bundle (/var/task/node_modules/adminjs/lib/adminjs.js:391:41)","    at uploadFileFeature (/var/task/node_modules/@adminjs/upload/build/features/upload-file/upload-file.feature.js:75:45)","    at AdminOptions.buildResources (/var/task/src/utils/buildAdminOptions.js:235:21)","    at module.exports (/var/task/src/main/config/setup.js:18:39)","    at Object.\<anonymous\> (/var/task/src/main/config/app.js:6:1)","    at Module.\_compile (internal/modules/cjs/loader.js:1085:14)","    at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)","    at Module.load (internal/modules/cjs/loader.js:950:32)"\]},"promise":{},"stack":\["Runtime.UnhandledPromiseRejection: ConfigurationError: ","    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist","    More information can be found at: https://docs.adminjs.co/AdminJS.html%22,%22    ","    at process.\<anonymous\> (/var/runtime/index.js:35:15)","    at process.emit (events.js:412:35)","    at process.emit (domain.js:475:12)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:96:32)"\]}
2022-12-08T12:33:06.863Z    undefined   ERROR   Unhandled rejection: ConfigurationError:
Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist
More information can be found at: https://docs.adminjs.co/AdminJS.html
at Function.resolveFilePath (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:108:11)
at ComponentLoader.\__unsafe_addWithoutChecks (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:52:46)
at Function.bundle (/var/task/node_modules/adminjs/lib/adminjs.js:391:41)
at uploadFileFeature (/var/task/node_modules/@adminjs/upload/build/features/upload-file/upload-file.feature.js:75:45)
at AdminOptions.buildResources (/var/task/src/utils/buildAdminOptions.js:235:21)
at module.exports (/var/task/src/main/config/setup.js:18:39)
at Object.\<anonymous\> (/var/task/src/main/config/app.js:6:1)
at Module.\_compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
RequestId: c78d99be-b47c-4848-942d-37a81c45fe78 Error: Runtime exited with error: exit status 1
Runtime.ExitError
</code>```

Installed libraries and their versions

```<code>"@adminjs/bundler": "^2.0.0",
"@adminjs/express": "^5.0.1",
"@adminjs/mongoose": "^3.0.0",
"@adminjs/upload": "^3.0.1",
"adminjs": "^6.6.5",
</code>```

Setup

```<code>
    require('dotenv').config();
    app.use(express.static(path.join(__dirname, '../../../public/')));
    app.use('/uploads', express.static('uploads'));
    const adminOptions = {
        locale: adminOptions().buildLocales(),
        resources: adminOptions().buildResources(),
        branding: adminOptions().buildBranding(),
        assets: {
            styles: ['/styles.css'],
        },
    };
    AdminJS.registerAdapter({ Database, Resource });
    const admin = new AdminJS(adminOptions);
    const adminRouter = AdminJSExpress.buildAuthenticatedRouter(admin, {
        ...
    });
    app.use(admin.options.rootPath, adminRouter);
</code>```

my entry file generated automatically

```<code>import Component0 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component0 = Component0
import Component1 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component1 = Component1
import Component2 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component2 = Component2
import Component3 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component3 = Component3
import Component4 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component4 = Component4
import Component5 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component5 = Component5
import Component6 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component6 = Component6
import Component7 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component7 = Component7
import Component8 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component8 = Component8
import Component9 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component9 = Component9
import Component10 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component10 = Component10
import Component11 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component11 = Component11
import Component12 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component12 = Component12
import Component13 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component13 = Component13
import Component14 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component14 = Component14
import Component15 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component15 = Component15
import Component16 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component16 = Component16
import Component17 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component17 = Component17
import Component18 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component18 = Component18
import Component19 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component19 = Component19
import Component20 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component20 = Component20
</code>```

I already tried to use @adminjs/bundler with ADMIN_JS_SKIP_BUNDLE="true", but i'm not sure if i'm doing it correctly.

And my project an only .js app.

Body:
I have an api with adminjs and upload feature with aws s3 that is working correctly when i run locally. But when deployed on vercel i get the following error:

t.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
Legacy server listening...
2022-12-08T12:33:06.859Z    undefined   ERROR   Unhandled Promise Rejection     {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"ConfigurationError: \\n    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist\\n    More information can be found at: https://docs.adminjs.co/AdminJS.html%5Cn    ","reason":{"errorType":"ConfigurationError","errorMessage":"\\n    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist\\n    More information can be found at: https://docs.adminjs.co/AdminJS.html%5Cn    ","name":"ConfigurationError","stack":\["ConfigurationError: ","    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist","    More information can be found at: https://docs.adminjs.co/AdminJS.html%22,%22    ","    at Function.resolveFilePath (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:108:11)","    at ComponentLoader.\__unsafe_addWithoutChecks (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:52:46)","    at Function.bundle (/var/task/node_modules/adminjs/lib/adminjs.js:391:41)","    at uploadFileFeature (/var/task/node_modules/@adminjs/upload/build/features/upload-file/upload-file.feature.js:75:45)","    at AdminOptions.buildResources (/var/task/src/utils/buildAdminOptions.js:235:21)","    at module.exports (/var/task/src/main/config/setup.js:18:39)","    at Object.\<anonymous\> (/var/task/src/main/config/app.js:6:1)","    at Module.\_compile (internal/modules/cjs/loader.js:1085:14)","    at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)","    at Module.load (internal/modules/cjs/loader.js:950:32)"\]},"promise":{},"stack":\["Runtime.UnhandledPromiseRejection: ConfigurationError: ","    Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist","    More information can be found at: https://docs.adminjs.co/AdminJS.html%22,%22    ","    at process.\<anonymous\> (/var/runtime/index.js:35:15)","    at process.emit (events.js:412:35)","    at process.emit (domain.js:475:12)","    at processPromiseRejections (internal/process/promises.js:245:33)","    at processTicksAndRejections (internal/process/task_queues.js:96:32)"\]}
2022-12-08T12:33:06.863Z    undefined   ERROR   Unhandled rejection: ConfigurationError:
Trying to bundle file '/var/task/node_modules/@adminjs/upload/src/features/upload-file/components/edit' but it doesn't exist
More information can be found at: https://docs.adminjs.co/AdminJS.html
at Function.resolveFilePath (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:108:11)
at ComponentLoader.\__unsafe_addWithoutChecks (/var/task/node_modules/adminjs/lib/backend/utils/component-loader.js:52:46)
at Function.bundle (/var/task/node_modules/adminjs/lib/adminjs.js:391:41)
at uploadFileFeature (/var/task/node_modules/@adminjs/upload/build/features/upload-file/upload-file.feature.js:75:45)
at AdminOptions.buildResources (/var/task/src/utils/buildAdminOptions.js:235:21)
at module.exports (/var/task/src/main/config/setup.js:18:39)
at Object.\<anonymous\> (/var/task/src/main/config/app.js:6:1)
at Module.\_compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module.\_extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
RequestId: c78d99be-b47c-4848-942d-37a81c45fe78 Error: Runtime exited with error: exit status 1
Runtime.ExitError

Installed libraries and their versions

"@adminjs/bundler": "^2.0.0",
"@adminjs/express": "^5.0.1",
"@adminjs/mongoose": "^3.0.0",
"@adminjs/upload": "^3.0.1",
"adminjs": "^6.6.5",

Setup

    require('dotenv').config();
    app.use(express.static(path.join(__dirname, '../../../public/')));
    app.use('/uploads', express.static('uploads'));
    const adminOptions = {
        locale: adminOptions().buildLocales(),
        resources: adminOptions().buildResources(),
        branding: adminOptions().buildBranding(),
        assets: {
            styles: ['/styles.css'],
        },
    };
    AdminJS.registerAdapter({ Database, Resource });
    const admin = new AdminJS(adminOptions);
    const adminRouter = AdminJSExpress.buildAuthenticatedRouter(admin, {
        ...
    });
    app.use(admin.options.rootPath, adminRouter);

my entry file generated automatically

import Component0 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component0 = Component0
import Component1 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component1 = Component1
import Component2 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component2 = Component2
import Component3 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component3 = Component3
import Component4 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component4 = Component4
import Component5 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component5 = Component5
import Component6 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component6 = Component6
import Component7 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component7 = Component7
import Component8 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component8 = Component8
import Component9 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component9 = Component9
import Component10 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component10 = Component10
import Component11 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component11 = Component11
import Component12 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component12 = Component12
import Component13 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component13 = Component13
import Component14 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component14 = Component14
import Component15 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component15 = Component15
import Component16 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component16 = Component16
import Component17 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component17 = Component17
import Component18 from '../node_modules/@adminjs/upload/src/features/upload-file/components/edit.tsx'
AdminJS.UserComponents.Component18 = Component18
import Component19 from '../node_modules/@adminjs/upload/src/features/upload-file/components/list.tsx'
AdminJS.UserComponents.Component19 = Component19
import Component20 from '../node_modules/@adminjs/upload/src/features/upload-file/components/show.tsx'
AdminJS.UserComponents.Component20 = Component20

I already tried to use @adminjs/bundler with ADMIN_JS_SKIP_BUNDLE="true", but i'm not sure if i'm doing it correctly.

And my project an only .js app.