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
4
votes
2 answers

Spring WebSockets - how to apply @DestinationVariable only to @SendTo annotation?

I'm trying to apply a destination variable to a method in my controller that handles incoming messages from WebSocket. Here's what I want to achieve: @Controller public class DocumentWebsocketController { @MessageMapping("/lock-document") …
pidabrow
  • 966
  • 1
  • 21
  • 47
4
votes
1 answer

JSF 2.3 with Spring 4.3 @Inject @ManagedProperty issue

I have Faces-Config.xml set to web-facesconfig_2_3.xsd. Got the latest jars for JSF 2.3. Using CDI annotations for JSF and Spring, created two beans with request scope and tries to inject managed property from another bean paymentBean. Followed this…
4
votes
1 answer

How to use OAuth2RestTemplate + Spring 4?

I'm trying to understand how to use a OAuth2RestTemplate object to consume my OAuth2 secured REST service (which is running under a different project and let's assume also on a different server etc...) f.e. my rest service…
4
votes
1 answer

java.io.IOException: UT010029: Stream is closed

How to Resove below Error: ERROR [com.test.filter.AuthenticationFilter] (default task-6) displayUpdateUser:Error occurred while displaying the Update User page.: java.io.IOException: UT010029: Stream is closed at…
Thamaraikkannan
  • 41
  • 1
  • 1
  • 2
4
votes
3 answers

Migration to hibernate core 5.2.1 ava.lang.NoSuchMethodError: org.hibernate.Session.getFlushMode()Lorg/hibernate/FlushMode;

Using spring version:4.3.1,Spring data:1.10.2,hibernate core: 5.2.1. using postgres Database pg connector version :9.4.1208.jre7 After upgrading from hibernate 5.1.0 to 5.2.1 when i am trying to create an entity getting below exception at…
arun kumar
  • 247
  • 2
  • 5
  • 15
4
votes
4 answers

How to set active profiles in Spring annotation based java config

set active profile like context.getEnvironment().setActiveProfiles( "DEV" ); which can be achieved by using public class SpringWebInitializer implements WebApplicationInitializer { public void onStartup( final ServletContext servletContext…
arun kumar
  • 247
  • 2
  • 5
  • 15
4
votes
1 answer

How to use Spring 4 convertPropertyValue (for reading encrypted values)?

We are using spring 4 place holder feature The property files: ##sample.properties user=admin password=123 We try to…
Alireza Fattahi
  • 42,517
  • 14
  • 123
  • 173
4
votes
1 answer

Is there anyway to get "Effective Spring Config" from all spring beans annotations?

I liked annotations used for bean declaration etc. But now we have so many beans with order (@Depends). It is tough to maintain or look at a glance the configuration. Is there any tool that provides "Effective Spring Config" information based on…
gpa
  • 2,411
  • 6
  • 38
  • 68
4
votes
2 answers

ImportBeanDefinitionRegistrar vs BeanDefinitionRegistryPostProcessor

My use case deals with creating beans dynamically. I find they are two options to register bean definitions: ImportBeanDefinitionRegistrar and BeanDefinitionRegistryPostProcessor I wanted to understand the difference between two. Thanks, Prateek
prateek
  • 89
  • 1
  • 6
4
votes
0 answers

Different result sets for same native query when executed by SQL client and application

all. I have a weird situation when executing a native SQL query against an Oracle database. If the query is executed via SQL client software (in my case, DbVisualizer) I have one result set; if my application (Java, Spring-based) executes it, the…
Matheus Moreira
  • 2,338
  • 4
  • 24
  • 31
4
votes
1 answer

Error after upgrading from Spring 3.2.3 to Spring 4

After I upgrade my web app from Spring 3.2.3 to Spring 4 I am experiencing NoSuchMethodError: java.lang.NoSuchMethodError: org.springframework.security.web.access.expression.WebSecurityExpressionRoot.setDefaultRolePrefix(Ljava/lang/String;)V This…
bogdan.rusu
  • 901
  • 4
  • 21
  • 41
4
votes
1 answer

Migrating from web.xml to Java based configuration - unable to start Tomcat 8

I am trying to migrate my app's web.xml to Java based configuration. We are using spring 4.1, Java 7, Servlet 3.1, Tomcat 8 and Eclipse Luna. The web service framework is Jersey 2.14. I used mainly the following guide:…
Eyal
  • 1,748
  • 2
  • 17
  • 31
4
votes
2 answers

what is the difference between using or not Spring Beans?

Probably i'll get a lot of downvotes, but it's so confusing for me all this fact of whether use beans or not. Lets suppose this example interface ICurrency { String getSymbol(); } public class CurrencyProcessor { private ICurrency…
jscherman
  • 5,839
  • 14
  • 46
  • 88
4
votes
1 answer

Upgrading to Spring 4.1 Breaks Quartz Persistence due to removed JobDetailAwareTrigger

I am upgrading from Spring 3.2.x to Spring 4.1.x and am using Quartz 2.2.1. We dynamically create jobs and have been persisting them using the solution described in this stackoverlow answer. The solution in that answer depends on a constant…
Jeff M
  • 1,055
  • 1
  • 10
  • 22
4
votes
1 answer

How can I globally set FlushMode for Hibernate 4.3.5.Final with Spring 4.0.6?

I'm trying to upgrade our application with Hibernate 4.3.5.Final and Spring 4.0.6. Any where in my app with database write operation gets an error as below: Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are…
Max
  • 1,064
  • 9
  • 23