Skip to content

Instantly share code, notes, and snippets.

@oncomouse
Last active December 23, 2021 15:37
Show Gist options
  • Save oncomouse/3172563c1105f0618e43f8703c87490d to your computer and use it in GitHub Desktop.
Save oncomouse/3172563c1105f0618e43f8703c87490d to your computer and use it in GitHub Desktop.
Patch to run Juxta in 2021

This is a patch to compile and run juxta-services in 2021, which doesn't work otherwise.

You have to run JDK-1.8, as the code does not work with anything newer.

Usage

  1. Clone https://github.com/performant-software/juxta-service and run cd juxta-service
  2. Run curl -so patch.diff https://gist.githubusercontent.com/oncomouse/3172563c1105f0618e43f8703c87490d/raw/0be455e65ef6acd49fba050d5884cf197c468358/patch.diff to download the below patch.diff file.
  3. Run git apply patch.diff
  4. You can then follow the instructions in the original README file included with Juxta.

I make no claims that all of this actually works or that it's usable, but I was able to spin up the server and access the Juxta API.

Changes

  1. Update various pom.xml files to work with modern versions of Maven.
  2. offset is now an invalid key name in MariaDB, so change that to offset_x.
  3. Some of the tests for juxta_ws refuse to run, so we turn off tests for that project.
