ApplicationContext 1 « Core « Spring Q&A





1. Using Multiple ApplicationContexts in Spring - question about cleaning up resources    stackoverflow.com

If I have a main appCtx and then I have a series of separate appCtxs which refer to the main one as the parent, then can I destory the child contexts ...

2. Spring: JUnit-Test: applicationContext is not loaded    stackoverflow.com

I've got the following Test-class, but it doesn't matter what I set as "ContextConfiguration-locations" - it never set my UserService. And it doesn't throw any error when I set a non-existing ...

3. Spring applicationcontext loading hooks    stackoverflow.com

Are there any hooks into the Spring ApplicationContext loading process? I want to run a piece of code just before the application context loads (before any beans/properties/aspects/etc... are instantiated). thanks in advance

4. Proper ApplicationContext usage?    stackoverflow.com

I've recently started learning the Spring Framework, and I'm a bit unclear on how the ApplicationContext is supposed to be used - in both standalone and web applications. I understand that ...

5. ApplicationContext ctx = new FileSystemXmlApplicationContext error    stackoverflow.com

Hi I am completely new to Java, so sorry if my question may sound a bit stupid. I am following a tutorial on hibernate and i am trying to get the context ...

6. How to load a springframework ApplicationContext from Jython    stackoverflow.com

I have a class that loads a springframework application context like so:

