Questions tagged [spring-bean]

A simple JavaBean managed by the Spring IoC container.

A simple JavaBean managed by the Spring IoC container. These beans are created with the configuration metadata that is supplied to the container, for example, in the form of XML <bean/> definitions or @Bean annotation. Actually, the BeanFactory is the main IoC container which instantiates, configures, and manages these beans. These beans typically have associations with each other, and therefore have dependencies between themselves. These dependencies are configured in the configuration files used by the BeanFactory. Other dependencies that are invisible from the configuration file could be a function of programmatic interactions between beans at run-time.

767 questions
0
votes
1 answer

Spring-Boot create bean with out name will cause "NoSuchBeanDefinitionException, No qualifying bean of type[]found for dependency "

I Create the bean by configuration with out name @Configuration @ConfigurationProperties(prefix = "mysql") public class DbConfiguration extends BaseDbConfiguration { @Bean//(name = "fix") @Override public DbClient createClient() { …
Lillard
  • 1
  • 2
0
votes
1 answer

is it possible to create Bean Singleton by name or its value?

I want to create single instance of Preference By Unique Name(Bean Name). So myBeanName1 will be one instance across the spring context. And another myBeanName2 across the spring context. Is it possible to do like that ?I am bit confused with this…
Viraj
  • 1,360
  • 3
  • 18
  • 38
0
votes
2 answers

How to use a custom xml file to load variables to my spring.xml using PropertyPlaceholderConfigurer?

I´m trying to use a custom xml as my properties file so I can define some variables on the spring.xml file. I searched for similar question, but the xml file had to follow a standard to be use. Normally I would load the .properties files like…
0
votes
1 answer

Getting BeanCreationException on server startup. I am using 3.0.5 version of spring with 3.0.1 version of apache tiles

I am using 3.0.5 version of spring with 3.0.1 version of apache tiles and while server startup I am getting BeanCreationException. The error stack trace is given below. dispatcher-servlet.xml
0
votes
1 answer

Injecting bean in spring using autowired

My interface public interface IProcessContextFactory { public IProcessContext createContext(T data); } @Component("PricingProcessContextFactory") public class PricingProcessContextFactory implements…
Saurabh Kumar
  • 16,353
  • 49
  • 133
  • 212
0
votes
2 answers

autowire DataSource to a class which extends JdbcDaoSupport

I'm developing java,spring web application. I had some problems with adding DataSource to the DAO implement class which extends JdbcDaoSupport. I searched through the internet and found similar solution. DaoImpliment Class @Repository public class…
Guest
  • 53
  • 2
  • 15
0
votes
1 answer

Spring bean interface declaring

I have a work class : public class WorkClass implements ApplicationContextAware { ... // has access to ApplicationContext } Have some useful interface : public interface UsefulInterface { void doUseful(); } Have some impl class that can do…
user2602807
  • 1,232
  • 2
  • 15
  • 28
0
votes
1 answer

How to search and auto-register all beans under a specific package

I have x number of beans under some base-package say com.mypackage.basepackage. What I am trying to do is to auto-scan this package and register all the beans to ApplicationContext with BeanDefinitionRegistryPostProcessor. Here is how I am trying to…
Sajjad
  • 853
  • 2
  • 15
  • 32
0
votes
2 answers

Keeping a reference to a bean inside @Configuration

Can I keep a reference to an exposed bean inside the @Configuration class so that I can later on execute operations on that same bean? For example: @Configuration class MyBeanConfiguration extends DisposableBean { private MyBean myBean; //…
Roy Stark
  • 463
  • 2
  • 15
0
votes
2 answers

How to create a bean in spring that is available to all users in my app?

I'm building an online chat application in spring just like the one on Facebook. I want to create a bean with a property[Array] called active-users. Then performs the following: Whenever a user logs in, I'll add his/her userId into the array. When…
Ajay Ullal
  • 378
  • 2
  • 10
0
votes
1 answer

Spring BeanPostProcessor not get called its implemented bean , but invoke for all other beans

my bean.xml hi friends.., i am just learning spring . i implement the interface BeanPostProcessor in HelloWorld.java . its methods invoked for all other beans , but not itself(Helloworld.java bean)
P.JAYASRI
  • 358
  • 2
  • 18
0
votes
1 answer

Spring MVC: Set property value based on input

I have a login page where I have to select which database it should connect I have my configuration like this:
SK.
  • 1,390
  • 2
  • 28
  • 59
0
votes
1 answer

How to send property to the class inside dwrController?

I'm using spring mvc and dwr, I already made some tests and my configuration works, but now that I'm trying to access the database from the script I get a NullPointerException on this line: List citas = citasManager.select(); Obviously that…
Artemio Ramirez
  • 1,116
  • 1
  • 10
  • 23
0
votes
2 answers

How to access the logged-in Principal from a session scoped spring bean

I want to access the logged-in user from a session-scoped spring bean, is that possible? I'm not using spring security, but openam instead to provide security to my web application, so I can't use this (as I've seen in many examples on the…
Henrique Ordine
  • 3,337
  • 4
  • 44
  • 70
0
votes
1 answer

Spring XML - ignore $ in url which is writen in xml , without using propeties file

I have a spring bean which contain list of strings. Every string represent a url which in runtime is resolved using ognal For example: www.google.co.il/?name%3d${name}&lastname%3d${lastname} Which is resolved in run time . How can I ignore…
yoav.str
  • 1,547
  • 6
  • 33
  • 73