Comments (11)
AFAIK this was already fixed in later versions of Typesafe Config, just exclude the Akka Typesafe Config dependency and add your own. Does that fix the issue?
from config.
Assuming that you're on Akka 2.0.4 (which is the latest release for 2.0)
from config.
Hi Viktor and thank you for the quick response. Yes i'm on 2.0.4. I can't exclude the dependency on Config as it is very useful and used by other components of the application as well.
For now i just changed the Manifest of the Config so that the class in question is exported as well, but i think it could be the issue for somebody else.
Thanks again
from config.
But why does OSGi need internal implementation details to be exported? That seems buggy to me.
from config.
Java serialization is just full of hacks. We use the writeReplace() mechanism to provide an internal object to be serialized rather than the original object. Normally, serialization doesn't care that the replacement object has a private class, but with OSGi the class loader actively blocks loading the private class I guess, so the Java deserializer can't load it to call readExternal().
Putting the internal class in the manifest does sound like the only solution, though I don't really understand OSGi in much detail. Hopefully there's a way to export just the one class and not the whole "impl" package.
from config.
Basically, all classes that are needed to construct (or clone or deserialize) an object must be available for the class loader. In OSGi some class is available if it's package is exported by some bundle (with respect to the version information). If some package declared private, it is available only for the declaring bundle.
I would say that if an application relies on the serialised form of something, than this serialised form should be considered to be a part of the API.
Yes, i think there is no need to export full package. I'd export the serialised form only. For example, by moving this class from the "impl" package. This will work but it will also create another issue with cyclic package dependencies :)
from config.
I'm not sure what the actual appropriate change in the typesafe config code is; I've never dealt with OSGi. I would like to keep this class "as private as possible" while still keeping OSGi working. I might need a patch or at least a description of the changes.
from config.
What about moving SerializedConfigValue
to com.typesafe.config
package but change its accessibility to default (from public)?
from config.
If default access would work that sounds fine, but renaming the class would break serialization back-compat, which could cause akka upgrade problems (I think? I know we've discussed it). In retrospect, a class name which appears in the serialization probably should not have had "impl" in it. Ugh.
from config.
Where I currently have OsgiKeys.exportPackage := Seq("com.typesafe.config")
in the build, is there any huge downside to just adding the impl
package to the export list? It means OSGi users can use the impl
but non-OSGi users can cheat and do that too, and in both cases we just tell them they are wrong and they get both pieces when it breaks, right?
from config.
No huge downside - just what you already listed. The package has impl
in its name so that's typically enough of a clue to users to stay away from it. This is probably the simplest solution that maintains full compatibility.
from config.
Related Issues (20)
- Is this project active? HOT 4
- Find a StackOverflowError in config
- Find a StackOverflowError in config
- Find a StackOverflowError in config HOT 1
- underscore characters HOT 2
- Problems with com.typesafe/config and maven-dependency-plugin
- introduce method accepting a list of Objects to add a value
- Should this project be explicitly considered as deprecated/not supported? HOT 29
- Community fork? HOT 7
- Resolving Variable Substitutions Between Multiple Config HOT 1
- Something error when use com.typesafe.config API convert conf file to scala bean class
- withFallBack is not adding value if not present
- how to load the config with substitution details HOT 3
- Add info about which signing keys will be used for published artifacts.
- Cannot provide environment variables programmatically
- Rendering partially resolved appended array results in invalid configuration HOT 1
- Inconsistent behavior with Overflow/Underflow and Exceptions
- Regression in environment variable reading behavior HOT 2
- Add a module info HOT 6
- Question about `ConfigFactory.systemProperties()` on windows HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from config.