From 0b12f400a108e534ee6c09a6081216095aa5ccfb Mon Sep 17 00:00:00 2001 From: Gerard Lemson Date: Tue, 3 Mar 2026 08:46:46 -0500 Subject: [PATCH 1/3] Add local development setup for RACM debugging Add documentation and configuration changes to support running RACM locally via Spring Boot embedded Tomcat for development and debugging. - Add RACM README.md with local setup, build, and Eclipse instructions - Exclude spring-boot-starter-logging globally to prevent log4j bridge conflicts - Exclude org.springframework.boot.jdbc from AspectJ weaving (Oracle classes) - Add .gitignore entries for Eclipse artifacts, AspectJ dumps, and RACM lib/ - Add racm .gitignore for lib/ and WebContent/WEB-INF/classes/ Co-Authored-By: Claude Opus 4.6 --- .gitignore | 4 + components/java/build.gradle | 4 + components/java/racm/.gitignore | 2 + components/java/racm/CLAUDE.md | 39 ++++++++ components/java/racm/README.md | 90 +++++++++++++++++++ .../racm/src/main/resources/META-INF/aop.xml | 1 + 6 files changed, 140 insertions(+) create mode 100644 components/java/racm/.gitignore create mode 100644 components/java/racm/CLAUDE.md create mode 100644 components/java/racm/README.md diff --git a/.gitignore b/.gitignore index 03bd3b2..4c6e882 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,11 @@ docs/_build/ .idea .project .classpath +.settings/ +bin/ +*.bak .gradle +ajcore.*.txt **/WebContent/WEB-INF/application.properties **/WebContent/WEB-INF/version diff --git a/components/java/build.gradle b/components/java/build.gradle index 66e7d46..f5d3cdf 100644 --- a/components/java/build.gradle +++ b/components/java/build.gradle @@ -11,4 +11,8 @@ subprojects { maxWarnings 0 showViolations false } + + configurations.all { + exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' + } } diff --git a/components/java/racm/.gitignore b/components/java/racm/.gitignore new file mode 100644 index 0000000..ab81501 --- /dev/null +++ b/components/java/racm/.gitignore @@ -0,0 +1,2 @@ +/lib/ +/WebContent/WEB-INF/classes/ diff --git a/components/java/racm/CLAUDE.md b/components/java/racm/CLAUDE.md new file mode 100644 index 0000000..45d0bab --- /dev/null +++ b/components/java/racm/CLAUDE.md @@ -0,0 +1,39 @@ +# RACM Component + +## Code Style +- Java 17 project +- ALWAYS use Gradle for package dependencies and managing the environment +- Always use SIMPLEST code and structure, don't over-engineer +- Don't create unnecessary files. When creating new version of a file, archive or delete the legacy file +- DO NOT ADD UNNECESSARY FEATURES! Keep code simple + +## Building +- Gradle root is at `components/java/` (where `settings.gradle` lives) +- Build racm and deps: `cd components/java && ./gradlew :racm:modelJar && ./gradlew :racm:build` +- Root `build.gradle` excludes `spring-boot-starter-logging` globally to avoid log4j bridge conflicts + +## Eclipse Setup +- Import as Gradle project from `components/java/` — creates separate projects per subproject +- Buildship prefs `connection.project.dir` must point to the Gradle root (`..` for depth-1, `../..` for depth-2 subprojects) +- Do NOT use the legacy flat `.classpath` at root (renamed to `.classpath.bak`) + +## Debugging in Eclipse +- Run/debug `org.sciserver.springapp.RACMApplication` as Java Application +- Requires two `-javaagent` VM arguments in Debug Configuration: + - `-javaagent:/aspectjweaver-1.9.22.1.jar` (AspectJ load-time weaving, found in Gradle cache) + - `-javaagent:/spring-instrument-5.3.31.jar` (Spring classloader instrumentation, stored in `racm/lib/`) +- The `lib/` folder is gitignored and holds JARs needed only for local Eclipse debugging +- Without these agents, `@EnableLoadTimeWeaving` and EclipseLink entity enhancement will fail + +## Configuration +- `application.properties` consolidates all config for local development (server, login, admin, DB, URLs, etc.) +- `jpa-config.properties` is loaded separately by EclipseLink via `RACMDatabaseConfiguration` +- `persistence.xml` lists all JPA entity classes +- In production, Helm generates `racm-application.yaml` with all config (see `helm/sciserver/files/racm-application.yaml`) + +## Key Architecture +- Spring Boot 2.7.18 with EclipseLink JPA (not Hibernate) +- AspectJ for `@Transactional` support (`AdviceMode.ASPECTJ`) +- SQL Server database +- Auth: header, cookie, and query param filters via Spring Security +- Depends on: `springutils:logging-interceptor`, `springutils:authenticator`, `clients:auth` diff --git a/components/java/racm/README.md b/components/java/racm/README.md new file mode 100644 index 0000000..60385a8 --- /dev/null +++ b/components/java/racm/README.md @@ -0,0 +1,90 @@ +# RACM - Resource Access Control Manager + +RACM is the central authorization and resource management service for SciServer. +It manages users, groups, resources, access control, compute jobs, and storage. + +## Building + +```sh +cd components/java +./gradlew :racm:modelJar && ./gradlew :racm:build +``` + +## Running Locally + +RACM can be run locally via the Spring Boot main class +`org.sciserver.springapp.RACMApplication`. This starts an embedded Tomcat server +without needing an external servlet container. + +### Prerequisites + +- Java 17 JDK +- SQL Server with a `racm` database +- Two Java agent JARs (required by AspectJ load-time weaving and EclipseLink): + - `aspectjweaver-1.9.22.1.jar` (available in Gradle cache after building) + - `spring-instrument-5.3.31.jar` (download from Maven Central, store in `racm/lib/` which is gitignored) + +### Configuration + +Create `src/main/resources/application.properties` (gitignored) with your local +configuration. Use `helm/sciserver/files/racm-application.yaml` as a reference +for all available properties. At minimum you need: + +```properties +spring.application.name=racm +server.servlet.context-path=/racm +spring.mvc.pathmatch.matching-strategy=ant-path-matcher + +spring.datasource.url=jdbc:sqlserver://localhost;DatabaseName=RACM +spring.datasource.username=racm_user +spring.datasource.password= + +spring.mvc.view.prefix=/WEB-INF/jsp/ +spring.mvc.view.suffix=.jsp +spring.main.allow-circular-references=true +spring.flyway.enabled=false + +eclipselink.logging.level=WARNING + +org.sciserver.racm.login.loginPortalUrl=http://localhost:8080/login-portal/ +org.sciserver.racm.login.login-admin.username=admin +org.sciserver.racm.login.login-admin.password= + +org.sciserver.racm.admin.username=__racm__ +org.sciserver.racm.admin.password= +org.sciserver.racm.admin.email=racm@do.not.send +``` + +### JVM Arguments + +Both Java agents must be passed as VM arguments when launching: + +``` +-javaagent:/aspectjweaver-1.9.22.1.jar +-javaagent:/racm/lib/spring-instrument-5.3.31.jar +``` + +Without these, `@EnableLoadTimeWeaving` and EclipseLink entity enhancement will +fail on startup. + +### Verifying + +The app starts on `http://localhost:8080/racm/`. Example endpoints: +- `GET /racm/ugm/rest/publicgroups` — list public groups +- `GET /racm/actuator/health` — health check + +### Eclipse Setup + +To debug in Eclipse: + +1. **File > Import > Gradle > Existing Gradle Project**, browse to `components/java/` +2. Right-click `RACMApplication.java` in the `sciserver-java-racm` project > **Debug As > Java Application** +3. In **Run > Debug Configurations > Arguments > VM arguments**, add both `-javaagent` entries above + +## Notes + +- `jpa-config.properties` is loaded separately by EclipseLink via `RACMDatabaseConfiguration` +- External services (Login Portal, File Service, Logging) may not be available + locally — the app will start but those features won't work +- The `aop.xml` excludes `org.springframework.boot.jdbc` from AspectJ weaving + to avoid Oracle DataSource class errors diff --git a/components/java/racm/src/main/resources/META-INF/aop.xml b/components/java/racm/src/main/resources/META-INF/aop.xml index 33364e5..1376eb3 100644 --- a/components/java/racm/src/main/resources/META-INF/aop.xml +++ b/components/java/racm/src/main/resources/META-INF/aop.xml @@ -6,6 +6,7 @@ + From 995f66a32c50c01d327d13a557b752ad34c1367c Mon Sep 17 00:00:00 2001 From: Gerard Lemson Date: Tue, 3 Mar 2026 08:46:46 -0500 Subject: [PATCH 2/3] Add local development setup for RACM debugging Add documentation and configuration changes to support running RACM locally via Spring Boot embedded Tomcat for development and debugging. - Add RACM README.md with local setup, build, and Eclipse instructions - Exclude spring-boot-starter-logging globally to prevent log4j bridge conflicts - Exclude org.springframework.boot.jdbc from AspectJ weaving (Oracle classes) - Add .gitignore entries for Eclipse artifacts, AspectJ dumps, and RACM lib/ - Add racm .gitignore for lib/ and WebContent/WEB-INF/classes/ Co-Authored-By: Claude Opus 4.6 --- .gitignore | 4 + components/java/build.gradle | 2 + components/java/racm/.gitignore | 2 + components/java/racm/CLAUDE.md | 39 ++++++++ components/java/racm/README.md | 90 +++++++++++++++++++ .../racm/src/main/resources/META-INF/aop.xml | 1 + 6 files changed, 138 insertions(+) create mode 100644 components/java/racm/.gitignore create mode 100644 components/java/racm/CLAUDE.md create mode 100644 components/java/racm/README.md diff --git a/.gitignore b/.gitignore index 03bd3b2..4c6e882 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,11 @@ docs/_build/ .idea .project .classpath +.settings/ +bin/ +*.bak .gradle +ajcore.*.txt **/WebContent/WEB-INF/application.properties **/WebContent/WEB-INF/version diff --git a/components/java/build.gradle b/components/java/build.gradle index 66e7d46..961b667 100644 --- a/components/java/build.gradle +++ b/components/java/build.gradle @@ -11,4 +11,6 @@ subprojects { maxWarnings 0 showViolations false } + + } diff --git a/components/java/racm/.gitignore b/components/java/racm/.gitignore new file mode 100644 index 0000000..ab81501 --- /dev/null +++ b/components/java/racm/.gitignore @@ -0,0 +1,2 @@ +/lib/ +/WebContent/WEB-INF/classes/ diff --git a/components/java/racm/CLAUDE.md b/components/java/racm/CLAUDE.md new file mode 100644 index 0000000..45d0bab --- /dev/null +++ b/components/java/racm/CLAUDE.md @@ -0,0 +1,39 @@ +# RACM Component + +## Code Style +- Java 17 project +- ALWAYS use Gradle for package dependencies and managing the environment +- Always use SIMPLEST code and structure, don't over-engineer +- Don't create unnecessary files. When creating new version of a file, archive or delete the legacy file +- DO NOT ADD UNNECESSARY FEATURES! Keep code simple + +## Building +- Gradle root is at `components/java/` (where `settings.gradle` lives) +- Build racm and deps: `cd components/java && ./gradlew :racm:modelJar && ./gradlew :racm:build` +- Root `build.gradle` excludes `spring-boot-starter-logging` globally to avoid log4j bridge conflicts + +## Eclipse Setup +- Import as Gradle project from `components/java/` — creates separate projects per subproject +- Buildship prefs `connection.project.dir` must point to the Gradle root (`..` for depth-1, `../..` for depth-2 subprojects) +- Do NOT use the legacy flat `.classpath` at root (renamed to `.classpath.bak`) + +## Debugging in Eclipse +- Run/debug `org.sciserver.springapp.RACMApplication` as Java Application +- Requires two `-javaagent` VM arguments in Debug Configuration: + - `-javaagent:/aspectjweaver-1.9.22.1.jar` (AspectJ load-time weaving, found in Gradle cache) + - `-javaagent:/spring-instrument-5.3.31.jar` (Spring classloader instrumentation, stored in `racm/lib/`) +- The `lib/` folder is gitignored and holds JARs needed only for local Eclipse debugging +- Without these agents, `@EnableLoadTimeWeaving` and EclipseLink entity enhancement will fail + +## Configuration +- `application.properties` consolidates all config for local development (server, login, admin, DB, URLs, etc.) +- `jpa-config.properties` is loaded separately by EclipseLink via `RACMDatabaseConfiguration` +- `persistence.xml` lists all JPA entity classes +- In production, Helm generates `racm-application.yaml` with all config (see `helm/sciserver/files/racm-application.yaml`) + +## Key Architecture +- Spring Boot 2.7.18 with EclipseLink JPA (not Hibernate) +- AspectJ for `@Transactional` support (`AdviceMode.ASPECTJ`) +- SQL Server database +- Auth: header, cookie, and query param filters via Spring Security +- Depends on: `springutils:logging-interceptor`, `springutils:authenticator`, `clients:auth` diff --git a/components/java/racm/README.md b/components/java/racm/README.md new file mode 100644 index 0000000..60385a8 --- /dev/null +++ b/components/java/racm/README.md @@ -0,0 +1,90 @@ +# RACM - Resource Access Control Manager + +RACM is the central authorization and resource management service for SciServer. +It manages users, groups, resources, access control, compute jobs, and storage. + +## Building + +```sh +cd components/java +./gradlew :racm:modelJar && ./gradlew :racm:build +``` + +## Running Locally + +RACM can be run locally via the Spring Boot main class +`org.sciserver.springapp.RACMApplication`. This starts an embedded Tomcat server +without needing an external servlet container. + +### Prerequisites + +- Java 17 JDK +- SQL Server with a `racm` database +- Two Java agent JARs (required by AspectJ load-time weaving and EclipseLink): + - `aspectjweaver-1.9.22.1.jar` (available in Gradle cache after building) + - `spring-instrument-5.3.31.jar` (download from Maven Central, store in `racm/lib/` which is gitignored) + +### Configuration + +Create `src/main/resources/application.properties` (gitignored) with your local +configuration. Use `helm/sciserver/files/racm-application.yaml` as a reference +for all available properties. At minimum you need: + +```properties +spring.application.name=racm +server.servlet.context-path=/racm +spring.mvc.pathmatch.matching-strategy=ant-path-matcher + +spring.datasource.url=jdbc:sqlserver://localhost;DatabaseName=RACM +spring.datasource.username=racm_user +spring.datasource.password= + +spring.mvc.view.prefix=/WEB-INF/jsp/ +spring.mvc.view.suffix=.jsp +spring.main.allow-circular-references=true +spring.flyway.enabled=false + +eclipselink.logging.level=WARNING + +org.sciserver.racm.login.loginPortalUrl=http://localhost:8080/login-portal/ +org.sciserver.racm.login.login-admin.username=admin +org.sciserver.racm.login.login-admin.password= + +org.sciserver.racm.admin.username=__racm__ +org.sciserver.racm.admin.password= +org.sciserver.racm.admin.email=racm@do.not.send +``` + +### JVM Arguments + +Both Java agents must be passed as VM arguments when launching: + +``` +-javaagent:/aspectjweaver-1.9.22.1.jar +-javaagent:/racm/lib/spring-instrument-5.3.31.jar +``` + +Without these, `@EnableLoadTimeWeaving` and EclipseLink entity enhancement will +fail on startup. + +### Verifying + +The app starts on `http://localhost:8080/racm/`. Example endpoints: +- `GET /racm/ugm/rest/publicgroups` — list public groups +- `GET /racm/actuator/health` — health check + +### Eclipse Setup + +To debug in Eclipse: + +1. **File > Import > Gradle > Existing Gradle Project**, browse to `components/java/` +2. Right-click `RACMApplication.java` in the `sciserver-java-racm` project > **Debug As > Java Application** +3. In **Run > Debug Configurations > Arguments > VM arguments**, add both `-javaagent` entries above + +## Notes + +- `jpa-config.properties` is loaded separately by EclipseLink via `RACMDatabaseConfiguration` +- External services (Login Portal, File Service, Logging) may not be available + locally — the app will start but those features won't work +- The `aop.xml` excludes `org.springframework.boot.jdbc` from AspectJ weaving + to avoid Oracle DataSource class errors diff --git a/components/java/racm/src/main/resources/META-INF/aop.xml b/components/java/racm/src/main/resources/META-INF/aop.xml index 33364e5..1376eb3 100644 --- a/components/java/racm/src/main/resources/META-INF/aop.xml +++ b/components/java/racm/src/main/resources/META-INF/aop.xml @@ -6,6 +6,7 @@ + From c965322f5d78dd99139f3cc2712dda4b2866a8bf Mon Sep 17 00:00:00 2001 From: Gerard Lemson Date: Tue, 3 Mar 2026 14:44:26 -0500 Subject: [PATCH 3/3] remove artefacts from root build.gradle --- components/java/build.gradle | 8 -------- components/java/racm/CLAUDE.md | 6 +++--- components/java/racm/README.md | 4 ++-- components/java/springutils/build.gradle | 4 +++- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/components/java/build.gradle b/components/java/build.gradle index de7901a..66e7d46 100644 --- a/components/java/build.gradle +++ b/components/java/build.gradle @@ -11,12 +11,4 @@ subprojects { maxWarnings 0 showViolations false } - -<<<<<<< HEAD - -======= - configurations.all { - exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' - } ->>>>>>> 0b12f400a108e534ee6c09a6081216095aa5ccfb } diff --git a/components/java/racm/CLAUDE.md b/components/java/racm/CLAUDE.md index 45d0bab..4111c48 100644 --- a/components/java/racm/CLAUDE.md +++ b/components/java/racm/CLAUDE.md @@ -10,7 +10,7 @@ ## Building - Gradle root is at `components/java/` (where `settings.gradle` lives) - Build racm and deps: `cd components/java && ./gradlew :racm:modelJar && ./gradlew :racm:build` -- Root `build.gradle` excludes `spring-boot-starter-logging` globally to avoid log4j bridge conflicts +- RACM's `build.gradle` excludes `spring-boot-starter-logging` to avoid log4j bridge conflicts ## Eclipse Setup - Import as Gradle project from `components/java/` — creates separate projects per subproject @@ -21,7 +21,7 @@ - Run/debug `org.sciserver.springapp.RACMApplication` as Java Application - Requires two `-javaagent` VM arguments in Debug Configuration: - `-javaagent:/aspectjweaver-1.9.22.1.jar` (AspectJ load-time weaving, found in Gradle cache) - - `-javaagent:/spring-instrument-5.3.31.jar` (Spring classloader instrumentation, stored in `racm/lib/`) + - `-javaagent:/spring-instrument-.jar` (Spring classloader instrumentation, stored in `racm/lib/`; version should match Spring Framework) - The `lib/` folder is gitignored and holds JARs needed only for local Eclipse debugging - Without these agents, `@EnableLoadTimeWeaving` and EclipseLink entity enhancement will fail @@ -32,7 +32,7 @@ - In production, Helm generates `racm-application.yaml` with all config (see `helm/sciserver/files/racm-application.yaml`) ## Key Architecture -- Spring Boot 2.7.18 with EclipseLink JPA (not Hibernate) +- Spring Boot with EclipseLink JPA (not Hibernate) - AspectJ for `@Transactional` support (`AdviceMode.ASPECTJ`) - SQL Server database - Auth: header, cookie, and query param filters via Spring Security diff --git a/components/java/racm/README.md b/components/java/racm/README.md index 60385a8..cabc18d 100644 --- a/components/java/racm/README.md +++ b/components/java/racm/README.md @@ -22,7 +22,7 @@ without needing an external servlet container. - SQL Server with a `racm` database - Two Java agent JARs (required by AspectJ load-time weaving and EclipseLink): - `aspectjweaver-1.9.22.1.jar` (available in Gradle cache after building) - - `spring-instrument-5.3.31.jar` (download from Maven Central, store in `racm/lib/` which is gitignored) + - `spring-instrument.jar` (download from Maven Central, store in `racm/lib/` which is gitignored; version should match the Spring Framework version used by the project) ### Configuration @@ -61,7 +61,7 @@ Both Java agents must be passed as VM arguments when launching: ``` -javaagent:/aspectjweaver-1.9.22.1.jar --javaagent:/racm/lib/spring-instrument-5.3.31.jar +-javaagent:/racm/lib/spring-instrument-.jar ``` Without these, `@EnableLoadTimeWeaving` and EclipseLink entity enhancement will diff --git a/components/java/springutils/build.gradle b/components/java/springutils/build.gradle index c37d812..72cf5a9 100644 --- a/components/java/springutils/build.gradle +++ b/components/java/springutils/build.gradle @@ -10,7 +10,9 @@ subprojects { } dependencies { - api 'org.springframework.boot:spring-boot-starter-web:2.6.6' + api('org.springframework.boot:spring-boot-starter-web:2.6.6') { + exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging' + } implementation 'org.springdoc:springdoc-openapi-ui:1.6.6' api project(':logging') testImplementation 'org.testng:testng:6.14.3'