question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot get it working - error: cannot find symbol

See original GitHub issue

Hello,

I’m really glad I’ve discovered this amazing project, but I’m running into a weird error with manifold and I cannot get it working at all. The project is a multi-module Gradle setup and I’m using manifold version 2022.1.9

TestCsv.csv

a  ,b  ,c
bla,bli,blub
    @Test
    void calculate() {
        TestCsv test = TestCsv.fromSource();

        for (TestCsv.TestCsvItem testCsvItem : test) {
            System.out.println(testCsvItem.getA__());
        }
    }

root build.gradke

buildscript {
    repositories {
        maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
        maven { url 'https://plugins.gradle.org/m2/' }
    }
    dependencies {
        classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.0'
    }
}


plugins {
    id 'io.spring.dependency-management' version "${springDependencyManagementVersion}"
    id 'systems.manifold.manifold-gradle-plugin' version '0.0.2-alpha'
    id 'org.springframework.boot' version "${springVersion}"
}

subprojects {

    apply plugin: 'java'
    apply plugin: 'idea'
    apply plugin: 'com.adarshr.test-logger'
    apply plugin: 'io.spring.dependency-management'

    sourceCompatibility = '11'
    targetCompatibility = '11'

    compileJava.options.encoding = 'UTF-8'
    compileTestJava.options.encoding = 'UTF-8'

    test {
        useJUnitPlatform()
    }

    tasks.withType(JavaCompile) {
        options.compilerArgs += ['-Xplugin:Manifold']
    }

    dependencies {

        implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        implementation "systems.manifold:manifold-ext:${manifoldVersion}"
        implementation "systems.manifold:manifold-science:${manifoldVersion}"

        testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
        testImplementation "systems.manifold:manifold-ext:${manifoldVersion}"
        testImplementation "systems.manifold:manifold-science:${manifoldVersion}"

        annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
        testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
    }

    configurations {
        all {
            //noinspection GroovyAssignabilityCheck
            exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
        }

        // give tests access to annotationProcessor dependencies
        testImplementation.extendsFrom annotationProcessor
    }

}

Leads to this error

Error compiling Java class: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv

/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:3: error: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv is not abstract and does not override abstract method remove(int) in java.util.List
public class java_util_ArrayList_structuralproxy_test_carbon_TestCsv implements test.carbon.TestCsv {
       ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:16: error: remove(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement remove(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object remove( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:22: error: get(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement get(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object get( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:10: error: name clash: add(java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public boolean add( java.lang.Object p0 ) {
                 ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:13: error: name clash: add(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public void add( int p0, java.lang.Object p1 ) {
              ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:70: error: name clash: set(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and set(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public java.lang.Object set( int p0, java.lang.Object p1 ) {
                          ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:101: error: cannot find symbol
    return (java.util.List)manifold.ext.rt.RuntimeMethods.coerce(_root.getList(), java.util.List.class);
                                                                      ^
  symbol:   method getList()
  location: variable _root of type java.util.ArrayList
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

manifold.internal.javac.JavaCompileIssuesException: Error compiling Java class: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv

/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:3: error: test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv is not abstract and does not override abstract method remove(int) in java.util.List
public class java_util_ArrayList_structuralproxy_test_carbon_TestCsv implements test.carbon.TestCsv {
       ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:16: error: remove(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement remove(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object remove( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:22: error: get(int) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv cannot implement get(int) in manifold.ext.rt.api.IListBacked
  public java.lang.Object get( int p0 ) {
                          ^
  return type java.lang.Object is not compatible with test.carbon.TestCsv.TestCsvItem
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:10: error: name clash: add(java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public boolean add( java.lang.Object p0 ) {
                 ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:13: error: name clash: add(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and add(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public void add( int p0, java.lang.Object p1 ) {
              ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:70: error: name clash: set(int,java.lang.Object) in test.carbon.java_util_ArrayList_structuralproxy_test_carbon_TestCsv and set(int,test.carbon.TestCsv.TestCsvItem) in manifold.ext.rt.api.IListBacked have the same erasure, yet neither overrides the other
  public java.lang.Object set( int p0, java.lang.Object p1 ) {
                          ^
/test/carbon/java_util_ArrayList_structuralproxy_test_carbon_TestCsv.java:101: error: cannot find symbol
    return (java.util.List)manifold.ext.rt.RuntimeMethods.coerce(_root.getList(), java.util.List.class);
                                                                      ^
  symbol:   method getList()
  location: variable _root of type java.util.ArrayList
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

	at manifold.internal.runtime.protocols.ManClassesUrlConnection$LazyByteArrayInputStream.compileProxyClass(ManClassesUrlConnection.java:344)
	at manifold.internal.runtime.protocols.ManClassesUrlConnection$LazyByteArrayInputStream.init(ManClassesUrlConnection.java:247)
	at manifold.internal.runtime.protocols.ManClassesUrlConnection$LazyByteArrayInputStream.read(ManClassesUrlConnection.java:367)
	at java.base/jdk.internal.loader.Resource.getBytes(Resource.java:124)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:797)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:398)
	at manifold.ext.StructuralTypeProxyGenerator.makeProxy(StructuralTypeProxyGenerator.java:65)
	at manifold.ext.DynamicProxyFactory.makeProxyFactory(DynamicProxyFactory.java:58)
	at manifold.ext.rt.RuntimeMethods.createProxy(RuntimeMethods.java:419)
	at manifold.ext.rt.RuntimeMethods.createNewProxy(RuntimeMethods.java:391)
	at manifold.ext.rt.RuntimeMethods.constructProxy(RuntimeMethods.java:67)
	at com.myapplication.test.MyTest.calculate(MyTest.java:19)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:212)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:208)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:137)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:71)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:248)
	at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$5(DefaultLauncher.java:211)
	at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
	at com.sun.proxy.$Proxy2.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
	at java.base/java.lang.Thread.run(Thread.java:834)

Would appreciate any help.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
rsmckinneycommented, Apr 28, 2022

@mklueh Ok, I do have an issue after I built on the command line. Looking at this now.

0reactions
rsmckinneycommented, May 6, 2022

changes work locally, please reopen if your issue persists, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Resolve The Cannot Find Symbol Error in Java - Rollbar
When the Java compiler encounters a use of an identifier which it cannot find in the symbol table, it raises the cannot find...
Read more >
java - What does a "Cannot find symbol" or "Cannot resolve ...
A "Cannot find symbol" error means that the compiler cannot do this. Your code appears to be referring to something that the compiler...
Read more >
What can cause the "cannot find symbol" error in Java?
The “cannot find symbol” error occurs mainly when we try to reference a variable that is not declared in the program which we...
Read more >
"Cannot Find Symbol" compile error - Net-Informations.Com
The "Cannot find symbol" errors generally occur when you try to reference an undeclared variable in your code. A "Cannot find symbol" error...
Read more >
What Causes “Cannot find symbol” Compilation Error in Java?
This is the most common and most occurring reason behind the Java cannot find symbol error. Misspelling an existing variable, class, interface, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found