问:
Application is running correctly but when try to build jar "org.springframework.beans.factory.UnsatisfiedDependencyException"
UserRepo.java

```<code>package com.sample.sample.repository;

import com.sample.sample.entity.User;
import com.sample.sample.model.UserModel;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepo extends PagingAndSortingRepository<User, Long> {

    Optional<User> getUserByEmail(String email);

    Optional<User> getUserByPhoneNumber(String phoneNumber);

    @Query("SELECT * FROM users WHERE email = :userName OR phone_number = :userName")
    Optional<User> get_user_by_user_name(String userName);

    Optional<User> findById(Long id);
}
</code>```

SecurityConfig.java

```<code>package com.sample.sample.config;

import com.sample.sample.security.CustomUserDetailsService;
import com.sample.sample.security.RestAuthenticationEntryPoint;
import com.sample.sample.security.TokenAuthenticationFilter;
import com.sample.sample.security.oauth2.CustomOAuth2UserService;
import com.sample.sample.security.oauth2.HttpCookieOAuth2AuthorizationRequestRepository;
import com.sample.sample.security.oauth2.OAuth2AuthenticationFailureHandler;
import com.sample.sample.security.oauth2.OAuth2AuthenticationSuccessHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.BeanIds;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(
        securedEnabled = true,
        jsr250Enabled = true,
        prePostEnabled = true
)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private CustomUserDetailsService customUserDetailsService;

    @Autowired
    private CustomOAuth2UserService customOAuth2UserService;

    @Autowired
    private OAuth2AuthenticationSuccessHandler oAuth2AuthenticationSuccessHandler;

    @Autowired
    private OAuth2AuthenticationFailureHandler oAuth2AuthenticationFailureHandler;

    @Autowired
    private HttpCookieOAuth2AuthorizationRequestRepository httpCookieOAuth2AuthorizationRequestRepository;

    @Bean
    public TokenAuthenticationFilter tokenAuthenticationFilter() {
        return new TokenAuthenticationFilter();
    }

    /*
      By default, Spring OAuth2 uses HttpSessionOAuth2AuthorizationRequestRepository to save
      the authorization request. But, since our service is stateless, we can't save it in
      the session. We'll save the request in a Base64 encoded cookie instead.
    */
    @Bean
    public HttpCookieOAuth2AuthorizationRequestRepository cookieAuthorizationRequestRepository() {
        return new HttpCookieOAuth2AuthorizationRequestRepository();
    }

    @Override

    public void configure(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
        authenticationManagerBuilder
                .userDetailsService(customUserDetailsService)
                .passwordEncoder(passwordEncoder());
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Bean(BeanIds.AUTHENTICATION_MANAGER)
    @Override
    public AuthenticationManager authenticationManagerBean() throws Exception {
        return super.authenticationManagerBean();
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .cors()
                    .and()
                .sessionManagement()
                    .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                    .and()
                .csrf()
                    .disable()
                .formLogin()
                    .disable()
                .httpBasic()
                    .disable()
                .exceptionHandling()
                    .authenticationEntryPoint(new RestAuthenticationEntryPoint())
                    .and()
                .authorizeRequests()
                    .antMatchers("/",
                        "/error",
                        "/favicon.ico",
                        "/**/*.png",
                        "/**/*.gif",
                        "/**/*.svg",
                        "/**/*.jpg",
                        "/**/*.html",
                        "/**/*.css",
                        "/**/*.js")
                        .permitAll()
                    .antMatchers("/auth/**", "/oauth2/**")
                        .permitAll()
                    .anyRequest()
                        .permitAll()
                    .and()
                .oauth2Login()
                    .authorizationEndpoint()
                        .baseUri("/oauth2/authorize")
                        .authorizationRequestRepository(cookieAuthorizationRequestRepository())
                        .and()
                    .redirectionEndpoint()
                        .baseUri("/oauth2/callback/*")
                        .and()
                    .userInfoEndpoint()
                        .userService(customOAuth2UserService)
                        .and()
                    .successHandler(oAuth2AuthenticationSuccessHandler)
                    .failureHandler(oAuth2AuthenticationFailureHandler);

        // Add our custom Token based authentication filter
        http.addFilterBefore(tokenAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
    }
}
</code>```

CustomUserDetailsService.java

```<code>package com.sample.sample.security;

import com.sample.sample.exception.ResourceNotFoundException;
import com.sample.sample.entity.User;
import com.sample.sample.repository.UserRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Component
    public class CustomUserDetailsService implements UserDetailsService {

    @Autowired
    UserRepo userRepo;

    @Override
    @Transactional
    public UserDetails loadUserByUsername(String userName)
            throws UsernameNotFoundException {
        User user = userRepo.get_user_by_user_name(userName)
                .orElseThrow(() ->
                        new UsernameNotFoundException("User not found with email or password : " + userName)
        );

        return UserPrincipal.create(user);
    }

    @Transactional
    public UserDetails loadUserById(Long id) {
        User user = userRepo.findById(id).orElseThrow(
            () -> new ResourceNotFoundException("User", "id", id)
        );

        return UserPrincipal.create(user);
    }
}
</code>```

pom.xml

```<code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.6.RELEASE</version>
    </parent>
    <groupId>com.sample.sample</groupId>
    <artifactId>sample</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Sample</name>
    <description>Online Confectionary API</description>

    <properties>
        <java.version>11</java.version>
        <spring-cloud.version>2020.0.0-M5</spring-cloud.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.9</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jdbc</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.22</version>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-client</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <!-- JWT library -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>0.9.1</version>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <!-- DO NOT include log4j.properties file in your Jar -->
                    <excludes>
                        <exclude>**/log4j.properties</exclude>
                    </excludes>
                    <archive>
                        <manifest>
                            <!-- Jar file entry point -->
                            <mainClass>com.sample.sample.Application</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
        </repository>
    </repositories>

</project>
</code>```

Error