diff --git a/README b/README
index 6e52f26..b00bc80 100644
--- a/README
+++ b/README
@@ -3,6 +3,8 @@
Juxta Web Service Service (Juxta WS)
===============================================================================
+*In order to run this software in a modern (2021) context, you have to use JDK-1.8.*
+
Synopsis
--------
diff --git a/juxta-diff/pom.xml b/juxta-diff/pom.xml
index d01000d..4bbf84d 100644
--- a/juxta-diff/pom.xml
+++ b/juxta-diff/pom.xml
@@ -68,8 +68,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
diff --git a/juxta-indexer/pom.xml b/juxta-indexer/pom.xml
index 851749d..91544a7 100644
--- a/juxta-indexer/pom.xml
+++ b/juxta-indexer/pom.xml
@@ -44,8 +44,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
diff --git a/juxta-ws/pom.xml b/juxta-ws/pom.xml
index 4ff72f5..c696213 100644
--- a/juxta-ws/pom.xml
+++ b/juxta-ws/pom.xml
@@ -21,13 +21,13 @@
<!-- Organization developing the application -->
<!-- Repositories for resolving dependencies -->
- <repositories>
- <repository>
- <id>maven-restlet</id>
- <name>Public online Restlet repository</name>
- <url>http://maven.restlet.org</url>
- </repository>
- </repositories>
+<repositories>
+ <repository>
+ <id>maven-restlet</id>
+ <name>Public online Restlet repository</name>
+ <url>https://maven.restlet.talend.com</url>
+ </repository>
+</repositories>
<dependencies>
<!-- Support for import of MSWord, OpenOffice & ePub files -->
@@ -41,7 +41,13 @@
<artifactId>tika-parsers</artifactId>
<version>1.3</version>
</dependency>
-
+
+ <!-- <dependency> -->
+ <!-- <groupId>javax.xml.bind</groupId> -->
+ <!-- <artifactId>jaxb-api</artifactId> -->
+ <!-- <version>2.1</version> -->
+ <!-- </dependency> -->
+
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j</artifactId>
@@ -287,9 +293,21 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
+ <executions>
+ <execution>
+ <id>default-testCompile</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </execution>
+ </executions>
</plugin>
<!-- plugin to jar the results and add a manifest that specifies -->
diff --git a/juxta-ws/scripts/create_db.sql b/juxta-ws/scripts/create_db.sql
index 01725ad..122d804 100644
--- a/juxta-ws/scripts/create_db.sql
+++ b/juxta-ws/scripts/create_db.sql
@@ -171,7 +171,7 @@ CREATE TABLE IF NOT EXISTS juxta_note (
CREATE TABLE IF NOT EXISTS juxta_page_mark (
id BIGINT NOT NULL AUTO_INCREMENT,
witness_id BIGINT NOT NULL,
- offset MEDIUMINT UNSIGNED NOT NULL,
+ offset_x MEDIUMINT UNSIGNED NOT NULL,
label TEXT,
mark_type enum('PAGE_BREAK','LINE_NUMBER') not null default 'PAGE_BREAK',
PRIMARY KEY (id),
diff --git a/juxta-ws/src/main/java/org/juxtasoftware/dao/impl/PageMarkDaoImpl.java b/juxta-ws/src/main/java/org/juxtasoftware/dao/impl/PageMarkDaoImpl.java
index 0ecc3eb..1fbe845 100644
--- a/juxta-ws/src/main/java/org/juxtasoftware/dao/impl/PageMarkDaoImpl.java
+++ b/juxta-ws/src/main/java/org/juxtasoftware/dao/impl/PageMarkDaoImpl.java
@@ -24,7 +24,7 @@ public class PageMarkDaoImpl implements PageMarkDao {
return;
}
this.jdbcTemplate.batchUpdate(
- "insert into "+TABLE_NAME+" (witness_id, offset, label, mark_type) values (?,?,?,?)",
+ "insert into "+TABLE_NAME+" (witness_id, offset_x, label, mark_type) values (?,?,?,?)",
new BatchPreparedStatementSetter() {
@Override
@@ -82,13 +82,13 @@ public class PageMarkDaoImpl implements PageMarkDao {
@Override
public List<PageMark> find(final Long witnessId, final PageMark.Type type) {
final StringBuilder sql = new StringBuilder();
- sql.append( "select id,witness_id,offset,label,mark_type");
+ sql.append( "select id,witness_id,offset_x,label,mark_type");
sql.append(" from ").append(TABLE_NAME);
sql.append(" where witness_id=?");
if ( type != null ) {
sql.append(" and mark_type = ?");
}
- sql.append(" order by offset asc");
+ sql.append(" order by offset_x asc");
RowMapper<PageMark> rm = new RowMapper<PageMark>(){
@Override
@@ -96,7 +96,7 @@ public class PageMarkDaoImpl implements PageMarkDao {
PageMark mark = new PageMark();
mark.setId( rs.getLong("id"));
mark.setWitnessId( rs.getLong("witness_id"));
- mark.setOffset( rs.getLong("offset"));
+ mark.setOffset( rs.getLong("offset_x"));
mark.setLabel( rs.getString("label"));
mark.setType( PageMark.Type.valueOf(rs.getString("mark_type")) );
return mark;
diff --git a/juxta-ws/src/main/resources/juxta-ws-mysql-schema.sql b/juxta-ws/src/main/resources/juxta-ws-mysql-schema.sql
index 08dcf99..a3ff9b8 100644
--- a/juxta-ws/src/main/resources/juxta-ws-mysql-schema.sql
+++ b/juxta-ws/src/main/resources/juxta-ws-mysql-schema.sql
@@ -145,7 +145,7 @@ CREATE TABLE IF NOT EXISTS juxta_note (
CREATE TABLE IF NOT EXISTS juxta_page_mark (
id BIGINT NOT NULL AUTO_INCREMENT,
witness_id BIGINT NOT NULL,
- offset MEDIUMINT UNSIGNED NOT NULL,
+ offset_x MEDIUMINT UNSIGNED NOT NULL,
label TEXT,
mark_type enum('PAGE_BREAK','LINE_NUMBER') not null default 'PAGE_BREAK',
PRIMARY KEY (id),
@@ -228,4 +228,4 @@ DROP TABLE text_annotation_link_data;
DROP TABLE text_annotation_link_target;
DROP TABLE text_annotation_link;
DROP TABLE text_annotation_data;
-DROP TABLE text_annotation;
\ No newline at end of file
+DROP TABLE text_annotation;
diff --git a/pom.xml b/pom.xml
index 4a50967..1d45049 100644
--- a/pom.xml
+++ b/pom.xml
@@ -51,18 +51,6 @@
</developer>
</developers>
- <!-- additional maven repos to search -->
- <repositories>
- <repository>
- <id>middell-releases</id>
- <url>http://gregor.middell.net/maven/content/repositories/releases</url>
- </repository>
- <repository>
- <id>interedition-releases</id>
- <url>http://gregor.middell.net/maven/content/repositories/interedition-releases</url>
- </repository>
- </repositories>
-
<!-- external library debendencies -->
<dependencies>
<dependency>
@@ -144,8 +132,9 @@
<dependency>
<groupId>eu.interedition</groupId>
<artifactId>text</artifactId>
- <version>1.0</version>
+ <version>1.1</version>
</dependency>
+
</dependencies>
</dependencyManagement>
@@ -157,8 +146,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
- <source>1.6</source>
- <target>1.6</target>
+ <source>1.7</source>
+ <target>1.7</target>
</configuration>
</plugin>
<plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment