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
3
votes
1 answer

Declare and use RabbitMQ with Spring 4 Websockets

in our current app, we are using Spring AMQP this way:
Antonio Acevedo
  • 1,480
  • 3
  • 21
  • 39
3
votes
1 answer

Ambiguous mapping found with ControllerClassNameHandlerMapping

How to map requests to methods without explicit annotations on top of methods? For instance, the following request: http://somedomain:8080/SampleSpring/access/loginFailed should be mapped to "loginFailed" method of "AccessController" without the…
coolscitist
  • 3,317
  • 8
  • 42
  • 59
3
votes
5 answers

Spring 4 binaries download

I haven't downloaded spring in a while. I'm investigating gradle, but don't seem to have the hang of it yet, so i want to create a new spring framework project using java, Spring 4 and ant. I can't seem to find the place to download the binaries for…
Thom
  • 14,013
  • 25
  • 105
  • 185
2
votes
0 answers

aws sqs starts up with an NoSuchMethodError error

I am using spring 4.1.x, to create a producer to put messages into AWS SQS. I created a configuration class for QueueMessagingTemplate. I get the below error during application start up. There seems to be some dependency conflicts after reading…
2
votes
1 answer

Spring4 Jersey2 integration: Adding jersey-spring4 fails

I'm trying to integrate Spring 4 with Jersey 2. However this exception is thrown and deployment on Glassfish 4.1.1 fails: java.lang.AbstractMethodError: …
PKey
  • 3,715
  • 1
  • 14
  • 39
2
votes
2 answers

Spring 4: run some initialization code before application context refresh

I am using Spring 4 (not Spring Boot) in the web application. I need to run some initialization code before any of the beans in the application context would be created. I tried to create implementation of…
briarheart
  • 1,906
  • 2
  • 19
  • 33
2
votes
1 answer

How do I validate a @QueryParam?

I've got a simple REST resource which accepts a couple of query parameters. I'd like to validate one of these parameters, and came across ConstraintValidator for this purpose. The REST resource expects the query param territoryId to be a UUID, so…
sbrattla
  • 5,274
  • 3
  • 39
  • 63
2
votes
0 answers

Spring 4 rest to download URL resource as zip archive

I wanted to add a REST service to download a resource found by URL, and archived in ZIP format. I use the following code to do that: @GetMapping(value = "/downloadAsZip", produces = "application/zip") @ResponseBody public Resource…
androberz
  • 744
  • 10
  • 25
2
votes
1 answer

Spring @EventListener with two arguments

I'm looking for a way to pass two arguments to an @EventListener. I have an Event class. It looks like this: public class Event { String id; Date timestamp; String data; String type; } The data is serialized, and the type describes…
Josh C.
  • 4,303
  • 5
  • 30
  • 51
2
votes
2 answers

Error while setting Up Ehcahe 3 with spring boot 1.5

I have recently upgraded to spring boot 1.5.7 from 1.4 and found that Ehcache has been upgraded to 3.x from 2.x. The configurations have all changed. Now I am unable to set up the caching config. I tried following the steps on the official blog at…
Nikhil Sahu
  • 2,463
  • 2
  • 32
  • 48
2
votes
1 answer

how to configure the Jackson Streaming API with Spring 4 MVC

I have around a 250MB request body that I need to http PUT in Spring 4. I was thinking that the Jackson Streaming API might be a good way to handle this large body since I am getting OOM issues. I only need this to be enabled for a single…
Ron Stevenson
  • 166
  • 1
  • 13
2
votes
0 answers

How can I use the same Connection when parallelizing these queries in a Spring transaction?

We are using Spring 4.1.6 (MVC, TM, and JDBC), running under Java 8, against an Oracle 12c database. Let's say for now this is a database of persons. I have a stateless @Service (called PersonService) with a @Transactional method (called…
2
votes
2 answers

NoClassDefFoundError Could not initialize class com.ibm.mq.headers.internal.HeaderType

We have upgraded to IBM MQ8 and have following dependencies in our project. The following dependencies…
IMahajan
  • 53
  • 3
  • 13
2
votes
3 answers

How to run update query in Spring JPA for quartz job

I have a quartz job in spring 4 and I am using JPA hibernate to update database value through quartz job but I am getting javax.persistence.TransactionRequiredException: Executing an update/delete query I don't understand what kind of configuration…
pise
  • 849
  • 6
  • 24
  • 51
2
votes
2 answers

How to get the session object in general from within a class?

There is a class : @Configuration @ComponentScan("com.ambre.pta") @EnableTransactionManagement @PropertySources({ @PropertySource("classpath:fr/global.properties"), @PropertySource("classpath:fr/main.properties"), …
pheromix
  • 18,213
  • 29
  • 88
  • 158