Questions tagged [spring-4]

Version 4.x of the Spring Framework

Use for general Spring related questions. This tag is for questions that are specific to versions 4.x only.

618 questions
0
votes
1 answer

Hibernate lazy initialization not working with Jackson Mapper

I am using Spring 4 and Hibernate 4. I am using java jpa to use hibernate. I want to load few data lazily. And I have also configured Jackson mapper to convert my java object to json and vice versa. But it's throwing exception while converting the…
aviundefined
  • 802
  • 2
  • 10
  • 25
0
votes
1 answer

Spring MVC4 REST webservice getting error 406

I am stuck in this part of code where I am getting HTTP 406 error. The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers. I searched for two…
Arun
  • 3,701
  • 5
  • 32
  • 43
0
votes
0 answers

JPA + Spring - Parallel Classes Hierarchy

As far as I know, the only way to implement parallel class hierarchy on JPA entities is as follows: @Entity public abstract class Job { @Any(metaColumn = @Column) @AnyMetaDef( idType = "integer", metaType =…
Poly
  • 195
  • 2
  • 8
0
votes
1 answer

Why Hibernate 4.3.7.Final saveOrUpdate fires update after every insert ?

In earlier version of Hibernate , saveorUpdate fires insert or update query based on the entity. But in hibernate 4.3.7 fires update query after every insert.I see both insert and update query. Domain Object import java.io.Serializable; import…
Mahesh
  • 248
  • 4
  • 19
0
votes
0 answers

Validate annotation on getter in Spring 4

How to make delegate fields validation (using annotation) in wrapper? Is it possible to make annotation on getter instead on fields? I tried to do something like this: class A{ private Object obj; public Object getObj(){ return obj; } …
Consec
  • 549
  • 6
  • 12
0
votes
1 answer

Spring 4 Converters

I'm writing a webserivce using Spring 4. I have a problem with data binding. I've got org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.util.Set' for…
user3025978
  • 477
  • 2
  • 8
  • 27
0
votes
1 answer

Spring security for CSRF

I am building an application where authentication is done by external system. For CSRF handling, I would like to use Spring Security's CSRF suport (http://docs.spring.io/spring-security/site/docs/3.2.0.CI-SNAPSHOT/reference/html/csrf.html) I tried…
Chir
  • 671
  • 1
  • 10
  • 29
0
votes
1 answer

Using one DataSource object for multiple DB connections - using only one connection at a time

Can we define only one DataSource object and wire it dynamically at runtime connecting to different databases ? I need to connect to only one database at a time. I will be passing the name of the Database as argument. I will lookup the DB URL and…
Shrinath
  • 534
  • 10
  • 18
0
votes
1 answer

Can a Spring 4 application support spring-beans.dtd when it is run in a firewalled enviorment?

I have a Spring 4 project that when it is deployed it is run behind a very restrictive firewall. The effect of this firewall is that my project cannot download anything from the internet when it is starting up/running. My project has a dependency on…
Rylander
  • 19,449
  • 25
  • 93
  • 144
0
votes
1 answer

No Response Body with HttpMessageConverter invoked by ControllerAdvice

EDIT: The error was in the client not the server. The response body was getting written, but the client was not reading it on a 400 response. I have a custom message converter to produce text/csv, application/csv from an ErrorResponse object. It…
Brian
  • 451
  • 4
  • 15
0
votes
1 answer

Why do spring framework reference doc missing context-support in their diagram

The Diagram [2.1. Overview of the Spring Framework] in Spring Framework reference 4.1.4 which is updated since last doc but it is missing spring-context-support from it. In the diagram they mentioned context ,do that represents…
Sankalp
  • 2,030
  • 7
  • 30
  • 41
0
votes
1 answer

Print a message after Tomcat comes up

Is there a good way to print information when Spring is done initializing everything and Tomcat is up and ready for service? I'd like to display a small banner (like Spring boot does, though I'm not using Spring boot), and print out some stuff like…
Jazzepi
  • 5,259
  • 11
  • 55
  • 81
0
votes
1 answer

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed

I have created a prpject using spring3 and hibernate. But it fails to run due to Bean creation Exception.The Code and Root Cause are provided below. HomeController code @Controller public class HomeController { @Autowired private UserDao…
shalu
  • 113
  • 2
  • 14
0
votes
2 answers

Move Spring XML context to Groovy

I am trying to move my simple spring integration application from XML context to Groovy contex. Unfortunately, a couldn't find any useful examples how to work with namespaces in Groovy context. I started from the simplest part, inbound gateway…
Andrey Vlasenko
  • 127
  • 1
  • 2
  • 7
0
votes
0 answers

Spring 4: ThreadPoolTaskExecutor transaction management issue

We recently upgraded our spring version to 4.x from 2.x which started causing some issues with one of our 'threadpooltaskexecutor' implementation. The implementation was as below: public class…
Anand03
  • 213
  • 2
  • 6
  • 17