小编Pit*_*ton的帖子

Spring bean 类型没有很好地定义并且缺少配置

我正在更改 Spring 连接到数据库的安全性,但是它说 bean 没有很好地定义,我已经使用了 @Autowired 及其相应的 @Bean;我还在学习配置。

这可能是插头缺失吗?

错误:
描述:com.bookstore.config.SecurityConfig 中的字段 env 需要类型为“org.hibernate.cfg.Environment”的 bean,但无法找到。

注入点有以下注释: - @org.springframework.beans.factory.annotation.Autowired(required=true)

行动:

考虑在配置中定义“org.hibernate.cfg.Environment”类型的 bean。

Github: https: //github.com/latinprogrammer/Ecommerce-Spring-Boot

SecurityConfig.java

    package com.bookstore.config;

    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.context.annotation.Configuration;
    import org.hibernate.cfg.Environment;
    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.crypto.bcrypt.BCryptPasswordEncoder;
    import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

    import com.bookstore.service.impl.UserSecurityService;
    import com.bookstore.utility.SecurityUtility;

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


@Autowired
private Environment env;


@Autowired
private UserSecurityService userSecurityService;

private BCryptPasswordEncoder passwordEncoder() {

    return SecurityUtility.passwordEncoder();

}

private static final String[] PUBLIC_MATCHERS= …
Run Code Online (Sandbox Code Playgroud)

java spring hibernate web

5
推荐指数
0
解决办法
1201
查看次数

目标容器不是使用 webpack 4 和 React 的 DOM 元素

我正在使用 Webpack 4.29.0 并响应 16.7.0,我试图从 2019 年从头到尾呈现来自 Udemy 课程 Web 开发的简单网站消息,但是我收到错误:未捕获的错误:目标容器不是DOM 元素,我无法确定问题,我对 webpack.config.js 所做的每个更改似乎都不起作用。

我的理解:在 src 文件夹中 > 我创建了 components 文件夹 > header.js > import react 并导出了将由 > index.js > 使用 ReactDom.render 渲染它然后使用 index.html 显示的头组件> #root。我不明白为什么我的页面信息无法加载。

Package.json 信息:

{
  "name": "ch-hawk-project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "buildDev": "webpack-dev-server --mode development",
    "buildProd": "webpack-dev-server --mode production",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/konistleio/Ch-Hawk-project.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": { …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs webpack

2
推荐指数
1
解决办法
2504
查看次数

标签 统计

hibernate ×1

java ×1

javascript ×1

reactjs ×1

spring ×1

web ×1

webpack ×1