How to debug ClassNotFoundExceptions for Forge JARs?
lennartj Jun 28, 2013 4:57 PMHello there,
I have a project which successfully creates a plugin, and verifies its operation within a unit test.
When installing the plugin using forge source-plugin, an exception occurs and is clearly shown in the ~/.forge/runtime.log.
The ultimate cause is shown below:
Caused by: java.lang.ClassNotFoundException: org.jboss.forge.maven.plugins.Configuration from
[Module "se.jguru.nazgul.forge.factory.impl.nazgul.nazgul-forge-factory-impl-nazgul.dependencies:1.0.0-SNAPSHOT-7a50e966-1b44-4c16-9a67-9d016be21aa8"
from local module loader @22006edb
(roots:
/usr/local/share/forge/modules,
/Users/lj/.forge/plugins,
/Users/lj/Development/Projects/Nazgul/nazgul_forge/factory/factory-impl-nazgul)]
I am at a loss here, since I got the impression that the forge-maven-api should be accessible.
How can I proceed in the debugging?
The project is small, and located in https://github.com/lennartj/nazgul_forge.git if anyone wants to take a look.
Facts
The Configuration class highlighted above is defined within the dependency org.jboss.forge:forge-maven-api:1.3.2.Final, which is
- included in the forge distribution and found under /usr/local/share/forge/modules - which is claimed to be searched by Forge in the log above, and
- referenced in provided scope within the plugin's project maven pom:
<dependency>
<groupId>org.jboss.forge</groupId>
<artifactId>forge-maven-api</artifactId>
<version>1.3.2.Final</version>
<scope>provided</scope>
</dependency>
I checked the ~/.forge/plugins/.../[my plugin]/modules.xml which looks OK:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<module xmlns="urn:jboss:module:1.0" name="se.jguru.nazgul.forge.factory.impl.nazgul.nazgul-forge-factory-impl-nazgul" slot="1.0.0-SNAPSHOT-7a50e966-1b44-4c16-9a67-9d016be21aa8">
<resources>
<resource-root path="nazgul-forge-factory-impl-nazgul.jar"/>
</resources>
<dependencies>
<module name="se.jguru.nazgul.forge.factory.impl.nazgul.nazgul-forge-factory-impl-nazgul.dependencies" slot="1.0.0-SNAPSHOT-7a50e966-1b44-4c16-9a67-9d016be21aa8"/>
<module name="org.jboss.forge.javaee.api" services="import"/>
<module name="org.jboss.forge.maven.api" services="import"/>
<module name="org.jboss.forge.scaffold.api" services="import"/>
<module name="org.jboss.forge.scaffoldx.api" services="import"/>
<module name="org.jboss.forge.shell.api" services="import"/>
<module name="org.jboss.seam.render" services="import"/>
<module name="javax.api"/>
</dependencies>
</module>