tkobayas opened a new issue, #7324:
URL: https://github.com/apache/incubator-kie/issues/7324
While cleaning up `drools-xml-support` (#7263 / #7323), we found that JAXB
support for Drools commands appears to be unused in Apache KIE.
JAXB marshalling of commands was originally added for KIE Server /
kie-remote-client (REST API, Fuse integration), which are not part of Apache
KIE. Within this repository there is no production code that marshals commands
with JAXB.
## Findings
- `drools-commands`: ~73 classes carry `jakarta.xml.bind` annotations
(`runtime/rule`, `runtime/process`, `BatchExecutionCommandImpl`,
`ExecutionResultImpl`, `FlatQueryResults`, ...), plus the JAXB helper classes
in `org.drools.commands.jaxb` (`JaxbListWrapper`, `JaxbListAdapter`,
`JaxbMapAdapter`, `JaxbUnknownAdapter`, `JaxbObjectObjectPair`,
`JaxbStringObjectPair`, `ObjectFactory`) and
`org.drools.commands.runtime.ObjectFactory` / `QueryResultsJaxbAdapter`.
`jakarta.xml.bind-api` is a `provided` dependency.
- `drools-compiler`: `DroolsJaxbHelperProviderImpl.JAXB_ANNOTATED_CMD` lists
command classes for `newJAXBContext()`, exposed through
`KnowledgeBuilderHelper.newJAXBContext()` in `kie-internal`. The list contains
a typo (`"org.drools.commands.runtimeExecutionResultImpl"`), so
`newJAXBContext()` always fails with `ClassNotFoundException` /
`JAXBException`. Nothing in the repository calls it.
- Tests that only exercise JAXB marshalling of commands:
-
`drools-xml-support/src/test/java/org/drools/xml/support/CommandSerializationTest.java`
(it uses no `drools-xml-support` classes; kept in #7323 to be handled here)
- the JAXB round-trip part of
`drools-test-coverage/test-compiler-integration/.../query/QueryTest.java`
(`FlatQueryResults`)
## Proposal
Remove JAXB support for commands:
1. Remove the JAXB annotations and JAXB helper classes from
`drools-commands`, and the `jakarta.xml.bind` dependency if it is no longer
needed.
2. Remove `JAXB_ANNOTATED_CMD` and `newJAXBContext()` from
`DroolsJaxbHelperProviderImpl` / `DroolsJaxbHelperProvider` /
`KnowledgeBuilderHelper`.
3. Remove `CommandSerializationTest` and the JAXB part of `QueryTest`.
4. Review whether `drools-xml-support` still needs `drools-commands` and the
JAXB dependencies.
Out of scope: the XSD model support in `DroolsJaxbHelperProviderImpl`
(`addXsdModel()` / `addPackageFromXSD()`), which is a separate feature.
Removing `newJAXBContext()` changes `kie-internal`, so this should be
confirmed as acceptable before going ahead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]