Reputation: 852
In my case I have:
When I deploy WAR file on tomcat, I don't see HtmlTags.config in $CATALINA_BASE/webapps/LangDetectionService.
I tried to add HtmlTags.config to LangDetectionService also, and after deploying HtmlTags.config is in $CATALINA_BASE/webapps/LangDetectionService folder, but it doesn't work.
What's wrong here? What's the best practices to do it?
Upvotes: 0
Views: 122
Reputation: 852
It's solution. 1. Add HtmlTags.config to service project. 2. Change line "Configuration.class.getResourceAsStream("/" + configName)" to line "Configuration.class.getClassLoader ().getResourceAsStream(configName)" . 3. When LangDetector.jar will load HtmlTags.config it will get it from service project (behavior like in .NET)
Upvotes: 0
Reputation: 1285
If it is like that, HtmlTags.config should be in classpath and readable to your service. But what code should read this HtmlTags.config file is unclear from your question.
You can try to read this file like that:
log.debug("HtmlTags.config exists: " + new File("HtmlTags.config").exists());
, where log is your logger.
And like always, you should start checking your server and application logs for errors and warnings.
And your question leaves me wonder, why you need to see that file in that directory? If you want to read it from your application, then it should be in classpath. Physical location is not really important, or is it?
Upvotes: 1