Skip to content
This repository was archived by the owner on Feb 18, 2022. It is now read-only.
This repository was archived by the owner on Feb 18, 2022. It is now read-only.

Code generation not working, seems to be a classloading issue. #37

@jfbenckhuijsen

Description

@jfbenckhuijsen

Hi,

I've created an APT maven project to generate some code. I've succesfully tested this code from Maven and all seems to work fine. However, whenever I use the m2e-apt plugin to run this from Eclipse, I get unexpected runtime-errors in the compilation process. The concrete exceptions differ largely from build-to-build, from execution-to-execution and from pc-to-pc, i.e. there is no real direct cause which I can define.

I've seen various ResourceExceptions where internal JDK code is complaining about the JAR file being correct (the same JAR which is used for the maven compilation, i.e. the JAR is fine), I've seen exceptions of files which cannot be loaded from the classpath (classLoader.getResourceAsStream() like calls which fail) and classcast exceptions (some velocity class does not implement an interface from velocity itself).

All these seem to indicate some classloading issue, however, I've got no idea where to start searching (running an Eclipse debug session right now), or how to fix this without diving headlong into the plugin code, so any advice is apprectiated.

RIght now I can see two possible solutions:

  • The m2e-apt plugin needs to fixes to handle classloading correctly
  • A (wild guess) might be if I implement some additional classes so this apt-plugin can also function as an eclipse plugin, so Eclipse knows how to handle the classloading issues correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions