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
3 answers

How to use the ApplicationContext to set MidParent value using C#

I need to create a method that will open up a Mid form under some conditions. When opening the Mid form, I have to assign the MidParent value to the parent of the application. I am trying to use the ApplicationContext class to figure out the current…
Jaylen
  • 39,043
  • 40
  • 128
  • 221
0
votes
1 answer

Spring Context Reference java

I know that in java, objects are eligible to be deleted by Garbage Collector if no reference refers to them. So my question is : how spring can make spring bean available all time? I think there is some object which refers all beans. But these…
0
votes
1 answer

Annotation based Spring Activiti ProcessEngine

I am quite new to Spring and Activiti. I'm developing annotation based Spring web application with embedded Activiti engine. I have some services implemented, SubscriptionService is one of them. In one process I call that service as bean…
AdiC
  • 38
  • 6
0
votes
0 answers

how call a declared constructor using ApplicationContextAware and pass HttpServletRequest and HttpServletResponse

I am using ApplicationContextAware to get a bean from a legacy code. I need to pass two parameters to the constructor. When I use WebApplicationContextUtils it is easy but I didn't find how to do the same using ApplicationContextAware. Basically, I…
Jim C
  • 3,957
  • 25
  • 85
  • 162
0
votes
1 answer

Casting a String property to int in Spring config file

I have a properties file test.properties HOST = http://localhost PORT = 1234 In my config file I am passing the values from the properties file to a bean constructor-arg.
0
votes
1 answer

Spring: Can't load the application context. NoSuchBeanDefinitionException

i hope anybody might had a solution for this. I implemented a simple test to check if the application context starts correctly, but all i get is an NoSuchBeanDefinition Exception. So i had a closer look to the ctx-*.xml files. Sadly i had found…
Dirk Rother
  • 440
  • 1
  • 4
  • 18
0
votes
0 answers

define EntityManageFactory and Transactional beans in separate contex

I have a context by name dao-context.xml as following:
Sam
  • 6,770
  • 7
  • 50
  • 91
0
votes
1 answer

Trouble accessing database from class for turn based multiplayer

I am using google's turn based multiplayer api. In the turn data class I am trying to access my sqlite database in order to put the information that needs to be passed to the next player in a byte array. Here is the turn data class: public class…
sboehnke
  • 287
  • 1
  • 3
  • 13
0
votes
1 answer

Bean is not properly generated from the application context retrieved from context aware

Below is my Pojo: public class Triangle implements ApplicationContextAware, BeanNameAware{ private Point pointA; private Point pointB; private Point pointC; My springs.xml's structure goes here:
Betta
  • 416
  • 5
  • 17
0
votes
1 answer

Spring 2 to 4: beans missing from web-app context

I'm upgrading Spring version from 2.x to 4.x for a legacy application that runs as a FileSystem Xml Application context and initiates an embedded jetty server with WebApplicon context using beans from parent context. In Spring 2 this is achieved via…
0
votes
3 answers

New in Spring: Load Application Context

I am new with Spring. So far in my application, every time I need to use a bean I load the XML. ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); So, in every class where I need to load a…
0
votes
1 answer

How to create a bean collection into an XML Java confifuration in Spring?

I am studying for the Spring Core certification and I have the following doubt related to the definition of a beans collection into an XML configuration. For example I have this XML configuration snippet:
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
0
votes
1 answer

How it works together these 2 Spring Java configuration classes?

I am studying for the Spring Core certification and I have the followind doubt with an exercice related to the beans configuration using the Java configuration way. So I have the following RewardsConfig class that configure my beans (this class is…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
0
votes
1 answer

ApplicationContext loads when JUnit test run from eclipse, but not from ant build

Seems weird to me. JUnit test runs fine from eclipse. But when I run from Ant command line, it shows error. Looks like its not loading / application context. Here is the base class of test class. @ContextConfiguration(locations = {…
Kevin Rave
  • 13,876
  • 35
  • 109
  • 173
0
votes
1 answer

ClassPathXmlApplicationContext created from several config files overrides beans with the same types and different ids

I have multiple spring config xml files which are being used to create one global context like this: