Questions tagged [applicationcontext]

The Spring `ApplicationContext` class

The Spring ApplicationContext class is the central interface to provide configuration to any Spring application.

869 questions
0
votes
1 answer

Startup the Spring application by @Configuration

I found this piece of code in my codebase. Actually the class: package my.services.config; @Configuration @ImportResource("classpath:spring/*.xml") @ComponentScan("my.services.jms.server") public class MyServicesConfiguration { @Bean public…
ses
  • 13,174
  • 31
  • 123
  • 226
0
votes
1 answer

Android Unit Test, context is passed between activities in tests

I want to run a number of unit tests on a clean instance of my application and thought I could do that by creating an instance with getActivity and finish it at the end of the test. However, I noticed that the actions in the previous test had effect…
Lorenz
  • 165
  • 1
  • 1
  • 10
0
votes
1 answer

how to define the argument in the factory-bean's factory-method

i have a bean that has a constructor-arg of type A, which is created by a factory class B, B has a factory-method as 'getInstance(String name)', depends on the input name Class B return an instance of A, in the applicationContext.xml file i don't…
user468587
  • 4,799
  • 24
  • 67
  • 124
0
votes
2 answers

Android SMS listener wrong application context

I am working with a SMS listener, code below: public class SMSReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { EventEntry entry =…
Jin
  • 6,055
  • 2
  • 39
  • 72
0
votes
3 answers

Unable to Import persistence.xml within applicationContext.xml file

I'm using eclipse juno IDE I have Java application which have src folder. within the folder I have: 1) applicationContext.xml 2) persistence.xml I also have DBInterface and i implemented it with JPA. Now in the applicationContext.xml file I have a…
eliorsh
  • 195
  • 1
  • 5
  • 20
0
votes
1 answer

Alternative for ApplicationContext aware

I am in a situation where i have a class (badly designed) with only static methods and Im adding a new field within it which will be initialized to a bean managed by spring. This field will be used by one of the static methods. I found that I can…
maverik
  • 3,409
  • 3
  • 16
  • 7
0
votes
1 answer

NullPointerException with @Autowired in Spring

I try to use Spring framework with @Autowired annotation to get a Service class. Here my class (this class is called by a WebSocketServlet) which need to use the Service (I get NullPointerException on call of it): public class…
Chris
  • 33
  • 2
  • 8
0
votes
1 answer

Spring Context Configuration

I have created a spring MVC application. I'm working on spring security concepts. So I've created a context configuration file name webbsite-security.xml and I've given the same file location in the context configuration path. The application fails…
vvekselva
  • 803
  • 3
  • 17
  • 34
0
votes
2 answers

Spring Framework - root-context.xml FileNotFoundException?

I am using SpringSource suit 2.9.2 and a newbie in Spring MVC world. I am trying to get an hold over object of Application Context using the following code: - ApplicationContext context = new…
Varundroid
  • 9,135
  • 14
  • 63
  • 93
0
votes
2 answers

Sharing Spring Security Configuration Between Applications

I'm brand spanking new at Spring and have gotten a majority of the knowledge I do have from the Spring Recipes book from Apress. I've got LDAP authentication working with Spring Security within one webapp. I would like to rip out my application…
Buns of Aluminum
  • 2,439
  • 3
  • 26
  • 44
0
votes
1 answer

Where are OnClosing Events typically raised from?

I am created a class inherited from ApplicationContext in .NET and I'm wondering where is best to raise my OnClosing event. Now, ApplicationContext has a "ThreadExit" event, but this fires after both ExitThread and ExitThreadCore have run. Is this…
user912447
  • 696
  • 1
  • 11
  • 31
0
votes
1 answer

JRuby PermGen out of space even use java objects in ruby code

Description: If we use java objects jruby get permgen too: System.out.println("Initialazing.."); //Spring applicaton context WebApplicationContext wac = (WebApplicationContext) AppContext.getApplicationContext(); // prepare path to internal ruby…
Veniamin
  • 466
  • 6
  • 18
0
votes
0 answers

Define multiple webAppConfig (Jetty)

Introduction I'm working with a Spring-based webapp at the moment, in which we have two different implementations for the DAO beans: A real DB access implementation (based on JDBC to retrieve data from DB). A testing implementation (in which each…
0
votes
1 answer

Load different jndi.properties file in spring application context depending on profile

I have a jms connection settings that is defined in jndi.properties file on my classpath which I used to connect to ActiveMQ in my local development environment. I would like to rename this file to "activemq.jndi.properties" as I am planning to have…
0
votes
1 answer

Practise to Load Spring Beans

Folks, What's the recommended practise to load spring beans from ApplicationContext ? Do we write ServletContextListener to load this when server starts up takes And save bean info in the context? Or write some static method to do:…
Mujahed
  • 186
  • 1
  • 7