Announcement Announcement Module
Collapse
No announcement yet.
Problem with Valkyrie Simple Sample Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with Valkyrie Simple Sample

    Just running the easy example I get the below error. I'm think is something relate with auto-wiring but don't know what it's.

    I thought the reason is because of this:
    2480 [main] INFO org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker - Bean 'org.valkyriercp.sample.simple.SimpleSampleApplica tionConfig#0' of type [class org.valkyriercp.sample.simple.SimpleSampleApplicat ionConfig$$EnhancerByCGLIB$$3301b34c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    2564 [main] INFO org.springframework.context.support.AbstractApplic ationContext$BeanPostProcessorChecker - Bean 'applicationObjectConfigurer' of type [class org.valkyriercp.application.config.support.Default ApplicationObjectConfigurer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

    Errors:
    java.lang.IllegalStateException: Application start thrown an exception: Command context could not be loaded
    at org.valkyriercp.application.support.ApplicationLau ncher.launchMyRichClient(ApplicationLauncher.java: 269) ~[classes/:na]
    at org.valkyriercp.application.support.ApplicationLau ncher.<init>(ApplicationLauncher.java:132) ~[classes/:na]
    at org.valkyriercp.application.support.ApplicationLau ncher.<init>(ApplicationLauncher.java:104) ~[classes/:na]
    at org.valkyriercp.sample.simple.SimpleSampleRunner.m ain(SimpleSampleRunner.java:9) ~[classes/:na]
    org.valkyriercp.application.ConfigurationException : Command context could not be loaded
    at org.valkyriercp.application.config.support.Default ApplicationLifecycleAdvisor.initNewWindowCommandBa rFactory(DefaultApplicationLifecycleAdvisor.java:4 1) ~[classes/:na]
    at org.valkyriercp.application.config.support.Default ApplicationLifecycleAdvisor.createWindowCommandMan ager(DefaultApplicationLifecycleAdvisor.java:28) ~[classes/:na]
    at org.valkyriercp.application.support.AbstractApplic ationWindow.init(AbstractApplicationWindow.java:50 ) ~[classes/:na]
    ...
    at java.awt.EventQueue$1.run(EventQueue.java:639) ~[na:1.6.0_24]
    at java.awt.EventQueue$1.run(EventQueue.java:637) ~[na:1.6.0_24]
    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_24]
    at java.security.AccessControlContext$1.doIntersectio nPrivilege(AccessControlContext.java:87) ~[na:1.6.0_24]
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 648) ~[na:1.6.0_24]
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:296) ~[na:1.6.0_24]
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:211) ~[na:1.6.0_24]
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:201) ~[na:1.6.0_24]
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:196) ~[na:1.6.0_24]
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:188) ~[na:1.6.0_24]
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122) ~[na:1.6.0_24]
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'applicationWindowCommandManager' defined in class org.valkyriercp.sample.simple.SimpleSampleCommandC onfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionSt oreException: Factory method [public org.valkyriercp.application.support.ApplicationWin dowCommandManager org.valkyriercp.sample.simple.SimpleSampleCommandC onfig.applicationWindowCommandManager()] threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.Construc torResolver.instantiateUsingFactoryMethod(Construc torResolver.java:581) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateUsingFactory Method(AbstractAutowireCapableBeanFactory.java:983 ) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:879) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 ) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:194) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplic ationContext.registerBeanPostProcessors(AbstractAp plicationContext.java:722) ~[spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:410) ~[spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.valkyriercp.application.config.support.Default ApplicationLifecycleAdvisor$CommandBarApplicationC ontextFactory.getObject(DefaultApplicationLifecycl eAdvisor.java:124) ~[classes/:na]
    at org.valkyriercp.application.config.support.Default ApplicationLifecycleAdvisor.initNewWindowCommandBa rFactory(DefaultApplicationLifecycleAdvisor.java:3 9) ~[classes/:na]
    ... 24 common frames omitted
    Caused by: org.springframework.beans.factory.BeanDefinitionSt oreException: Factory method [public org.valkyriercp.application.support.ApplicationWin dowCommandManager org.valkyriercp.sample.simple.SimpleSampleCommandC onfig.applicationWindowCommandManager()] threw exception; nested exception is java.lang.NullPointerException
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:157) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.springframework.beans.factory.support.Construc torResolver.instantiateUsingFactoryMethod(Construc torResolver.java:570) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ... 36 common frames omitted
    Caused by: java.lang.NullPointerException: null
    at org.valkyriercp.command.support.DefaultCommandMana ger.configure(DefaultCommandManager.java:194) ~[classes/:na]
    at org.valkyriercp.command.support.DefaultCommandMana ger.registerCommand(DefaultCommandManager.java:161 ) ~[classes/:na]
    at org.valkyriercp.command.support.DefaultCommandMana ger.createTargetableActionCommand(DefaultCommandMa nager.java:180) ~[classes/:na]
    at org.valkyriercp.application.support.ApplicationWin dowCommandManager.setSharedCommandIds(ApplicationW indowCommandManager.java:37) ~[classes/:na]
    at org.valkyriercp.sample.simple.SimpleSampleCommandC onfig.applicationWindowCommandManager(SimpleSample CommandConfig.java:25) ~[classes/:na]
    at org.valkyriercp.sample.simple.SimpleSampleCommandC onfig$$EnhancerByCGLIB$$d62b4032.CGLIB$application WindowCommandManager$2(<generated>) ~[cglib-nodep-2.2.jar:na]
    at org.valkyriercp.sample.simple.SimpleSampleCommandC onfig$$EnhancerByCGLIB$$d62b4032$$FastClassByCGLIB $$5fd62062.invoke(<generated>) ~[cglib-nodep-2.2.jar:na]
    at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodP roxy.java:215) ~[cglib-nodep-2.2.jar:na]
    at org.springframework.context.annotation.Configurati onClassEnhancer$BeanMethodInterceptor.intercept(Co nfigurationClassEnhancer.java:210) ~[spring-context-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    at org.valkyriercp.sample.simple.SimpleSampleCommandC onfig$$EnhancerByCGLIB$$d62b4032.applicationWindow CommandManager(<generated>) ~[cglib-nodep-2.2.jar:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method) ~[na:1.6.0_24]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39) ~[na:1.6.0_24]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25) ~[na:1.6.0_24]
    at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_24]
    at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:145) ~[spring-beans-3.0.5.RELEASE.jar:3.0.5.RELEASE]
    ... 37 common frames omitted
    6068 [main] ERROR org.valkyriercp.application.exceptionhandling.Abst ractLoggingExceptionHandler - The ExceptionHandler has thrown the following exception itself:
    java.lang.NullPointerException: null
    at org.valkyriercp.application.exceptionhandling.Mess agesDialogExceptionHandler.resolveExceptionCaption (MessagesDialogExceptionHandler.java:68) ~[classes/:na]
    at org.valkyriercp.application.exceptionhandling.JXEr rorDialogExceptionHandler.notifyUserAboutException (JXErrorDialogExceptionHandler.java:39) ~[classes/:na]
    ...
    at java.lang.Thread.dispatchUncaughtException(Thread. java:1898) [na:1.6.0_24]

  • #2
    Are you running the class from an IDE or from the command line? If running from an IDE, remember that Valkyrie using AOP weaving. IntelliJ detects this out-of-the-box and compiles the aspects into the classes as defined by the Maven plugin. If I'm not mistaken, Eclipse has a plugin like this too to enable compile time weaving.

    Comment


    • #3
      If you're using Eclipse/STS/RAD/MyEclipse/..., take a look at this:
      http://maven.apache.org/plugins/mave...-projects.html
      As for Netbeans... I haven't got a clue.
      As said before, IntelliJ works out-of-the-box.

      Comment


      • #4
        I'm doing in Intellij IDEA and does not work for me. I don't know what I can be doing wrong. I try everything.

        Thanks

        Comment


        • #5
          A little forward in the process. Open just on example at the time I get the splash screen, the login dialog, after login, the same again. The log is in the attachment.

          Thanks in advance

          Comment


          • #6
            Do a git pull and try again, if you will. Could've been a problem with some recent changes

            Comment


            • #7
              Now the samples don't compile for some errors. Mainly because a change in AbstractView, now no have a constructor with String parameter.

              Also in line 78 of SimpleSampleApplicationConfig because you are returning a PageComponentDescriptor instead a ViewDescriptor.

              Comment


              • #8
                I just did a fresh clone of the entire git repo and a mvn clean install. Everything compiles as it should. Are you sure you did a git pull of the entire codebase?

                Comment


                • #9
                  Now everything compile fine, after a fresh clone. But getting the same result like my first message.

                  What I can doing wrong? I no have more ideas about it. I'm trying to make run my first application test and something very similar happe.

                  Comment


                  • #10
                    What version of IntelliJ are you using? IDEA X? The ultimate or community edition? In your project settings, are you using the ajc compiler with the right aspectjtools library?
                    I'm using IDEA X Ultimate and importing the project from the POM configures everything correctly. However, if you're using the Community Edition, you need to install the AspectJ Support plugin and correctly configure the ajc compiler in order to correctly run the code (due to the @Configurable beans). Unfortunately, the plugin is the 0.4 version, as IntelliJ 10 is blocked for newer versions of the plugin (as it's bundled since X, but only in the Ultimate edition, whoops).
                    What you could do is create a run config which does a mvn clean compile instead of a make before install... But you're better off downloading the aspectj compiler and configuring the plugin in IntelliJ.

                    Now I'm just waiting for one of the STS guys to jump in and tell us that STS does this out of the box as well (it should, as Roo uses AspectJ quite extensively).

                    Comment


                    • #11
                      I just changed the POM a bit so that the codebase now works with STS. I'll push the changes this evening. The change was simple:
                      - move the aspectj compiler from the core module to the parent pom
                      - move the spring-aspects dependency from the core module to the parent pom
                      Oh, and I added the eclipse project files to the .gitignore list .
                      So the code can now be run in both IntelliJ IDEA X Ultimate and STS. I'll stick to supporting those 2 IDE's, as it's a nice mix of the best non-free IDE and the best free IDE (sorry IntellIJ guys, IDEA Community Edition just doesn't cut it compared to STS). If someone cares to see whether Netbeans also works, the effort is much appreciated.

                      Comment


                      • #12
                        Finally the problem was solved. The problem was a bad configuration of ajc in IDEA. Without your clue Lieven I didn't find it.

                        I'm still having the same problem in my test application and I can't find it.

                        Thanks for the help.

                        Comment


                        • #13
                          Here is my IDEA project. It was make with the Archetype, just add the FirstView class, copy the applicationLifecycleAdvisor and applicationPageFactory methods from the VLDocking sample. All the time get this:

                          11147 [main] ERROR org.valkyriercp.application.exceptionhandling.Abst ractLoggingExceptionHandler - Uncaught throwable handled.
                          java.lang.IllegalStateException: Application start thrown an exception: null
                          at org.valkyriercp.application.support.ApplicationLau ncher.launchMyRichClient(ApplicationLauncher.java: 269) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.support.ApplicationLau ncher.<init>(ApplicationLauncher.java:132) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.support.ApplicationLau ncher.<init>(ApplicationLauncher.java:104) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.support.ApplicationLau ncher.<init>(ApplicationLauncher.java:60) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at com.ernestoandernesto.ApplicationRunner.main(Appli cationRunner.java:7) ~[classes/:na]
                          java.lang.NullPointerException: null
                          at org.valkyriercp.application.support.AbstractApplic ationPage.getViewDescriptorRegistry(AbstractApplic ationPage.java:396) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.support.AbstractApplic ationPage.getViewDescriptor(AbstractApplicationPag e.java:117) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.support.AbstractApplic ationPage.showView(AbstractApplicationPage.java:27 2) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.docking.VLDockingAppli cationPage.addView(VLDockingApplicationPage.java:1 04) ~[valkyrie-rcp-vldocking-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.support.MultiViewPageD escriptor.buildInitialLayout(MultiViewPageDescript or.java:25) ~[valkyrie-rcp-core-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]
                          at org.valkyriercp.application.docking.VLDockingAppli cationPage.createControl(VLDockingApplicationPage. java:161) ~[valkyrie-rcp-vldocking-1.0-SNAPSHOT.jar:1.0-SNAPSHOT]

                          If I comment the applicationPageFactory method everything is fine. I don't have any idea what is happening.

                          Comment


                          • #14
                            Just checked your code, and it runs . It must be something with the configuration of the aspectj compiler, as the NPE is caused by a bean that should have been injected. What version of intellij are you using?

                            Comment


                            • #15
                              Grrrrrrr ... LOL. I'm using the version 10.0.3 build 103.255, jdk 1.6.0_24 from Apple. I'm attaching and image of my AJC configuration in IDEA.

                              Thanks for your time.

                              Comment

                              Working...
                              X