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

Spring 3 Dynamically choosing bean class

So on an spring 3 app I'm building, it would be convenient to be able to read a value from configuration, and then based off of the value read, choose between two implementations of an interface and then build a bean of that object. I have the…
Nixx
  • 370
  • 3
  • 20
0
votes
1 answer

Spring Maven unitTest applicationContext loading wrong file

.I have a project that has a spring-config.xml file in src/main/webapp/WEB-INF and an applicationContext.xml file in src/test/resources. I also have an abstract test base class for my unit tests in src/test/java looks something…
sparks
  • 736
  • 1
  • 9
  • 29
0
votes
3 answers

Property-placeholder using envriomental variables as CATALINA_HOME

I would like to use a Envriomental variable in the location of property-placeholder but I don't get it: I tried in this way: but I get this…
Josema
  • 445
  • 2
  • 6
  • 22
0
votes
3 answers

How to access Spring context from a depending project?

Suppose I have two projects: ProjectA and ProjectB ProjectA depends on ProjectB And I have a context.xml locates at ProjectB/target/test-classes/context.xml. Now I need to loat the context from ProjectA. In projectB I have an accesser class: Class…
Edmond
  • 614
  • 2
  • 11
  • 26
0
votes
1 answer

Spring ApplicationContext Running twice

I want to migrate Spring WebMvcConfigurerAdapter Configuration with Spring security. Now i get the problem that i get 2 ApplicationContextes and my Singelten Classes are Statefull. Here my web.xml and my FrontendConfig. Please be indulgent with me.…
Moinsn
  • 3
  • 1
  • 6
0
votes
2 answers

Initializing Spring bean from static method from another Class, giving method arguments?

How can you initialize a bean by using a factory method that needs a parameter? I cannot find an example with a method that has parameter, only no params methods... spring docs Thanks
Roxana
  • 1,569
  • 3
  • 24
  • 41
0
votes
2 answers

How to load application context from string in Spring 2.5?

As the title says, I want to load some beans from a String. This approach only works in Spring 3 because GenericXmlApplicationContext is unavailable in version 2.5.
Pantaziu Cristian
  • 882
  • 2
  • 14
  • 26
0
votes
1 answer

Multiple SharedEntityManagerBeans and ApplicationContext.getBean issue

I have two databases which I want to access from my Spring application. I configured two SharedEntityManagerBean for both databases. Here is the config:
Ümit
  • 17,379
  • 7
  • 55
  • 74
0
votes
2 answers

how to load applicationContext

I have 2 applicationContext file under the same directory and I want to load each time one of them. what is the command I need to use in order to run the application context from a command line? is there changes in the classpath?
Sarit
  • 101
  • 1
  • 3
  • 6
0
votes
2 answers

How can I pass VM args to applicationContext in spring

How can I pass vm args (java -Dport = 5) to the application context? I want to configure the port dynamically by the user, using the application context.
Sarit
  • 101
  • 1
  • 3
  • 6
0
votes
1 answer

can i know the log directory path in applicationcontext.xml?

I'm writing a java Application for Tomcat 7. I have a bean configuration for a class that creates a log file and appends information to it. now the question is how can I know the tomcat log directory path in bean configuration. for now I have the…
ufk
  • 30,912
  • 70
  • 235
  • 386
0
votes
1 answer

Spring Security AuthenticationProvider No Bean Defined

I am implementing my own authenticator provider for Spring Security 3.1.4. But when I running application on Tomcat I receive this log error from Tomcat. org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named…
Dani
  • 4,001
  • 7
  • 36
  • 60
0
votes
3 answers

injecting directly to servlet instead of new ClassPathXmlApplicationContext

I have a big java project that contains many servlets. and each servlet needs to get objects from the same bean file using the following command: ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml"); and then I use …
ufk
  • 30,912
  • 70
  • 235
  • 386
0
votes
3 answers

How would I properly autowire this class and applicatonContext.xml?

I am fairly new to using Spring. I understand the concept of autowiring, but am confused on the implementation. I have a Maven multi-module project, and I am trying to Autowire the manager class in Module A so that I can use it in Module B. When I…
stevendao
  • 954
  • 1
  • 8
  • 13
0
votes
1 answer

ApplicationContext and message window in bottom right corner

I'm building application that will stay in tray, from time to time it will do a service call and if service returns result it will show it as nice window in bottom right corner.I found nice looking component as codeproject -…
Misiu
  • 4,738
  • 21
  • 94
  • 198