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

new bean for every wicket session

I was creating my first application using Apache wicket and am stuck on a problem. After the user logs in through the authentication method I have a new session which is created for that user. Now if I wanted to have data stored for just that user…
auahmed
  • 151
  • 1
  • 3
  • 16
0
votes
2 answers

BeanCreationException - Worked before, not anymore

I have a project which is working locally, but when I try to deploy it to a tomcat 7 server, it gets the following exception: ERROR: [Feb-05 16:39:30,240] web.context.ContextLoader - Context initialization…
benskiiii
  • 439
  • 3
  • 11
  • 23
0
votes
1 answer

Spring Bean error

I have the following Spring Bean defined:
smeeb
  • 27,777
  • 57
  • 250
  • 447
0
votes
2 answers

Spring OAuth2 implementation with InMemoryTokenStore bean creation issue

I try to implement Oauth2 into my project using this blog I am newbie on Spring framework, so occured an exception such as ClassNotFoundException, altough all comliant classes exist under right package though. Source (maven project) can be seen on…
webyildirim
  • 587
  • 3
  • 12
  • 32
0
votes
0 answers

Why must everything be a Spring @Bean?

I don't think this is a spring-amqp-specific question, but it provides a relatively tidy example to motivate my question. Consider this @Configuration, from the spring-rabbit Hello World project: @Configuration public class HelloWorldConfiguration…
Andres Jaan Tack
  • 22,566
  • 11
  • 59
  • 78
0
votes
1 answer

How to change a class's metaClass per test

I'm using the ExpandoMetaClass to make a service always return success in an integration test but I would like to have one test that actually fails. Example use of ExpandoMetaClass: static { ExpandoMetaClass someService = new…
0
votes
1 answer

Struts is not able to refer the action bean with its bean id generated by spring for dependency injection

I'm trying to integrate Spring with struts as my controller. Spring does initializes the beans as per the configuration in applicationContext.xml but when I refer the bean id as action class in struts.xml its not able to detect. Here is my…
0
votes
2 answers

Java Spring IOC bean creation value

I need a bean like this This is OK. My problem is I…
chiperortiz
  • 4,751
  • 9
  • 45
  • 79
0
votes
1 answer

Declare beans with identical properties

Is that possible to define at Spring XML context few beans with the same property set? Example
Michael Z
  • 3,883
  • 10
  • 43
  • 57
0
votes
1 answer

Spring not initializing session bean with requestcontextlistener

I am trying to decouple my webapp from enunciate and I have a web.xml as follows but when Spring 3 bootstraps I get: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could…
bugg
  • 61
  • 6
0
votes
2 answers

How to autowire a generic bean in spring

How to autowire a generic bean in spring? I have a dao implement as follows: @Transactional public class GenericDaoImpl implements IGenericDao { private Class entityClass; @Autowired private SessionFactory sessionFactory; …
NingLee
  • 1,477
  • 2
  • 17
  • 26
0
votes
0 answers

multi-module bean injection failure

I have 2 maven modules, API and Impl. Impl is DI based and has the following code
Raghuveer
  • 2,859
  • 7
  • 34
  • 66
0
votes
1 answer

Java modules calling Spring context throws BeanFactory not initialized or already closed - call 'refresh' before accessing beans

All though I see lots of questions, some answers are not relevant to my setup. I have a total of 3 modules API, Impl and consumer. Consumer has dependency of API and Impl. Consumer has web.xml, which looks like Archetype…
Raghuveer
  • 2,859
  • 7
  • 34
  • 66
0
votes
1 answer

Spring injection issue with constructor-arg overload

I would like to ask about the Spring Constructor Injection. So in the class, I have two constructors with different number of arguments. public class MyClassHello() { public MyClassHello(String A) { // do sth } public…
0
votes
1 answer

@Named annotation can't load a bean in a Servlet - javax.naming.NameNotFoundException: Name student is not bound in this Context

I originally used @Component for a bean(Student.java) that is being called in a Servlet. I changed @Component to @Named. I used to use following code to get the student bean in the Servlet. Student student =…
user3123690
  • 1,053
  • 5
  • 17
  • 27