Questions tagged [spring]

The Spring Framework is an open source framework for application development on the Java platform. At its core is rich support for component-based architectures, and it currently has over a dozen highly integrated modules.

0
votes
0answers
5 views

Minimize method injection parameters in SpringBoot 2

I'm relatively new to the Spring community and I have a question about reducing the number of method injection parameters. Example Config Class @Configuration public class CustomConfig { @...
0
votes
0answers
6 views

Send file from Spring server to Angularjs client with web socket

I've always used rest web services to transfert file between client and server but now I have to make this through web socket. This is the scenary: user requires file download by page interface, so ...
1
vote
0answers
7 views

Spring HATEOAS error handling with VndErrors

I am struggling to find a clean way of handling errors produced by an HATEOAS enabled api. Basically our backend service is a spring application that in case of exceptions uses @ControllerAdvice to ...
0
votes
0answers
6 views

Apply aspect on non-spring-managed beans

Apply aspect on non-spring-managed beans I have an integration-test which calls a micro-service (abc-service) implemented using drop-wizard framework. My integration test calls a resource end point ...
0
votes
1answer
13 views

Angular 1.7.2/Spring Boot - Infinite template loading when include navbar and footer

My project was migrated from Thymeleaf to Angular. Navbar and footer is being included from another files on all pages. What is interesting - navbar/footer works on most of pages, without Home Page, ...
0
votes
1answer
9 views

Spring Integration DSL Stackoverflow Error

We are using Spring Integration Java DSL and intermittently we are observing stackoverflow error , and from stack-trace , we observe the infinite loop too . But unable to figure out why its happening ...
0
votes
0answers
7 views

Signifance of overriding MongoDBs ObjectId

I am working on an integration where I am overriding the _id field to keep track of sessions. I am doing this using Spring and a Converter interface, and instead of MongoDBs generated id I am placing ...
0
votes
0answers
8 views

Would @WebService annotation interfere with @Endpoint in Spring Web Services?

I'm writing a Spring Boot Web Services application, thus I'm using @Endpoint and @PayloadRoot annotations. For documentation purposes I'm using Enunciate, which doesn't support Spring-WS annotatinos ...
1
vote
0answers
14 views

Hibenate BasicExtractor doesn't log anything

