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

Loading a jar's context.xml from classpath

I'm trying to load an application context which is inside a jar as a plugin. I use this to load the context: ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath*:**my-context.xml"); When I load the jar through…
Nereis
  • 486
  • 1
  • 4
  • 21
0
votes
2 answers

Spring cross context file bean auto wire

I am currently using spring web mvc framework. And I have my web.xml/servlet-context.xml/each layer xml files in following structure: web.xml -> servlet-context.xml ---imports-->service-applicationContext.xml …
Tim Raynor
  • 733
  • 2
  • 12
  • 28
0
votes
0 answers

Spring 3 - Context Initialization Error BeanCurrentlyInCreationException

We are currently using Spring 3.2.8-RELEASE, heavily relying on @Autowired annotations in our code. Whilst starting the application we are getting the following error: Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException:…
Kros
  • 848
  • 1
  • 10
  • 24
0
votes
0 answers

JUnit Test on WebApp

I'm trying to test a webapp using Junit. The class I want to test CalculMoisUtils load a bean from applicationcontext ( spring) using this code: Properties prop = new Properties(); InputStream input = null; ApplicationContext ctx =…
0
votes
0 answers

servletContext Null Pointer Exception

I'm trying to run a liferay project on an application server, but I have to run this part of code String tablesSQL = HttpUtil.URLtoString(servletContext.getResource("/WEB-INF/sql/tables.sql")); The problem is that the servletContext is still null…
user3429578
  • 1,093
  • 3
  • 12
  • 21
0
votes
0 answers

ContextConfiguration stuck running tests

Output ------------------------------------------------------- T E S T S ------------------------------------------------------- Running xxxxxxxxxxxxxx.aus.alerts.CriticalAlertMngTest [06/25/14 10:21:33:395](main) WARN - pertyPlaceholderConfigurer…
Veniamin
  • 466
  • 6
  • 18
0
votes
0 answers

Cannot use placeholder in static factory method creating a SpringLiquibase bean

Spring 3.1.0 with Liquibase 2.0.5 running on Glassfish 2.1.1 - From a long gone colleague I have inherited this applicationContext.xml which constructs a SpringLiquibase bean this way:
Marco Faustinelli
  • 3,734
  • 5
  • 30
  • 49
0
votes
1 answer

ApplicationContextAware used in spring does not create a new instance of the beans

All I know is that ApplicationContextAware is used to get a new instance of the bean everytime I do getBean. I created a class Triangle which is singleton, and its class members variables as "prototype" Now I wanted to get new instances of the class…
0
votes
0 answers

Spring applicationContext not loading in a POJO

My applicationContext is placed at path:src\main\webapp\WEB-INF\conf\applicationContext.xml When I build this web application.I can see that conf folder is placed at {projectname.war}\WEB-INF\conf\applicationContext.xml.And Application works…
Rips
  • 1,964
  • 1
  • 23
  • 45
0
votes
2 answers

What is difference between object stored in Application Context and static global Object?

I am using apache-tomcat-7.0.35 as web server for my java web application. I am confused what is difference between two methods of storing object as given below. 1.store object in ApplicationContext 2.declare private static final obj = new…
Vishal Zanzrukia
  • 4,902
  • 4
  • 38
  • 82
0
votes
2 answers

Intilaizing a bean with constructor args - WebApplicationContext vs ClassPathApplicationContext

A bean defiend on the applicationContext.xml is getting instantiated using both ClassPathXmlApllicationContext and WebApplicationContext. While using the former the bean is returned as expected but while using the latter, WebApplicationContext, I'm…
Bharath ABK
  • 324
  • 3
  • 4
  • 16
0
votes
2 answers

How to move data from Session's attributes to application context in a spring web application?

There is a web application that I am working on currently and it has to be extended to expose web services. In the current project - when the application context is loaded at startup - database queries are made and static data like role names is set…
user811433
  • 3,999
  • 13
  • 53
  • 76
0
votes
1 answer

Configure programmatically Apache Camel camel-config.xml?

I'm working on Apache Camel to build proxies. I am able to run the sample provided. But in that I have to configure camel-config.xml file manually. I want to know that whether we can configure this file programmatically to host/confgure proxies in…
NGoyal
  • 190
  • 2
  • 18
0
votes
1 answer

ClassPathXmlApplicationContext from a Runtime.getRuntime.exec

I developp a web app in eclipse with spring to handle dependency injection & maven to deploy. I'm trying to make work this little code : public class MainExternal { public static void main( String[] args ) throws Exception{ …
ZheFrench
  • 1,164
  • 3
  • 22
  • 46
0
votes
1 answer

Spring not able to load class from ApplicationContext xml file

I am getting class not found exception when trying to create new instance of ApplicationContext below. Is there anything I'm missing? package com.john; import org.springframework.context.ApplicationContext; import…
Learner
  • 980
  • 7
  • 20
  • 37