Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can manually run project but not in VS Code due to an ambiguous failure to compile #1496

Open
ryanswech opened this issue Jul 2, 2024 · 4 comments
Assignees

Comments

@ryanswech
Copy link

ryanswech commented Jul 2, 2024

As of last Friday morning (2024-06-28) I can no longer run my project through VS Code. No change to the project occurred between the last time I ran it this way and these issues.

A few of my classes (it seems to be specifically automatically generate classes from JOOQ) are randomly marked with the following error at the very top of the file (ie. the error indicator doesn't seem to be linked to any part of the code):

Internal compiler error: java.lang.RuntimeException: Internal Error compiling /myapp/target/generated-sources/db/mydb/com/myapp/mydb/tables/Comm.java at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:151)

If I manually compile and run my code ("mvn install", "java -jar -Dspring.profiles.active=local target/myapp-0.0.1-SNAPSHOT.jar") there are no compilation errors and everything works as expected.

When I try to run my application through VS Code it fails because of missing classes on the class path (java.lang.ClassNotFoundException: com.myapp.mydb.tables.records.SomeClassRecord). When I go look in the target folder, those classes are indeed missing but one of the Java extensions seems to be the culprit.

If I manually compile ("mvn compile") the application, the classes get compiled and added to the classes folder by maven. However, when I run it in VS Code the extensions seem to recompile the project (the target folder seems to get cleared out) and fails to re-add the classes, presumably because of the error described above.

I have attached what I believe to be the relevant part of the log but if you need additional logs I am happy to include them.

Environment
  • Operating System: Windows 10.0.19045.4529
  • JDK version: 18.0.1.1
  • Visual Studio Code version: 1.90.2
  • Java extension version: 0.23.7 (java-dependency, not sure if that is the extension you mean)
  • Java Debugger extension version: 0.58.0
Steps To Reproduce

Sorry, I am not sure how to describe the reproduction of the issue in a project agnostic way since I don't understand it and I can't really give you my entire project.

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-07-02 11:16:24.601
!MESSAGE Reconciled 1. Took 94 ms

!ENTRY org.eclipse.jdt.core 4 4 2024-07-02 11:16:25.316
!MESSAGE Exception occurred during problem detection:
----------------------------------- SOURCE BEGIN -------------------------------------
/*
 * This file is generated by jOOQ.
 */
package com.myapp.mydb.tables;


import com.myapp.mydb.MyDb;
import com.myapp.mydb.Keys;
import com.myapp.mydb.tables.records.CommRecord;

