GithubHelp home page GithubHelp logo

seckill's Introduction

秒杀业务模块-Seckill

开发环境

Java Maven Spring Spring Security MyBatis MySQL jQuery bootstrap

效果预览

发布地址: [https:] 前端页面流程 详情页面流程 秒杀列表 用户标识存cookie 秒杀等待 暴露秒杀接口 秒杀成功 重复秒杀

核心实现

高并发优化

秒杀系统流程及并发优化分析

问题故障

1. Java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/exc/InvalidDefinitionException

即便引入了该依赖,类都存在

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.5.4</version>
</dependency>

解决方法 改为高版本的,如2.9.9

2. org.apache.jasper.JasperException: Unable to convert string "${st.startTime}" to class "java.util.Date" for attribute "value": Property Editor not registered with the PropertyEditorManager

实际代码没错。因为web.xml的使用遗弃的命名空间问题。改为解决方法

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
        http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id="WebApp_ID"
        version="2.5">
</web-app>

3. 静态资源拦截问题

项目中在spring-web.xml为静态资源做了默认不拦截配置

<mvc:default-servlet-handler/>

但是静态资源还是不要放在WEB-INF目录下,这个是默认安全目录,资源访问会被限制。 可以放到上层webapp目录下

4. slf4j整合logback,记得把scope从test删去

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.3</version>
      <scope>test</scope>
    </dependency>
    <!-- 实现slf4j接口并且整合 -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>1.2.3</version>
    </dependency>

总是忽略了这个,依赖都在了就是没有发现为啥绑定失败。

相关参考

seckill's People

Contributors

chgl16 avatar

Watchers

 avatar

Forkers

judylime

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.