On 25/10/2021 15:47, Martynas Jusevičius wrote:
JenaSystem.init() called from ServletContextListener in webapp.

There might be a possibility I messed up the versions somehow, but
just cannot see where...

NoSuchFieldError for RDFFormat.SHACLC means wrong jar at runtime (3.16.0 or earlier) because it was there to compile.

The post 3.17.0 fixes are for a different error (class initailization cycle leading to NPE and ExceptionInInitializerError -- not NoSuchFieldError.

    Andy


I also happened to hit
https://issues.apache.org/jira/browse/JENA-2018, so I guess I need to
get it together and upgrade to 4.2.0.

On Mon, Oct 25, 2021 at 3:57 PM Andy Seaborne <[email protected]> wrote:

Possibly because the app touched SHACLC directly or indirectly before
JenaSystem.init.

Where is JenaSystem.init triggerd from?

try JenaSystem.DEBUG_INIT = true;

before any Jena code.

On 25/10/2021 12:26, Martynas Jusevičius wrote:
Hi,

Any suggestions as to why I'm getting this error after upgrading from
3.16.0 to 3.17.?

There were later changes that might be related - try 4.2.0

      Andy


          java.lang.NoSuchFieldError: SHACLC
                  at org.apache.jena.shacl.compact.SHACLC.init(SHACLC.java:43)
                  at 
org.apache.jena.shacl.sys.InitShacl.start(InitShacl.java:30)
                  at
org.apache.jena.sys.JenaSystem.lambda$init$2(JenaSystem.java:117)
                  at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
                  at org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:192)
                  at org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:169)
                  at org.apache.jena.sys.JenaSystem.init(JenaSystem.java:115)

I know this usually has to do with clashing JAR versions, but as far
as I can see all the Jena dependencies are 3.17.0:

[INFO] com.atomgraph:processor:jar:3.10.20-SNAPSHOT
[INFO] +- junit:junit:jar:4.13.1:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- jakarta.servlet:jakarta.servlet-api:jar:4.0.3:provided
[INFO] +- com.atomgraph:twirl:jar:1.0.22-SNAPSHOT:compile
[INFO] |  +- org.apache.jena:jena-arq:jar:3.17.0:compile
[INFO] |  |  +- org.apache.jena:jena-core:jar:3.17.0:compile
[INFO] |  |  |  +- org.apache.jena:jena-base:jar:3.17.0:compile
[INFO] |  |  |  |  +- org.apache.jena:jena-shaded-guava:jar:3.17.0:compile
[INFO] |  |  |  |  +- org.apache.commons:commons-csv:jar:1.8:compile
[INFO] |  |  |  |  +- commons-codec:commons-codec:jar:1.15:compile
[INFO] |  |  |  |  +- org.apache.commons:commons-compress:jar:1.20:compile
[INFO] |  |  |  |  \- com.github.andrewoma.dexx:collection:jar:0.7:compile
[INFO] |  |  |  +- org.apache.jena:jena-iri:jar:3.17.0:compile
[INFO] |  |  |  \- commons-cli:commons-cli:jar:1.4:compile
[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] |  |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.13:compile
[INFO] |  |  +- com.github.jsonld-java:jsonld-java:jar:0.13.2:compile
[INFO] |  |  |  \- commons-io:commons-io:jar:2.8.0:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-core:jar:2.11.3:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.11.3:compile
[INFO] |  |  |  \-
com.fasterxml.jackson.core:jackson-annotations:jar:2.11.3:compile
[INFO] |  |  +- org.apache.httpcomponents:httpclient-cache:jar:4.5.13:compile
[INFO] |  |  +- org.apache.thrift:libthrift:jar:0.13.0:compile
[INFO] |  |  |  \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] |  |  \- org.apache.commons:commons-lang3:jar:3.11:compile
[INFO] |  \- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] |     +- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] |     \- log4j:log4j:jar:1.2.17:compile
[INFO] +- com.atomgraph:core:jar:3.0.18-SNAPSHOT:compile
[INFO] |  +- 
org.glassfish.jersey.containers:jersey-container-servlet:jar:2.30.1:compile
[INFO] |  |  +-
org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.30.1:compile
[INFO] |  |  +- org.glassfish.jersey.core:jersey-common:jar:2.30.1:compile
[INFO] |  |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  |  +- org.glassfish.hk2:osgi-resource-locator:jar:1.0.3:compile
[INFO] |  |  |  \- com.sun.activation:jakarta.activation:jar:1.2.1:compile
[INFO] |  |  +- org.glassfish.jersey.core:jersey-server:jar:2.30.1:compile
[INFO] |  |  |  +-
org.glassfish.jersey.media:jersey-media-jaxb:jar:2.30.1:compile
[INFO] |  |  |  +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] |  |  |  \- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] |  |  |     \-
jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] |  |  \- jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6:compile
[INFO] |  +- org.glassfish.jersey.core:jersey-client:jar:2.30.1:compile
[INFO] |  |  \- org.glassfish.hk2.external:jakarta.inject:jar:2.6.1:compile
[INFO] |  +- org.glassfish.jersey.inject:jersey-hk2:jar:2.30.1:compile
[INFO] |  |  +- org.glassfish.hk2:hk2-locator:jar:2.6.1:compile
[INFO] |  |  |  +-
org.glassfish.hk2.external:aopalliance-repackaged:jar:2.6.1:compile
[INFO] |  |  |  +- org.glassfish.hk2:hk2-api:jar:2.6.1:compile
[INFO] |  |  |  \- org.glassfish.hk2:hk2-utils:jar:2.6.1:compile
[INFO] |  |  \- org.javassist:javassist:jar:3.25.0-GA:compile
[INFO] |  \- org.slf4j:jcl-over-slf4j:jar:1.6.4:compile
[INFO] \- org.apache.jena:jena-shacl:jar:3.17.0:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.902 s
[INFO] Finished at: 2021-10-25T13:14:08+02:00
[INFO] ------------------------------------------------------------------------

Thanks,

Martynas

Reply via email to