Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration Files on the Classpath present in a Jar File will not load #253

Closed
smflorentino opened this issue Aug 11, 2015 · 0 comments
Closed

Comments

@smflorentino
Copy link

I'm currently writing a plugin to enable AppInsights on my project (it's a Maven project). I created a plugin, also a Maven project, and bundled the ApplicationInsights.xml file inside, as a resource. This works fine in my IDE, since the file is not inside of a jar, but on the filesystem. However, once I package the project and use the resulting artifact as a dependency (a jar of the plugin gets placed on the classpath), AppInsights sees the configuration file but cannot load it from the jar.

I tracked down the source of the bug - if the ApplicationInsights.xml file is present in a jar on the classpath, the SDK still tries to load as a file - but it should be loaded as a resource or input stream, since its not a file on the filesystem per se.

I'm able to reproduce this as a failing unit test in the SDK, as I've pushed to my branch on the PR, where I'm hoping a fix can be discussed/implemented.

Other people seem to be experiencing the problem too - as I found this StackOverflow question when searching for answers:
http://stackoverflow.com/questions/31789083/issue-unmarshalling-object-from-file-inside-jar/31931056#31931056

smflorentino pushed a commit to smflorentino/ApplicationInsights-Java that referenced this issue Aug 11, 2015
smflorentino pushed a commit to smflorentino/ApplicationInsights-Java that referenced this issue Aug 11, 2015
@ghost ghost locked as resolved and limited conversation to collaborators Jul 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants