HTM.java 's dependency is departed

Hi, guys

I tried to compile the project HTM.java and found out that one of its dependency: com.github.johnrengelman.shadow is departed.

Does anyone meet this same problem before?

How do you guys fix that?

If anyone can clearify this then it would be much appreciated!

Thank you!

Hi @maizeng2008,

What OS are you on?

Hi, :smiley: @cogmission

Thank you for reply!

Im building it with MacOS Catalina 10.15

It gave me an error saying

The maven plugin has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the maven-publish plugin instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.4.1/userguide/upgrading_version_5.html#legacy_publication_system_is_deprecated_and_replaced_with_the_publish_plugins

and it is for ‘com.github.johnrengelman.shadow’

Thank you!

Try commenting out line #86 inside the build.gradle file at the project root, then typing

gradle -Pskipbench check

That shadow plugin is only used for cutting a new release and shouldn’t be needed anyway for the build - but just try that, I want to see what happens…

I don’t have com.github.johnrengelman.shadow in my .m2 maven repo so when I issued the “*check” command that class wasn’t searched for…

It will have another error:
Could not find method leftShift() for arguments [build_ezyxyml4a2q05mi0yk0j7jmbc$_run_closure6@55171ba7] on task ‘:runBench’ of type org.gradle.api.DefaultTask

I commented all the lines related with that dependency

Hi, @cogmission

I think I did not comment all lines about jmh out :smiley:

Now it is working but it still gave me a test error

> Task :test

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by org.nustaq.serialization.FSTClazzInfo (file:/Users/zengmai-river/.gradle/caches/modules-2/files-2.1/de.ruedigermoeller/fst/2.45/3cc5cb8d2d2eca5f7af3a623d2fe0fcc395cdec9/fst-2.45.jar) to field java.lang.String.value

WARNING: Please consider reporting this to the maintainers of org.nustaq.serialization.FSTClazzInfo

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

org.numenta.nupic.network.NetworkTest > testRegionHierarchies FAILED

java.lang.OutOfMemoryError at NetworkTest.java:583

654 tests completed, 1 failed

But that’s a good start anyway

Thank you very much!

@maizeng2008,

You have to use JDK 8, and probably an older version of Gradle since it has deprecated the internally used Gradle method “leftShift()”…

You are using JDK9 or above which one of the libraries does not support (org.nustaq…) it.

Continuing the discussion from HTM.java 's dependency is departed:

Hi, @cogmission

I am using JDK 8 currently and after I comment all the dependency of shadowjar, I got it compiled but right now I just have a failed test.

> Task :test

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by org.nustaq.serialization.FSTClazzInfo (file:/Users/zengmai-river/.gradle/caches/modules-2/files-2.1/de.ruedigermoeller/fst/2.45/3cc5cb8d2d2eca5f7af3a623d2fe0fcc395cdec9/fst-2.45.jar) to field java.lang.String.value

WARNING: Please consider reporting this to the maintainers of org.nustaq.serialization.FSTClazzInfo

WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations

WARNING: All illegal access operations will be denied in a future release

org.numenta.nupic.network.NetworkTest > testRegionHierarchies FAILED

java.lang.OutOfMemoryError at NetworkTest.java:583

654 tests completed, 1 failed

Do you have any idea about that?

Thank you!

Hi @maizeng2008 - The above indicates that you are using a Java version (most likely) that is denying reflective access which may have changed in a different Java version.

Tell me more about your environment, because there is something different in your environment.

My java version is

java version “1.8.0_144”

Java™ SE Runtime Environment (build 1.8.0_144-b01)

Java HotSpot™ 64-Bit Server VM (build 25.144-b01, mixed mode)

Hi, @cogmission

Thank you for all your help!

but what I got wrong is from the test:

NetworkTest.java

and it tells me

org.numenta.nupic.network.NetworkTest > testRegionHierarchies FAILED
java.lang.OutOfMemoryError at NetworkTest.java:583

My java version is

java version “1.8.0_144”

Java™ SE Runtime Environment (build 1.8.0_144-b01)

Java HotSpot™ 64-Bit Server VM (build 25.144-b01, mixed mode)

Found out the error code is like this
java.lang.OutOfMemoryError: Java heap space
at java.lang.reflect.Array.multiNewArray(Native Method)
at java.lang.reflect.Array.newInstance(Array.java:111)
at org.numenta.nupic.util.SparseBinaryMatrix.(SparseBinaryMatrix.java:64)
at org.numenta.nupic.util.SparseBinaryMatrix.(SparseBinaryMatrix.java:50)
at org.numenta.nupic.algorithms.SpatialPooler.initMatrices(SpatialPooler.java:122)
at org.numenta.nupic.algorithms.SpatialPooler.init(SpatialPooler.java:84)
at org.numenta.nupic.network.Layer.close(Layer.java:542)
at org.numenta.nupic.network.Region.close(Region.java:199)
at org.numenta.nupic.network.Region.observe(Region.java:315)
at org.numenta.nupic.network.Network.observe(Network.java:535)
at org.numenta.nupic.network.NetworkTest.testRegionHierarchies(NetworkTest.java:583)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62)

Hi @maizeng2008,

I will think on it and contact you tomorrow - if I come up with something…