import java.util.function.Function;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Function8;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Records;
import org.jooq.Row8;
import org.jooq.Schema;
import org.jooq.SelectField;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Comm extends TableImpl<CommRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>mydb.comm</code>
     */
    public static final Comm COMM = new Comm();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<CommRecord> getRecordType() {
        return CommRecord.class;
    }

    /**
     * The column <code>mydb.comm.id</code>.
     */
    public final TableField<CommRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.port</code>.
     */
    public final TableField<CommRecord, Integer> PORT = createField(DSL.name("port"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.status</code>.
     */
    public final TableField<CommRecord, Byte> STATUS = createField(DSL.name("status"), SQLDataType.TINYINT.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.load_id</code>.
     */
    public final TableField<CommRecord, Integer> LOAD_ID = createField(DSL.name("load_id"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.start</code>.
     */
    public final TableField<CommRecord, Byte> START = createField(DSL.name("start"), SQLDataType.TINYINT.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.ks_pkcs12</code>.
     */
    public final TableField<CommRecord, byte[]> KS_PKCS12 = createField(DSL.name("ks_pkcs12"), SQLDataType.BLOB.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.ks_psw_enc</code>.
     */
    public final TableField<CommRecord, String> KS_PSW_ENC = createField(DSL.name("ks_psw_enc"), SQLDataType.VARCHAR(64).nullable(false), this, "");

    /**
     * The column <code>mydb.comm.ks_alias</code>.
     */
    public final TableField<CommRecord, String> KS_ALIAS = createField(DSL.name("ks_alias"), SQLDataType.VARCHAR(16).nullable(false), this, "");

    private Comm(Name alias, Table<CommRecord> aliased) {
        this(alias, aliased, null);
    }

    private Comm(Name alias, Table<CommRecord> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
    }

    /**
     * Create an aliased <code>mydb.comm</code> table reference
     */
    public Comm(String alias) {
        this(DSL.name(alias), COMM);
    }

    /**
     * Create an aliased <code>mydb.comm</code> table reference
     */
    public Comm(Name alias) {
        this(alias, COMM);
    }

    /**
     * Create a <code>mydb.comm</code> table reference
     */
    public Comm() {
        this(DSL.name("comm"), null);
    }

    public <O extends Record> Comm(Table<O> child, ForeignKey<O, CommRecord> key) {
        super(child, key, COMM);
    }

    @Override
    public Schema getSchema() {
        return aliased() ? null : MyDb.MYDB;
    }

    @Override
    public UniqueKey<CommRecord> getPrimaryKey() {
        return Keys.KEY_COMM_PRIMARY;
    }

    @Override
    public Comm as(String alias) {
        return new Comm(DSL.name(alias), this);
    }

    @Override
    public Comm as(Name alias) {
        return new Comm(alias, this);
    }

    @Override
    public Comm as(Table<?> alias) {
        return new Comm(alias.getQualifiedName(), this);
    }

    /**
     * Rename this table
     */
    @Override
    public Comm rename(String name) {
        return new Comm(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public Comm rename(Name name) {
        return new Comm(name, null);
    }

    /**
     * Rename this table
     */
    @Override
    public Comm rename(Table<?> name) {
        return new Comm(name.getQualifiedName(), null);
    }

    // -------------------------------------------------------------------------
    // Row8 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row8<Integer, Integer, Byte, Integer, Byte, byte[], String, String> fieldsRow() {
        return (Row8) super.fieldsRow();
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
     */
    public <U> SelectField<U> mapping(Function8<? super Integer, ? super Integer, ? super Byte, ? super Integer, ? super Byte, ? super byte[], ? super String, ? super String, ? extends U> from) {
        return convertFrom(Records.mapping(from));
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Class,
     * Function)}.
     */
    public <U> SelectField<U> mapping(Class<U> toType, Function8<? super Integer, ? super Integer, ? super Byte, ? super Integer, ? super Byte, ? super byte[], ? super String, ? super String, ? extends U> from) {
        return convertFrom(toType, Records.mapping(from));
    }
}

----------------------------------- SOURCE END -------------------------------------
!STACK 0
java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding (org.eclipse.jdt.internal.compiler.lookup.ArrayBinding and org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @58654294)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:547)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:530)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.TypeBinding.upwardsProjection(TypeBinding.java:325)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.deriveTypeArgumentConstraints(BoundSet.java:974)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:630)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:511)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.resolve(InferenceContext18.java:1215)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1052)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1035)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod18(ParameterizedGenericMethodBinding.java:256)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:92)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:842)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:799)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod0(Scope.java:1753)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1655)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:3145)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:1138)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:914)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:866)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:362)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:713)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:409)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:611)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1514)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:1068)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:1110)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:280)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:346)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:186)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:92)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:739)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:804)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1303)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:332)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:295)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler$PublishDiagnosticJob.run(BaseDocumentLifeCycleHandler.java:777)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.core.resources 4 2 2024-07-02 11:16:25.562
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
java.lang.RuntimeException: Internal Error compiling /myapp/target/generated-sources/db/mydb/com/myapp/mydb/tables/Comm.java
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:151)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding (org.eclipse.jdt.internal.compiler.lookup.ArrayBinding and org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @58654294)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:547)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:530)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.TypeBinding.upwardsProjection(TypeBinding.java:325)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.deriveTypeArgumentConstraints(BoundSet.java:974)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:630)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:511)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.resolve(InferenceContext18.java:1215)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1052)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1035)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod18(ParameterizedGenericMethodBinding.java:256)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:92)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:842)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:799)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod0(Scope.java:1753)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1655)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:3145)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:1138)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:914)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:866)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:362)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:713)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:409)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:611)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1514)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:904)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:147)
	... 1 more

