Skip to content
Advertisement

Tag: spring

Spring deserializes a LocalDate in a @RequestBody differently from one in a @RequestParam – why, and can they be the same?

QUESTION: Spring appears to use different deserialization methods for LocalDate depending on whether it appears in a @RequestBody or a request @ReqestParam – is this correct, and if so, is there a way to configure them to be the same throughout an application? BACKGROUND: In my @RestController, I have two methods – one GET, and one POST. The GET expects

Spring boot app terminated at startup

I have created a spring boot project using spring initilizer. I use spring-boot-cli version v1.5.3.RELEASE. I just try to run: But my server won’t stay running, it is closing automatically. On port 8080 I have no other connection: LATER EDIT: Still not working. EDIT: here is the pom file: Answer I added in the pom file a tomcat dependency and

Change or override default Behavior of Mongorepository.save(document)

Is there any way to intercept or change the document before MongoRepository.save(e) updates it? I am trying to push a subproperty inside and array in a document. I have tried to manipulate DBObjects by implementing converter(using custom converter) but the $push operation did not work over there. I think to make it work I have to implement something like mongoOperation.update(dbObjectMatch,dbObjectUdate).

How to reset Hibernate sequence generators?

I’m using Hibernate 3.5.6-Final with an Oracle database for production and a H2 database for integration tests. The Hibernate mapping for ID creation looks like this with every entity extending EasyPersistentObject: Before each JUnit integration test I am removing all data from the database with Everything works fine until I increment the allocationSize for sequence generation. Raising this to e.g.

Static variable set to null by @Value

My Constants File: My settings.properties: My Referring Class and Method: But Root Domain is coming as null [update] My spring-master.xml And the ApplicationContextProvider class is as follows: So yes the files are in classpath Answer @Value() gets called on the initialization of the bean , the bean gets initialized on need not on the startup so you will not have

DispatcherServlet and web.xml in Spring Boot

I’m currently trying to move my project from Java EE to Spring Boot project. However, i’ve been stucked and confused on the part with dispatcher servlet and web.xml and it seems like web.xml is no longer being read by the project anymore. The current project is running on tomcat 7. In my web.xml file, I have lots of servlet, servlet-mapping,

Send invites with google calendar API

I have a Java Spring API where I want to integrate Google Calendar. The task: Basically creating an event for two attendees (users) and send them an invite with the option to accept/decline (standard GCalendar invite) I tried this example here: https://developers.google.com/google-apps/calendar/quickstart/java But I think this is not the right one since I authenticate as a user – or do

Could not exec java with Spring+Maven exit code 1

I am new to Spring/Maven, and am following this tutorial: Serving Web Content with Spring MVC. Everytime I run mvn spring-boot:run, I get this error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.2.RELEASE:run (default-cli) on project gs-serving-web-content: Could not exec java: Application finished with exit code: 1 -> I tried to add classpath, tried to run mvn install clean spring-boot:run, did a lot

Spring Boot application in eclipse, the Tomcat connector configured to listen on port XXXX failed to start

I’m developing a REST API using Spring Framework. First I wasn’t able to run my application because of the same problem. The port 8080 on my computer is busy. Then I found out that one alternative to solve this problem is creating an application.properties file under src/main/resources folder. That’s what I made, and set up the server to listen on

Advertisement