Koen
Koen

Reputation: 81

Eclipse Apache ISIS HelloWorld archetype errors: flatten, QHelloWorldObject, maven build java.sql.SQLException missing

I'm trying to get an apache ISIS project to work correctly in Eclipse. I encounter some problems:

  1. compile error in src/main/java/domainapp.dom.impl/HelloWorldObjects.findByName(...): QHelloWorldObject cannot be resolved to a type

  2. pom.xml .../plugin/executions/execution/id=flatten: Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:flatten-maven-plugin:1.0.0:flatten

  3. when creating a maven build configuration with targets: clean package jetty:run. I get: [ERROR] Failed to execute goal org.datanucleus:datanucleus-maven-plugin:5.0.2:enhance ... Error executing DataNucleus tool org.datanucleus.enhancer.DataNucleusEnhancer: InvocationTargetException: java/sql/SQLException: java.sql.SQLException ... org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal ... Caused by: java.lang.ClassNotFoundException: java.sql.SQLException (However on the command line outside Eclipse all is working fine. I can also launch the application as Java Application with the org.apache.isis.WebServer class)

  4. When I run Project > DataNuclues > Run Schema Tool SchemaInfo, I get: DataNucleus SchemaTool : Schema information An error was encountered creating a PersistenceManagerFactory : Error creating transactional connection factory - please consult the log for more information. Adding/removing DataNucleus from the project doesn't make a difference.

I think I followed all steps in https://isis.apache.org/setupguide/2.0.0-M5/eclipse/about.html correctly. DataNucleus plugin and Lombok are there.

I'm on a Linux (OpenSUSE 15.3) machine with openJDK 11, eclipse-2021-03 (I did a fresh install of this version, downloaded all the latest plugins, and it's on a fresh eclipse workspace with no other project in it).

The project was created in Eclipse with the File > New > Project > Maven > Maven Project GroupId: org.apache.isis.archetype, ArtifactId: helloworld-archetype

I seem unable to pinpoint the cause(s) of this, and I'm running in circles, after various hours I'm back at the starting point. Can anyone point me in the right direction?

Upvotes: 1

Views: 153

Answers (1)

Dan Haywood
Dan Haywood

Reputation: 2235

Thanks for trying out Apache Isis. Your problem might be that you are trying to use an old archetype, combined maybe with JDK11. Since git repos are ubiquitous now, we decided to move to using a git repo to maintain our starter apps ... it also means that we can improve them outside of the formal release cadence.

The details are on the home page of the website, in the "quick start" section... or more details here. If you are struggling with the DN enhancer for JDO (which can, admittedly be somewhat fiddly), then be aware that as of 2.0.0-M5 we are supporting JPA too, which removes that requirement.

In terms of the errors you encountered, here are some thoughts:

  1. the Qxxx files are created using a DataNucleus annotation processor which runs as part of the compile process. If you build the app with maven you should see them created - check that Eclipse's compile process is also generating them in a sensible location, and that location is one of the source paths that it compiles from.

  2. we don't use the flatten plugin anymore, so this relates to the old archetype.

  3. again, relates to the old archetype. 2.0.0-M5 uses Spring Boot.

  4. I don't know why you are running DN's SchemaTool. That is used to create a schema manually. We normally would let DN automatically create the DB schema when running in prototype mode. If running in production, Flyway is the way to go to handle schema migrations.

If you want more help, consider joining our slack channel

Upvotes: 0

Related Questions