9 Replies Latest reply on Feb 18, 2013 12:43 PM by Lincoln Baxter III

    Scaffolding not working after restart of forge?

    mzitg Newbie

      My scaffolding works fine until i leave forge.

       

      If i restart forge i get a IllegalStateException.

       

      Has anybody seen this problem before?

       

      I have tried Version 1.0.5.Final and forge-distribution-1.0.6-20120719.171604-23.zip.

       

      Linux, JDK 1.7.0_05 Oracle

       

       

       

      [Rechnungen] Adresse.java $ scaffold from-entity ch.internettechnik.rechnungen.entity.Adresse.java

      ***INFO*** Using currently installed scaffold [faces]

      ***ERROR*** [scaffold from-entity] Error generating default scaffolding: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

      org.jboss.forge.shell.exceptions.CommandExecutionException: Error generating default scaffolding: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

              at org.jboss.forge.shell.command.Execution.perform(Execution.java:155)

              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:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              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:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              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:151)

              at java.lang.Thread.run(Thread.java:722)

      Caused by: java.lang.reflect.InvocationTargetException

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:601)

              at org.jboss.forge.shell.command.Execution.perform(Execution.java:150)

              ... 31 more

      Caused by: java.lang.RuntimeException: Error generating default scaffolding: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

              at org.jboss.forge.scaffold.faces.FacesScaffold.generateFromEntity(FacesScaffold.java:343)

              at org.jboss.forge.scaffold.plugins.ScaffoldPlugin.generateFromEntity(ScaffoldPlugin.java:187)

              ... 36 more

      Caused by: org.metawidget.inspector.iface.InspectorException: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

              at org.metawidget.inspector.iface.InspectorException.newException(InspectorException.java:45)

              at org.metawidget.inspector.impl.BaseObjectInspector.inspectAsDom(BaseObjectInspector.java:279)

              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:327)

              at org.metawidget.statically.StaticMetawidget.write(StaticMetawidget.java:273)

              at org.jboss.forge.scaffold.faces.FacesScaffold.generateFromEntity(FacesScaffold.java:269)

              ... 37 more

      Caused by: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

              at org.jboss.forge.parser.java.impl.AbstractJavaSource.getImportResolvers(AbstractJavaSource.java:361)

              at org.jboss.forge.parser.java.impl.AbstractJavaSource.resolveType(AbstractJavaSource.java:329)

              at org.jboss.forge.parser.java.impl.TypeImpl.getQualifiedName(TypeImpl.java:174)

              at org.jboss.forge.scaffold.faces.metawidget.inspector.propertystyle.ForgePropertyStyle$ForgeProperty.getGenericType(ForgePropertyStyle.java:541)

              at org.metawidget.inspector.propertytype.PropertyTypeInspector.inspectProperty(PropertyTypeInspector.java:175)

              at org.metawidget.inspector.impl.BaseObjectInspector.inspectTraits(BaseObjectInspector.java:343)

              at org.metawidget.inspector.impl.BaseObjectInspector.inspectAsDom(BaseObjectInspector.java:243)

              ... 47 more

      [Rechnungen] Adresse.java $

        • 1. Re: Scaffolding not working after restart of forge?
          Koen Aers Master

          Hi Michael,

           

          I have not seen this phenomenon (yet). Can you please post the (minimal) sequence of Forge commands that produces this exception so we can try and reproduce it?

           

          Cheers,

          Koen

          • 2. Re: Scaffolding not working after restart of forge?
            mzitg Newbie

            Thanks Koen

             

            i did some research over night.

             

            This is a verry simple example of a non-working forge-project: https://github.com/michzuerch/ScaffoldTest

             

            These are my steps to create the project:

             

            1. new-project --named ScaffoldTest

            2. persistence setup --provider HIBERNATE --container JBOSS_AS7

            3. scaffold setup --scaffoldType faces

            4. entity --named Address

            5. field string --named firstname

            6. field string --named lastname

            7. scaffold from-entity

             

            Everything woks fine until i leave forge (exit).

             

            After the restart i get this:

             

            [ScaffoldTest] Address.java $ scaffold from-entity com.example.ScaffoldTest.model.Address.java

            ***INFO*** Using currently installed scaffold [faces]

            ***ERROR*** [scaffold from-entity] Error generating default scaffolding: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

            org.jboss.forge.shell.exceptions.CommandExecutionException: Error generating default scaffolding: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

                    at org.jboss.forge.shell.command.Execution.perform(Execution.java:155)

                    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:57)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:601)

                    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:57)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:601)

                    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:151)

                    at java.lang.Thread.run(Thread.java:722)

            Caused by: java.lang.reflect.InvocationTargetException

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                    at java.lang.reflect.Method.invoke(Method.java:601)

                    at org.jboss.forge.shell.command.Execution.perform(Execution.java:150)

                    ... 31 more

            Caused by: java.lang.RuntimeException: Error generating default scaffolding: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

                    at org.jboss.forge.scaffold.faces.FacesScaffold.generateFromEntity(FacesScaffold.java:343)

                    at org.jboss.forge.scaffold.plugins.ScaffoldPlugin.generateFromEntity(ScaffoldPlugin.java:187)

                    ... 36 more

            Caused by: org.metawidget.inspector.iface.InspectorException: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

                    at org.metawidget.inspector.iface.InspectorException.newException(InspectorException.java:45)

                    at org.jboss.forge.scaffold.faces.metawidget.inspector.propertystyle.ForgePropertyStyle$AnnotationProxy.newInstance(ForgePropertyStyle.java:605)

                    at org.jboss.forge.scaffold.faces.metawidget.inspector.propertystyle.ForgePropertyStyle$ForgeProperty.getAnnotation(ForgePropertyStyle.java:513)

                    at org.metawidget.inspector.impl.BaseTrait.isAnnotationPresent(BaseTrait.java:58)

                    at org.jboss.forge.scaffold.faces.metawidget.inspector.ForgeInspector.inspectProperty(ForgeInspector.java:142)

                    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:327)

                    at org.metawidget.statically.StaticMetawidget.write(StaticMetawidget.java:273)

                    at org.jboss.forge.scaffold.faces.FacesScaffold.generateFromEntity(FacesScaffold.java:269)

                    ... 37 more

            Caused by: java.lang.IllegalStateException: No instances of [org.jboss.forge.parser.spi.WildcardImportResolver] were found on the classpath.

                    at org.jboss.forge.parser.java.impl.AbstractJavaSource.getImportResolvers(AbstractJavaSource.java:361)

                    at org.jboss.forge.parser.java.impl.AbstractJavaSource.resolveType(AbstractJavaSource.java:329)

                    at org.jboss.forge.parser.java.impl.AnnotationImpl.getQualifiedName(AnnotationImpl.java:104)

                    at org.jboss.forge.scaffold.faces.metawidget.inspector.propertystyle.ForgePropertyStyle$AnnotationProxy.newInstance(ForgePropertyStyle.java:594)

                    ... 52 more

            [ScaffoldTest] Address.java $

            • 3. Re: Scaffolding not working after restart of forge?
              Koen Aers Master

              Hi Michael,

               

              This scenario seems to work fine on OSX Lion with Java 1.6.0_33. I'll try on a Linux box when I have one handy.

               

              Cheers,

              Koen

              • 4. Re: Scaffolding not working after restart of forge?
                Lincoln Baxter III Master

                Hi Michael,

                 

                This problem is caused because you are using wildcard imports in some of your sources and Forge cannot make accurated deductions about which types are on your classpath. You should be able to work around this problem by converting any wildcard imports to standard ones:

                 

                E.g. anything like:

                 

                import org.jboss.forge.*; --should become-> import org.jboss.forge.Shell; import org.jboss.forge.Blah;

                 

                Thanks,

                Lincoln

                • 5. Re: Scaffolding not working after restart of forge?
                  Koen Aers Master

                  Ah then it means the Adress.java file was edited after exiting Forge and before relaunching it? Or else how can the wildcards appear in the source?

                   

                  The stack trace makes sense when you explain it Lincoln, but it's not obvious at all what causes it without this inside knowledge. Forge should be able to tell what the problem in the sources is instead of just throwing this exception, no? 

                  1 of 1 people found this helpful
                  • 6. Re: Scaffolding not working after restart of forge?
                    Lincoln Baxter III Master

                    Yeah, the error message could be a little more helpful. Typically wildcard imports show up when your IDE does auto-organization of imports when you save a file.

                    • 7. Re: Scaffolding not working after restart of forge?
                      mzitg Newbie

                      You are right Lincoln.

                       

                      I changed the import from:

                       

                       

                      import javax.persistence.*;

                      import java.io.Serializable;

                       

                      to

                       

                      import javax.persistence.Column;

                      import javax.persistence.Entity;

                      import javax.persistence.GeneratedValue;

                      import javax.persistence.GenerationType;

                      import javax.persistence.Id;

                      import javax.persistence.Version;

                      import java.io.Serializable;

                       

                      and now it works.

                       

                      My IntelliJ did a 'optimize import'. You can change the settings with 'Settings, Codestyle, Java, Imports'.

                       

                      Thanks,

                       

                      Michael

                      • 8. Re: Scaffolding not working after restart of forge?
                        Rüdiger zu Dohna Newbie

                        @Lincoln: Looking at the AbstractJavaSource class, the exceptions seems to indicate that this is an extension point, i.e. there is some work in progress to add support for wildcard imports. Could you provide a link?

                        • 9. Re: Scaffolding not working after restart of forge?
                          Lincoln Baxter III Master

                          Hi Rüdiger,

                           

                          Yes, it is an extension point. We are currently discussing on the forge-dev@lists.jboss.org email list if you would like to join in. Send an email to the list with your request and I can include you

                           

                          Thanks!

                          ~Lincoln