I can't to see my web page in spring [spring] - spring

I'm new using this framework, I'm tryng to deploy a web with a hibernate connection, I created a .xml config file to connect to PostgreSQL.
But the logs shows this error:
2020-11-14T22:32:28.610246+00:00 heroku[router]: at=info method=GET path="/"
host=gstlabs.herokuapp.com request_id=978ecfdc-917f-41a0-8867-8cc55b73def1 fwd="190.84.149.124" dyno=web.1 connect=2ms service=211ms status=500 bytes=610 protocol=https
2020-11-14T23:04:34.213061+00:00 heroku[web.1]: Idling
2020-11-14T23:04:34.215664+00:00 heroku[web.1]: State changed from up to down
2020-11-14T23:04:35.167671+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-11-14T23:04:35.279279+00:00 app[web.1]: 2020-11-14 23:04:35.278 INFO 4 --- [extShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-11-14T23:04:35.279712+00:00 app[web.1]: 2020-11-14 23:04:35.279 WARN 4 --- [extShutdownHook] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'entityManagerFactory': org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: com.example.core.models.Projects.technologies in com.example.core.models.Technologies.projects
2020-11-14T23:04:35.280073+00:00 app[web.1]: 2020-11-14 23:04:35.279 INFO 4 --- [extShutdownHook] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2020-11-14T23:04:35.282600+00:00 app[web.1]: 2020-11-14 23:04:35.282 INFO 4 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2020-11-14T23:04:35.325392+00:00 app[web.1]: 2020-11-14 23:04:35.325 INFO 4 --- [extShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2020-11-14T23:04:35.426750+00:00 heroku[web.1]: Process exited with status 143
There are my Classes:
[Technologies]
package com.example.core.models;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
#Entity
#Table(name="technologies")
public class Technologies {
#Id
#Column(name="id")
private int id;
#Column(name="name")
private String name;
public Technologies() {
}
public Technologies(String name) {
this.name = name;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
#Override
public String toString() {
return "Technologies [id=" + id + ", name=" + name + "]";
}
#ManyToMany(mappedBy="technologies")
private Set<Projects> projects = new HashSet<>();
public Set<Projects> getProjects() {
return projects;
}
public void setProjects(Set<Projects> projects) {
this.projects = projects;
}
}
[Projects]
package com.example.core.models;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
#Entity
#Table(name="projects")
public class Projects {
#Id
#Column(name="id")
private int id;
#Column(name="photo")
private String photo;
#Column(name="link")
private String link;
public Projects() {
}
public Projects(String photo, String link) {
this.photo = photo;
this.link = link;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
#Override
public String toString() {
return "Projects [id=" + id + ", photo=" + photo + ", link=" + link + "]";
}
#ManyToMany(cascade= {CascadeType.ALL})
#JoinTable(
name="projects_has_technologies",
joinColumns=#JoinColumn(name="project_id"),
inverseJoinColumns=#JoinColumn(name="technology_id")
)
Set<Technologies> tecnologies = new HashSet<>();
#ManyToMany(mappedBy="projects")
private Set<Profiles> profiles = new HashSet<>();
public Set<Technologies> getTecnologies() {
return tecnologies;
}
public void setTecnologies(Set<Technologies> tecnologies) {
this.tecnologies = tecnologies;
}
public Set<Profiles> getProfiles() {
return profiles;
}
public void setProfiles(Set<Profiles> profiles) {
this.profiles = profiles;
}
}
There are some code that are some at my clases in this proyect the other intermedial clases are similar, I'm trynt in this moment insert some objects to the database.
Thanks to your help in advance.

Have you tried to add a Configuration Class in your project for example
#Configuration
#EnableTransactionManagement
#EnableJpaRepositories( basePackages = "your repository package" )
#EntityScan( basePackages = {"your entity package1","your entity package2"}
public class TransactionConfiguration {}
This will help you to find your entity classes in the project.

Related

Java Spring Boot Entites not saving to JpaRepository

That's my first project with Spring Boot implemented. I tried going step by step with official Spring tutorial but I'm stuck with a problem that I can't find any answer about.
Whenever I try to call findAll() or find() method on my repository it returns empty array [].
Even with manual preloading enitites like done in tutorial and immediately trying to display database content I get the same result.
I can guess I'm missing something silly, but I can't figure it out for some hours now. What's the cause? Tomcat/jpa/spring version mismatch? Missing annotation somewhere?
Here's my AnimalRepository.java
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
#Repository
public interface AnimalRepository extends JpaRepository<Animal, Long> {
}
LoadDatabase.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.Transactional;
#Configuration
class LoadDatabase {
private static final Logger log = LoggerFactory.getLogger(LoadDatabase.class);
#Bean
CommandLineRunner initDatabase(AnimalRepository repository) {
return args -> {
log.info("Preloading " + repository.save(new Lion("Bilbo")));
log.info("Preloading " + repository.save(new Lion("Frodo")));
log.info(repository.findAll().toString()); //try to log content to console
};
}
}
The logging above basically ends up with this console output:
logging result
Probably not as important, but AnimalController.java
import org.springframework.web.bind.annotation.*;
import java.util.List;
#RestController
public class AnimalController {
private final AnimalRepository repository;
AnimalController(AnimalRepository repository) {
this.repository = repository;
}
#GetMapping("/animals")
List<Animal> all() {
repository.save(new Lion("Bilbo")); //this doesn't work either
return repository.findAll();
}
#PostMapping("/animals")
Animal newAnimal(#RequestBody Animal newAnimal) {
return repository.save(newAnimal);
}
#GetMapping("/animals/{id}")
Animal one(#PathVariable Long id) {
return repository.findById(id)
.orElseThrow(() -> new AnimalNotFoundException(id));
}
#PutMapping("/animals/{id}")
Animal replaceAnimal(#RequestBody Animal newAnimal, #PathVariable Long id) {
return repository.findById(id)
.map(animal -> {
animal.setName(newAnimal.getName());
animal.setSpecies(newAnimal.getSpecies());
return repository.save(animal);
})
.orElseGet(() -> {
newAnimal.setId(id);
return repository.save(newAnimal);
});
}
#DeleteMapping("/animals/{id}")
void deleteAnimal(#PathVariable Long id) {
repository.deleteById(id);
}
}
And the finally Lion.java
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import java.util.Objects;
#Entity
public class Lion implements Animal {
private #Id
#GeneratedValue Long id;
private String name;
private String species;
private int requiredFood;
//private Zone zone;
public Lion(String name) {
this.name = name;
this.species = this.getClass().getSimpleName();
this.requiredFood = LION_REQUIRED_FOOD;
}
public Lion() {
}
#Override
public Long getId() {
return id;
}
#Override
public void setId(Long id) {
this.id = id;
}
#Override
public String getName() {
return name;
}
#Override
public void setName(String name) {
this.name = name;
}
#Override
public String getSpecies() {
return species;
}
#Override
public void setSpecies(String species) {
this.species = species;
}
#Override
public int getRequiredFood() {
return requiredFood;
}
#Override
public void setRequiredFood(int requiredFood) {
this.requiredFood = requiredFood;
}
#Override
public boolean equals(Object o) {
if (this == o)
return true;
if (!(o instanceof Animal animal))
return false;
return Objects.equals(this.id, animal.getId()) && Objects.equals(this.name, animal.getName())
&& Objects.equals(this.species, animal.getSpecies());
}
#Override
public int hashCode() {
return Objects.hash(this.id, this.name, this.species);
}
#Override
public String toString() {
return "Animal{" + "id=" + this.id + ", name='" + this.name + '\'' + ", species='" + this.species + '\'' + '}';
}
}
I tried switching JpaRepository to CrudRepository, but that didn't work out.
I think the problem here is that your data haven't been saved to the database, because of the transaction. try to change your repository.save() to repository.saveAndFlush()

Nullpointer Exception unknown resource springmicriservice

cnv any one help me I dont knoe where make mistake,when i run my
application in chrome in browser when type
http://localhost:8100/currency-converter-feign/from/USD/to/INR/quantity/1000
i got this type of erro
This application has no explicit mapping for /error, so you are seeing
this as a fallback.
Fri Jul 17 21:38:29 IST 2020 There was an unexpected error
(type=Internal Server Error, status=500). No message available
java.lang.NullPointerException at
java.math.BigDecimal.multiply(Unknown Source) at
com.main.conteoller.CurrencyconversionController.convertCurencyFfeign(CurrencyconversionController.java:47)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at
java.lang.reflect.Method.invoke(Unknown Source) at
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:215)
at
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:142)
at
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800)
at
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at
currencyconvertercontroller.java
package com.main.conteoller;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import com.main.Bean.ConversionBean;
import com.main.serviceproxy.CurrencyexchangeserviceProxy;
#RestController
public class CurrencyconversionController {
#Autowired
private CurrencyexchangeserviceProxy proxy;
#GetMapping("/currency-converter/from/{from}/to/{to}/quantity/{quantity}")
public ConversionBean convertCurency(#PathVariable String from,
#PathVariable String to,
#PathVariable BigDecimal quantity) {
Map<String, String>uriVariables= new HashMap<>();
uriVariables.put("from", from);
uriVariables.put("to", to);
ResponseEntity<ConversionBean>resp = new RestTemplate()
.getForEntity("http://localhost:8000/currency-exchange/from/{from}/to/{to}",
ConversionBean.class,
uriVariables);
ConversionBean cbresp=resp.getBody();
return new ConversionBean(cbresp.getId(),from,to,cbresp.getConvermultiple(),
quantity,quantity.multiply(cbresp.getConvermultiple()),cbresp.getPort());
}
#GetMapping("/currency-converter-feign/from/{from}/to/{to}/quantity/{quantity}")
public ConversionBean convertCurencyFfeign(#PathVariable String from,
#PathVariable String to,
#PathVariable BigDecimal quantity) {
ConversionBean cbresp=proxy.retrivefromexchange(from, to);
return new ConversionBean(cbresp.getId(),from,to,cbresp.getConvermultiple(),
quantity,quantity.multiply(cbresp.getConvermultiple()),cbresp.getPort());
}
}
currencybean.java
package com.main.Bean;
import java.math.BigDecimal;
public class ConversionBean {
private int id;
private String from;
private String to;
private BigDecimal convermultiple;
private BigDecimal quantity;
private BigDecimal totalCalamount;
private int port;
public ConversionBean() {}
public ConversionBean(int id, String from, String to, BigDecimal convermultiple, BigDecimal quantity,
BigDecimal totalCalamount, int port) {
super();
this.id = id;
this.from = from;
this.to = to;
this.convermultiple = convermultiple;
this.quantity = quantity;
this.totalCalamount = totalCalamount;
this.port = port;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public BigDecimal getConvermultiple() {
return convermultiple;
}
public void setConvermultiple(BigDecimal convermultiple) {
this.convermultiple = convermultiple;
}
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
public BigDecimal getTotalCalamount() {
return totalCalamount;
}
public void setTotalCalamount(BigDecimal totalCalamount) {
this.totalCalamount = totalCalamount;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}
currencyexchangeproxy.java
package com.main.serviceproxy;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import com.main.Bean.ConversionBean;
#FeignClient(name="currency-exchange",url="localhost:8000")
public interface CurrencyexchangeserviceProxy {
#GetMapping("/currency-exchange/from/{from}/to/{to}")
public ConversionBean retrivefromexchange(#PathVariable ("from") String from,
#PathVariable ("to") String to);
}
It is occurs due to mismatch of comumn name in your db table and in
your entity class. Because I use micriservices,I call some exchange
rates from another project by provideing its url in my repository, in
that project i privide same name in my entity class and in my db table
,but i declared diffrent name in my exchange service project. there i
declare conversationmultople and here declare convermultiple
.make sure both name same in db and your bean class
#EnableFeignClient service in your springboot main method
for example
package com.main;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
#SpringBootApplication
#EnableFeignClients("com.main.serviceproxy")
public class CurrencyConversionServiceApplication {
public static void main(String[] args) {
SpringApplication.run(CurrencyConversionServiceApplication.class, args);
}
}

how i can resolve the error unable to insert NULL in ("NAWFEL". "ORDO_DEP_UUSATEUR". "EMPLOI")

I'm developing a user registration form, the problem I get is that when I want to test my web service in postman it shows me the following error in my eclipse console:
> 2020-06-02 19:50:04.559 WARN 1576 --- [nio-8484-exec-2]
> o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1400, SQLState:
> 23000 2020-06-02 19:50:04.560 ERROR 1576 --- [nio-8484-exec-2]
> o.h.engine.jdbc.spi.SqlExceptionHelper : ORA-01400: impossible
> d'insérer NULL dans ("NAWFEL"."ORDO_DEP_UTILISATEUR"."EMPLOI")
>
> 2020-06-02 19:50:04.582 ERROR 1576 --- [nio-8484-exec-2]
> o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for
> servlet [dispatcherServlet] in context with path [] threw exception
> [Request processing failed; nested exception is
> org.springframework.dao.DataIntegrityViolationException: could not
> execute statement; SQL [n/a]; constraint [null]; nested exception is
> org.hibernate.exception.ConstraintViolationException: could not
> execute statement] with root cause
>
> oracle.jdbc.OracleDatabaseException: ORA-01400: impossible d'insérer
> NULL dans ("NAWFEL"."ORDO_DEP_UTILISATEUR"."EMPLOI")
>
> at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513)
> ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0] at
> oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461)
> ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0] at
> oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104)
> ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0] at
> oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550)
> ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0] at
> oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268)
> ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0] at
> oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:655)
> ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
he tells me that I cannot insert a null value in the job "emploi" column, but I entered the value of the job column in my postman as you can see here:
this is my entity code :
package com.app.habilitation.entity;
import java.sql.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
#Entity
#Table(name="ORDO_DEP_UTILISATEUR")
public class UserEntity {
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
#Column(name="IDENTIFIANT")
private Integer IDENTIFIANT;
#ManyToOne(cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
#JoinColumn(name="EMPLOI")
private EmploiEntity emploi;
#ManyToOne(cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
#JoinColumn(name="ENTITE")
private EntiteEntity entite;
#Column(name="LOGIN")
private String login;
#Column(name="MOTDEPASSE")
private String mdp;
#Column(name="NOM")
private String nom;
#Column(name="PRENOM")
private String prenom;
#Column(name="CREEPAR")
private Integer creerpar;
#Column(name="ANNULEPAR")
private Integer annulepar;
#Column(name="STATUT")
private String statut;
#Column(name="DATEEFFET")
private Date dateeffet;
#Column(name="DATEFIN")
private Date datefin;
#Column(name="CREELE")
private Date creele;
#Column(name="MOTIFDEDESACTIVATION")
private String motifdedesactivation;
#Column(name="ANNULELE")
private Date annulele;
#Column(name="EMAIL")
private String email;
#Column(name="CONFIRMATIONMOTDEPASSE")
private String confirmation_mot_de_passe;
public String getConfirmation_mot_de_passe() {
return confirmation_mot_de_passe;
}
public void setConfirmation_mot_de_passe(String confirmation_mot_de_passe) {
this.confirmation_mot_de_passe = confirmation_mot_de_passe;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public Integer getIDENTIFIANT() {
return IDENTIFIANT;
}
public void setIDENTIFIANT(Integer iDENTIFIANT) {
IDENTIFIANT = iDENTIFIANT;
}
public EmploiEntity getEmploi() {
return emploi;
}
public void setEmploi(EmploiEntity emploi) {
this.emploi = emploi;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getMdp() {
return mdp;
}
public void setMdp(String mdp) {
this.mdp = mdp;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public Integer getCreerpar() {
return creerpar;
}
public void setCreerpar(Integer creerpar) {
this.creerpar = creerpar;
}
public Integer getAnnulepar() {
return annulepar;
}
public void setAnnulepar(Integer annulepar) {
this.annulepar = annulepar;
}
public String getStatut() {
return statut;
}
public void setStatut(String statut) {
this.statut = statut;
}
public Date getDateeffet() {
return dateeffet;
}
public void setDateeffet(Date dateeffet) {
this.dateeffet = dateeffet;
}
public Date getDatefin() {
return datefin;
}
public void setDatefin(Date datefin) {
this.datefin = datefin;
}
public Date getCreele() {
return creele;
}
public void setCreele(Date creele) {
this.creele = creele;
}
public String getMotifdedesactivation() {
return motifdedesactivation;
}
public void setMotifdedesactivation(String motifdedesactivation) {
this.motifdedesactivation = motifdedesactivation;
}
public Date getAnnulele() {
return annulele;
}
public void setAnnulele(Date annulele) {
this.annulele = annulele;
}
public EntiteEntity getEntite() {
return entite;
}
public void setEntite(EntiteEntity entite) {
this.entite = entite;
}
public UserEntity(EmploiEntity emploi, EntiteEntity entite, String login, String mdp, String nom, String prenom,
Integer creerpar, Integer annulepar, String statut, Date dateeffet, Date datefin, Date creele,
String motifdedesactivation, Date annulele, String email, String confirmation_mot_de_passe) {
this.emploi = emploi;
this.entite = entite;
this.login = login;
this.mdp = mdp;
this.nom = nom;
this.prenom = prenom;
this.creerpar = creerpar;
this.annulepar = annulepar;
this.statut = statut;
this.dateeffet = dateeffet;
this.datefin = datefin;
this.creele = creele;
this.motifdedesactivation = motifdedesactivation;
this.annulele = annulele;
this.email = email;
this.confirmation_mot_de_passe = confirmation_mot_de_passe;
}
public UserEntity() {
}
#Override
public String toString() {
return "UserEntity [IDENTIFIANT=" + IDENTIFIANT + ", emploi=" + emploi + ", entite=" + entite + ", login="
+ login + ", mdp=" + mdp + ", nom=" + nom + ", prenom=" + prenom + ", creerpar=" + creerpar
+ ", annulepar=" + annulepar + ", statut=" + statut + ", dateeffet=" + dateeffet + ", datefin="
+ datefin + ", creele=" + creele + ", motifdedesactivation=" + motifdedesactivation + ", annulele="
+ annulele + ", email=" + email + ", confirmation_mot_de_passe=" + confirmation_mot_de_passe + "]";
}
}
and this is my dao ( i use jpa) :
package com.app.habilitation.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import com.app.habilitation.entity.UserEntity;
public interface UserDao extends JpaRepository<UserEntity, Integer> {
}
and this is my userService :
package com.app.habilitation.service;
import java.util.List;
import com.app.habilitation.entity.UserEntity;
public interface UserService {
public void save (UserEntity theUser);
}
and this is my userServiceImpl :
package com.app.habilitation.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.app.habilitation.dao.UserDao;
import com.app.habilitation.entity.UserEntity;
#Service
public class UserServiceImpl implements UserService {
private UserDao userDao;
#Autowired
public UserServiceImpl (UserDao theuserDao) {
userDao = theuserDao;
}
#Override
#Transactional
public void save(UserEntity theUser) {
userDao.save(theUser);
}
}
and this is my controller :
package com.app.habilitation.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.app.habilitation.entity.UserEntity;
import com.app.habilitation.service.UserService;
#SpringBootApplication
#RestController
#CrossOrigin(origins = "*")
//#RequestMapping("/user")
public class UserController {
private UserService userService;
#Autowired
public UserController (UserService theuserService) {
userService=theuserService;
}
#GetMapping("/")
public String login() {
return "authenticaated succesfully";
}
#GetMapping("/getUsers")
public String getUsers() {
return "users";
}
#PostMapping("/addUser")
public UserEntity addUser (#RequestBody UserEntity theUser) {
System.out.println("test");
userService.save(theUser);
return theUser;
}
}
and this is my table user (i use oracle 10g) :
can someone help me please ?
Check your Column definition, is it a Many to one or just a regular column?
#Column(name="EMPLOI")
private EmploiEntity emploi;
if it is your Emploi created right?

how i can resolve the error "status": 500, "error": "Internal Server Error"

I am developing the backend part of a registration page for my website, the problem is that when I test this in postman I get the following error:
and I also get this error in my eclipse console:
2020-05-29 17:58:06.226 ERROR 1368 --- [nio-8484-exec-8] o.h.engine.jdbc.spi.SqlExceptionHelper : ORA-01400: impossible d'insérer NULL dans ("NAWFEL"."ORDO_DEP_UTILISATEUR"."IDENTIFIANT")
2020-05-29 17:58:06.230 ERROR 1368 --- [nio-8484-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement] with root cause
oracle.jdbc.OracleDatabaseException: ORA-01400: impossible d'insérer NULL dans ("NAWFEL"."ORDO_DEP_UTILISATEUR"."IDENTIFIANT")
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:513) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:461) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1104) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:550) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:268) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:655) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:270) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:91) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:970) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1205) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
I see that the error comes from the id but as you can see here I inserted the id in postman in the json part :
{
"id":2,
"EMPLOI":2,
"ENTITE":2,
"LOGIN":"hr",
"MOTDEPASSE":"hr",
"NOM":"bougrine",
"PRENOM":"rachid",
"STATUT":"br",
"CREEPAR": 2
}
this is my code for configure spring security in my app :
package com.app.habilitation.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
#Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
#Override
protected void configure (HttpSecurity http) throws Exception {
http.cors();
http.csrf().disable();
http.authorizeRequests().antMatchers("/**").
fullyAuthenticated().and().httpBasic();
}
#Override
protected void configure (AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("hr")
.password("{noop}hr").roles("USER");
}
}
and this is my controller :
package com.app.habilitation.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.app.habilitation.entity.UserEntity;
import com.app.habilitation.service.UserService;
#SpringBootApplication
#RestController
#CrossOrigin(origins = "*")
public class UserController {
private UserService userService;
#Autowired
public UserController (UserService theuserService) {
userService=theuserService;
}
#GetMapping("/")
public String login() {
return "authenticaated succesfully";
}
#GetMapping("/getUsers")
public String getUsers() {
return "users";
}
#PostMapping("/addUser")
public UserEntity addUser (#RequestBody UserEntity theUser) {
System.out.println("test");
userService.save(theUser);
return theUser;
}
}
and this is my dao ( i use jpa) :
package com.app.habilitation.dao;
import org.springframework.data.jpa.repository.JpaRepository;
import com.app.habilitation.entity.UserEntity;
public interface UserDao extends JpaRepository<UserEntity, Integer> {
}
this is my entity class :
package com.app.habilitation.entity;
import java.sql.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
#Entity
#Table(name="ORDO_DEP_UTILISATEUR")
public class UserEntity {
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
#Column(name="IDENTIFIANT")
private Integer IDENTIFIANT;
/*#ManyToOne(cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
#JoinColumn(name="EMPLOI") */
#Column(name="EMPLOI")
private Integer emploi;
/* #ManyToOne(cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
#JoinColumn(name="ENTITE") */
#Column(name="ENTITE")
private Integer entite;
#Column(name="LOGIN")
private String login;
#Column(name="MOTDEPASSE")
private String mdp;
#Column(name="nom")
private String nom;
#Column(name="prenom")
private String prenom;
#Column(name="CREEPAR")
private Integer creerpar;
#Column(name="ANNULEPAR")
private Integer annulepar;
#Column(name="STATUT")
private String statut;
#Column(name="DATEEFFET")
private Date dateeffet;
#Column(name="DATEFIN")
private Date datefin;
#Column(name="CREELE")
private Date creele;
#Column(name="MOTIFDEDESACTIVATION")
private String motifdedesactivation;
#Column(name="ANNULELE")
private Date annulele;
public Integer getIDENTIFIANT() {
return IDENTIFIANT;
}
public void setIDENTIFIANT(Integer iDENTIFIANT) {
IDENTIFIANT = iDENTIFIANT;
}
public Integer getEmploi() {
return emploi;
}
public void setEmploi(Integer emploi) {
this.emploi = emploi;
}
public Integer getEntite() {
return entite;
}
public void setEntite(Integer entite) {
this.entite = entite;
}
public String getLogin() {
return login;
}
public void setLogin(String login) {
this.login = login;
}
public String getMdp() {
return mdp;
}
public void setMdp(String mdp) {
this.mdp = mdp;
}
public String getNom() {
return nom;
}
public void setNom(String nom) {
this.nom = nom;
}
public String getPrenom() {
return prenom;
}
public void setPrenom(String prenom) {
this.prenom = prenom;
}
public Integer getCreerpar() {
return creerpar;
}
public void setCreerpar(Integer creerpar) {
this.creerpar = creerpar;
}
public Integer getAnnulepar() {
return annulepar;
}
public void setAnnulepar(Integer annulepar) {
this.annulepar = annulepar;
}
public String getStatut() {
return statut;
}
public void setStatut(String statut) {
this.statut = statut;
}
public Date getDateeffet() {
return dateeffet;
}
public void setDateeffet(Date dateeffet) {
this.dateeffet = dateeffet;
}
public Date getDatefin() {
return datefin;
}
public void setDatefin(Date datefin) {
this.datefin = datefin;
}
public Date getCreele() {
return creele;
}
public void setCreele(Date creele) {
this.creele = creele;
}
public String getMotifdedesactivation() {
return motifdedesactivation;
}
public void setMotifdedesactivation(String motifdedesactivation) {
this.motifdedesactivation = motifdedesactivation;
}
public Date getAnnulele() {
return annulele;
}
public void setAnnulele(Date annulele) {
this.annulele = annulele;
}
public UserEntity(Integer iDENTIFIANT, Integer emploi, Integer entite, String login, String mdp, String nom,
String prenom, Integer creerpar, Integer annulepar, String statut, Date dateeffet, Date datefin,
Date creele, String motifdedesactivation, Date annulele) {
IDENTIFIANT = iDENTIFIANT;
this.emploi = emploi;
this.entite = entite;
this.login = login;
this.mdp = mdp;
this.nom = nom;
this.prenom = prenom;
this.creerpar = creerpar;
this.annulepar = annulepar;
this.statut = statut;
this.dateeffet = dateeffet;
this.datefin = datefin;
this.creele = creele;
this.motifdedesactivation = motifdedesactivation;
this.annulele = annulele;
}
public UserEntity() {
}
#Override
public String toString() {
return "UserEntity [IDENTIFIANT=" + IDENTIFIANT + ", emploi=" + emploi + ", entite=" + entite + ", login="
+ login + ", mdp=" + mdp + ", nom=" + nom + ", prenom=" + prenom + ", creerpar=" + creerpar
+ ", annulepar=" + annulepar + ", statut=" + statut + ", dateeffet=" + dateeffet + ", datefin="
+ datefin + ", creele=" + creele + ", motifdedesactivation=" + motifdedesactivation + ", annulele="
+ annulele + "]";
}
}
this is my service interface :
package com.app.habilitation.service;
import java.util.List;
import com.app.habilitation.entity.UserEntity;
public interface UserService {
public void save (UserEntity theUser);
}
and this is my service interface Impl :
package com.app.habilitation.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.app.habilitation.dao.UserDao;
import com.app.habilitation.entity.UserEntity;
#Service
public class UserServiceImpl implements UserService {
private UserDao userDao;
#Autowired
public UserServiceImpl (UserDao theuserDao) {
userDao = theuserDao;
}
#Override
#Transactional
public void save(UserEntity theUser) {
userDao.save(theUser);
}
}
this is my application.properties ( i change port 8080 to 8484 because a nother application use this port) :
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url=jdbc:oracle:thin:#localhost:1521:XE
spring.datasource.username=nawfel
spring.datasource.password=hr
spring.jpa.show-sql=true
server.port=8484
and this is my table in oracle 10g :
I think the problem is that you are telling in your entity that id is a generated value. Doing so the value is removed by Jpa during insert. You have to change your strategy, if you are supplying the id you should not mark it as autogenerated.
hth