!ENTRY org.eclipse.jdt.ls.core 1 0 2024-07-02 11:16:26.011
!MESSAGE Reconciled 1. Took 3 ms

!ENTRY org.eclipse.jdt.core 4 4 2024-07-02 11:16:26.701
!MESSAGE Exception occurred during problem detection:
----------------------------------- SOURCE BEGIN -------------------------------------
/*
 * This file is generated by jOOQ.
 */
package com.myapp.mydb.tables;


import com.myapp.mydb.MyDb;
import com.myapp.mydb.Keys;
import com.myapp.mydb.tables.records.CommRecord;

import java.util.function.Function;

import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Function8;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Records;
import org.jooq.Row8;
import org.jooq.Schema;
import org.jooq.SelectField;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Comm extends TableImpl<CommRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>mydb.comm</code>
     */
    public static final Comm COMM = new Comm();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<CommRecord> getRecordType() {
        return CommRecord.class;
    }

    /**
     * The column <code>mydb.comm.id</code>.
     */
    public final TableField<CommRecord, Integer> ID = createField(DSL.name("id"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.port</code>.
     */
    public final TableField<CommRecord, Integer> PORT = createField(DSL.name("port"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.status</code>.
     */
    public final TableField<CommRecord, Byte> STATUS = createField(DSL.name("status"), SQLDataType.TINYINT.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.load_id</code>.
     */
    public final TableField<CommRecord, Integer> LOAD_ID = createField(DSL.name("load_id"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.start</code>.
     */
    public final TableField<CommRecord, Byte> START = createField(DSL.name("start"), SQLDataType.TINYINT.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.ks_pkcs12</code>.
     */
    public final TableField<CommRecord, byte[]> KS_PKCS12 = createField(DSL.name("ks_pkcs12"), SQLDataType.BLOB.nullable(false), this, "");

    /**
     * The column <code>mydb.comm.ks_psw_enc</code>.
     */
    public final TableField<CommRecord, String> KS_PSW_ENC = createField(DSL.name("ks_psw_enc"), SQLDataType.VARCHAR(64).nullable(false), this, "");

    /**
     * The column <code>mydb.comm.ks_alias</code>.
     */
    public final TableField<CommRecord, String> KS_ALIAS = createField(DSL.name("ks_alias"), SQLDataType.VARCHAR(16).nullable(false), this, "");

    private Comm(Name alias, Table<CommRecord> aliased) {
        this(alias, aliased, null);
    }

    private Comm(Name alias, Table<CommRecord> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table());
    }

    /**
     * Create an aliased <code>mydb.comm</code> table reference
     */
    public Comm(String alias) {
        this(DSL.name(alias), COMM);
    }

    /**
     * Create an aliased <code>mydb.comm</code> table reference
     */
    public Comm(Name alias) {
        this(alias, COMM);
    }

    /**
     * Create a <code>mydb.comm</code> table reference
     */
    public Comm() {
        this(DSL.name("comm"), null);
    }

    public <O extends Record> Comm(Table<O> child, ForeignKey<O, CommRecord> key) {
        super(child, key, COMM);
    }

    @Override
    public Schema getSchema() {
        return aliased() ? null : MyDb.MYDB;
    }

    @Override
    public UniqueKey<CommRecord> getPrimaryKey() {
        return Keys.KEY_COMM_PRIMARY;
    }

    @Override
    public Comm as(String alias) {
        return new Comm(DSL.name(alias), this);
    }

    @Override
    public Comm as(Name alias) {
        return new Comm(alias, this);
    }

    @Override
    public Comm as(Table<?> alias) {
        return new Comm(alias.getQualifiedName(), this);
    }

    /**
     * Rename this table
     */
    @Override
    public Comm rename(String name) {
        return new Comm(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public Comm rename(Name name) {
        return new Comm(name, null);
    }

    /**
     * Rename this table
     */
    @Override
    public Comm rename(Table<?> name) {
        return new Comm(name.getQualifiedName(), null);
    }

    // -------------------------------------------------------------------------
    // Row8 type methods
    // -------------------------------------------------------------------------

    @Override
    public Row8<Integer, Integer, Byte, Integer, Byte, byte[], String, String> fieldsRow() {
        return (Row8) super.fieldsRow();
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Function)}.
     */
    public <U> SelectField<U> mapping(Function8<? super Integer, ? super Integer, ? super Byte, ? super Integer, ? super Byte, ? super byte[], ? super String, ? super String, ? extends U> from) {
        return convertFrom(Records.mapping(from));
    }

    /**
     * Convenience mapping calling {@link SelectField#convertFrom(Class,
     * Function)}.
     */
    public <U> SelectField<U> mapping(Class<U> toType, Function8<? super Integer, ? super Integer, ? super Byte, ? super Integer, ? super Byte, ? super byte[], ? super String, ? super String, ? extends U> from) {
        return convertFrom(toType, Records.mapping(from));
    }
}

----------------------------------- SOURCE END -------------------------------------
!STACK 0
java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding (org.eclipse.jdt.internal.compiler.lookup.ArrayBinding and org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @58654294)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:547)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:530)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.TypeBinding.upwardsProjection(TypeBinding.java:325)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.deriveTypeArgumentConstraints(BoundSet.java:974)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:630)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:511)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.resolve(InferenceContext18.java:1215)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1052)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1035)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod18(ParameterizedGenericMethodBinding.java:256)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:92)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:842)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:799)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod0(Scope.java:1753)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1655)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:3145)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:1138)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:914)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:866)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:362)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:713)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:409)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:611)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1514)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:1068)
	at org.eclipse.jdt.internal.compiler.Compiler.resolve(Compiler.java:1110)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:280)
	at org.eclipse.jdt.internal.core.CompilationUnitProblemFinder.process(CompilationUnitProblemFinder.java:346)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.makeConsistent(ReconcileWorkingCopyOperation.java:186)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:92)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:739)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:804)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1303)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:332)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:295)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler$PublishDiagnosticJob.run(BaseDocumentLifeCycleHandler.java:777)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.jdt.ls.core 4 0 2024-07-02 11:16:29.695
