I need to read the manifest file from java code. The project is a enterprise java project which runs in wildfly. I need to read the manifest file of web. Following is what i tried.
@Resource
private WebServiceContext context;
ServletContext servletContext =
(ServletContext) context.getMessageContext().get(
MessageContext.SERVLET_CONTEXT);
Properties prop = new Properties();
prop.load(servletContext.getResourceAsStream("/META-INF/MANIFEST.MF"));
But i get the following error
Caused by: javax.naming.NameNotFoundException: env/abc.def.rest.ManifestRestService/context -- service jboss.naming.context.java.module.abc-ear.abc-web.env."abc.def.ManifestRestService".context
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:104) [jboss-as-naming.jar:7.2.0.Final]
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202) [jboss-as-naming.jar:7.2.0.Final]
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179) [jboss-as-naming.jar:7.2.0.Final]
at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)
Any ideas how to get this working.