Spring back end localhost requires login

I'm trying to develop a cross-platform application, with Cordova in the front-end and using Spring in the back_end.
Basically, I started by the link between the database and generating the classes (models). Here's my application properties:
# Keep the connection alive if idle for a long time (needed in production)
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
# Show or not log for each sql query
spring.jpa.show-sql = true
# Hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = updateUnable to find column with logical name: program_id
# Naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
# Use spring.jpa.properties.* for Hibernate native properties (the prefix is
# stripped before adding them to the entity manager)
# The SQL dialect makes Hibernate generate better SQL for the chosen database
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
# Server
server.port=8080
endpoints.cors.allowed-origins=*
I wanted to try if I'm getting the list in JSON form before I go to the backend. So I made an example to get the list of operators, the class Operator is declared like that:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.rest.model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* #author gate11
*/
#Entity
#Table(catalog = "db_suivi", schema = "")
#XmlRootElement
#NamedQueries({
#NamedQuery(name = "Operator.findAll", query = "SELECT o FROM Operator o")
, #NamedQuery(name = "Operator.findById", query = "SELECT o FROM Operator o WHERE o.id = :id")
, #NamedQuery(name = "Operator.findByOperatorFName", query = "SELECT o FROM Operator o WHERE o.operatorFName = :operatorFName")
, #NamedQuery(name = "Operator.findByOperatorLName", query = "SELECT o FROM Operator o WHERE o.operatorLName = :operatorLName")})
public class Operator implements Serializable {
private static final long serialVersionUID = 1L;
#Id
#GeneratedValue(strategy = GenerationType.IDENTITY)
#Basic(optional = false)
private Long id;
#Basic(optional = false)
#NotNull
#Size(min = 1, max = 100)
private String operatorFName;
#Basic(optional = false)
#NotNull
#Size(min = 1, max = 100)
private String operatorLName;
#JoinTable(name = "BadgeOperator", joinColumns = {
#JoinColumn(name = "idOp", referencedColumnName = "id")}, inverseJoinColumns = {
#JoinColumn(name = "idBad", referencedColumnName = "id")})
#ManyToMany(fetch = FetchType.LAZY)
private List<BadgePoint> badgePointList;
#ManyToMany(mappedBy = "operatorList", fetch = FetchType.LAZY)
private List<Zone> zoneList;
#OneToMany(cascade = CascadeType.ALL, mappedBy = "operator", fetch = FetchType.LAZY)
private List<TimePass> timePassList;
public Operator() {
}
public Operator(Long id) {
this.id = id;
}
public Operator(Long id, String operatorFName, String operatorLName) {
this.id = id;
this.operatorFName = operatorFName;
this.operatorLName = operatorLName;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getOperatorFName() {
return operatorFName;
}
public void setOperatorFName(String operatorFName) {
this.operatorFName = operatorFName;
}
public String getOperatorLName() {
return operatorLName;
}
public void setOperatorLName(String operatorLName) {
this.operatorLName = operatorLName;
}
#XmlTransient
public List<BadgePoint> getBadgePointList() {
return badgePointList;
}
public void setBadgePointList(List<BadgePoint> badgePointList) {
this.badgePointList = badgePointList;
}
#XmlTransient
public List<Zone> getZoneList() {
return zoneList;
}
public void setZoneList(List<Zone> zoneList) {
this.zoneList = zoneList;
}
#XmlTransient
public List<TimePass> getTimePassList() {
return timePassList;
}
public void setTimePassList(List<TimePass> timePassList) {
this.timePassList = timePassList;
}
#Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
#Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Operator)) {
return false;
}
Operator other = (Operator) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
#Override
public String toString() {
return "com.rest.Operator[ id=" + id + " ]";
}
}
I added an interface (repository) implementing JpaRepository:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.rest.repository;
import com.rest.model.Operator;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
/**
*
* #author gate11
*/
public interface OperatorRepository extends JpaRepository<Operator, Long>{
#Override
List<Operator> findAll();
}
And as needed, also a controller for the class Operator:
package com.rest.rest;
import com.rest.model.Operator;
import com.rest.service.OperatorService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import org.springframework.web.bind.annotation.RestController;
#RestController
#RequestMapping(value = "/api", produces = MediaType.APPLICATION_JSON_VALUE)
public class OperatorController {
#Autowired
private OperatorService operatorService;
#CrossOrigin
#RequestMapping(method = GET, value = "/operator/all")
public List<Operator> loadAll() {
return this.operatorService.findAll();
}
}
The interface service:
package com.rest.service;
import com.rest.model.Operator;
import java.util.List;
/**
*
* #author gate11
*/
public interface OperatorService {
List<Operator> findAll();
}
The service Implement also:
package com.rest.serviceImp;
import com.rest.model.Operator;
import com.rest.repository.OperatorRepository;
import com.rest.service.OperatorService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
*
* #author gate11
*/
#Service
public class OperatorServiceImp implements OperatorService{
#Autowired
private OperatorRepository operatorRepository;
#Override
public List<Operator> findAll() {
List<Operator> operator = operatorRepository.findAll();
return operator;
}
}
When I launch the application, the log:
2018-03-05 14:34:47.427 INFO 10768 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/css/**'], Ant [pattern='/js/**'], Ant [pattern='/images/**'], Ant [pattern='/webjars/**'], Ant [pattern='/**/favicon.ico'], Ant [pattern='/error']]], []
2018-03-05 14:34:47.565 INFO 10768 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: Ant [pattern='/h2-console/**'], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#183bb809, org.springframework.security.web.context.SecurityContextPersistenceFilter#593fdbbe, org.springframework.security.web.header.HeaderWriterFilter#2d784ff4, org.springframework.security.web.authentication.logout.LogoutFilter#55ef8d65, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#3ba7a547, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#12e1efcb, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#57449117, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#5cba96fc, org.springframework.security.web.session.SessionManagementFilter#5403d62a, org.springframework.security.web.access.ExceptionTranslationFilter#4817a878, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#36126980]
2018-03-05 14:34:47.573 INFO 10768 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: OrRequestMatcher [requestMatchers=[Ant [pattern='/**']]], [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#70c855ab, org.springframework.security.web.context.SecurityContextPersistenceFilter#1eef0aa6, org.springframework.security.web.header.HeaderWriterFilter#537d0675, org.springframework.security.web.authentication.logout.LogoutFilter#7d1011c1, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#1b4c8eff, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#73c2d36e, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#48372dcd, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#3cfcbfa3, org.springframework.security.web.session.SessionManagementFilter#4befcfad, org.springframework.security.web.access.ExceptionTranslationFilter#4ed4729f, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#dffb1e0]
2018-03-05 14:34:47.807 INFO 10768 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2018-03-05 14:34:47.900 INFO 10768 --- [ restartedMain] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2018-03-05 14:34:48.000 INFO 10768 --- [ restartedMain] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2018-03-05 14:34:48.008 INFO 10768 --- [ restartedMain] com.rest.Application : Started Application in 10.365 seconds (JVM running for 11.067)
2018-03-05 14:42:28.257 INFO 10768 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'
2018-03-05 14:42:28.257 INFO 10768 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization started
2018-03-05 14:42:28.279 INFO 10768 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 21 ms
Then, I should go to localhost:8080/api/operator/all to get the list of operator as I used to do, but it's asking me to use a username password, I tried everything from db user (root, root) but doesn't work.
I don't even have a connexion page in the application.
enter image description here
If you have any idea, please feel free to suggest, I'm using a Mac as you see.
Thanks.

Resources