!MESSAGE Failed to build projects.
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Errors occurred during the build.
	at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:612)
	at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:491)
	at org.eclipse.jdt.ls.core.internal.handlers.BuildWorkspaceHandler.buildProjects(BuildWorkspaceHandler.java:116)
	at com.microsoft.java.debug.plugin.internal.Compile.compile(Compile.java:100)
	at com.microsoft.java.debug.plugin.internal.JavaDebugDelegateCommandHandler.executeCommand(JavaDebugDelegateCommandHandler.java:72)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:604)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Contains: Errors running builder 'Java Builder' on project 'myapp'.
java.lang.RuntimeException: Internal Error compiling /myapp/target/generated-sources/db/mydb/com/myapp/mydb/tables/Comm.java
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:151)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding (org.eclipse.jdt.internal.compiler.lookup.ArrayBinding and org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @58654294)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:547)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:530)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.TypeBinding.upwardsProjection(TypeBinding.java:325)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.deriveTypeArgumentConstraints(BoundSet.java:974)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:630)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:511)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.resolve(InferenceContext18.java:1215)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1052)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1035)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod18(ParameterizedGenericMethodBinding.java:256)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:92)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:842)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:799)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod0(Scope.java:1753)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1655)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:3145)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:1138)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:914)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:866)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:362)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:713)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:409)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:611)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1514)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:904)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:147)
	... 1 more
