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

NullPointerException when running with remote neo4j #4

Open
lennartfricke opened this issue Apr 25, 2024 · 0 comments
Open

NullPointerException when running with remote neo4j #4

lennartfricke opened this issue Apr 25, 2024 · 0 comments

Comments

@lennartfricke
Copy link

lennartfricke commented Apr 25, 2024

First of all, thank you for all the work you put in jqassistant.

Under special conditions the plugin jqassistant crashes with the following stacktrace.
I was not able to reproduce the error with public material only.

Steps to reproduce:

  • I need to launch jqassistant with limited memory and mariadb connector on classpath.
    java -Xmx200M -cp jqassistant-commandline-distribution-2.0.10/lib/com.buschmais.jqassistant.cli-jqassistant-commandline-distribution-2.0.10.jar:mariadb-java-client-2.7.12.jar scan -f jqassistant.plugin.rdbms.properties

  • I use the older mariadb-client to connect to mysql. neo4j is version 5.15.0.

  • jqassistant.yml:

jqassistant:
 plugins:
   - group-id: org.jqassistant.plugin
     artifact-id: jqassistant-rdbms-plugin
     version: 2.0.0
 store:
   uri: XXXXXX
   remote:
       username: neo4j
       password: XXXXXXXX
       encryption: true
       trust-strategy: trustAllCertificates
  • Unfortunately I was not able to reproduce the error with any other schema than the one I cannot disclose at the moment.
    But the schema is rather large containing about 500 tables, over 1500 indices and about 6000 columns. I was not able to find some similar schema for testing fast enough.

The run throws the following exception:

Exception in thread "main" com.buschmais.jqassistant.core.scanner.impl.UnrecoverableScannerException: Unexpected problem encountered while scanning: item='jqassistant.plugin.rdbms.properties', path='....', scope='NONE', pipeline='[com.buschmais.jqassistant.plugin.common.impl.scanner.FileResourceScannerPlugin@40f35e52, com.buschmais.jqassistant.plugin.java.impl.scanner.PropertyFileScannerPlugin@7c011174, org.jqassistant.plugin.rdbms.impl.scanner.ConnectionPropertyFileScannerPlugin@480b57e2]'. Please report this error including the full stacktrace (continueOnError=false).
	at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan(ScannerImpl.java:105)
	at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan(ScannerImpl.java:64)
	at com.buschmais.jqassistant.plugin.common.impl.scanner.FileScannerPlugin.scan(FileScannerPlugin.java:35)
	at com.buschmais.jqassistant.plugin.common.impl.scanner.FileScannerPlugin.scan(FileScannerPlugin.java:21)
	at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan(ScannerImpl.java:125)
	at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan(ScannerImpl.java:85)
	at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan(ScannerImpl.java:64)
	at com.buschmais.jqassistant.commandline.task.ScanTask.scan(ScanTask.java:103)
	at com.buschmais.jqassistant.commandline.task.ScanTask.lambda$scanFiles$4(ScanTask.java:93)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at com.buschmais.jqassistant.commandline.task.ScanTask.scanFiles(ScanTask.java:83)
	at com.buschmais.jqassistant.commandline.task.ScanTask.lambda$run$0(ScanTask.java:61)
	at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
	at com.buschmais.jqassistant.commandline.task.ScanTask.lambda$run$2(ScanTask.java:60)
	at com.buschmais.jqassistant.commandline.task.AbstractStoreTask.withStore(AbstractStoreTask.java:51)
	at com.buschmais.jqassistant.commandline.task.ScanTask.run(ScanTask.java:52)
	at com.buschmais.jqassistant.commandline.Main.executeTask(Main.java:303)
	at com.buschmais.jqassistant.commandline.Main.executeTasks(Main.java:263)
	at com.buschmais.jqassistant.commandline.Main.interpretCommandLine(Main.java:203)
	at com.buschmais.jqassistant.commandline.Main.run(Main.java:87)
	at com.buschmais.jqassistant.commandline.Main.main(Main.java:68)
