我有停止的时候,我从改变春节引导版本一起使用工作代码2.0.3.RELEASE来2.1.0.BUILD-SNAPSHOT.
有时错误是:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
***************************
APPLICATION FAILED TO START
***************************
Description:
The bean 'dataSource', defined in BeanDefinition defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Run Code Online (Sandbox Code Playgroud)
要么 ...
Error starting ApplicationContext. To …Run Code Online (Sandbox Code Playgroud) 对不起,我的英文.
我有一个应用程序,我可以通常的方式登录.
@Configuration
@EnableWebSecurity
public class LoginSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
System.out.println("LoginSecurityConfig :: configure");
auth.jdbcAuthentication().dataSource( getDataSource() )
.passwordEncoder( new BCryptPasswordEncoder(16) )
.usersByUsernameQuery(
"select user_name as username,password,enabled from users where user_name=?")
.authoritiesByUsernameQuery(
"select user_name as username, role_name from users_roles ur join users u on ur.user_id = u.user_id and u.user_name = ?");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
.antMatchers("/login*").anonymous()
.antMatchers("/resources/**").permitAll()
.antMatchers("/fotos/**").permitAll()
.antMatchers("/users").access("hasRole('ROLE_ADMIN')")
.antMatchers("/user").access("hasRole('ROLE_ADMIN')")
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/loginPage")
.defaultSuccessUrl("/home", true) …Run Code Online (Sandbox Code Playgroud) 我必须创建一个Spring Boot WEB应用程序,但是JSP页面显示为纯文本,没有任何突出显示或标记。
如何配置STS以像Eclipse一样显示JSP文件?
使用STS 4.0.0.M12。
我有一些cytoscape节点
style: cytoscape.stylesheet()
.selector('node')
.css({
'border-color': '#0266C8',
'border-width' : '1px',
'shape': 'data(faveShape)',
'width': '80px',
'font-family' : 'Consolas',
'font-size' : '10px',
'content': 'data(id)',
'text-valign': 'center',
'background-color': 'data(faveColor)',
'color': 'data(textColor)'
})
...
Run Code Online (Sandbox Code Playgroud)
如何使内容包含两行或更多行以及2个或更多串联字符串?
...
'content': 'data(id)' + '<br>' + data('name') + '<br>test123',
...
Run Code Online (Sandbox Code Playgroud)
TIA
我有“父”和“子”休眠实体。
在“父母”上,我有一个Set<Child>持有它的孩子。
当我用新的孩子更新 Parent 时,一切正常:孩子是在“child”表上创建的。
但是,当我从父哈希集中删除一个元素并保存时,不会删除数据库上的对应子项。
这是:
在 PARENT(命名为工作流)上:
@OneToMany(orphanRemoval=true, cascade = CascadeType.ALL, mappedBy="workflow", fetch = FetchType.EAGER)
private Set<ActivityDB> activities;
Run Code Online (Sandbox Code Playgroud)
关于孩子(命名活动)
@ManyToOne
@JoinColumn(name="id_workflow")
@Fetch(FetchMode.JOIN)
private WorkflowDB workflow;
Run Code Online (Sandbox Code Playgroud)
我正在会话中处理持久性实例。没有出现错误。似乎工作正常,但数据库上的寄存器仍然存在。
为了进行测试,我加载工作流并执行
workflow.activities.remove( activity_index_x )
Run Code Online (Sandbox Code Playgroud)
然后使用session.update( workflow ). 但是“activity_index_x”仍然在数据库中,当我重新加载工作流程时,它会再次出现。
我有两个项目。一项如下(例如项目1):
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.3.RELEASE</version>
<relativePath/>
</parent>
Run Code Online (Sandbox Code Playgroud)
第二个(例如项目2)如下:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.0.BUILD-SNAPSHOT</version>
<relativePath/>
</parent>
Run Code Online (Sandbox Code Playgroud)
两者都有:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
好吧,项目1运行正常。我可以在我的.M2 repo文件夹中看到Spring Plugin 2.0.0.BUILD-SNAPSHOT。
项目2引发以下错误:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin; but it does not exist. Its class, org.springframework.plugin.core.PluginRegistry, is available from the following locations:
jar:file:/.../.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.BUILD-SNAPSHOT/spring-plugin-core-2.0.0.BUILD-SNAPSHOT.jar!/org/springframework/plugin/core/PluginRegistry.class
It was loaded from the following location:
file:/.../.m2/repository/org/springframework/plugin/spring-plugin-core/2.0.0.BUILD-SNAPSHOT/spring-plugin-core-2.0.0.BUILD-SNAPSHOT.jar
Action:
Correct the classpath of your application so that it contains a single, …Run Code Online (Sandbox Code Playgroud) 我正在开发一种迁移软件,它将使用来自REST服务的未知数据.
我已经考虑过使用MongoDB,但我决定不使用它并使用PostgreSQL.
阅读本文之后,我尝试使用Spring JPA在我的SpringBoot应用程序中实现它,但我不知道jsonb在我的实体中进行映射.
试过这个,但什么都不懂!
我就是这样的地方:
@Repository
@Transactional
public interface DnitRepository extends JpaRepository<Dnit, Long> {
@Query(value = "insert into dnit(id,data) VALUES (:id,:data)", nativeQuery = true)
void insertdata( @Param("id")Integer id,@Param("data") String data );
}
Run Code Online (Sandbox Code Playgroud)
和......
@RestController
public class TestController {
@Autowired
DnitRepository dnitRepository;
@RequestMapping(value = "/dnit", method = RequestMethod.GET)
public String testBig() {
dnitRepository.insertdata(2, someJsonDataAsString );
}
}
Run Code Online (Sandbox Code Playgroud)
和表:
CREATE TABLE public.dnit
(
id integer NOT NULL,
data jsonb,
CONSTRAINT dnit_pkey PRIMARY KEY (id)
) …Run Code Online (Sandbox Code Playgroud) spring-boot ×3
cytoscape.js ×1
hibernate ×1
java ×1
javascript ×1
jpa ×1
jsonb ×1
jsp ×1
maven ×1
orm ×1
postgresql ×1
spring-mvc ×1