autowired Questions
6
Solved
In my Spring Boot application, suppose I have interface in Java:
public interface MyFilter<E extends SomeDataInterface>
(a good example is Spring's public interface ApplicationListener<...
Slang asked 27/10, 2016 at 13:37
2
Solved
I'm currently trying to configure Spring Boot (using Java Annotations and ComponentScan) for the following scenario:
Scenario
There's an interface MyService.
I want to provide a default implemen...
Fealty asked 1/1, 2015 at 23:40
5
Solved
When launching with mvn spring-boot:run or even with gradle returns that issue.
***************************
APPLICATION FAILED TO START
***************************
Description:
Field userDetails...
Phenacite asked 19/9, 2017 at 10:15
4
Solved
Why does Spring automatically choose the superclass types during autowiring?
For instance, if I have
@Component
public class Foo {}
@Component
public class Bar extends Foo {}
and someone autow...
Witch asked 22/5, 2013 at 4:20
17
Solved
i am using spring 3, and i have two beans of view scope:
1- Bean1:
@Component("bean1")
@Scope("view")
public class Bean1 {
@Autowired
private Bean2 bean2;
}
2- Bean2:
@Component("bean2")
@Sc...
Attar asked 4/4, 2012 at 9:48
12
Solved
I am going through some blogs on SpringSource and in one of the blogs, the author is using @Inject and I suppose he can also use @Autowired.
Here is the piece of code:
@Inject private CustomerOrder...
Sanskrit asked 22/8, 2011 at 2:30
3
Solved
I'm attempting to update an old Spring application. Specifically, I'm trying to pull all of the beans out of the old xml-defined form and pull them into a @SpringBootApplication format (while drama...
Ruthie asked 26/4, 2018 at 16:4
4
Solved
Why is Spring @Value Annotation not working in the constructor?
I have this Email class that is reading some email related configuration.
In the constructor, if I put a break-point the values are ...
Vinny asked 7/5, 2019 at 21:8
52
Solved
I have created a simple unit test but IntelliJ is incorrectly highlighting it red. marking it as an error
No beans?
As you can see below it passes the test? So it must be Autowired?
Raseda asked 12/11, 2014 at 15:0
5
Solved
I have an Exception somewhere in my service/ folder, and Symfony is trying to autowire it :
Cannot autowire service
"App\Service\Order\Exception\StripeRequiresActionException": argument
"$secr...
4
Solved
When I run TaskJob I am getting null pointer exception because Spring doesn't autowiring serviceJob service. Is new thread causing this problem because Spring autowired mysqlService without any pro...
3
Solved
I am struggling to get a specific service via class name from group of injected tagged services.
Here is an example:
I tag all the services that implement DriverInterface as app.driver and bind it...
Donovan asked 1/3, 2019 at 14:28
2
In my Spring Boot application, I use com.github.spotbugs:spotbugs-maven-plugin plugin. The spotbugs check reports no issues on following class:
@Service
public class FooService {
@Autowired
CocoC...
Phoenicia asked 26/5, 2022 at 15:55
10
Solved
I'm using Spring 3.1.4.RELEASE and Mockito 1.9.5. In my Spring class I have:
@Value("#{myProps['default.url']}")
private String defaultUrl;
@Value("#{myProps['default.password']}")
private String...
Fotina asked 18/4, 2014 at 21:36
5
Solved
I am configuring Websockets in Spring basically by following the guide provided in the documentation.
I am currently trying to send a message from the server to the client as explained in the sect...
Hereditary asked 8/4, 2014 at 1:21
15
Solved
I'm creating a very simple application with a few REST API's and it's currently working correctly until I try to use the BuildProperties on my health check API. While starting my application I get ...
Glove asked 17/6, 2019 at 15:6
8
Solved
I have some problems wth autowire annotation. My app looks like this:
Here is controller:
@Controller
public class MyController {
@Autowired
@Qualifier("someService")
private SomeService someS...
Rosco asked 26/11, 2010 at 18:48
8
In a spring project, I'd like to create a LocalDate from an @Autowired constructor parameter whose value is in a .properties file. Two things I'd like to do:
1. If the property file contains the pr...
Finch asked 2/2, 2018 at 3:48
2
Solved
I have a spring-boot application.
I have no ApplicationContext.xml or web.xml files in my project. I prefer to avoid them and have everything configured in Java code.
I have read the following th...
Mainis asked 20/8, 2015 at 19:59
23
Solved
I've started my project by creating entities, services and JUnit tests for services using Spring and Hibernate. All of this works great.
Then I've added spring-mvc to make this web application usin...
Brunobruns asked 2/12, 2013 at 16:33
2
Solved
My autowiring is not working for a basic file entity listener.
I have a File entity class which uses annotations to specify the listener, like:
/**
@Orm\Entity(repositoryClass="root\CoreBundle\R...
Takamatsu asked 17/11, 2017 at 1:24
16
I understand that @Component annotation was introduced in Spring 2.5 to get rid of XML bean definition by using classpath scanning.
@Bean was introduced in spring 3.0 and can be used with @Configur...
Isauraisbel asked 15/5, 2012 at 15:45
10
Solved
So since I've been using Spring, if I were to write a service that had dependencies I would do the following:
@Component
public class SomeService {
@Autowired private SomeOtherService someOtherSe...
Demott asked 15/11, 2016 at 21:29
5
Solved
This is an Spring MVC project with Hibernate.
I'm, trying to make a Logger class that, is responsible for inputting logs into database.
Other classes just call proper methods with some attributes a...
Aristides asked 9/7, 2012 at 9:51
4
Solved
I have this hierarchy in my project:
▼ server
▼ myproject
▼ src
▼ main
▼ java
▼ rest
▼ repository
Ⓘ MyRepository
▶ resources
▼ test
▼ java
▼ rest
Ⓒ MyRepositoryTest
This is the MyRepos...
Endue asked 15/2, 2022 at 9:11
1 Next >
© 2022 - 2025 — McMap. All rights reserved.