Caused by: java.lang.NullPointerException: Cannot invoke "com.buschmais.xo.neo4j.remote.impl.model.AbstractRemotePropertyContainer.getId()" because "propertyContainer" is null
	at com.buschmais.xo.neo4j.remote.impl.datastore.RemoteDatastoreSessionCache.update(RemoteDatastoreSessionCache.java:94)
	at com.buschmais.xo.neo4j.remote.impl.datastore.RemoteDatastoreSessionCache.update(RemoteDatastoreSessionCache.java:89)
	at com.buschmais.xo.neo4j.remote.impl.datastore.RemoteDatastoreEntityManager.lambda$flushAddedRelationships$3(RemoteDatastoreEntityManager.java:299)
	at com.buschmais.xo.neo4j.remote.impl.datastore.StatementBatchBuilder.close(StatementBatchBuilder.java:73)
	at com.buschmais.xo.neo4j.remote.impl.datastore.RemoteDatastoreEntityManager.flush(RemoteDatastoreEntityManager.java:252)
	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.cache.CacheSynchronization.beforeCompletion(CacheSynchronization.java:15)
	at com.buschmais.xo.impl.XOTransactionImpl.lambda$beforeCompletion$0(XOTransactionImpl.java:85)
	at com.buschmais.xo.impl.XOTransactionImpl.executeSynchronizations(XOTransactionImpl.java:95)
	at com.buschmais.xo.impl.XOTransactionImpl.beforeCompletion(XOTransactionImpl.java:85)
	at com.buschmais.xo.impl.XOTransactionImpl.commit(XOTransactionImpl.java:35)
	at com.buschmais.jqassistant.core.store.impl.AbstractGraphStore.commitTransaction(AbstractGraphStore.java:204)
	at com.buschmais.jqassistant.core.store.impl.AbstractGraphStore.flush(AbstractGraphStore.java:131)
	at com.buschmais.jqassistant.core.store.impl.AbstractGraphStore.autoCommit(AbstractGraphStore.java:125)
	at com.buschmais.jqassistant.core.store.impl.AbstractGraphStore.create(AbstractGraphStore.java:95)
	at org.jqassistant.plugin.rdbms.impl.scanner.AbstractSchemaScannerPlugin.getTableDescriptor(AbstractSchemaScannerPlugin.java:349)
	at org.jqassistant.plugin.rdbms.impl.scanner.AbstractSchemaScannerPlugin.createTables(AbstractSchemaScannerPlugin.java:162)
	at org.jqassistant.plugin.rdbms.impl.scanner.AbstractSchemaScannerPlugin.createSchemas(AbstractSchemaScannerPlugin.java:136)
	at org.jqassistant.plugin.rdbms.impl.scanner.AbstractSchemaScannerPlugin.scanConnection(AbstractSchemaScannerPlugin.java:57)
	at org.jqassistant.plugin.rdbms.impl.scanner.ConnectionPropertyFileScannerPlugin.scan(ConnectionPropertyFileScannerPlugin.java:97)
	at org.jqassistant.plugin.rdbms.impl.scanner.ConnectionPropertyFileScannerPlugin.scan(ConnectionPropertyFileScannerPlugin.java:28)
	at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan(ScannerImpl.java:125)
	at com.buschmais.jqassistant.core.scanner.impl.ScannerImpl.scan(ScannerImpl.java:89)
	... 20 more

Debugging lead me to following hypothesis:

  • The SchemaScannerPlugin creates relations, but for some reason drops strong references to them.
  • During flush the values com.buschmais.xo.neo4j.remote.impl.datastore.RemoteDatastoreSessionCache are already cleaned up, so that the no value is found in cache.

I know too little about the design choices of jqassistant to work out a fix. One possibility would being prepared to get nulll when getting information from cache. The other I can imagine is a bug in this plugin.

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

1 participant