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 twenty highly integrated modules. For Spring Boot related questions, also include the tag [spring-boot].

spring
80,859 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1 vote
1 answer
382 views

Spring Data JPA: overriding toPredicate when inner object's variable is criteria

I want to create method which will find all the A class objects, which specificValues contains SpecificValue class object with name == value. @Entity Class A { String variable; @ManyToMany List&...
1kka's user avatar
  • 77
1 vote
2 answers
1k views

spring+springmvc+mybatis:Injection of autowired dependencies failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'Userservice': Injection of autowired dependencies failed; mybatis-config.xml <?xml version="1.0" ...
黄旭阳's user avatar
1 vote
0 answers
300 views

No scoped proxy for SqlSessionTemplate with Spring JavaConfig

I am trying to make MyBatis Mappers serializable (kind of). To do so, I would simply want to wrap the SqlSessionTemplate (which is the non-serializable thing) via Java config into a scoped proxy... @...
Florian Schaetz's user avatar
1 vote
0 answers
64 views

SubscribableJmsChannel bug?

In the onMessage event, if the message does not get converted as a Spring Integration message it will try and use the MessageBuilder to rebuild it. But it doesn't include the headers. This seems ...
optisoft's user avatar
1 vote
1 answer
1k views

How to use @RefreshScope with @EnableBinding-annotated classes?

@EnableBinding turns class into @Configuration, and it's documented that: @RefreshScope works (technically) on an @Configuration class, but it might lead to surprising behaviour: e.g. it does not ...
Max Romanovsky's user avatar
1 vote
1 answer
338 views

How do I get my custom annotation invoked using Spring?

I’m using Spring 3.2.11.RELEASE with Java 6. I’m trying to create a custom annotation but I’m having trouble getting the logic to handle it invoked. I have created this annotation package org....
Dave's user avatar
  • 16.2k
1 vote
0 answers
1k views

UserDetailsService won't throw custom Exception

For my project I have used Spring 4.2.5, Spring Security 4.0.4 and JSF Mojarra. And I'll throw a custom exception from my custom UserDetailsService. @Override public UserDetails loadUserByUsername(...
aprisniak's user avatar
  • 402
1 vote
0 answers
281 views

Java Spring declare bean in service class

I have Spring Java Services class with a lot of beans: @Service ("employeeManager") public class EmployeeManagerImpl implements EmployeeManager { @Autowired EmployeeDAO employeedao; @...
avi's user avatar
  • 15
1 vote
1 answer
725 views

How to re-write request URI along with path variable in Spring?

I'm using Spring 4 right now and I have a controller defined a such: @RequestMapping(value = "/{id}/definitions", method = RequestMethod.PUT) @ResponseBody public List<ResponseDTO> update(@...
HiChews123's user avatar
  • 1,648
1 vote
1 answer
167 views

SpringDataRestAdapter load child resources

Hi there, I'm using SpringDataRestAdapter to interact with my spring data rest api. From the screen shot you can see that I've just loaded all the questions and I'm attempting to load their answers (...
Mark Gargan's user avatar
1 vote
1 answer
502 views

spring-data-cassandra how to implement generic repository

I'm familiar with Spring Data Repositories concept, but what should I do when I need standard CRUD for 100 different models? Creating 100 Repository classes doesn't look like good solution especially ...
Vladimir Nikulin's user avatar
1 vote
0 answers
1k views

Domain Class Field Type not Getting Mapped to Spring Data ElasticSearch

I have a Domain Class of Books I use this for hibernate and elasticsearch both. import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; ...
Rahul Agarwal's user avatar
1 vote
1 answer
632 views

spring mqtt: catch ConnectException

I have a question about spring. I make a connection with MQTT broker using Spring-Paho MqttPahoMessageDrivenChannelAdapter. Here is a java config part: @Bean @Description("mqtt inbound adapter: ...
user2957954's user avatar
  • 1,249
1 vote
0 answers
91 views

How to insert several multiple selection same name into mysql?

I need to know how Html form several multiple selection same name insert into mysql?? I'll get this problem->enter image description here that all insert into one field ,those score option 1 should be ...
jason010183333's user avatar
1 vote
1 answer
1k views

Spring Security interfering with transition/redirect/page loading

I have a small Spring/ JSF/ JDBC webapp, which worked fine until Spring Security was added. Since adding the springsecurityfilterchain, the sign-up button (as opposed to sign-in) on the login/welcome ...
Fonderman's user avatar
1 vote
0 answers
459 views

Tomcat, Sessions and Browser reload

We have web-application which is regularly updated and deployed on Tomcat. Also infinite session is set in tomcat configuration(there were reasons for it). When war is deployed, old websocket ...
nurgasemetey's user avatar
1 vote
0 answers
1k views

Spring doesn't find a bean for view

I have a controller which maps the path / to a file index.html. I am getting an error that normally doesn't show up in the log, but when debug logging is turned on then it shows: No matching bean ...
cst1992's user avatar
  • 3,891
1 vote
1 answer
732 views

How to create custom component model for MapStruct?

MapStruct provides component models for creating converters. But, these converters are generated like independent Spring components. Is there a way to "put" them into ConversionService? Here is an ...
Cherry's user avatar
  • 32.4k
1 vote
0 answers
4k views

decrypt springboot datasource password using own secret key before db connection

Our company has an encryption utility that we want to use it as a universal encryption/decryption method. Our spring-boot application have an external properties to specify spring.datasource.* ...
Mark's user avatar
  • 11
1 vote
0 answers
547 views

Spring, hibernate jsp: binding ManyToMany relationship to form

I am trying to bind a ManyToMany relationship to JSP but apparently that is not so easy. @Entity public Course { Set<Student> students; } @Entity public Student { Set<Course> ...
user1539343's user avatar
  • 1,619
1 vote
0 answers
425 views

drools6.3.0.Final spring integration

I am new to drools and I have got a problem while I am trying to integrate drools with spring following the guide of the drools doc page.Here's the link :http://docs.jboss.org/drools/release/6.3.0....
Zerdin.Joe's user avatar
1 vote
1 answer
4k views

Hibernate failed to lazily initialize a collection of role no session in entity service even with @Transactional

I have a hibernate project that connects to two data sources and has a base dao. I use the base dao to derive generic daos for the data sources as well. I have a service that fetches a join ...
Sakib's user avatar
  • 1,533
1 vote
0 answers
782 views

Spring boot 2 database with jpaRepositories

I create one app with use 2 databases, but in my test I need to create this class: @Repository public class UsuarioRegistroRep { @PersistenceContext(unitName = "dbregistro") EntityManager em; ...
Fabio Ebner's user avatar
  • 2,683
1 vote
0 answers
736 views

Spring: Dynamically instantiate a bean from a factory

Is it possible to dynamically instantiate a bean in Spring using a factory? I'd like to be able to instantiate some beans when a particular annotation is detected. E.g. @Retention ( RetentionPolicy....
Andy N's user avatar
  • 1,266
1 vote
1 answer
649 views

How to initialize objects inside constructor of a class using spring framework?

I have following code in java: public class A{ private B b; private C c; public A(){ b=new B(); c=new C(); c.foo(d,e); } } I want to change the constructor such that i dont ...
Utkarsh Gupta's user avatar
1 vote
0 answers
180 views

How to map nested form values to an HashMap in SpringMVC

Budding Java/Spring developer coming from Python/Ruby background trying to understand how things are done on the other side of the fence. :) I've made an HTML page which looks like this: <input ...
gaqzi's user avatar
  • 3,787
1 vote
0 answers
3k views

Implementation of One-to-Many Relationships with Document References using mongodb and spring data

I want to use spring data with mongodb and want to implement a one to many relationship using document reference. db should look like this: { _id = 123451232 "countryName":"India", "...
dhyanandra singh's user avatar
1 vote
0 answers
833 views

How to add my own custom filter in SpringSecurityFilterChain to check captcha in spring java config?

I have e CaptchaFilter class that checks the value of captcha when user logins. in xml configuration of spring, i configured it as seen below: <filter> <filter-name>...
Rasool Ghafari's user avatar
1 vote
0 answers
882 views

How to cache-control multiple resource locations in Spring MVC 4

We are using the WebContentInterceptor to prevent caching on dynamic resources but have not been able to add caching headers to static resources in multiple locations. The main issue is static ...
MXXIIIO's user avatar
  • 11
1 vote
1 answer
283 views

Class.getAnnotations() does not return full list of Class level Annotations when @PreAuthorize or @PostAuthorize is used inside it on method level

Lets say I have a below class with Annotations - @Component @Path("/somepath/") @Api(value = "/somepath", description = "Operations") public class SomeResourceClass { @POST @Consumes(...
Dhiraj's user avatar
  • 113
1 vote
0 answers
645 views

BeanCreationException for Session scoped bean in @async method

I am stuck into a problem of accessing a session scoped bean in async method. My Bean definition: <bean name="ABC" class="java.util.HashMap" scope="session"> <aop:scoped-proxy /> </...
himanshu tageja's user avatar
1 vote
0 answers
152 views

Is there a way to conditionally include attributes in custom JSP tag?

Lets say I have a field that can take 3 attributes <myTag a="something" b="something" c="something" /> Let's say I want to only include those a,b,c attributes when a variables are not blank. ...
Luke's user avatar
  • 1,258
1 vote
0 answers
348 views

How Spring MVC model-controller binding works

Why in the example without any annotations the POST handler recieves the populated instance of the form? How Spring MVC figures it out to make the binding between the model attribute and the ...
kidwon's user avatar
  • 4,498
1 vote
0 answers
2k views

Spring OAuth2 Client Redirect to Auth Server doesn't work

When I try to access my own OAuth2 secured REST API using an authorization code, I don't get redirected to the API and get this error: org.springframework.security.oauth2.client.resource....
Philipp D.'s user avatar
1 vote
0 answers
311 views

spring boot error 4070 Cannot add or update a child row

i spent alot of trying to crack this for a very long time but to no avail.i have a database,and i want to get some data from a certain table user_test_summary and insert this data into another table ...
Okeme Christian's user avatar
1 vote
0 answers
514 views

Handling Spring MVC Controller method with @PathVariable at root (like /{domain})

I am trying to implement an application which queries data based on a @PathVariable. Slight complexity is that the path variable is at the root. I mean it's like mydomain.com/{myVar}. When I try to ...
Vsoma's user avatar
  • 605
1 vote
0 answers
77 views

Look up method with own implementation instead of spring's proxy class

When a singleton bean has reference of prototype bean, we use look up method in spring to inject new instance every time. As per Spring documentation, spring will create a proxy by generating sub ...
javafan's user avatar
  • 1,545
1 vote
1 answer
3k views

Prepared Statement with Hibernate Session and Spring MVC

I have got a method with prepared statement that works with Connection class. How to make that i could work with Hibernate sessions? @SuppressWarnings("unchecked") @Override public List&...
Serg Shapoval's user avatar
1 vote
1 answer
1k views

JUnit + Spring profiles: could not load JDBC driver class

How fix next exception? Can not see any problems in configuration. It worked well, but after some refactoring failed. Exception java.lang.IllegalStateException: Failed to load ApplicationContext ...
user avatar
1 vote
0 answers
627 views

java.util.zip.ZipException: error in opening zip file for spring-webmvc-3.0.7.RELEASE.jar

When analyzing the build logs of a Jenkins build for WSO2 Application Server 5.3.1-SNAPSHOT, I came across the following exception which had occurred when deploying spring3-restful-jndi-service.war. ...
Chiranga Alwis's user avatar
1 vote
0 answers
493 views

How to send an object with file in spring rest template

I am using Spring Boot and wrote service and controller. So, my controller looks like @RequestMapping(value = "/addSentiment", method = RequestMethod.POST, consumes = "multipart/form-data") public @...
abi_pat's user avatar
  • 582
1 vote
0 answers
1k views

Spring Interceptor: how to populate model in preHandle method?

So basically question listed in title. Is there a way to populate org.springframework.ui.Model in preHandle method ? public class SomeInterceptor extends HandlerInterceptorAdapter { @Override ...
marknorkin's user avatar
  • 4,044
1 vote
0 answers
1k views

Spring applies a custom bean naming strategy when?

auto wiring is disabled and bean name is not provided dependency checking is enabled and dependency exists for a bean in different context using specific annotations that do not contain name value ...
user116238's user avatar
1 vote
0 answers
862 views

Spring LDAP Connection Pooling Not Working

I have an AXIS2 web service that uses Spring LDAP to accesses multiple directories. It is running on Weblogic 10.3.6. I am trying to use Spring Connection pooling to manage the ldap connections per ...
user2216182's user avatar
1 vote
0 answers
110 views

enable SSL on mongodb on windows

I search in the internet but unfortunately there is not a good document that help to emable SSL on mongodb on Windows. I have Spring Restful server that CRUD with mongodb. is there any example guide ...
alien's user avatar
  • 11
1 vote
1 answer
457 views

Configure App. context to use QualifierAnnotationAutowireCandidateResolver using annotations

The problem started when in Spring 4.2.5 I attempted to inject an interface having more than one implementations, below is the test class : @RunWith(SpringJUnit4ClassRunner.class) @...
Kaliyug Antagonist's user avatar
1 vote
3 answers
145 views

OAuth2 client UI confusion

So, I think I'm getting lost in the mass of approaches given I'm new to all of this but, I have a standalone Auth Server using basic auth for user credentials input. I then have a very simple client ...
martin samm's user avatar
1 vote
1 answer
539 views

Spring MVC File Upload - The request sent by the client was syntactically incorrect

I'm getting (The request sent by the client was syntactically incorrect) error, when I try to access the following method. @RequestMapping ( value = "/prospect/prospectupdated", method = ...
karthi's user avatar
  • 559
1 vote
1 answer
637 views

Spring, Hibernate : Retrieve Objects based upon date, if not found, nearest date

I am working on a Spring-MVC project in which I am working on creating a backup of GroupNote object every night. Before creating a backup, I am checking if boolean flag indicating that the object was ...
We are Borg's user avatar
  • 5,223

1
476 477
478
479 480
1618