[
https://issues.jboss.org/browse/FORGE-2189?page=com.atlassian.jira.plugin...
]
Jerome B commented on FORGE-2189:
---------------------------------
I somehow solved this by recreating the project from CLI and copying sources to this new
project (after removing everything JAXB). First build worked.
Decommenting everything JAXB broke the usage again (addon is installed but cant run,
complain about a beans.xml that is in the project and in the jar in .forge/addons )
Back to first project :
My pom was broken. My fault, because of the version mismatch.
It declared <version.furnace> set to 2.13.1 and other addons were all 2.12
What is surprising is that a class from org.jboss.* was missing although I did not use it
directly.
The maven dependencies (non addons, like the yandex I added due to this error) were not
included in the jar I saw in target.
The jar was either 16Kb or 16 Mb (when using goal assembly:single but the jar then
contains roaster, addon, furnace and parser packages)
Also, before building, hitting tab proposes to display 115 commands
After build, said as successfull, as many commands are available.
This info could be used to determine if the build is successfull or not
(I'll file an improvement request)
All of this because I cant connect to JBDS' forge console in debug from JBDS
Anyway what this issue highlighted
* forge team is very responsive to the users
* Do not use jaxb ?!?
* maven dependencies are not added in the JAR built (manually adding jandex dep did not
add it to the jar)
* I dont read numbers in pom.xml well ....
* Version mismatch leads to wasted time
Custom Addon cannot be run, jandex not found
--------------------------------------------
Key: FORGE-2189
URL:
https://issues.jboss.org/browse/FORGE-2189
Project: Forge
Issue Type: Bug
Components: Addon Development
Affects Versions: 2.13.1.Final
Environment: JBoss Dev studio
W7 64, Java 1.7, forge 2.13.1
Reporter: Jerome B
My custom addon builds successfully BUT log fills with error
The cause would be
Caused by: java.lang.NoClassDefFoundError: org/jboss/jandex/Indexer
at
org.jboss.weld.environment.se.discovery.url.JandexEnabledFileSystemURLHandler.<init>(JandexEnabledFileSystemURLHandler.java:35)
... 19 more
It still happens although I added the dependency
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>1.2.2.Final</version>
<scope>runtime</scope>
</dependency>
I even tried with
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
<version>2.2.8.Final</version>
</dependency>
Without luck.
First time I see this error when writing addons
My addon uses a lot of reflection to discover annotations on fields and methods. I wonder
what triggers the use of jandex
The full stack is
18:38:44,078 INFO [org.jboss.forge.furnace.impl.addons.AddonRunnable]
(fr.employer.addons:ADDONS213,1.0.2-SNAPSHOT) > Starting container
[fr.employer.addons:ADDONS213,1.0.2-SNAPSHOT] [C:\Users\jerome.b\.forge\addons]
18:38:44,088 SEVERE [org.jboss.forge.furnace.impl.addons.AddonRunnable]
(fr.employer.addons:ADDONS213,1.0.2-SNAPSHOT) Failed to start addon
[fr.employer.addons:ADDONS213,1.0.2-SNAPSHOT] with classloader [ModuleClassLoader for
Module
"fr.employer.addons.ADDONS213:1.0.2-SNAPSHOT_2677a771-c4eb-4323-8ef7-1608cdad2915"
from AddonModuleLoader]: java.lang.IllegalStateException: Unable to instantiate
org.jboss.weld.environment.se.discovery.url.JandexEnabledFileSystemURLHandler using
parameters: [org.jboss.weld.bootstrap.WeldBootstrap@3546eaec]
at org.jboss.weld.environment.se.util.SEReflections.newInstance(SEReflections.java:85)
at org.jboss.weld.environment.se.discovery.url.URLScanner.scan(URLScanner.java:81)
at
org.jboss.weld.environment.se.discovery.url.DiscoveryStrategy.discoverArchives(DiscoveryStrategy.java:52)
at org.jboss.weld.environment.se.Weld.createDeployment(Weld.java:202)
at
org.jboss.forge.furnace.container.cdi.weld.ModularWeld.createDeployment(ModularWeld.java:41)
at org.jboss.weld.environment.se.Weld.initialize(Weld.java:127)
at
org.jboss.forge.furnace.container.cdi.lifecycle.WeldAddonLifecycleProvider.start(WeldAddonLifecycleProvider.java:77)
at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:92)
[furnace-2.13.1.Final.jar:2.13.1.Final]
at org.jboss.forge.furnace.impl.addons.AddonRunnable$2.call(AddonRunnable.java:86)
[furnace-2.13.1.Final.jar:2.13.1.Final]
at org.jboss.forge.furnace.util.ClassLoaders.executeIn(ClassLoaders.java:42)
[furnace-api-2.13.1.Final.jar:2.13.1.Final]
at org.jboss.forge.furnace.impl.addons.AddonRunnable.run(AddonRunnable.java:85)
[furnace-2.13.1.Final.jar:2.13.1.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[rt.jar:1.7.0_40]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_40]
at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_40]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedConstructorAccessor493.newInstance(Unknown Source) [:1.7.0_40]
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[rt.jar:1.7.0_40]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_40]
at org.jboss.weld.environment.se.util.SEReflections.newInstance(SEReflections.java:83)
... 15 more
Caused by: java.lang.NoClassDefFoundError: org/jboss/jandex/Indexer
at
org.jboss.weld.environment.se.discovery.url.JandexEnabledFileSystemURLHandler.<init>(JandexEnabledFileSystemURLHandler.java:35)
... 19 more
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)