org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'securityConfig': Unsatisfied dependency
expressed through field 'customUserDetailsService'; nested exception
is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'customUserDetailsService': Unsatisfied
dependency expressed through field 'userRepo'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'userRepo' defined in
com.sample.sample.repository.UserRepo defined in
@EnableJdbcRepositories declared on
JdbcRepositoriesRegistrar.EnableJdbcRepositoriesConfiguration:
Invocation of init method failed; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'refreshEventListener' defined in class
path resource
[org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'refreshEventListener'
parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'configDataContextRefresher' defined in class
path resource
[org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.cloud.context.refresh.ConfigDataContextRefresher]:
Factory method 'configDataContextRefresher' threw exception; nested
exception is java.lang.NoClassDefFoundError:
org/springframework/boot/ConfigurableBootstrapContext     at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]   at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]   at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
~[spring-boot-test-2.3.6.RELEASE.jar:2.3.6.RELEASE]   at
org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:123)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:98)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$5(ClassBasedTestDescriptor.java:341)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:346)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:341)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
~[na:na]  at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
~[na:na]  at
java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
~[na:na]  at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
~[na:na]  at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
~[na:na]  at
java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)
~[na:na]  at
java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
~[na:na]  at
java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
~[na:na]  at
java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
~[na:na]  at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:340)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:263)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:256)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
java.base/java.util.Optional.orElseGet(Optional.java:369) ~[na:na]    at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:255)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:29)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:108)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:107)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:71)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:107)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:107)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:75)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
at
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
at
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
~[surefire-junit-platform-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
~[surefire-junit-platform-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
~[surefire-booter-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
~[surefire-booter-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
~[surefire-booter-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
~[surefire-booter-2.22.2.jar:2.22.2]

Application is Running correctly , but when I try to build the jar , the above error occurred , please someone help me on this,
what is the problem here , whether I have missed something ?

Body:
UserRepo.java

package com.sample.sample.repository;

import com.sample.sample.entity.User;
import com.sample.sample.model.UserModel;
import org.springframework.data.jdbc.repository.query.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface UserRepo extends PagingAndSortingRepository<User, Long> {

    Optional<User> getUserByEmail(String email);

    Optional<User> getUserByPhoneNumber(String phoneNumber);

    @Query("SELECT * FROM users WHERE email = :userName OR phone_number = :userName")
    Optional<User> get_user_by_user_name(String userName);

    Optional<User> findById(Long id);
}

SecurityConfig.java

package com.sample.sample.config;

import com.sample.sample.security.CustomUserDetailsService;
import com.sample.sample.security.RestAuthenticationEntryPoint;
import com.sample.sample.security.TokenAuthenticationFilter;
import com.sample.sample.security.oauth2.CustomOAuth2UserService;
import com.sample.sample.security.oauth2.HttpCookieOAuth2AuthorizationRequestRepository;
import com.sample.sample.security.oauth2.OAuth2AuthenticationFailureHandler;
import com.sample.sample.security.oauth2.OAuth2AuthenticationSuccessHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.BeanIds;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(
        securedEnabled = true,
        jsr250Enabled = true,
        prePostEnabled = true
)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    private CustomUserDetailsService customUserDetailsService;

    @Autowired
    private CustomOAuth2UserService customOAuth2UserService;

    @Autowired
    private OAuth2AuthenticationSuccessHandler oAuth2AuthenticationSuccessHandler;

    @Autowired
    private OAuth2AuthenticationFailureHandler oAuth2AuthenticationFailureHandler;

    @Autowired
    private HttpCookieOAuth2AuthorizationRequestRepository httpCookieOAuth2AuthorizationRequestRepository;

    @Bean
    public TokenAuthenticationFilter tokenAuthenticationFilter() {
        return new TokenAuthenticationFilter();
    }

    /*
      By default, Spring OAuth2 uses HttpSessionOAuth2AuthorizationRequestRepository to save
      the authorization request. But, since our service is stateless, we can't save it in
      the session. We'll save the request in a Base64 encoded cookie instead.
    */
    @Bean
    public HttpCookieOAuth2AuthorizationRequestRepository cookieAuthorizationRequestRepository() {
        return new HttpCookieOAuth2AuthorizationRequestRepository();
    }

    @Override

    public void configure(AuthenticationManagerBuilder authenticationManagerBuilder) throws Exception {
        authenticationManagerBuilder
                .userDetailsService(customUserDetailsService)
                .passwordEncoder(passwordEncoder());
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }

    @Bean(BeanIds.AUTHENTICATION_MANAGER)
    @Override
    public AuthenticationManager authenticationManagerBean() throws Exception {
        return super.authenticationManagerBean();
    }

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .cors()
                    .and()
                .sessionManagement()
                    .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                    .and()
                .csrf()
                    .disable()
                .formLogin()
                    .disable()
                .httpBasic()
                    .disable()
                .exceptionHandling()
                    .authenticationEntryPoint(new RestAuthenticationEntryPoint())
                    .and()
                .authorizeRequests()
                    .antMatchers("/",
                        "/error",
                        "/favicon.ico",
                        "/**/*.png",
                        "/**/*.gif",
                        "/**/*.svg",
                        "/**/*.jpg",
                        "/**/*.html",
                        "/**/*.css",
                        "/**/*.js")
                        .permitAll()
                    .antMatchers("/auth/**", "/oauth2/**")
                        .permitAll()
                    .anyRequest()
                        .permitAll()
                    .and()
                .oauth2Login()
                    .authorizationEndpoint()
                        .baseUri("/oauth2/authorize")
                        .authorizationRequestRepository(cookieAuthorizationRequestRepository())
                        .and()
                    .redirectionEndpoint()
                        .baseUri("/oauth2/callback/*")
                        .and()
                    .userInfoEndpoint()
                        .userService(customOAuth2UserService)
                        .and()
                    .successHandler(oAuth2AuthenticationSuccessHandler)
                    .failureHandler(oAuth2AuthenticationFailureHandler);

        // Add our custom Token based authentication filter
        http.addFilterBefore(tokenAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
    }
}

CustomUserDetailsService.java

package com.sample.sample.security;

import com.sample.sample.exception.ResourceNotFoundException;
import com.sample.sample.entity.User;
import com.sample.sample.repository.UserRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Component
    public class CustomUserDetailsService implements UserDetailsService {

    @Autowired
    UserRepo userRepo;

    @Override
    @Transactional
    public UserDetails loadUserByUsername(String userName)
            throws UsernameNotFoundException {
        User user = userRepo.get_user_by_user_name(userName)
                .orElseThrow(() ->
                        new UsernameNotFoundException("User not found with email or password : " + userName)
        );

        return UserPrincipal.create(user);
    }

    @Transactional
    public UserDetails loadUserById(Long id) {
        User user = userRepo.findById(id).orElseThrow(
            () -> new ResourceNotFoundException("User", "id", id)
        );

        return UserPrincipal.create(user);
    }
}

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.6.RELEASE</version>
    </parent>
    <groupId>com.sample.sample</groupId>
    <artifactId>sample</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>Sample</name>
    <description>Online Confectionary API</description>

    <properties>
        <java.version>11</java.version>
        <spring-cloud.version>2020.0.0-M5</spring-cloud.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>3.9</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jdbc</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.22</version>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-client</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>0.9.1</version>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>

                    <excludes>
                        <exclude>**/log4j.properties</exclude>
                    </excludes>
                    <archive>
                        <manifest>

                            <mainClass>com.sample.sample.Application</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
        </repository>
    </repositories>

</project>

Error

org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'securityConfig': Unsatisfied dependency
expressed through field 'customUserDetailsService'; nested exception
is org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'customUserDetailsService': Unsatisfied
dependency expressed through field 'userRepo'; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'userRepo' defined in
com.sample.sample.repository.UserRepo defined in
@EnableJdbcRepositories declared on
JdbcRepositoriesRegistrar.EnableJdbcRepositoriesConfiguration:
Invocation of init method failed; nested exception is
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'refreshEventListener' defined in class
path resource
[org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'refreshEventListener'
parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'configDataContextRefresher' defined in class
path resource
[org/springframework/cloud/autoconfigure/RefreshAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.cloud.context.refresh.ConfigDataContextRefresher]:
Factory method 'configDataContextRefresher' threw exception; nested
exception is java.lang.NoClassDefFoundError:
org/springframework/boot/ConfigurableBootstrapContext     at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
~[spring-beans-5.2.11.RELEASE.jar:5.2.11.RELEASE]     at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]   at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
~[spring-context-5.2.11.RELEASE.jar:5.2.11.RELEASE]   at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
~[spring-boot-2.3.6.RELEASE.jar:2.3.6.RELEASE]    at
org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:120)
~[spring-boot-test-2.3.6.RELEASE.jar:2.3.6.RELEASE]   at
org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:124)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:123)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:190)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:132)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:244)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:98)
~[spring-test-5.2.11.RELEASE.jar:5.2.11.RELEASE]  at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$5(ClassBasedTestDescriptor.java:341)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:346)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$6(ClassBasedTestDescriptor.java:341)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
~[na:na]  at
java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
~[na:na]  at
java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
~[na:na]  at
java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
~[na:na]  at
java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
~[na:na]  at
java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:312)
~[na:na]  at
java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
~[na:na]  at
java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734)
~[na:na]  at
java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
~[na:na]  at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:340)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:263)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:256)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
java.base/java.util.Optional.orElseGet(Optional.java:369) ~[na:na]    at
org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:255)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:29)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:108)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:107)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:71)
~[junit-jupiter-engine-5.6.3.jar:5.6.3]   at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:107)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:107)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:75)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
at
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
at
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
~[junit-platform-engine-1.6.3.jar:1.6.3]  at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
~[junit-platform-launcher-1.3.1.jar:1.3.1]    at
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:150)
~[surefire-junit-platform-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:124)
~[surefire-junit-platform-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
~[surefire-booter-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
~[surefire-booter-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
~[surefire-booter-2.22.2.jar:2.22.2]  at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)
~[surefire-booter-2.22.2.jar:2.22.2]

Application is Running correctly , but when I try to build the jar , the above error occurred , please someone help me on this,
what is the problem here , whether I have missed something ?


来源: stackexchange

问:
Does Quarkus provide a simple password hashing component?
I currently have a Quarkus project and implemented JWT authentication wit smallrye. I have a simple login API endpoint, but currently the password is stored in plain text as i do not have any hashing. I know there are a lot of complicated framework things with configuration files etc., but is there a simple component or class that is provided by the framework i can use to hash the password to store/check it with the database? I just want to have a class i can call to hash a password for a specific algorithm. Here is the code for the API endpoint:

```<code>@POST
@Path("/login")
@PermitAll
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public TokenResponse login(@Valid LoginRequest request) {
    // Hash the password in request.getPassword() first here?
    User user = userRepository.getByEmailAndPassword(request.getEmail(), request.getPassword());
    if (user == null) throw new NotFoundException();
    String jwt = jwtGenerator.generateTokenFor(user);
    return tokenResponseBuilder.buildTokenResponseFor(user, jwt);
}
</code>```

If there is not anything provided by default, can anyone recommend one to use here? I am not sure how to go about this, as with Spring Boot there was seemingly always a straightforward way to do this.

ContentLicense: CC BY-SA 4.0

Body:
I currently have a Quarkus project and implemented JWT authentication wit smallrye. I have a simple login API endpoint, but currently the password is stored in plain text as i do not have any hashing. I know there are a lot of complicated framework things with configuration files etc., but is there a simple component or class that is provided by the framework i can use to hash the password to store/check it with the database? I just want to have a class i can call to hash a password for a specific algorithm. Here is the code for the API endpoint:

@POST
@Path("/login")
@PermitAll
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public TokenResponse login(@Valid LoginRequest request) {
    // Hash the password in request.getPassword() first here?
    User user = userRepository.getByEmailAndPassword(request.getEmail(), request.getPassword());
    if (user == null) throw new NotFoundException();
    String jwt = jwtGenerator.generateTokenFor(user);
    return tokenResponseBuilder.buildTokenResponseFor(user, jwt);
}

If there is not anything provided by default, can anyone recommend one to use here? I am not sure how to go about this, as with Spring Boot there was seemingly always a straightforward way to do this.


问:
How to retrieve data with date filter in datetime column
I have a sqlite database where I have a table called result and a column named for_date which stores data in the format of

```<code>YYYY-MM-DD HH:MM:SS
</code>```

where I want to filter data for just particular date.
for example

```<code>2020-12-12
</code>```

so it should fetch all the data for that date.

I tried strftime,date functions but they seems to be not working.

can anybody help here?

below query gives data for date greater than date passed which includes all the days after that, which I don't want

```<code>select result.id result.subject,result.studentid,result.for_date as date
from result
where for_date >='2022-12-10';
</code>```

Body:
I have a sqlite database where I have a table called result and a column named for_date which stores data in the format of

YYYY-MM-DD HH:MM:SS

where I want to filter data for just particular date.
for example

2020-12-12

so it should fetch all the data for that date.

I tried strftime,date functions but they seems to be not working.

can anybody help here?

below query gives data for date greater than date passed which includes all the days after that, which I don't want

select result.id result.subject,result.studentid,result.for_date as date
from result
where for_date >='2022-12-10';


问:
Laravel Relationship: Belongtomany and wherein
I have 2 tables, there's a belong to many relationship between them with a pivot table.
I'm trying to get a query of the first table with an array of ids on the second table.

Example:
TableA: ID: 1, 2, 3
TableB: ID: 1, 2, 3

Pivot Table:

ID_tableA: 1, 1, 2, 3

ID_tableB: 1, 2, 2, 3

I must fetch a Table A when both id 1 and 2 of table B are related in the pivot table.
Example:

```<code>TableA::whereHas('tableB', fn($q)=>$q->magicQueryPleaseHelp([1, 2]))->get();
</code>```

Should return only TableA with id 1.

I've tried using whereIn('id', [1,2]) inside the whereHas but it fetches out TableA with id 2 too.
Using many whereHas on each of the array items give the desire result but it's too weird.

There's a more adequate solution?

Body:
I have 2 tables, there's a belong to many relationship between them with a pivot table.
I'm trying to get a query of the first table with an array of ids on the second table.

Example:
TableA: ID: 1, 2, 3
TableB: ID: 1, 2, 3

Pivot Table:

ID_tableA: 1, 1, 2, 3

ID_tableB: 1, 2, 2, 3

I must fetch a Table A when both id 1 and 2 of table B are related in the pivot table.
Example:

TableA::whereHas('tableB', fn($q)=>$q->magicQueryPleaseHelp([1, 2]))->get();

Should return only TableA with id 1.

I've tried using whereIn('id', [1,2]) inside the whereHas but it fetches out TableA with id 2 too.
Using many whereHas on each of the array items give the desire result but it's too weird.

There's a more adequate solution?


问:
How can I add line break for a text in d3?
I want to add line breaks to text label in my graph if line exceeds 30 characters for d3  . ie. if the label is

```<code>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
</code>```

should be

```<code>It is a long established fact
that a reader will be
distracted by the readable
content of a page when looking
at its layout.
</code>```

I have the code

  const id_label_text = svg
    .selectAll("text.id-label")
    .data(nodes)
    .enter()
    .append("text")
    .attr("id", "id-label-text")
    .attr("text-anchor", "left")
    .attr("alignment-baseline", "left")
    .style("pointer-events", "none")
    .text((node) => node.name);

  simulation.on("tick", () => {
    id_label_text
      .attr("x", (node) => node.x + 10 - RECT_WIDTH / 2)
      .attr("y", (node) => node.y - 8);
});
```

I was looking into tspan without success. how can I add line breaks so that id_label_text or node.name has line breaks in d3

Body:
I want to add line breaks to text label in my graph if line exceeds 30 characters for d3  . ie. if the label is

It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.

should be

It is a long established fact
that a reader will be
distracted by the readable
content of a page when looking
at its layout.

I have the code

  const id_label_text = svg
    .selectAll("text.id-label")
    .data(nodes)
    .enter()
    .append("text")
    .attr("id", "id-label-text")
    .attr("text-anchor", "left")
    .attr("alignment-baseline", "left")
    .style("pointer-events", "none")
    .text((node) => node.name);

  simulation.on("tick", () => {
    id_label_text
      .attr("x", (node) => node.x + 10 - RECT_WIDTH / 2)
      .attr("y", (node) => node.y - 8);
});

I was looking into tspan without success. how can I add line breaks so that id_label_text or node.name has line breaks in d3


问:
I Am Facing an Issue with Google IMAPs
I am working on a project which is capable of sending emails, however, the main function which is to send emails is facing a few issues, I did a few cross references between my coding and my colleagues and found that they match, however I am still incapable of sending said emails.

I tried looking online and applied their solution, but it is yet to be solved. Is it my coding that is problematic or the SMTP Server which I set up?

```<code>Imports System.Net.MailImports System.IOImports System.DataImports System.Data.OdbcImports System.Web.UI.PagePartial Class _DefaultInherits System.Web.UI.Page
</code>```
```<code>Private Sub Button_Redirect_Click(sender As Object, e As EventArgs) Handles Button_Redirect.Click
    Response.Redirect("excel_upload.aspx")
End Sub

Private Sub submit_Click(sender As Object, e As EventArgs) Handles submit.Click
    Response.Write(tmail.Text)
    Response.Write("<br>")
    Response.Write(fmail.Text)
    Response.Write("<br>")
    Response.Write(customerRequest.Text)
    Response.Write(kin.Text)
    Response.Write("<br>")
    Response.Write(kul.Text)
    Response.Write("<br>")
    Response.Write(icpsp.Text)
    Response.Write("<br>")
    Response.Write(fname.Text)
    Response.Write("<br>")
End Sub

Function SendEmail() As Boolean
    Dim SmtpServer As New SmtpClient()
    Dim mail As New MailMessage()
    Dim msg As String = ""

    Try
        SmtpServer.Credentials = New Net.NetworkCredential("ausm6228@gmail.com", "nxbciglfckwinxiz")
        SmtpServer.Host = "smtp.gmail.com"
        SmtpServer.Port = 143
        SmtpServer.EnableSsl = True

        mail = New MailMessage()
        mail.From = New MailAddress(fmail.Text)
        mail.To.Add(tmail.Text)
        mail.Bcc.Add("")
        'mail.Subject = "Permohonan Pengaktifan ePayment@USM"
        mail.IsBodyHtml = True
        mail.Body = customerRequest.Text

        'If FileLoc <> "" Then
        '    If File.Exists(FileLoc) Then mail.Attachments.Add(New Attachment(FileLoc))
        'End If

        mail.Priority = MailPriority.High
        SmtpServer.Send(mail)

        msg = "Emel telah dihantar."
        Return True
    Catch ex As SmtpFailedRecipientsException
        For i As Integer = 0 To ex.InnerExceptions.Length - 1
            Dim status As SmtpStatusCode = ex.InnerExceptions(i).StatusCode

            If status = SmtpStatusCode.MailboxBusy OrElse status = SmtpStatusCode.MailboxUnavailable Then
                msg = "Delivery failed - retrying in 5 seconds."
                System.Threading.Thread.Sleep(5000)
                SmtpServer.Send(mail)
            Else
                msg = "Failed to deliver message to {0}" + ex.InnerExceptions(i).FailedRecipient
            End If
        Next
    Catch ex As Exception
        msg = "Exception caught in RetryIfBusy(): {0}" + ex.ToString()
    End Try

    Return False
End Function
</code>```

Image of the website layout

Image of IMAP setup

I changed the SMTP Server Host and Port.
I set up a new Windows MAIL IMAP account.

Title: I Am Facing an Issue with Google IMAPs

Body:
I am working on a project which is capable of sending emails, however, the main function which is to send emails is facing a few issues, I did a few cross references between my coding and my colleagues and found that they match, however I am still incapable of sending said emails.

I tried looking online and applied their solution, but it is yet to be solved. Is it my coding that is problematic or the SMTP Server which I set up?

Imports System.Net.MailImports System.IOImports System.DataImports System.Data.OdbcImports System.Web.UI.PagePartial Class _DefaultInherits System.Web.UI.Page

Private Sub Button_Redirect_Click(sender As Object, e As EventArgs) Handles Button_Redirect.Click
    Response.Redirect("excel_upload.aspx")
End Sub

Private Sub submit_Click(sender As Object, e As EventArgs) Handles submit.Click
    Response.Write(tmail.Text)
    Response.Write("
")
    Response.Write(fmail.Text)
    Response.Write("
")
    Response.Write(customerRequest.Text)
    Response.Write(kin.Text)
    Response.Write("
")
    Response.Write(kul.Text)
    Response.Write("
")
    Response.Write(icpsp.Text)
    Response.Write("
")
    Response.Write(fname.Text)
    Response.Write("
")
End Sub

Function SendEmail() As Boolean
    Dim SmtpServer As New SmtpClient()
    Dim mail As New MailMessage()
    Dim msg As String = ""

    Try
        SmtpServer.Credentials = New Net.NetworkCredential("ausm6228@gmail.com", "nxbciglfckwinxiz")
        SmtpServer.Host = "smtp.gmail.com"
        SmtpServer.Port = 143
        SmtpServer.EnableSsl = True

        mail = New MailMessage()
        mail.From = New MailAddress(fmail.Text)
        mail.To.Add(tmail.Text)
        mail.Bcc.Add("")
        'mail.Subject = "Permohonan Pengaktifan ePayment@USM"
        mail.IsBodyHtml = True
        mail.Body = customerRequest.Text

        'If FileLoc <> "" Then
        '    If File.Exists(FileLoc) Then mail.Attachments.Add(New Attachment(FileLoc))
        'End If

        mail.Priority = MailPriority.High
        SmtpServer.Send(mail)

        msg = "Emel telah dihantar."
        Return True
    Catch ex As SmtpFailedRecipientsException
        For i As Integer = 0 To ex.InnerExceptions.Length - 1
            Dim status As SmtpStatusCode = ex.InnerExceptions(i).StatusCode

            If status = SmtpStatusCode.MailboxBusy OrElse status = SmtpStatusCode.MailboxUnavailable Then
                msg = "Delivery failed - retrying in 5 seconds."
                System.Threading.Thread.Sleep(5000)
                SmtpServer.Send(mail)
            Else
                msg = "Failed to deliver message to {0}" + ex.InnerExceptions(i).FailedRecipient
            End If
        Next
    Catch ex As Exception
        msg = "Exception caught in RetryIfBusy(): {0}" + ex.ToString()
    End Try

    Return False
End Function

Image of the website layout

Image of IMAP setup

I changed the SMTP Server Host and Port.
I set up a new Windows MAIL IMAP account.


问:
SD card reader not working on RHEL 8 Lenovo P16
I'm running RHEL 8 on a Lenovo P16 Gen 1 with a SD Express 7.0 card reader. However the SD card is not working at all. When I insert the card nothing happens. Looks like that the card is not recognized at all.

Any idea how I can get that working or how I can narrow the issue down?

Nothing in dmesg or /var/log/messages.

lspci shows:
00:00.0 Host bridge: Intel Corporation Device 4637 (rev 02) 00:01.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x16 Controller #1 (rev 02) 00:02.0 VGA compatible controller: Intel Corporation Alder Lake-HX GT1 [UHD Graphics 770] (rev 0c) 00:04.0 Signal processing controller: Intel Corporation Alder Lake Innovation Platform Framework Processor Participant (rev 02) 00:06.0 PCI bridge: Intel Corporation 12th Gen Core Processor PCI Express x4 Controller #0 (rev 02) 00:0a.0 Signal processing controller: Intel Corporation Platform Monitoring Technology (rev 01) 00:14.0 USB controller: Intel Corporation Alder Lake-S PCH USB 3.2 Gen 2x2 XHCI Controller (rev 11) 00:14.2 RAM memory: Intel Corporation Alder Lake-S PCH Shared SRAM (rev 11) 00:14.3 Network controller: Intel Corporation Alder Lake-S PCH CNVi WiFi (rev 11) 00:16.0 Communication controller: Intel Corporation Alder Lake-S PCH HECI Controller #1 (rev 11) 00:1c.0 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port #1 (rev 11) 00:1c.4 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port #5 (rev 11) 00:1d.0 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port #9 (rev 11) 00:1d.4 PCI bridge: Intel Corporation Alder Lake-S PCH PCI Express Root Port #13 (rev 11) 00:1f.0 ISA bridge: Intel Corporation Device 7a8d (rev 11) 00:1f.3 Audio device: Intel Corporation Alder Lake-S HD Audio Controller (rev 11) 00:1f.4 SMBus: Intel Corporation Alder Lake-S PCH SMBus Controller (rev 11) 00:1f.5 Serial bus controller: Intel Corporation Alder Lake-S PCH SPI Controller (rev 11) 01:00.0 VGA compatible controller: NVIDIA Corporation GA107GLM [RTX A2000 8GB Laptop GPU] (rev a1) 01:00.1 Audio device: NVIDIA Corporation Device 2291 (rev a1) 06:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 07:00.0 Non-Volatile memory controller: Micron Technology Inc Device 5407 0a:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5261 PCI Express Card Reader (rev 01) 20:00.0 PCI bridge: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] (rev 02) 21:00.0 PCI bridge: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] (rev 02) 21:01.0 PCI bridge: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] (rev 02) 21:02.0 PCI bridge: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] (rev 02) 21:03.0 PCI bridge: Intel Corporation Thunderbolt 4 Bridge [Maple Ridge 4C 2020] (rev 02) 22:00.0 USB controller: Intel Corporation Thunderbolt 4 NHI [Maple Ridge 4C 2020] 48:00.0 USB controller: Intel Corporation Thunderbolt 4 USB Controller [Maple Ridge 4C 2020]


问:
Editable List in SwiftUI does not work with Transferable
I wrote a short program to test Transferable with a List of objects for an easy implementation of drag and drop. My list already provided movable items (taking for granted from the SwiftUI List). After I added Transferable that functionality was broken. Does anyone know what I am doing wrong? In the example code uncommenting draggable disables the movable functionality while enabling drag and drop.

```<code>struct EditableListApp: App {
    @State private var model: [Profile] = Profile.profiles()

    var body: some Scene {
        WindowGroup {
            ContentView(profiles: $model)
        }
    }
}

struct ContentView: View {
    @Binding var profiles: [Profile]

    var body: some View {
        HStack(alignment: .top, spacing: 0) {
            ProfileList(profiles: $profiles)
            DetailView()
        }
    }
}

struct ProfileList: View {
    @Binding var profiles: [Profile]

    var body: some View {
        List($profiles, editActions: [.move, .delete]) { $item in
            ProfileView(profile: $item)
        }
    }
}

struct ProfileView: View {
    @Binding var profile: Profile

    var body: some View {
        HStack {
            Text(profile.name)
                .font(.title)
                .padding(5)
        }
        .frame(maxWidth: .infinity, alignment: .leading)
        .padding(5)
        .border(.gray)
        .padding(2)

        .contentShape(Rectangle()) // used so everything in the view is draggable
        //.draggable(profile) // uncomment for drag and drop
    }
}

struct DropView: View {
    @Binding var profile: Profile?
    @State private var borderColor = Color.clear
    @State private var borderWidth: CGFloat = 1.0

    var body: some View {
        VStack {
            if let binding = Binding<Profile>($profile) {
                ProfileView(profile: binding)
            } else {
                Text("Drop a profile here")
                    .frame(maxWidth: .infinity, maxHeight: .infinity)
            }
        }
        .border(borderColor, width: borderWidth)

        .dropDestination(for: Profile.self) { items, location in
            profile = items.first

            return true // item is allowed to be dropped
        } isTargeted: { inDropArea in
            borderColor = inDropArea ? .accentColor : .clear
            borderWidth = inDropArea ? 5.0 : 1.0
        }
    }
}

struct DetailView: View {
    @State private var profile: Profile?

    var body: some View {
        VStack(alignment: .leading, spacing: 10) {
            DropView(profile: $profile)
                .frame(minWidth: 300, maxWidth: .infinity, minHeight: 300, maxHeight: .infinity)
                .border(.gray)
        }
        .padding()
    }
}

struct Profile: Identifiable, Codable {
    var id: UUID = UUID()
    var name: String

    static func profiles() -> [Profile] {
        return [Profile(name: "Adam"), Profile(name: "Beat"), Profile(name: "Casper")]
    }
}

extension Profile: Transferable {
    static var transferRepresentation: some TransferRepresentation {
        CodableRepresentation(for: Profile.self, contentType: .profile)
    }
}

extension UTType {
    static var profile = UTType(exportedAs: "de.enovatia.tutorial.profile")
}
</code>```

Both are built-in features, that should probably not be XOR-ed. So I expect that I miss something important to get it going.

Body:
I wrote a short program to test Transferable with a List of objects for an easy implementation of drag and drop. My list already provided movable items (taking for granted from the SwiftUI List). After I added Transferable that functionality was broken. Does anyone know what I am doing wrong? In the example code uncommenting draggable disables the movable functionality while enabling drag and drop.

struct EditableListApp: App {
    @State private var model: [Profile] = Profile.profiles()

    var body: some Scene {
        WindowGroup {
            ContentView(profiles: $model)
        }
    }
}

struct ContentView: View {
    @Binding var profiles: [Profile]

    var body: some View {
        HStack(alignment: .top, spacing: 0) {
            ProfileList(profiles: $profiles)
            DetailView()
        }
    }
}

struct ProfileList: View {
    @Binding var profiles: [Profile]

    var body: some View {
        List($profiles, editActions: [.move, .delete]) { $item in
            ProfileView(profile: $item)
        }
    }
}

struct ProfileView: View {
    @Binding var profile: Profile

    var body: some View {
        HStack {
            Text(profile.name)
                .font(.title)
                .padding(5)
        }
        .frame(maxWidth: .infinity, alignment: .leading)
        .padding(5)
        .border(.gray)
        .padding(2)

        .contentShape(Rectangle()) // used so everything in the view is draggable
        //.draggable(profile) // uncomment for drag and drop
    }
}

struct DropView: View {
    @Binding var profile: Profile?
    @State private var borderColor = Color.clear
    @State private var borderWidth: CGFloat = 1.0

    var body: some View {
        VStack {
            if let binding = Binding<Profile>($profile) {
                ProfileView(profile: binding)
            } else {
                Text("Drop a profile here")
                    .frame(maxWidth: .infinity, maxHeight: .infinity)
            }
        }
        .border(borderColor, width: borderWidth)

        .dropDestination(for: Profile.self) { items, location in
            profile = items.first

            return true // item is allowed to be dropped
        } isTargeted: { inDropArea in
            borderColor = inDropArea ? .accentColor : .clear
            borderWidth = inDropArea ? 5.0 : 1.0
        }
    }
}

struct DetailView: View {
    @State private var profile: Profile?

    var body: some View {
        VStack(alignment: .leading, spacing: 10) {
            DropView(profile: $profile)
                .frame(minWidth: 300, maxWidth: .infinity, minHeight: 300, maxHeight: .infinity)
                .border(.gray)
        }
        .padding()
    }
}

struct Profile: Identifiable, Codable {
    var id: UUID = UUID()
    var name: String

    static func profiles() -> [Profile] {
        return [Profile(name: "Adam"), Profile(name: "Beat"), Profile(name: "Casper")]
    }
}

extension Profile: Transferable {
    static var transferRepresentation: some TransferRepresentation {
        CodableRepresentation(for: Profile.self, contentType: .profile)
    }
}

extension UTType {
    static var profile = UTType(exportedAs: "de.enovatia.tutorial.profile")
}

Both are built-in features, that should probably not be XOR-ed. So I expect that I miss something important to get it going.


问:
RangeError: Maximum call stack size exceeded on npm start
I am getting the error react-scripts\scripts\start.js:19
throw err;
I am trying to run npm start, and this error occurs. It came from nowhere i do not know what happend</p>
```<code>D:\Programowanie\Ujccap\client\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

RangeError: Maximum call stack size exceeded
    at Object.isExpressionWithTypeArguments (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:29486:43)
    at Object.tryGetClassImplementingOrExtendingExpressionWithTypeArguments (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:19246:19)
    at getTypeOfNode (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:88475:32)
    at getTypeOfVariableOrParameterOrPropertyWorker (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:57771:30)
    at getTypeOfVariableOrParameterOrProperty (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:57728:28)
    at getTypeOfSymbol (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:58114:24)
    at getNarrowedTypeOfSymbol (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:73170:20)
    at checkIdentifier (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:73246:24)
    at checkExpressionWorker (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:81571:28)
    at checkExpression (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:81520:38)
</code>```

Body:
I am getting the error react-scripts\scripts\start.js:19
throw err;
I am trying to run npm start, and this error occurs. It came from nowhere i do not know what happend

D:\Programowanie\Ujccap\client\node_modules\react-scripts\scripts\start.js:19
  throw err;
  ^

RangeError: Maximum call stack size exceeded
    at Object.isExpressionWithTypeArguments (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:29486:43)
    at Object.tryGetClassImplementingOrExtendingExpressionWithTypeArguments (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:19246:19)
    at getTypeOfNode (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:88475:32)
    at getTypeOfVariableOrParameterOrPropertyWorker (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:57771:30)
    at getTypeOfVariableOrParameterOrProperty (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:57728:28)
    at getTypeOfSymbol (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:58114:24)
    at getNarrowedTypeOfSymbol (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:73170:20)
    at checkIdentifier (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:73246:24)
    at checkExpressionWorker (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:81571:28)
    at checkExpression (D:\Programowanie\Ujccap\client\node_modules\typescript\lib\typescript.js:81520:38)


问:
How do I save box plots in a loop as a png file in PANDAS?
```<code>column_Names = final_diab.columns.values.tolist()
for col in column_Names:
    if col == 'SEQN' or col == 'DIQ010':
        continue
    else:
        test= stats.ttest_ind(final_diab[col], final_nodiab[col])
        box= sns.boxplot(x='DIQ010', y=col, data= final_data)
        box_fig = plt.figure();
        box_fig.savefig("box.png", format="png")
        plt.savefig('box')
</code>```

I tried the code above. It is saving a file in my folder but it has no box plot images in there. I want to save a separate file for each box plot.

Body:
column_Names = final_diab.columns.values.tolist()
for col in column_Names:
    if col == 'SEQN' or col == 'DIQ010':
        continue
    else:
        test= stats.ttest_ind(final_diab[col], final_nodiab[col])
        box= sns.boxplot(x='DIQ010', y=col, data= final_data)
        box_fig = plt.figure();
        box_fig.savefig("box.png", format="png")
        plt.savefig('box')

I tried the code above. It is saving a file in my folder but it has no box plot images in there. I want to save a separate file for each box plot.


问:
How to read beneath transparent window
So I have a tkinter window which is transparent. I want all the text we can see beneath the transparent window area to be captured. But how can I do that?

If you have suggestions that doesn't use tkinter please feel free to inform.

My initial code:

```<code>from tkinter import Tk

root = Tk()
root.geometry("444x444")
root.title("Read")
root.config(background="red")
root.wm_attributes('-transparentcolor', "red")

root.mainloop()
</code>```

Reference image:

Title: How to read beneath transparent window

Body:
So I have a tkinter window which is transparent. I want all the text we can see beneath the transparent window area to be captured. But how can I do that?

If you have suggestions that doesn't use tkinter please feel free to inform.

My initial code:

from tkinter import Tk

root = Tk()
root.geometry("444x444")
root.title("Read")
root.config(background="red")
root.wm_attributes('-transparentcolor', "red")

root.mainloop()

Reference image:


问:
req.user data is undefined when sending a request from the client to the api
So... when I access the route http://localhost:5000/api/isLoggedIn manually I get the user info (req.user) but not when I send a get request through the client (next.js) like why is this happening is it a config error for protection?
here is the code

const express = require("express");
const session = require("express-session");
const cookieParser = require('cookie-parser')
const passport = require("passport");
const LocalStrategy = require("passport-local").Strategy;
const cors = require("cors")
require('dotenv').config();

const app = express()

const db_url = process.env.DB_URL
const mongoose = require('mongoose');
mongoose.set('strictQuery', true);
const User = require("./modules/User")
mongoose.connect(db_url).then((res) => {
    console.log("successfuly connected to db")
}).catch((err) => {
    console.log(err)
})

app.use(cors())
app.use(express.urlencoded({ extended: true }))
app.use(express.json())
app.use(cookieParser());
app.use(session({ secret: process.env.SECRET, resave: true, saveUninitialized: true, cookie: { httpOnly: true, secure: false, expires: Date.now() + 1000 * 60 * 60 * 24 * 7, maxAge: 1000 * 60 * 60 * 24 * 7 } }))

app.use(passport.initialize());
app.use(passport.session());

passport.use(new LocalStrategy(User.authenticate()))
passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());
passport.debug = true;

const isLoggedIn = async (req, res, next) => {
    if (req.isAuthenticated()) {
        next()
    } else {
        res.redirect("/login")
    }
}

app.post("/api/register", async (req, res, next) => {
    try {
        const { username, email, password } = req.body
        const user = new User({ email, username })
        const newUser = await User.register(user, password)
        req.login(newUser, function (err) {
            if (err) {
                console.log(err);
            }
        }
        );
        await newUser.save()
        res.redirect("http://localhost:3000/")
    } catch (err) {
        next(err)
    }
})
app.post('/api/login', passport.authenticate('local', { failureRedirect: 'http://localhost:3000/login' }),
    (req, res) => {
        res.redirect('http://localhost:3000/')
    });

app.get("/api/logout", isLoggedIn, (req, res) => {
    req.logOut()
    req.session.destroy(err => {
        if (err) return next(err)
    })
    res.clearCookie('connect.sid');
    res.redirect("http://localhost:3000/")
})

app.get("/api/isLoggedIn", (req, res) => {
    try {
        // if (req.isAuthenticated()) {
        //     res.json({ isLoggedIn: true })
        // } else {
        //     res.json({ isLoggedIn: false })
        // }
        res.send(req.user)
    } catch (err) {
        console.log(err)
    }
})

app.listen(5000, () => {
    console.log("listening on port 5000")
})
```
<p>and here is the get request from the client (it shows undefined)</p>
```axios.get("http://localhost:5000/api/isLoggedIn").then((res) => {
            setTimeout(() => console.log(res.data), 1000)
        }).catch((err) => {
            console.log(err)
        })
```

i would really appreciate some help

i tried changing some session configurations to look and see if it's a protection problem but no success

Body:
So... when I access the route http://localhost:5000/api/isLoggedIn manually I get the user info (req.user) but not when I send a get request through the client (next.js) like why is this happening is it a config error for protection?
here is the code

const express = require("express");
const session = require("express-session");
const cookieParser = require('cookie-parser')
const passport = require("passport");
const LocalStrategy = require("passport-local").Strategy;
const cors = require("cors")
require('dotenv').config();

const app = express()

const db_url = process.env.DB_URL
const mongoose = require('mongoose');
mongoose.set('strictQuery', true);
const User = require("./modules/User")
mongoose.connect(db_url).then((res) => {
    console.log("successfuly connected to db")
}).catch((err) => {
    console.log(err)
})

app.use(cors())
app.use(express.urlencoded({ extended: true }))
app.use(express.json())
app.use(cookieParser());
app.use(session({ secret: process.env.SECRET, resave: true, saveUninitialized: true, cookie: { httpOnly: true, secure: false, expires: Date.now() + 1000 * 60 * 60 * 24 * 7, maxAge: 1000 * 60 * 60 * 24 * 7 } }))

app.use(passport.initialize());
app.use(passport.session());

passport.use(new LocalStrategy(User.authenticate()))
passport.serializeUser(User.serializeUser());
passport.deserializeUser(User.deserializeUser());
passport.debug = true;

const isLoggedIn = async (req, res, next) => {
    if (req.isAuthenticated()) {
        next()
    } else {
        res.redirect("/login")
    }
}

app.post("/api/register", async (req, res, next) => {
    try {
        const { username, email, password } = req.body
        const user = new User({ email, username })
        const newUser = await User.register(user, password)
        req.login(newUser, function (err) {
            if (err) {
                console.log(err);
            }
        }
        );
        await newUser.save()
        res.redirect("http://localhost:3000/")
    } catch (err) {
        next(err)
    }
})
app.post('/api/login', passport.authenticate('local', { failureRedirect: 'http://localhost:3000/login' }),
    (req, res) => {
        res.redirect('http://localhost:3000/')
    });

app.get("/api/logout", isLoggedIn, (req, res) => {
    req.logOut()
    req.session.destroy(err => {
        if (err) return next(err)
    })
    res.clearCookie('connect.sid');
    res.redirect("http://localhost:3000/")
})

app.get("/api/isLoggedIn", (req, res) => {
    try {
        // if (req.isAuthenticated()) {
        //     res.json({ isLoggedIn: true })
        // } else {
        //     res.json({ isLoggedIn: false })
        // }
        res.send(req.user)
    } catch (err) {
        console.log(err)
    }
})

app.listen(5000, () => {
    console.log("listening on port 5000")
})

and here is the get request from the client (it shows undefined)

axios.get("http://localhost:5000/api/isLoggedIn").then((res) => {
            setTimeout(() => console.log(res.data), 1000)
        }).catch((err) => {
            console.log(err)
        })

i would really appreciate some help

i tried changing some session configurations to look and see if it's a protection problem but no success


问:
Populate Combo Box with results of dynamic range
Hello wonderful community! I need some help with what I think is a simple issue, but I cannot figure out how to make it work.  I have an excel 'transfer file' I am setting up to process some raw tables into another format for consumption through Power Apps. My question is around the excel VBA and my user form.  I want a range of cells that will have a list of extensions for files listed by row inserted/ added into a combobox in a userform. We start with my listing of file extensions I pull from a one drive file with the following code.

```<code>Sub LoopThroughFiles()

Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Integer

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("Not important URL to one drive location")

For Each oFile In oFolder.Files
    Cells(i + 1, 1) = oFile.Name
    i = i + 1
Next oFile
End Sub
</code>```

This works fine and returns in column A of sheet 2 my file extensions.  I now want to add those file extensions into a combo box for a user to select.  My code I have thus far is this, but I cannot get it to work

```<code>    Private Sub UserForm_Initialize()

Dim lastRow As Integer
Dim i As Integer

UserForm1.Show

lastRow = Sheet2.Cells(Sheet2.Rows.Count, "A").End(xlUp).Row

    With UserForm1.ComboBox1
        For i = 1 To lastRow
            ComboBox1.AddItem Sheet2.Cells(i, 1)
        Next
    End With

End Sub
</code>```

I know I am not far off from what needs to be written but have been google digging for a couple hours and hope someone can guide me to complete faster.  Thank you all in advance!

Body:
Hello wonderful community! I need some help with what I think is a simple issue, but I cannot figure out how to make it work.  I have an excel 'transfer file' I am setting up to process some raw tables into another format for consumption through Power Apps. My question is around the excel VBA and my user form.  I want a range of cells that will have a list of extensions for files listed by row inserted/ added into a combobox in a userform. We start with my listing of file extensions I pull from a one drive file with the following code.

Sub LoopThroughFiles()

Dim oFSO As Object
Dim oFolder As Object
Dim oFile As Object
Dim i As Integer

Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder("Not important URL to one drive location")

For Each oFile In oFolder.Files
    Cells(i + 1, 1) = oFile.Name
    i = i + 1
Next oFile
End Sub

This works fine and returns in column A of sheet 2 my file extensions.  I now want to add those file extensions into a combo box for a user to select.  My code I have thus far is this, but I cannot get it to work

    Private Sub UserForm_Initialize()

Dim lastRow As Integer
Dim i As Integer

UserForm1.Show

lastRow = Sheet2.Cells(Sheet2.Rows.Count, "A").End(xlUp).Row

    With UserForm1.ComboBox1
        For i = 1 To lastRow
            ComboBox1.AddItem Sheet2.Cells(i, 1)
        Next
    End With

End Sub

I know I am not far off from what needs to be written but have been google digging for a couple hours and hope someone can guide me to complete faster.  Thank you all in advance!


问:
How do i get rid of pysdl-dll user warning?

I have installed sdl2 and sdl2-dll packages from pip and imported them.

Created a simple window and application loop.

But every time i run the application, i get an annoying user warning that says :

UserWarning: Using SDL2 binaries from pysdl2-dll 2.26.1

I tried using warnings.catch_warnings but it doesn't seem to work :(

How do i get rid of it and is there any environment variable that might solve my problem ?


问:
I want to build a bandwidth limiter using P4?
I am a beginner in P4, and currently learning P4.  Currently experiment with the meter in P4. How may I limit the bandwidth using P4 by identifying packets?

Here I have created an indirect meter like this in Ingress Processing

```<code>control MyIngress(inout headers hdr,
                  inout metadata meta,
                  inout standard_metadata_t standard_metadata) {

    meter(32w16384, MeterType.bytes) my_meter;

    action drop() {
        mark_to_drop(standard_metadata);
    }

    action m_action(bit<32> meter_index) {
        my_meter.execute_meter<bit<32>>(meter_index, meta.meter_tag);
    }

    table m_read {
        key = {
            hdr.ethernet.srcAddr: exact;
        }
        actions = {
            m_action;
            NoAction;
        }
        default_action = NoAction;
        size = 16384;
    }

    table m_filter {
        key = {
            meta.meter_tag: exact;
        }
        actions = {
            drop;
            NoAction;
        }
        default_action = drop;
        size = 16;
    }

    apply {
        // Same egress port for all packets in this example
        standard_metadata.egress_spec = 2;

        // Check meter
        m_read.apply();

        // Filter based on meter status
        m_filter.apply();

    }
}
</code>```

In Commands.txt file

```<code>table_add m_filter NoAction 0 =>
meter_array_set_rates my_meter 100000:1 200000:1
</code>```

Now my question is, how do I limit the bandwidth using P4 programing so that the iperf speed comes with a speed limit say 200KB/s.

Body:
I am a beginner in P4, and currently learning P4.  Currently experiment with the meter in P4. How may I limit the bandwidth using P4 by identifying packets?

Here I have created an indirect meter like this in Ingress Processing

control MyIngress(inout headers hdr,
                  inout metadata meta,
                  inout standard_metadata_t standard_metadata) {

    meter(32w16384, MeterType.bytes) my_meter;

    action drop() {
        mark_to_drop(standard_metadata);
    }

    action m_action(bit<32> meter_index) {
        my_meter.execute_meter<bit<32>>(meter_index, meta.meter_tag);
    }

    table m_read {
        key = {
            hdr.ethernet.srcAddr: exact;
        }
        actions = {
            m_action;
            NoAction;
        }
        default_action = NoAction;
        size = 16384;
    }

    table m_filter {
        key = {
            meta.meter_tag: exact;
        }
        actions = {
            drop;
            NoAction;
        }
        default_action = drop;
        size = 16;
    }

    apply {
        // Same egress port for all packets in this example
        standard_metadata.egress_spec = 2;

        // Check meter
        m_read.apply();

        // Filter based on meter status
        m_filter.apply();

    }
}

In Commands.txt file

table_add m_filter NoAction 0 =>
meter_array_set_rates my_meter 100000:1 200000:1

Now my question is, how do I limit the bandwidth using P4 programing so that the iperf speed comes with a speed limit say 200KB/s.


问:
Firebase CLI: how to get version for an apk from app distribution
I have uploaded couple of apk to firebase via app distribution cli command, which I am running via Firebase CLI + Jenkins.

Now its possible sometime we upload some binary explicitly to firebase manually, like client release or test few things and we change the version.

Is it possible to pull what's the latest binary version on firebase so that I can update mine while generating via Jenkins.

Thanks,

I tried using Firebase CLI, apps:list it return the apps but post that what command needs to run.

I tired with REST API, but it require OAuth token, for which I have to write explicitly node/java/python program to get token and then call the REST API and then parse the data then update the version. Seems problematic as token may get expired and then I have rebuild again, its also quite a step for a getting a build version, hence looking for something simpler or less steps.


问:
What is SPINX and why is it being used in this ASP.NET Framework 4.5 web site project?
I have inherited a codebase and one of the stumps is that I do not know what is SPINX. Or BasePAL. This is the code:

`using System;
namespace SPINX.Entity
{
public class ProductCatMappingPAL: BasePAL

}`

Questions:

What is SPINX?

What is the importance of SPINX in this ASP.NET Framework project?

What is the meaning of PAL/BasePAL in the context of this ASP.NET Framework v4.5 web site project?

The PAL definition I've found is "Programmable Logic Array". Seems like it's a fancy word to say "relation type" or "connection"

The things I found on Spinx is two sites: sphinx-doc.org and sphinxsearch.com
Sphinx search seems to focus on python but I'm looking for something C# based


问:
Windchill WRS API for Creating a new CADDocument
Is there a REST API command via WRS for creating a new CAD Document in Windchill? I only found the "GET" command for this

http://##.###.#.###:##/Windchill/servlet/odata/v3/CADDocumentMgmt/CADDocuments

 and there is no "POST" command. We are using Windchill 12.0.2

We also need a way to associate the newly created CAD document to a WTPart