Repository navigation
TP bring-up: missing JAXB Atom marshaller, narrow component scan, and broader OAuth2-client wiring gaps #146
Description
Summary
The Third Party module cannot complete Spring context initialization against the current dev-mysql profile. A narrow chain of bean-wiring gaps surfaces when bringing TP up locally against a fresh DC + AS pair (in support of #122 PR C4 manual testing). The deeper architectural issue is that TP is not currently a functional ESPI third party — its OAuth2 client config, Atom marshalling pipeline, and Notification Endpoint receiver path have not been brought to a working state in the Spring Boot 4 / Spring 7 migration.
Priority context: Per the project lead, DC API completion is upstream of this work. TP cannot meaningfully exercise the OAuth2 + ESPI resource flow without a complete DC API surface (the BatchList notifications, the Subscription resource feeds, the Customer/PII resource feeds, etc. that TP would receive). File a focused DC API audit/completion issue first; this TP issue should be triaged after DC stabilizes.
What's already been observed locally
Encountered in this order while running mvn spring-boot:run -Dspring-boot.run.profiles=dev-mysql:
-
Missing
UsagePointMapperbean — TP's@SpringBootApplication.scanBasePackagesexcludedorg.greenbuttonalliance.espi.common.mapper, so MapStruct-generated mapper impls were not registered. Half-fix in PR Phase 2.0 — Stand up auth-server in dev with opaque tokens + subscription-bound introspection (Phase 2 precursor) #122 PR C4 (broadened scan toorg.greenbuttonalliance.espi.common). -
Missing
EspiIdGeneratorServicebean — same root cause; lives inorg.greenbuttonalliance.espi.common.service(not.service.impl). Resolved by the same scan broadening in PR C4. -
Missing
Jaxb2Marshallerbean namedatomMarshaller—ResourceRESTRepositoryImpl(and several other resource repos)@Autowireda@Qualifier("atomMarshaller")Jaxb2Marshaller. No@Beandefinition currently exists for it in TP, openespi-common, or any autoconfiguration on the classpath. PR C4 does NOT fix this — manual testing stops here.
What likely remains under the surface
The pattern above (TP discovering missing collaborator beans one-at-a-time during context init) suggests the migration from the pre-Spring-Boot-4 codebase left TP partially wired. Likely items to audit:
- Atom feed marshalling pipeline —
Jaxb2Marshaller+ ESPI/Atom JAXB context configuration, currently undefined. - Notification Endpoint — TP's REST endpoint that receives
BatchListfrom DC at grant-completion. Status: unverified, likely also missing security + Jaxb plumbing. - OAuth2 client config — TP's
application.ymlreferencesclient-id: third_partyand callback URIs; needs end-to-end verification against AS's currentRegisteredClientdefinition (AuthorizationServerConfig.java:278-301). - Resource fetching layer —
ResourceRESTRepositoryImpl,UsagePointRESTRepositoryImpl, etc.; whether they actually round-trip against DC's current Atom feed endpoints. - JPA layer — TP has 24 repository interfaces; need to confirm the entity scan and database schema (TP currently runs with
flyway: 0 migrationsagainst athirdpartyMySQL DB, suggesting either it's relying on Hibernateddl-auto=updateor it doesn't actually persist anything that matters yet).
Reproduction (current state)
# Per PR C4 README instructions
cd openespi-thirdparty
mvn spring-boot:run -Dspring-boot.run.profiles=dev-mysqlFails with:
APPLICATION FAILED TO START
Field marshaller in org.greenbuttonalliance.espi.thirdparty.repository.impl.ResourceRESTRepositoryImpl
required a bean of type 'org.springframework.oxm.jaxb.Jaxb2Marshaller' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
- @org.springframework.beans.factory.annotation.Qualifier("atomMarshaller")
Recommended approach (after DC API work lands)
- Audit the full TP bean dependency graph at context-init time — identify every
@Autowiredcollaborator from TP code into openespi-common and confirm each has a definition path. Don't fix one-at-a-time; produce a list, then plan. - Define the missing
atomMarshallerJaxb2Marshallerbean — likely belongs in either openespi-common's Spring config or a new TP@Configurationclass. Aligns with whatever JAXB context the existingBaseExportServicefamily uses on DC. - End-to-end smoke the OAuth2 customer flow: TP root → AS
/oauth2/authorize→ DC consent screen → token exchange → TP fetches a UsagePoint feed. (Blocked on the DC API completion above.) - Notification Endpoint smoke test — DC pushes a BatchList to TP at grant-completion; TP processes and persists. (Likely also blocked on DC.)
- Remove PR Phase 2.0 — Stand up auth-server in dev with opaque tokens + subscription-bound introspection (Phase 2 precursor) #122 PR C4's TP scan-broadening workaround once the proper wiring is in place — or keep it as the canonical wide-scan pattern if that matches the project's preference.
Out of scope for this issue
- DC API completion + missing endpoints — upstream of this work, needs its own focused issue and probably its own multi-PR effort.
- The PR C4 work itself (Phase 2.0 — Stand up auth-server in dev with opaque tokens + subscription-bound introspection (Phase 2 precursor) #122) — already shipped, ships its workaround for the two minimal bean-wiring gaps so AS can be tested manually.
- Issue Complete #123 schema-repair sync: align AS V1 schema with application code column names #145 (AS schema-repair sync) — independent of TP.
Acceptance
- Document the architectural intent for TP (is it a reference OAuth2 client for ESPI integrators? a development harness for DC API testing? something else?).
-
mvn spring-boot:run -Dspring-boot.run.profiles=dev-mysqlboots TP cleanly against a working DC + AS. - Browser flow: TP root → OAuth2 authorize → DC screens → token exchange → TP can fetch and render at least one ESPI resource.
- DC-to-TP Notification Endpoint receives and processes a BatchList push.
- PR Phase 2.0 — Stand up auth-server in dev with opaque tokens + subscription-bound introspection (Phase 2 precursor) #122 PR C4's TP scan-broadening workaround is either confirmed correct and kept, or replaced with the project's preferred pattern.
Activity
feat(#122 PR C4): AS-side back-channel call + token-response augmenta…
feat(#158): DC→TP notification contract + TP-receiver stub (#163)
dfcoffin commentedon Jun 7, 2026
Bring-up findings (manual AS+DC+TP launch, 2026-06-06)
Confirmed the TP context-init wiring chain by launching all three servers locally (MySQL on 3306). Progress on the chain:
atomMarshallerJaxb2Marshallerbean — defined in PR fix: local sandbox bring-up — DC↔AS introspection alignment + TP atomMarshaller (#146) #170 (JaxbMarshallingConfiguration). TP now advances past this gap.ResourceRepository—ResourceRESTServiceImpl.resourceRepositoryrequiresorg.greenbuttonalliance.espi.common.repositories.usage.ResourceRepository, which is a custom interface with NO implementation anywhere (noResourceRepositoryImpl, noimplements ResourceRepository). The resource-fetch layer was never built. This is the substantive next step for TP bring-up.ResourceRepositorymethods likefindAllIdsByXPath). Per "DC API completion is upstream of TP," these stay deferred.Also note (not TP): the DC↔AS dev introspection config was misaligned (DC→:8080 / unseeded
datacustodianclient) — fixed in #170 so the sandbox introspects out of the box. And DC collection GETs marshal a rawList(500) — fixed by the #119 E-phase entry/feed assembly.Runbook for local 3-server bring-up captured in the working notes.
fix: local sandbox bring-up — DC↔AS introspection alignment + TP atom…
feat(#177): TP BatchList receiver does authenticated GET-and-import; …
feat(#177): admin compose & send ESPI BatchList notification (DC send…
fix(#146): make the Third Party application boot (remove dead Resourc…
feat(#177): admin compose & send ESPI BatchList notification (DC send…