package com.offlinesupport;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class OfflineScriptSupport {

    private static ApplicationContext appCtx;

    public static final ...

7. Calling A Method After all SpringBeans and ApplicationContext have been initialized    stackoverflow.com

I have a method in a complex java program that needs to be called immediately after the web ApplicationContext and SpringBeans have been initialized. I've tried toying around with <bean id="..." class="..." ...

8. how to read System environment variable in Spring applicationContext    stackoverflow.com

How to read the system environment variable in the application context? I want something like :

<util:properties id="dbProperties"
        location="classpath:config_DEV/db.properties" />
or
<util:properties id="dbProperties"
      ...

9. Java Project: Failed to load ApplicationContext    stackoverflow.com

I have a Java Project in which I am writing a simple JUNIT test case. I have copied the applicatinoContext.xml file into the root java source directory. I've tried ...





10. Why use Spring ApplicationContext hierarchies?    stackoverflow.com

I am trying to understand ApplicationContext hierarchies in spring. I learnt the following

  1. An ApplicationContext cannot have more than 1 parent ApplicationContext.
  2. When a given ApplicationContext cannot resolve a bean, it will pass on the resolution request ...

11. is It neccesary to call ApplicationContext.start    stackoverflow.com

I found without using start method, I can still create beans. What's the main purpose of ApplicationContext.start()?

12. Why is junit giving me a failed to load ApplicationContext error    stackoverflow.com

I am trying to run my first junit class in eclipse. When I right click on the new class and select run as junit it gives me a failed to ...

13. TestNG: Use ApplicationContext in multiple Test-Classes    stackoverflow.com

I've written some test-cases inside a single TestNG Test which extends AbstractTestNGSpringContextTests. The ApplicationContext is correctly setup and I can use it inside my test-cases. The problem is that the setting up ...

14. Spring junit test applicationcontext returns null    stackoverflow.com

i want to test my classes using springframework. I use it following way.

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("/META-INF/applicationContext.xml")
@TransactionConfiguration(transactionManager="txManager", defaultRollback=false)
public class AbstractDaoTest extends AbstractTransactionalJUnit4SpringContextTests {

@PersistenceContext
private EntityManager entityManager;

/**
 * Liefert die aktuelle SQL-Connection zurueck
 * 
 */
protected Connection ...

15. ApplicationContext confusion?    forum.springsource.org

ApplicationContext confusion? I am now building a web application with OpenSessionInViewFilter, the following is my web.xml : contextConfigLocation /WEB-INF/src/dataAccessContext.xml /WEB-INF/src/contentContext.xml /WEB-INF/src/scheduleContext.xml /WEB-INF/src/securityContext.xml Character Encoding ...

16. Event publishing: ApplicationContext or ApplicationEventPublisherAware    forum.springsource.org

Fairly new to Spring here.. My app has made heavy use of application events. I'm @Autowiring in my application context to the few classes that need to generate events. But now ...





17. Null ApplicationContext subclassing ApplicationObjectSupport    forum.springsource.org

I'm doing somthing wrong here : If I subclass ApplicationObjectSupport and then in the subclass to a getApplicationContext() call shouldnt I receive the ApplicationContext object ? Doing this I get a ...

18. 'Aggregating' an ApplicationContext    forum.springsource.org

Hi ! Is it possible to do the following or must each sub-context be explicitly added to the constructor arg list ? Code:

19. A questions on storing parameters in the applicationContext    forum.springsource.org

Could someone point me to assistance on being able to pass in fixed parameters into a method call? Basically, I want to prevent hard-coding in my code and instead pass in ...

20. creating new ApplicationContext    forum.springsource.org

creating new ApplicationContext I have a program that use spring and hibernate together. When I start my program in the debug mode and just create ApplicationContext, it uses more than 170 ...

21. Problem loading applicationContext via test    forum.springsource.org

Problem loading applicationContext via test I have a simple application context with no beans declared. When I try to run a test (using SpringJunit4ClassRunner) I recieve the following error: 12:58:26,265 INFO ...

22. TransactionProxyFactory and ApplicationContext    forum.springsource.org

TransactionProxyFactory and ApplicationContext Hi I have the following scenario I have a webapp in which the web.xml has an applicationcontext created using contextloaderservlet with a set of xml files defining the ...

23. help applicationContext config Spring 2    forum.springsource.org

help applicationContext config Spring 2 I have worked on previous version of Spring 1.1 where it is specified in application Context some entries like my.eg.xx.yy.handleThings=PROPAGATION_REQUIRES_NEW,-TempException,-AnotherException Moving on to Spring 2 I ...

24. Maintaining ApplicationContext in custom wrapper    forum.springsource.org

Maintaining ApplicationContext in custom wrapper Hi all. Using Spring across an API layer that is meant for use in both the Web and EJB layers. I have a collection of DAO's ...

25. ApplicationContext Hierarchical Sturcture    forum.springsource.org

Hi, I've been spending tens of hours on documentation right now. There is a rumor in the text that: ApplicationContext has an hierarchical context structure for different layers. Nothing is expressed ...

26. More than one ApplicationContext in one JVM instance?    forum.springsource.org

More than one ApplicationContext in one JVM instance? Hi, I have a web application which uses some libraries, in one of those libraries I have an static factory which I create ...

27. HierarchicalMessageSource and ApplicationContext hierarchy    forum.springsource.org

HierarchicalMessageSource and ApplicationContext hierarchy Hi, It seems that if you define a MessageSource hierarchy in an application context, that it itself part of a context hierarchy (e.g. servlet/webapp), the parent in ...

28. Refresh ApplicationContext    forum.springsource.org

I am working on a web application that needs to dynamically change the configuration without restarting the application. Is it safe to call ApplicationContext.refresh() while the application is still running? It ...

29. How to get a applicationcontext from stream    forum.springsource.org

hello,every one Suppose the spring config file is saved in a database using CLOB, and I can only get the file in the form of InputStream. The problem is how can ...

30. CLOSE ApplicationContext    forum.springsource.org

CLOSE ApplicationContext Hi I want write test that save files to STORAGE_FILE folder 1. Initialize ApplicationContext --> initialize StoreBean but before execute @PostConstruct public void init() that check Is folder empty; ...

31. Good strategies for managing both a deployment and test applicationContext?    forum.springsource.org

Good strategies for managing both a deployment and test applicationContext? I have an applicationContext for my app that specifies datasources and a JTA transaction manager. It will be deployed to WebLogic. ...

32. ApplicationContexts and Subsystems in Large App    forum.springsource.org

ApplicationContexts and Subsystems in Large App Not sure if question in right forum (maybe in Architecture?). Anyway, apologizing in advance if wrong. I'm making large app with several subsystem like client, ...

33. Why does JUnit 4 test runner spawn multiple ApplicationContext instances    forum.springsource.org

Why does JUnit 4 test runner spawn multiple ApplicationContext instances I have two JUnit 4 test classes - Test1 and Test2 - each annotated with: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations) ...where 'locations' define different ...

34. Accessing the ApplicationContext directly...    forum.springsource.org

Accessing the ApplicationContext directly... Hi All, I'm in the process of converting an existing app to use the Spring's DI features. I want to access the ApplicationContext the "bad" way while ...

35. How to init ApplicationContext to make test?    forum.springsource.org

How to init ApplicationContext to make test? My project can run smoothly. And now I want to make some test with it. My test code is like this: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ "/test/resources/spring-test.xml" ...

36. Retrieving applicationContext    forum.springsource.org

Hi I noticed that there is an 'XmlWebApplicationContext' instance stored as a servletContext attribute which has a key of 'interface org.springframework.web.context.WebApplicationCont ext.ROOT'. This object contains my beans which were defined in ...

37. Possible defect in ApplicationContext    forum.springsource.org

Version: 1.1.3 If you override the default EventMulticaster by specifing a bean with an id of "applicationEventMulticaster" in a parent context, but do not do the override in all child contexts, ...

38. applicationContext auto reloading    forum.springsource.org

39. ApplicationContext sharing problem    forum.springsource.org

ApplicationContext sharing problem Hi, I have a server application that is started with a 'Standard' application context: ApplicationContext ctx = new FileSystemXmlApplicationContext("cfg/server.xml"); In the Server I have services that are exposed ...

40. a question about applicationContext    forum.springsource.org

a question about applicationContext I am not good at English,so if you can understand my question,please give me a suggestion. I use hibernate implemented a special server (use socket receive and ...

41. Spring newbie q: best practice accessing ApplicationContext    forum.springsource.org

Spring newbie q: best practice accessing ApplicationContext I'm new to Spring and IoC so bear with me if this has been asked before. I would like to use Spring for a ...

42. Why isnt there a close method on ApplicationContext    forum.springsource.org

Hello there, Howdy. I'm wondering why only ConfigurableApplicationContext has close() method but not ApplicationContext interface. I'm writing some JMX MBeans to start and stop remote servers and I need to cast ...

43. Creating and using ApplicationContext    forum.springsource.org

Apr 28th, 2005, 04:53 PM #1 moacsjr View Profile View Forum Posts Private Message Junior Member Join Date Apr 2005 Location Belo Horizonte, MG - Brasil Posts 25 Creating and using ...

44. using ApplicationContext with Jbuilder    forum.springsource.org

Is there a problem using spring and JBuilder? When I'm using ant to build my project, it works correctly, but when I want to build the same project with Jbuilder i ...

45. Refresh ApplicationContext    forum.springsource.org

Refresh ApplicationContext How can I refresh the ApplicationContext? I'm using a beanRefFactory for EJBS. The applicationContext.xml is in the classpath. If I change some entries within the applicationContext.xml nothing is refreshed, ...

46. ApplicationContext "depends on" getDependencies()    forum.springsource.org

Hi, I'm building a java swing tree and i display the application context beans. I would like to display the "depends-on" beans as children of the node. Is there any method ...

47. Using ApplicationContext and ClassPathXmlApplicationContext    forum.springsource.org

Hello, I am trying to use ApplicationContext via the ClassPathXmlApplicationContext class. I don't think spring is finding any of my config files. Where should my config files be located? My directory ...

48. problems loading applicationcontext    forum.springsource.org

problems loading applicationcontext Hi, I have a problem when start my web application. It seem Tomcat 5.0.27 not load applicationcontext. The file web.xml is very simple: Code: example org.springframework.web.servlet.DispatcherServlet 2 ...

49. One ApplicationContext per Layer problem...    forum.springsource.org

One ApplicationContext per Layer problem... Hello, i try to define one ApplicationContext per Layer like this ! Code: NB: --> = depends, not extends Code: +-----------+ | RootLayer | +-----------+ ^ ...

50. Single shared applicationContext or Hierarchy?    forum.springsource.org

Single shared applicationContext or Hierarchy? Hi, I know this subject has been discussed many times, but as I read through all threads, I got confused. Please help me clarify an applicationContext ...

51. intercept a loaded applicationContext    forum.springsource.org

Hi everybody, I was thinking if there's an AOP possibility to intercept a loaded applicationContext. What does this mean. I'm try to build a simple spring application that gives some services ...

52. TestCase's ApplicationContext using beanRefFactory    forum.springsource.org

Is there a built in way to use a beanRefFactory.xml to initialize my TestCase's ApplicationContext? If not, can someone point me in the right direction to implement this on my own? ...

53. How to load ApplicationContext    forum.springsource.org

How to load ApplicationContext I'm very new to Spring so please excuse my potential lack of understanding. I'd like to use Spring to build/provide a business layer service in a new ...

54. Load informations from ApplicationContext    forum.springsource.org

Hi all, I have the following DAO code: Code: public class HibernateAreaDAO extends HibernateDaoSupport implements AreaDAO { /** * List the all Area. * * @return arrayList */ public ArrayList find() ...

55. ApplicationContext returns null in Junit Test Case    forum.springsource.org

Hi All, I am new to spring framework , Just wanted to know if there is any plug in required for testing DAO component (uses both Spring & Hibernate ) in ...

56. best practice for obtaining ApplicationContext ?    forum.springsource.org

Okay, so using the SingletonBeanFactoryLocator, i'm able to further control the startup of the BeanFactory, but how do you prevent the LazyInitializationException? I was using the OpenSessionInView filter, but that expects ...

57. ApplicationContext in a clustered environment    forum.springsource.org

If I deploy a webapp using spring in a clustered environment and the webapp is deployed to multiple servers. Will the ApplicationContext be created on each server within the cluster? More ...

58. Setting Parent ApplicationContext    forum.springsource.org

This seems like a simple problem, yet searching the documentation and the web yields no results. How does an application context specify it's parent? I need to specify this in the ...

59. Loading an Spring ApplicationContext in a J2EEContainer    forum.springsource.org

Loading an Spring ApplicationContext in a J2EEContainer Hi folks, now i have the following scenario: Basically i have an ear that contains a sar (Jboss service archive) with the hibernateServiceMbean. This ...

60. applicationContext is null    forum.springsource.org

this is my web.xml: Code: SISTEMA VIRTUSCollege SISTEMA VIRTUSCollege DefaultGateway DefaultGateway DefaultGateway org.openamf.DefaultGateway OPENAMF_CONFIG /WEB-INF/openamf-config.xml Location of the OpenAMF config file. 1 AdvancedGateway AdvancedGateway AdvancedGateway ...

61. setParent for ApplicationContext not working as documented    forum.springsource.org

Nov 2nd, 2005, 03:31 PM #1 maureenmartinez View Profile View Forum Posts Private Message Junior Member Join Date Sep 2005 Posts 3 setParent for ApplicationContext not working as documented I am ...

62. Error Applicationcontext    forum.springsource.org

Error Applicationcontext javax.servlet.ServletException: javax.faces.FacesException: javax.faces.el.EvaluationException: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'org.aqua.jsf.bean.ServiceLocatorBean'.. class org.aqua.jsf.bean.ServiceLocatorBean : org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/ApplicationContext-hibernate.xml]: Initialization of bean failed; ...

63. Best solution when having common applicationContext ?    forum.springsource.org

Best solution when having common applicationContext ? Hello, I'm wondering what is the best solution for the following situation : - I have a package commons.jar containing an applicationContext file in ...

64. applicationcontext errors ??    forum.springsource.org

Nov 17th, 2005, 09:30 AM #1 kanonmicke View Profile View Forum Posts Private Message Member Join Date Sep 2005 Posts 55 applicationcontext errors ?? Hi, I have a strange problem I ...

65. Make ApplicationContext loading lazy only in tests    forum.springsource.org

Make ApplicationContext loading lazy only in tests Hi Spring-Experts, is there a trick to override the default-lazy-init attribute of an application-context for a unit test only without changing the XML file ...

66. Autowiring ApplicationContext    forum.springsource.org

Autowiring ApplicationContext Hi, I have problem in Autowiring ApplicationContext. In my application Controller calls Business Service to perform business operation. Business Service logs using LOG4J. I have implemented a custom JDBC ...

67. Autowiring ApplicationContext    forum.springsource.org

Autowiring ApplicationContext Hi, I have problem in Autowiring ApplicationContext. In my application Controller calls Business Service to perform business operation. Business Service logs using LOG4J. I have implemented a custom JDBC ...

68. ApplicationContext problem    forum.springsource.org

Hi, I suspect that the beans XML definitions file is not in your classpath, in the bean factory sample you do not load the XML file from the classpath, you load ...

69. Is Refreshable ApplicationContext in Spring 2.0 ?    forum.springsource.org

Is Refreshable ApplicationContext in Spring 2.0 ? I'm wondering if anyone knows if the refreshable context is in Spring 2.0. It looks like JIRA says this is still an open issue: ...

70. Creating a server wide ApplicationContext...    forum.springsource.org

Creating a server wide ApplicationContext... I am trying set set up an ApplicationContext that holds common beans used server wide, such as code table definitions and language translations. We need the ...

71. ApplicationContext Scopes    forum.springsource.org

I'd like to have an application context per application, session, request, wizard/conversation, etc. The application context would parent the session context which would parent the request and wizard contexts, etc. If ...

72. How separate config from applicationContext?    forum.springsource.org

How separate config from applicationContext? I'm trying to reuse the same applicationContext for my integration testing as what's used for production use. The problem is that I can't figure out a ...

73. Safe ApplicationContext refresh    forum.springsource.org

Safe ApplicationContext refresh Is it safe to refresh application context? I explane my situation. In my application context I have JavaMail service. I want to change mail.properties in the console and ...

74. Initializing an ApplicationContext with multiple BeanFactories    forum.springsource.org

Initializing an ApplicationContext with multiple BeanFactories We are using Spring in an extremely large application within one JVM and often we vary which java components we deploy. We also like deploying ...

75. Junit & applicationContext errors    forum.springsource.org

Junit & applicationContext errors Hi I'm getting a frustrating error trying to run junit with ant: Exception in constructor: testSavePolicy (org.springframework.beans.factory.BeanDefinitionS toreException: Line 11 in XML document from class path resource ...

76. ContextLoaderListener and applicationContext    forum.springsource.org

ContextLoaderListener and applicationContext Hi there - newbie to Spring here. SHORT FORM: How do I get the applicationContext when using ContextLoaderListener? LONGER FORM: I'm working on a project, Hibernate+Servlets+JSP, and discovered ...

77. Dependencies in applicationContext    forum.springsource.org

Dependencies in applicationContext Hi, We have a large project where we have POJO'ed most of our existing ejbs. The ones we have not fully POJO'ed are our stateless session beans acting ...

78. Configuration Paceholders and ApplicationContext    forum.springsource.org

Configuration Paceholders and ApplicationContext Hi, I'm trying to replace a placeholder in my xml spring configuration file. In the manual I read about PropertyPlaceholderConfigurer but allways with XMLBeanFactory. Documention says that ...

79. how many times can i create ApplicationContext    forum.springsource.org

how many times can i create ApplicationContext hi.. i have small application i'm testing from within eclipse, i there am using the following: public class SpringBeanFactoryUtil { public static ApplicationContext getContext(){ ...

80. Merge ApplicationContext with separate ClassPaths    forum.springsource.org

Merge ApplicationContext with separate ClassPaths Hi All. Possible question like this already present in forum but I haven't found it (refer me if it exist). I want create a tool that ...

81. quick question about syntax in ApplicationContext    forum.springsource.org

quick question about syntax in ApplicationContext I want to use PropertyPlaceholderConfigure to customize some key properties for LDAP authentication before deploying my application. I have two entries in the property file(userName ...

82. Question about getting ApplicationContext???    forum.springsource.org

Question about getting ApplicationContext??? Hi: I am new to Spring... 1. My question is how to get the ApplicaitonContext from Java Servlet? ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContex t(getServletContext()); EmailService service = (EmailService) ...

83. testing with applicationContext    forum.springsource.org

hi.. i'm building a few services that will eventrually end up in a web container, i would like to test them with along with ApplicationContext problem i can only have one ...

84. Problems with the initialization of the ApplicationContext    forum.springsource.org

Problems with the initialization of the ApplicationContext hi, i'm trying to initialize my application context via the contextloadlistener (i also tried contextloaderservlet with the same result): Code: ...

85. Speeding up JTests dependent on ApplicationContext    forum.springsource.org

Speeding up JTests dependent on ApplicationContext I'm wondering if anyone has a strategy to speed up the loading of the application context? We load it statically so it only loads once ...

86. Problem Accessing ApplicationContext    forum.springsource.org

Problem Accessing ApplicationContext Hi all, I'm having problems accessing the ApplicationContext. I know that using the following: ApplicationContext ctx = new FileSystemXMLApplicationContext("/applicationContext.xml"); will give me the context but, I don't want ...

87. Auto-Starting with ApplicationContext    forum.springsource.org

Auto-Starting with ApplicationContext Newbie question 101! First of all, Spring is an incredible framework and I give its developers/thinkers/architects a ton of credit. So here is the question. I deploy my ...

88. Loading ApplicationContext through a Resource possible?    forum.springsource.org

Hi all, I'd like to load an ApplicationContext with an InputResourceStream with Maven, but I'm really not finding any constructors that accomodate an InputResourceStream the way an XMLBeanFactory can. Are there ...

89. Finding an already loaded ApplicationContext    forum.springsource.org

Finding an already loaded ApplicationContext Hello, I'd like to be able to load an applicationContext "on demand" inside a servlet environment. I already have an XmlWebApplicationContex loaded normally and I'd like ...

90. Change ApplicationContext during runtime    forum.springsource.org

Change ApplicationContext during runtime Hi, I want to be able to change some of my bean-definitions at runtime. I need to be able to locate an XML file in the classpath, ...

91. How to reference ApplicationContext from non-web classes?    forum.springsource.org

Hi My question is probably an easy one: I want to access the application context without having to instantiate a new one from inside a manager class, i.e I have no ...

92. applicationContext loads twice    forum.springsource.org

applicationContext loads twice Hello, I'm developing a web application for Tomcat. My webapp is using Spring. The web.xml looks like : Code: contextConfigLocation /config/file1.xml /config/file2.xml /config/file3.xml /WEB-INF/applicationContext.xml ...

93. How to get ApplicationContext    forum.springsource.org

How to get ApplicationContext Hi I'm using Spring with IBM WebSphere Portal Express I tried to obtain ApplicationContext: doViev(...) { [...] ApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContex t(request.getSession().getServletContext())); [...] } after this code ...

94. ApplicationContext problem    forum.springsource.org

ApplicationContext problem Hello all. I'm getting confused on what seems like a trivial thing, maybe someone can help me out? I implemented a spring/hibernate app, which worked fine, and the way ...

95. ApplicationObjectSupport always returns null for applicationContext    forum.springsource.org

If I extend org.springframework.context.support.ApplicationObj ectSupport, I should according to documentation be able to get the applicationContext using the method getApplicationContext(). The problem is that it always returns null no matter what. ...

96. performance-problem with loading applicationContext    forum.springsource.org

Jan 16th, 2007, 03:25 AM #1 kopinsky View Profile View Forum Posts Private Message Junior Member Join Date Dec 2006 Posts 29 performance-problem with loading applicationContext Hi, i have the following ...

97. applicationContext load at runtime    forum.springsource.org

Hi, I'm pretty new to Spring and I have a question for y'all. Spring loads various applicationContext-*.xml files on startup, and I want to be able to add xml files at ...

98. ApplicationContext    forum.springsource.org

Can we move applicationContext.xml from src to WEB-INF? I have moved but I am getting Error : Code: Failure invoking listener method 'public void com.palm.fnur.page.LoginPage.login(org.apache.tapestry.IRequestCycle)' on $LoginPage_0@1884319[Home]: IOException parsing XML document ...

99. Custom Classolader and ApplicationContext    forum.springsource.org

Hi, I have standalone java application. I'm using Spring 2.0 and FileSystemXmlApplicationContext. How can i tell Spring to use my custom classloader for creating of beans? Thanks, Peter

100. Arrays in ApplicationContext?    forum.springsource.org

I'm trying to define an array of objects as a bean in an applicationContext.xml file. I can't figure out the syntax for arrays of objects though. Here is what I'm trying: ...