!SUBENTRY 1 org.eclipse.core.resources 4 75 2024-07-02 11:16:29.695
!MESSAGE Errors occurred during the build.
!SUBENTRY 2 org.eclipse.jdt.core 4 75 2024-07-02 11:16:29.695
!MESSAGE Errors running builder 'Java Builder' on project 'myapp'.
!STACK 0
java.lang.RuntimeException: Internal Error compiling /myapp/target/generated-sources/db/mydb/com/myapp/mydb/tables/Comm.java
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:151)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class org.eclipse.jdt.internal.compiler.lookup.ArrayBinding cannot be cast to class org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding (org.eclipse.jdt.internal.compiler.lookup.ArrayBinding and org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @58654294)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:547)
	at org.eclipse.jdt.internal.compiler.lookup.CaptureBinding.downwardsProjection(CaptureBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:530)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.upwardsProjection(ParameterizedTypeBinding.java:1)
	at org.eclipse.jdt.internal.compiler.lookup.TypeBinding.upwardsProjection(TypeBinding.java:325)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.deriveTypeArgumentConstraints(BoundSet.java:974)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:630)
	at org.eclipse.jdt.internal.compiler.lookup.BoundSet.incorporate(BoundSet.java:511)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.resolve(InferenceContext18.java:1215)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1052)
	at org.eclipse.jdt.internal.compiler.lookup.InferenceContext18.solve(InferenceContext18.java:1035)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod18(ParameterizedGenericMethodBinding.java:256)
	at org.eclipse.jdt.internal.compiler.lookup.ParameterizedGenericMethodBinding.computeCompatibleMethod(ParameterizedGenericMethodBinding.java:92)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:842)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.computeCompatibleMethod(Scope.java:799)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod0(Scope.java:1753)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.findMethod(Scope.java:1655)
	at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:3145)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.findMethodBinding(MessageSend.java:1138)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:914)
	at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:866)
	at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.resolve(ReturnStatement.java:362)
	at org.eclipse.jdt.internal.compiler.ast.Statement.resolveWithBindings(Statement.java:498)
	at org.eclipse.jdt.internal.compiler.ast.ASTNode.resolveStatements(ASTNode.java:725)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:713)
	at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:409)
	at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:611)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1514)
	at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:1643)
	at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:666)
	at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:904)
	at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:147)
	... 1 more
Current Result

Failure to compile and therefore run a project that worked previously.

Expected Result

If I can successfully compile and run my project with maven then I should also be able to do it through these extensions or get a specific error about why my project could not be compiled/run.

Additional Informations

I have already tried:

  • Cleaning the Java Language Workspace Server
  • Uninstalling and reinstalling all of the extensions in the "Extension Pack for Java"
  • Restarting VS Code
  • Manually deleting the extensions from %USERPROFILE%.vscode\extensions\ then reinstalling
  • Manually clearing %APPDATA%\Code[ - Variant]\User\workspaceStorage\
@testforstephen
Copy link
Contributor

Can you share a sample snippet, including the necessary dependencies, to help reproduce the issue? It doesn't need to be your entire project—just a minimal sample that includes the relevant code and dependencies to reproduce the problem.

@ryanswech
Copy link
Author

I created a repository here https://github.com/ryanswech/vscode-java-debug-issue-1496. Sorry, its a bit of a mess. I was grabbing bits and pieces trying to figure out what all I needed to get the error to pop up again.

It relies on a MariaDB database (though other SQL databases should also work). The information for that database needs to be added to the following places (there are TODO comments in all the spots):

  • src\main\resources\application-local.yaml
  • pom.xml

The database must have a table named comm. I am not sure if the structure matters but here it is if it does

CREATE TABLE `comm` (
  `id` int(11) NOT NULL,
  `port` int(11) NOT NULL,
  `status` tinyint(4) NOT NULL,
  `load_id` int(11) NOT NULL,
  `start` tinyint(4) NOT NULL,
  `ks_pkcs12` blob NOT NULL,
  `ks_psw_enc` varchar(64) NOT NULL,
  `ks_alias` varchar(16) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci

Obviously, there are other tables in the database. I don't know if they matter I just pointed the sample at my local testing database for when I develop the actual application.

@BPfuelb
Copy link

BPfuelb commented Jul 24, 2024

We have encountered a similar/same problem. Solution was to downgrad the VSCode extension "Language Support for Java(TM) by Red Hat" (https://marketplace.visualstudio.com/items?itemName=redhat.java) to Version 1.31.0 (https://github.com/redhat-developer/vscode-java/releases/tag/v1.31.0).

This post confirms the same solution: redhat-developer/vscode-java#3700.

However, the compiler problem is related to tables that contain BLOBs.

@alexcormier
Copy link

We also ran into this; I submitted an issue to the compiler repo: eclipse-jdt/eclipse.jdt.core#2817.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants