This is a modularization issue. Adding the MVEL JAR to the plugin will cause the LinkageError, as the forge-core classes will depend on the MVEL classes loaded from the forge-core module(s), and the plugin module will use the MVEL JAR classes packaged with it (so if there's a hierarchy that crosses the plugin/core boundary, this will crash). The only good solution I can see is to add a module dependency on the MVEL module (or the module in which MVEL lives in forge-core).

AFAICT, depending on seam-render and adjusting seam-render module definition to export the MVEL classes should take care of this (if it's ever acceptable from a visibility perspective to depend on MVEL directly).


On 12-02-14 10:09 AM, Ryan Bradley wrote:
Lincoln, frankly, I'm stumped by this one.  I never received a LoaderConstraintViolation or anything similar.  My issue was with the seam-render not being added as a module to the plugin, since it was already included with the Forge core.  However, that issue has since been resolved.

Thomas, I'm not sure of the cause of your exception, as including seam-render and MVEL as dependencies solved the problem for me.  If I understand your most recent e-mail correctly, your problem is solved if MVEL is manually added to module.xml?  MVEL is not required for my ScaffoldProvider implementation, so maybe you are experiencing a similar problem?

Sorry,
Ryan

On 02/13/2012 07:15 PM, Lincoln Baxter, III wrote:
Ryan, how did you get around this?

Thomas, perhaps you could try including seam-render instead of MVEL? Make sure you use the same version that Forge Shell uses as a temporary workaround.

~Lincoln

On Mon, Feb 13, 2012 at 5:33 PM, Thomas Frühbeck <fruehbeck@aon.at> wrote:
Hi Ryan, Lincoln

> I ran into similar problems with my own plugin development.  Including
> MVEL as a Maven dependency in your pom.xml should resolve this issue.

this is exactly what I have tried to do. This will really look ugly :/
I will write it as clear as possible:

in pom.xml  I added:
<dependency>
<groupId>org.mvel</groupId>
<artifactId>mvel2</artifactId>
<scope>compile</scope>
</dependency>

On forge install-plugin ~/blabla/  I get:
***SUCCESS*** Installed from [plugin-faces-idaware] successfully.
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/1.0.0-SNAPSHOT-6c38c8fd-45f4-4736-ad0a-467dc9154a11
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/1.0.0-SNAPSHOT-6c38c8fd-45f4-4736-ad0a-467dc9154a11/plugin-faces-id-aware.jar
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/1.0.0-SNAPSHOT-6c38c8fd-45f4-4736-ad0a-467dc9154a11/module.xml
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/dependencies
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/dependencies/1.0.0-SNAPSHOT-6c38c8fd-45f4-4736-ad0a-467dc9154a11
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/dependencies/1.0.0-SNAPSHOT-6c38c8fd-45f4-4736-ad0a-467dc9154a11/metawidget-all-2.0.jar
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/dependencies/1.0.0-SNAPSHOT-6c38c8fd-45f4-4736-ad0a-467dc9154a11/mvel2-2.1.Beta7.jar
Wrote /home/thomas/.forge/plugins/at/tfr/forge/plugin-faces-id-aware/dependencies/1.0.0-SNAPSHOT-6c38c8fd-45f4-4736-ad0a-467dc9154a11/module.xml

So to me it is clear, that I was successful, integration of Mvel libraries is done.
But when I invoke my plugin, I get _a LoaderConstraintViolation_!!

[myidaware] myidaware $ set VERBOSE true
[myidaware] myidaware $ scaffold from-entity at.tfr.test.model.* --scaffoldType idaware
Use which scaffold provider?

  1 - [idaware]
  2 - [faces]*

 ? Choose an option by typing the number of the selection [*-default]  [0] 1
***ERROR*** [scaffold from-entity] loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/mvel2/templates/CompiledTemplate"
org.jboss.forge.shell.exceptions.CommandExecutionException: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/mvel2/templates/CompiledTemplate"

Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/mvel2/templates/CompiledTemplate"


So for me it is evident, that I brought my own Mvel jar, but the module loader will not let me use it!

Regards,
Thomas
_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev



--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"


_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev



_______________________________________________
forge-dev mailing list
forge-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/forge-dev