Skip to content
Advertisement

Tag: rest

POST: Exception Status expected: but was:

Technically it should be a simple task, but I can’t find the error. I want to write a normal “POST method”, but when I tested it, it came to a problem: enter code here Status expected:<201> but what:<200>. My question is, why do I get an OK and not a CREATED? CODE: PostMapping in Controller Unit Test Answer Because for

How to send Email in Java without DB setting [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I have set up a simpleMailMessage service following the codes and information given from spring-email from baeldung After setting my configuration, maven dependency, and service, I

Make a POST with JPA with existing data

I have the following problem, the thing is that I have an entity: The thing is that this back is connected to an Oracle DB, in which I already have a few registered users, but these are entered through a Mockaroo script, and when I try to save a new user through a service Rest throws me this error: Of

Java Rest API – Method to return balance on account [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago. Improve this question I need to get the balance for a particular customer id and account id. I have these two java classes.

Developing multiple springboot services in an IDE

How can you develop and test multiple REST services developed in Springboot from an IDE? I will have to have different port numbers for each REST service, is there any better way? Answer First of all you’ll probably want to show all the source files from all the services in the same IntelliJ project. So you’ll need to maintain a

No response on a GET query to JAX-RS service

I have a service that has two classes and is very simple: and Commented lines are the ones that I tried to use. Every time I call “http://localhost:8080/api/hello-world” or “http://localhost:8080/api” the response is 404-Not Found. I use Tomcat 9.0.50. What can be wrong with my usage of the classes or their calling from the outside? Answer The problem was –

Getting error : org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory

I have a project Webservice with Hibernate in Eclipse (Tomcat v10.0 et java JDK 8). When I run, I got this error: ” Servlet.service() for servlet [Jersey Web Application] in context with path [/musichall] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory] with root cause java.lang.ClassNotFoundException: javax.validation.ValidatorFactory” Below is my pom.xml Here is my file “persistence.xml” Here is the “MusicienService” class Here is

Advertisement