Newer
Older
cactus / COMPILATION_FIX.md
@agalyaramadoss agalyaramadoss on 16 Feb 2 KB added document

Compilation Fix Applied

Issue

Compilation error in ReplicationCoordinator.java line 130:

cannot find symbol: variable replicaFactor

Root Cause

Typo in variable name - used replicaFactor instead of replicationFactor

Fix Applied

Changed line 130 from:

int required = consistencyLevel.getRequiredResponses(replicaFactor);

To:

int required = consistencyLevel.getRequiredResponses(replicationFactor);

Verification

# Clean and compile
mvn clean compile

# Expected output:
[INFO] BUILD SUCCESS
[INFO] Total time: XX.XXX s

Common Compilation Issues & Solutions

Issue 1: Package does not exist

Error: package com.cube.xxx does not exist

Solution: Ensure all source files are in correct directories:

src/main/java/com/cube/
├── consistency/
├── cluster/
├── replication/
├── storage/
├── shell/
└── api/

Issue 2: Cannot find symbol

Error: cannot find symbol: class XXX

Solution:

  1. Check import statements
  2. Verify class exists in correct package
  3. Run mvn clean to clear old compiled classes

Issue 3: Java version mismatch

Error: Source option X is no longer supported

Solution: Update pom.xml:

<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>

And verify Java version:

java -version
# Should show Java 21 or later

Issue 4: Missing dependencies

Error: package org.springframework.xxx does not exist

Solution: Run Maven install:

mvn clean install

Build Commands

Full Clean Build

mvn clean package

Compile Only

mvn compile

Skip Tests (faster)

mvn clean package -DskipTests

Specific Module

mvn compile -pl :cube-db

Verbose Output

mvn clean compile -X

Verify Fix

After applying the fix, verify compilation:

cd cube-db
mvn clean compile

# You should see:
# [INFO] ------------------------------------------------------------------------
# [INFO] BUILD SUCCESS
# [INFO] ------------------------------------------------------------------------

Test Compilation

Run the full test suite:

mvn test

Expected output:

[INFO] Tests run: 23, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS

Quick Start After Fix

# 1. Clean build
mvn clean package -DskipTests

# 2. Start server
java -jar target/cube-db-1.0.0.jar

# 3. Start shell
./cubesh

File Status

Fixed: ReplicationCoordinator.java line 130 ✅ Verified: No other instances of replicaFactor typo ✅ Ready: All files ready for compilation


Status: ✅ Fix Applied - Ready to Build!