I am using Spring 5.0.5, Hibernate 5.2.16 and logback. I want to log values of parameters bound to SQL queries Hibernate generates. I managed to get log output from BasicBinder (similar to 2018-09-28 ...
0
votes
0answers
4 views

Store value of native query with resultSetMapping in external properties files

Default approach (in entity): @Entity @Table(...) @SqlResultSetMapping(name = "SomeName", classes = @ConstructorResult(targetClass = SomeClass.class, columns = {...})) @NamedNativeQuery(name = "...
0
votes
0answers
6 views

Spring cloud Stream producer batch

I have been developing a project utilizing the 1.0.0 Release of cloud stream kinesis binder (https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis). I have an in bound channel (...
1
vote
0answers
26 views

How to load balance a spring boot micro service database application

I have been doing research on micro services. I have used spring boot seeing how simple it is to start with. During my research i have read that is a good approach that every micro service, that is ...
0
votes
0answers
6 views

Spring Batch MultiResourceItemWriter - Job restart failing (File is not writable) if last file first chunk failed

I'm developing an Spring Batch application that writes database rows in CSV files. The database is huge so I need to generate multiple output CSV files partitioned (outputfile.csv.1, outputfile.csv.2, ...
3
votes
0answers
24 views

Spring Boot @Aspect Logging

I tried to use @Aspect for logging all request and response. If my endpoint has @RequestBody my code is working, but my get endpoints has not @RequestBody and I can't see logs. is that any ...
0
votes
0answers
7 views

Pass HashMap Form Jsp To Spring Controller

I have a HashMap in a jsp in jstl variable like below In the same Jsp a have a Hiperlink which pass some string parameters to spring controller.I am able to get String parameter easily by @...
0
votes
2answers
37 views

Eliminating Spring.xml from Spring Framework

In Spring Framework is it possible to eliminate the entire Spring.xml and use a configuration class with @Configuration and @Bean annotation for creating bean, and for all other purpose use a spring....
0
votes
1answer
15 views

Spring security: after log out the login doesn't work anymore if I use maxSessionsPreventsLogin()

I'm using Spring Security to perform log in and log out. Log in and log out seem to work well everytime I perform them. If I add maxSessionsPreventsLogin() the log in works during the first attempt; ...
0
votes
1answer
22 views

How to rollback transaction on calling @Transactional and non-Transactional method in same and different Service?

I am using spring data rest and Spring JPA. I am having one method which update one database table. @Autowired InvoiceClient; @Override @Transactional public String doBilling(String x){ //get date ...
0
votes
0answers
6 views

Adding google login_hint parameter to Spring oauth2 AuthorizationCode request

I have been trying to add a request parameter to the AuthorizationCode request spring oauth2 filter makes to google when as part of the oauth2 authentication flow. Specifically, I need to add a ...
0
votes
1answer
27 views

AND/OR in Thymeleaf if

i want to check two lists (empty-check). How can i do that in Thymeleaf? I tried the following th:if="${not #lists.isEmpty(teilmassnahmenAktiv) or not #lists.isEmpty(teilmassnahmenInaktiv)}" but no ...
0
votes
1answer
30 views

spring security and spring boot 2 with cors Access-Control-Allow-Origin issue

I am getting below error . can somebody help me how to configure cors in spring boot with spring security. is there any thing I have to do fro UI side in angularjs. Failed to load http://...
0
votes
0answers
6 views

RedisTemplate not fetching the same keys compared to RedisConnection

I am trying to fetch all the keys of my local redis server. I have configured the RedisTemplate like this: @Bean JedisConnectionFactory jedisConnectionFactory() { ...
0
votes
0answers
18 views

Docker application container cant connect mysql server MySQLNonTransientConnectionException

I need to run the application in docker(spring Application, MySQL). I download sample app spring application run application locally all works fine on tomcat server using MySQL DB. Docker for ...
0
votes
0answers
12 views

Tomcat HTTP Status 404 - Error during artifact deployment

I do a Spring boot project and bootstrapping at the moment. I run the app via the Tomcat and get this error, I have the minimal project structure, The Application class is provided, @...
-1
votes
0answers
20 views

Add Role to Spring Security

I have 3 roles in my application: ROLE_ADMIN, USER_USER, and ROLE_EMPLOYEE. I thought it is as easy as just adding another role in my database. But, it seems that Spring Security recognizes only ADMIN ...
0
votes
0answers
30 views

Blocking @Transactional method

I have a problem with adding some objects to the database. I have a user object that contains the @OneToOne object, which is a message box. There is an object with Set <Conversation> containing ...
0
votes
1answer
14 views

how to implement SSO with saml in my project using spring core not spring boot?

we would like to use OKTA as service authentication and authorisation. Any help would be appreciated.
0
votes
0answers
7 views

Spring JDBC + IBM App Scan as It is not able to recognize a different type of Validation

I am working on an Angular and Spring Application. I used IBM AppScan to run my Spring code and it reported few vulnerabilities of high priority. As I am using Spring JDBC , It turns out the issues ...
-1
votes
1answer
47 views

How to sort different Dates?

I want to sort the list products in class Foo by different dates (creationDate, displayDate and requestDate) and return Product List. Do you have an efficient proposal ? public class Car extend ...
0
votes
0answers
12 views

Http outbound-gateway: is there a way to handle not HTTP errors and, in particular, “no connection” error?

My gateway can handle HTTP errors by custom error-handler (extends DefaultResponseErrorHandler). But if there is a connection failure error, the gateway is silent. Gateway schema: <int-http:...
1
vote
1answer
41 views

Converting List of objects into pages in spring

I am trying to get page with a number of items in each page. For some reason, this method returns the complete list instead of page of 5 items. public Page<Item> searchPagedCategoryByName(@...
0
votes
0answers
5 views

How to use swagger with complex query data type for “get” request in spring mvc?

I used swagger to generate document for spring mvc project. For post request,it is OK. @ApiOperation("post") @PostMapping("post") public Map<String, String> post(@RequestBody Foo foo) { ...
0
votes
1answer
21 views

Spring Configuration Properties with DataSource (YML)

I need to use a configuration properties outside my jar. For this, I'm using a class to configurate: @Data @Configuration @PropertySource(value={"file:///C:/main.properties"}) public class YAMLConfig ...
1
vote
0answers
28 views

Multiple forward slashes in request mapping in spring

@RestController @RequestMapping("/api") public class AbcController { @RequestMapping(value = "/abc", method = RequestMethod.GET) public String abc(){ return "Hello"; } } Valid URL: http://...
0
votes
1answer
25 views

Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException

I'm getting issue when i'm hitting URL My Controller Please help me out find my error from my title @RestController @RequestMapping("/client") public class TestController { ...
0
votes
1answer
15 views

i have question! how to 'removeattr' next 'attr' “readonly”

Text status is readonly now. I want change remove readonly and modify and add readonly. Code is operates when the button(modify) is onClick. Code is `$("input[name=ELEMENT]").removeAttr('readOnly');...
0
votes
0answers
7 views

Spring data cassandra batch operations increment query

I have two related tables in cassandra. JourneyMetrics account | journey | journey_state | type | count -----+-------------+---------------+------+--------- JourneyState account | journey | ...
0
votes
1answer
10 views

Can't import springframework.security.extensions and find saml() method

org.springframework.security.extensions.saml2.config.SAMLConfigurer does not exist At least i can't import org.springframework.security.extensions.saml2.config.SAMLConfigurer in my Security ...
-3
votes
0answers
8 views

I can't understand “cacheManagerPeerProviderFactory” options

I can't understand below options. "rmiUrls=//hostname:port" How can Ehcahed App know another server IP? I think so options have to offer IP & Port Information.
-1
votes
0answers
7 views

how to deploy war(spring app) on Tomcat from intelij idea?

There is application on spring. Result of build procedure is creation of war file. When I deploy on local tomcat, everything ok When try to deploy to remote machine - there is error running remote. ...
0
votes
0answers
22 views

Get tokens from azure login

I'm using Azure AD to login to spring boot application. Although I can log in I need to see user information witch would come with bearer token. How could I get this token when user is redirected back ...
0
votes
0answers
8 views

How to avoid loading all the beans of the other Batch job if not running it

I am new to the Spring Batch wanted to understand how we can avoid the below issue. In my project, we are using AppCommonConfig where we've listed all the batch files to be called and using Spring ...
0
votes
1answer
27 views

Spring repository caching

I am writing an application with Spring 5 and Hibernate. There's a service that receives an entity in a different state than currently persisted. It performs some processing and saves the entity to ...
0
votes
2answers
44 views

Unable to load static content in spring security

I have built a basic spring authentication service from this source: https://spring.io/guides/gs/securing-web/ Tried to include JS files from Local folders using almost all solutions on stackoverflow ...
-1
votes
1answer
46 views

A “NullPointerException” could be thrown; “entity” is nullable here [duplicate]

I get an error A "NullPointerException" could be thrown; "entity" is nullable here. below is a sample of my code. NewResponse newResponse = new NewResponse(); if(entity.getName() != null){ ...
0
votes
0answers
23 views

Spring test profiles: how to load only related test context resources

This is my application.properties file: spring.data.mongodb.host: localhost spring.data.mongodb.port: 27017 spring.datasource.url: jdbc:postgresql://localhost:5432/frontoffice spring.datasource....
1
vote
2answers
32 views

What is the difference between loading properties files in spring through @propertysource annotation and by using PropertySourcesHolderConfigure bean

I am studying about how to access properties files in Spring and I am very confused to find out the difference among <context:property-placeholder> vs PropertySourcesPlaceHoderConfigure vs @...
0
votes
0answers
17 views

org.hibernate.AssertionFailure: Unable to locate referenced entity mapping

My project is using hibernate3 along with spring 2.5. Now I am migrating it to Spring5 and hibernate5 with JPA. I have hbm.xml for my entities using hibernate-mapping. After migration I get the error: ...
0
votes
0answers
14 views

Relation between sessionfactory, sessions and connection pool in hibernate

Suppose I m using hibernate in my project. And i have set the connection pool size to 25. Does this mean my sessionfactory can create only 25 session objects at a particular instance? What if i try to ...
0
votes
0answers
18 views

i need help Class “…” not found at spring-mvc project

It servlet-context.xml I am getting errors (as shown in image below) Below classes are not found: org.springframework.web.servlet.config.AnnotationDrivenBeanDefinitionParser$...