Spring sesurity 异常

13 篇文章 0 订阅
9 篇文章 0 订阅

···Java

org.springframework.context.ApplicationContextException: 

Unable to start embedded container;
-----------------------------------

 nested exception is org.springframework.context.ApplicationContextException: 

Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
------------------------------------------------------------------------

一 :NO Spring session store is configured
pom中有session集群配置,需要把session设置为none
application.properties数据库的配置

1:spring.session.store-type=none

设置端口:
1:server.port=8060
二:浏览器访问需要登录
设置spring security
1:security.basic.enabled=false

打包发布

父项目
run as—maven build
goals::clean package
跳过 skip tests自动化测试类跳过

查看每个文件包是否有target
因为没有jar包 需要插件

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>imocc.security.demo</artifactId>
  <parent>
    <groupId>com.imocc.security</groupId>
    <artifactId>imocc.security</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <relativePath>../imocc.security</relativePath>
  </parent>

    <dependencies>
  <dependency>
  <groupId>com.imocc.security</groupId>
  <artifactId>imocc.security.browser</artifactId>
  <!-- <version>1.1.0-SNAPSHOT </version> -->
  <version>${imocc.security.version}</version>
  </dependency>
 <!--  还可以是app -->
 <!--  web项目比app多个session -->
  <dependency>
    <groupId>org.springframework.session</groupId>
     <artifactId>spring-session</artifactId>
  </dependency>
  </dependencies>
 <!--  打包设置 -->
  <build>
        <plugins>
            <plugin> 
                <groupId>org.springframework.boot</groupId> 
                <artifactId>spring-boot-maven-plugin</artifactId> 
                <version>1.3.3.RELEASE</version>
                    <executions> 
                        <execution>
                            <!--    <id>attach-sources</id> -->
                          <goals>
                                 <goal>repackage</goal> 

                        </goals> 
                        </execution> 
                    </executions> 
            </plugin> 
        </plugins>      
        <finalName>demo</finalName> 
    </build>
</project>

update 更新maven再打包

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值