Add the javax.persistence APIs as a compile time dependency to your plugin's POM. This is expected behavior AFAIK.

Unfortunately, I believe you are probably seeing these classes resolve in your IDE because of this pom.xml entry:

<dependency>
<groupId>org.jboss.forge</groupId>
<artifactId>forge-javaee-impl</artifactId>
<version>${forge.version}</version>
<scope>test</scope>
</dependency>

Which is needed for testing... Damn the IDEs.

~Lincoln

On Thu, Mar 1, 2012 at 1:41 AM, Richard Kennard <richard@kennardconsulting.com> wrote:
Hi guys,

I'm struggling to get the AeroGear plugin working. It runs fine in unit tests, but when packaged as a standalone plugin I get the error below.

It appears my module does not have access to javax.persistence.* (hibernate-jpa-2.0-api-1.0.1.Final.jar or similar). How do I declare this dependency?

Regards,

Richard.

---

[test] test $ scaffold from-entity  com.test.model.* --scaffoldType aerogear
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.forge.shell.command.Execution.perform(Execution.java:149)
        at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:125)
        at org.jboss.forge.shell.command.fshparser.FSHRuntime.run(FSHRuntime.java:63)
        at org.jboss.forge.shell.ShellImpl$ExecutorThread.run(ShellImpl.java:829)
        at org.jboss.forge.shell.ShellImpl.execute(ShellImpl.java:852)
        at org.jboss.forge.shell.ShellImpl.doShell(ShellImpl.java:642)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:48)
        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:125)
        at org.jboss.forge.shell.ShellImpl$Proxy$_$$_WeldClientProxy.doShell(ShellImpl$Proxy$_$$_WeldClientProxy.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
        at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
        at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
        at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
        at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
        at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:282)
        at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:265)
        at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:234)
        at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:635)
        at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:622)
        at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:616)
        at org.jboss.forge.shell.Bootstrap$1.run(Bootstrap.java:120)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: javax/persistence/Lob
        at org.metawidget.inspector.jpa.JpaInspector.inspectProperty(JpaInspector.java:86)
        at org.metawidget.inspector.impl.BaseObjectInspector.inspectTraits(BaseObjectInspector.java:343)
        at org.metawidget.inspector.impl.BaseObjectInspector.inspectAsDom(BaseObjectInspector.java:243)
        at org.metawidget.inspector.impl.BaseObjectInspector.inspectAsDom(BaseObjectInspector.java:69)
        at org.metawidget.inspector.composite.CompositeInspector.runInspector(CompositeInspector.java:241)
        at org.metawidget.inspector.composite.CompositeInspector.runInspectors(CompositeInspector.java:220)
        at org.metawidget.inspector.composite.CompositeInspector.inspectAsDom(CompositeInspector.java:167)
        at org.metawidget.inspector.composite.CompositeInspector.inspectAsDom(CompositeInspector.java:151)
        at org.metawidget.inspector.composite.CompositeInspector.inspectAsDom(CompositeInspector.java:53)
        at org.metawidget.pipeline.base.BasePipeline.inspectAsDom(BasePipeline.java:344)
        at org.metawidget.statically.StaticMetawidget.inspect(StaticMetawidget.java:305)
        at org.metawidget.statically.StaticMetawidget.write(StaticMetawidget.java:251)
        at org.jboss.forge.scaffold.aerogear.AeroGearScaffold.generateFromEntity(AeroGearScaffold.java:218)
        at org.jboss.forge.scaffold.plugins.ScaffoldPlugin.generateFromEntity(ScaffoldPlugin.java:174)
        ... 36 more

_______________________________________________
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"