question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modernise configuration processing used in `Mage.Server`

See original GitHub issue

Why?

As a part of effort to be compatible with JDK11+, we need to make sure everything, including Mage.Server, builds with mvn package. Currently, due to JAXB deprecation, it is impossible to generate Config class from ConfigFactory. It should be noted, that I have tried to use every drop-in JAXB replacement out there, including jaxb-api + jaxb-impl dependencies and Spring’s implementation, and all of those attempts failed.

What?

  • Provide Config class with an API similar to the existing one (see ConfigFactoryTest)

How

Strategy A

Admittedly, the lowest hanging fruit is to start by manually making a module which would follow current config’s XML specification, perhaps even by slightly retouching the generated ./target/generated-sources/xjc/mage/server/util/config/Config.java. A huge drawback of this approach, is that it destroys the single source of truth, which is the XML schema, creating maintenance strain whenever config schema is changed. That said, I don’t see it as an event that happens all too often, this is why I think it’s a possible angle of attack.

~- [ ] Add a manually crafted or machine-generated Config.java to the codebase~ ~- [ ] Update tests to refer to Config class directly, rather than ConfigFactory~ ~- [ ] Comment out code of ConfigFactory, referring to this issue~

Strategy B

The proper way to solve this issue is to not search for a drop-in replacement for JAXB, but rather incorporate a modern approach for dynamic class generation based on XML specifications. I’m yet to learn how it’s done in Java 11+, but I’ve already asked an expert Java developer to have a look and, perhaps, he’ll provide some pointers.

~- [ ] Find out how JAXB-like functionality is implemented in modern Java~ ~- [ ] Rewrite ConfigFactory to use that modern approach~ ~- [ ] Adjust Config API (over which we won’t have control in Strategy B) throughout the codebase, including ConfigFactoryTest~

Strategy C

Perhaps, my lack of experience with mvn/pom.xml is the source of me failing to make a JAXB drop-in replacement work. If so:

  • Find a JAXB drop-in replacement
  • Add it to the dependencies
  • Make sure it works
    • at build step,
    • test step,
    • runtime

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fburatocommented, Mar 13, 2022

@cognivore: I’ve tried it out as well and I managed to get a running version that incorporate everything (JavaFX and JAXB). fburato/mage#38 builds with the simplest possible invocation (mvn clean install), has all tests passing, and runs with the client and the server starting without issue and managing to connect to one another.

1reaction
fburatocommented, Mar 11, 2022

@cognivore: it’s probably because VSCode is wiring in the classpath when you launch the client from the IDE. That’s what I meant in my comment to @weirddan455 with “I don’t know exactly how you are running the application”, and more generally when the application is packaged it is important to ensure that the lib folder that is added in the client contains all the necessary dependencies. I’m not familiar enough with the release process of Mage to know how that works, but I assume there is going to be another change to make to include the new dependencies.

More generally, however, I was suggesting to add the JARs in the classpath manually just to confirm that the application would run that way. Figuring out how to automate the addition comes after we have validated that the hypothesis is correct 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

MAGE User Guide
MAGE is a Game Server Framework for Node.js. It allows game developers to quickly create highly interactive games that are performant and scalable....
Read more >
Mage.exe (Manifest Generation and Editing Tool)
The Manifest Generation and Editing Tool (Mage.exe ) is a command-line tool that supports the creation and editing of application and deployment ...
Read more >
Sign Manifest files with Mage - DigiCert product docs
The Manifest Generation and Editing Tool (Mage.exe ) is a command-line tool that supports the creation and editing of application and deployment manifests....
Read more >
What Is Immutable Infrastructure? - DigitalOcean
In a traditional mutable server infrastructure, servers are ... into use, reducing the actual deployment process to a single update to make ...
Read more >
Installation and configuration of Deep Security Relay
DSM only gets update information from the Deep Security Relay. A typical configuration is for DSM to use a Deep Security Relay which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found