Reputation: 79
We have a web application which is an ear file containing 1 war and 1 MDB jar. Problem is that I load some properties file in my servlet when first request for servlet comes. These properties I will also need in my MDB. How can I access my Servlet class(inside war) in the EJB jar classes. Is there any way to use my war file as a utility jar.
Application is running on weblogic server.
Upvotes: 2
Views: 649
Reputation: 80593
Extract out your property management into a common, utility JAR that can be accessed from both tiers of your app.
Upvotes: 0
Reputation: 5299
You don't as a servlet is invoked through a HTTP call. You could hack it by doing an URLConnection to the servlet, but I would rather refactor your code a bit so you can call the initialization code on server startup in stead of by invoking the servlet. A context listener or an EJB init() could already do it.
Upvotes: 1