Skip to content
This repository was archived by the owner on Jul 12, 2024. It is now read-only.
This repository was archived by the owner on Jul 12, 2024. It is now read-only.

Unable to convert [C to Neo4j Value #60

@cristalp

Description

@cristalp

Bug Description

In one of my Maven modules, I have a couple of JUnit tests that contain inner classes. Using the embedded Neo4j works, but I followed https://101.jqassistant.org/setting-up-a-team-server/index.html and that's where the build fails.

Using the embedded Neo4j:

[INFO] --- jqassistant-maven-plugin:1.9.1:scan (scan-software) @ util-validation ---
[INFO] Scanning for jQAssistant plugins...
[INFO] [Asciidoc Report, CDI, Common, Core Analysis, Core Report, EJB3, GraphML, GraphQL, JAX-RS, JPA 2, JSON, JUnit, Java, Java EE 6, Maven 2 Repository, Maven 3, OSGi, RDBMS, Spring, TestNG, Tycho, XML, YAML].
[INFO] Connecting to store at 'file:/foo/bar/common/util/target/jqassistant/store/'
[INFO] Initializing embedded Neo4j server 3.x
[INFO] Resetting store.
[INFO] Reset finished (removed 0 nodes, 0 relations).
[INFO] Entering /foo/bar/common/util/util-validation/target/classes
[INFO] Leaving /foo/bar/common/util/util-validation/target/classes (103 entries, 548 ms)
[INFO] Entering /foo/bar/common/util/util-validation/target/test-classes
[INFO] Leaving /foo/bar/common/util/util-validation/target/test-classes (114 entries, 405 ms)
[INFO] Entering /foo/bar/common/util/util-validation/target/surefire-reports
[INFO] Leaving /foo/bar/common/util/util-validation/target/surefire-reports (68 entries, 251 ms)

Using the Neo4j server:

[INFO] --- jqassistant-maven-plugin:1.9.1:scan (scan-software) @ util-validation ---
[INFO] Scanning for jQAssistant plugins...
[INFO] [Asciidoc Report, CDI, Common, Core Analysis, Core Report, EJB3, GraphML, GraphQL, JAX-RS, JPA 2, JSON, JUnit, Java, Java EE 6, Maven 2 Repository, Maven 3, OSGi, RDBMS, Spring, TestNG, Tycho, XML, YAML].
[INFO] Connecting to store at 'bolt://localhost:7687' (username=neo4j)
Jul 01, 2021 9:16:53 AM org.neo4j.driver.internal.logging.JULogger info
INFORMATION: Direct driver instance 122063374 created for server address localhost:7687
[INFO] Resetting store.
[INFO] Reset finished (removed 0 nodes, 0 relations).
[INFO] Entering /foo/bar/common/util/util-validation/target/classes
[INFO] Leaving /foo/bar/common/util/util-validation/target/classes (103 entries, 69746 ms)
[INFO] Entering /foo/bar/common/util/util-validation/target/test-classes
[WARNING] Cannot scan class '/foo/bar/util/validation/constraints/VerfahrensspracheTest.class'.
org.neo4j.driver.exceptions.ClientException: Unable to convert [C to Neo4j Value.
    at org.neo4j.driver.Values.value (Values.java:134)
    at org.neo4j.driver.Values.value (Values.java:297)
    at org.neo4j.driver.Values.value (Values.java:119)
    at org.neo4j.driver.Values.parameters (Values.java:401)
    at com.buschmais.xo.neo4j.remote.impl.datastore.AbstractRemoteDatastorePropertyManager.flush (AbstractRemoteDatastorePropertyManager.java:68)
    at com.buschmais.xo.neo4j.remote.impl.datastore.RemoteDatastoreEntityManager.flush (RemoteDatastoreEntityManager.java:235)
    at com.buschmais.xo.impl.cache.CacheSynchronizationService.flush (CacheSynchronizationService.java:50)
    at com.buschmais.xo.impl.cache.CacheSynchronizationService.flush (CacheSynchronizationService.java:34)
    at com.buschmais.xo.impl.query.XOQueryImpl.flush (XOQueryImpl.java:158)
    at com.buschmais.xo.impl.query.XOQueryImpl.execute (XOQueryImpl.java:138)
    at com.buschmais.xo.impl.proxy.common.resultof.AbstractResultOfMethod.invoke (AbstractResultOfMethod.java:46)
    at com.buschmais.xo.impl.proxy.AbstractProxyMethodService.invoke (AbstractProxyMethodService.java:26)
    at com.buschmais.xo.impl.proxy.InstanceInvocationHandler.invoke (InstanceInvocationHandler.java:23)
    ...
[WARNING] Cannot scan class '/foo/bar/util/validation/constraints/VerfahrensspracheTest$Geschaeft.class'.
org.neo4j.driver.exceptions.ClientException: Unable to convert [C to Neo4j Value.
    at org.neo4j.driver.Values.value (Values.java:134)
    at org.neo4j.driver.Values.value (Values.java:297)
    at org.neo4j.driver.Values.value (Values.java:119)
    at org.neo4j.driver.Values.parameters (Values.java:401)
    at com.buschmais.xo.neo4j.remote.impl.datastore.AbstractRemoteDatastorePropertyManager.flush (AbstractRemoteDatastorePropertyManager.java:68)
    at com.buschmais.xo.neo4j.remote.impl.datastore.RemoteDatastoreEntityManager.flush (RemoteDatastoreEntityManager.java:235)
    at com.buschmais.xo.impl.cache.CacheSynchronizationService.flush (CacheSynchronizationService.java:50)
    at com.buschmais.xo.impl.cache.CacheSynchronizationService.flush (CacheSynchronizationService.java:34)
    at com.buschmais.xo.impl.query.XOQueryImpl.flush (XOQueryImpl.java:158)
    at com.buschmais.xo.impl.query.XOQueryImpl.execute (XOQueryImpl.java:138)
    at com.buschmais.xo.impl.proxy.common.resultof.AbstractResultOfMethod.invoke (AbstractResultOfMethod.java:46)
    at com.buschmais.xo.impl.proxy.AbstractProxyMethodService.invoke (AbstractProxyMethodService.java:26)
    at com.buschmais.xo.impl.proxy.InstanceInvocationHandler.invoke (InstanceInvocationHandler.java:23)
    ...

Expected Behaviour

It should make no difference whether the embedded Neo4j is used or an external instance on a server.

Your Environment

  • Java version "1.8.0_202": Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
  • Windows 10 with WSL2 and Ubuntu 20.10
  • Neo4j Server version: 3.5.28 (community)
  • Apache Maven 3.6.3
  • jqassistant-maven-plugin 1.9.1

How can we reproduce the bug?

The test contains an inner class:

public class VerfahrensspracheTest extends BeanValidationTestBase<VerfahrensspracheTest.Geschaeft> {

  /**
   * Tests {@link Verfahrenssprache} with English.
   */
  @Test
  public void testEnglish() {
    // Some test
  }

  /**
   * Some bean for testing.
   */
  @SuppressWarnings("javadoc")
  static class Geschaeft extends PrettyPrintObject {

    /**
     * Creates this with valid values.
     */
    public Geschaeft() {
      this.sprache1 = foo.bar.util.type.language.Verfahrenssprache.DEUTSCH;
      this.sprache2 = foo.bar.util.type.language.Verfahrenssprache.ENGLISCH.getISOCode();

      this.sprache3 = Maps.newHashMap();
      this.sprache3.put(foo.bar.util.type.language.Verfahrenssprache.DEUTSCH, "Deutsch");
      this.sprache3.put(foo.bar.util.type.language.Verfahrenssprache.FRANZOESISCH, "Français");
      this.sprache3.put(foo.bar.util.type.language.Verfahrenssprache.ITALIENISCH, "Italiano");
    }

    @Verfahrenssprache
    public foo.bar.util.type.language.Verfahrenssprache sprache1;

    @Verfahrenssprache(englishAllowed = true)
    public String sprache2;

    @Verfahrenssprache
    public Map<foo.bar.util.type.language.Verfahrenssprache, String> sprache3;
  }
}

If I extract the inner class to its own Geschaeft.java file, the error for that class vanishes, but the one for VerfahrensspracheTest.class remains.

Definition of Done for the Implementers

Remove this hint: these checkboxes can be checked like this: [x]

  • We got a final feedback from the reporting user (if applicable)
  • Unittests have been written (if applicable)
  • Integration tests have been written (if applicable)
  • Test coverage is the same or even better then before (if applicable)
  • Documentation has been written (if applicable)
  • Added a note on the new feature to the release notes (if applicable)

Metadata

Metadata

Assignees

Labels

status:in progressA human being is working on this problemtype:bugSoftware shows incorrect behavior or delivers incorrect results

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions