Questions tagged [applicationcontext]

The Spring `ApplicationContext` class

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

869 questions
-1
votes
1 answer

Spring Security 4 Throws HTTP Status 404 Error in One Machine But Works Fine In Another

I am working in developing a Java application that runs on Glassfish 4.1 and uses Spring Security 4.2.0 for user authentication. Spring Security has been working fine in my development environment as well as in the production server for several…
carlossierra
  • 4,479
  • 4
  • 19
  • 30
-1
votes
1 answer

My spring bean not working properly?

I'm getting null values for some of the methods in pojo class and other methods are working fine. This is my POJO class Student.java public class Student { private int id; private String name; private String message1; private String…
Rama Krishna
  • 275
  • 3
  • 12
-1
votes
1 answer

I am getting org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException

I am getting, the following exception in my code. org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 38 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is…
Virtual Realist
  • 175
  • 6
  • 19
-1
votes
1 answer

Loading context after application context

I have a doubt which is similar to the one here: Class Loading Application Context Spring But I also want to load the dependencies of the classes loaded after the application context. Is that possible to achieve?
Natasha
  • 367
  • 1
  • 5
  • 15
-1
votes
1 answer

how to get ClassPathXmlApplicationContext config locations from appContext object?

I need to get the context xml file locations from ClassPathXmlApplicationContext instance. When I inspected the source code, I saw that "configLocations" array ,which contains the locations of the files, are private and the getConfigLocations method…
Neron
  • 1,500
  • 7
  • 30
  • 52
-1
votes
3 answers

how to display a pop_up window when losing the Internet connection?

I want my android app to display a pop-up window when the internet connection lost in order to tells the user that he lost the connection, I tried to catch null stream and then initiate a pop-up then, but it gives me that exception: 03-20…
MRefaat
  • 515
  • 2
  • 8
  • 22
-1
votes
1 answer

Selecting text and clicking "Web Search" crashes the app

I am trying to reuse a webview across activity. Here's a sample of what I'm doing. There are two activities, Main and Secondary. In onResume() of Main i create a webview object, and I save it in my application context. WebView wv = new…
Sudarshan Bhat
  • 3,772
  • 2
  • 26
  • 53
-2
votes
1 answer

Why do I keep getting the IllegalStateException?

I have this hierarchy in my project: ▼ server ▼ myproject ▼ src ▼ main ▼ java ▼ com ▼ youben ▼ rest ▼ repository Ⓘ MyRepository ▶ resources ▼…
-2
votes
1 answer

NullPointerException when trying to @Autowired WorkerThread

I have my main Application annotated with @SpringBootApplication. Here is the code for the following: @SpringBootApplication public class Application { private Logger logger = LoggerFactory.getLogger(Application.class); …
-2
votes
2 answers

How can we access an android activity from within context?

Trying to call a function from an activity, but I need the specific instance of that activity to do so. Is there a way to call that specific activity from the application? If not, is there a way to start an activity from the application so that I…
Skorpius
  • 2,135
  • 2
  • 26
  • 31
-2
votes
1 answer

Static Application Contex on android

I am Trying to inflate one ListView When clicking a member of another ListView Which is in a ListActivity. So when I try to set Adapter it asks me for getApplicationContext, so the ListView is in another activity and I am trying to call that that…
kobbycoder
  • 682
  • 2
  • 10
  • 33
-2
votes
2 answers

application removed from recent application list

My query is, i want to cancel services using alarm manager when application going to destroy/closed. if i am in activity A by clicking on button started activity B suddenly user is going to press home button. ---- if application is running in…
Bhavesh Jethani
  • 3,891
  • 4
  • 24
  • 42
-3
votes
2 answers

Why in Spring JUnit test a new ApplicationContext is initialized and created for each test method?

I am studying unit test in Spring and I have the following doubt. Why a new ApplicationContext is initialized and created for each test method? Why Spring need a new ApplicationContext for each test method and not reuse a same ApplicationContext…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
-4
votes
1 answer

Use ApplicationContext if possible in Android?

Is it a good practice to use application context instead of other context(Activity, Service and so on) if possible? Pros: Application context can help us avoid memory leak. Application context can help eliminate params in some circumstances Other…
Bin
  • 222
  • 2
  • 15
1 2 3
57
58