Announcement Announcement Module
Collapse
No announcement yet.
Getting started: problems Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting started: problems

    Hello guys, i'm a student with j2se programming experience, i used hibernate in a project for school and really liked it, but now for the first time i want to use a framework. I'm familiar with the concept of a framework (i use a php framework each day). Advanced concepts like ioc and the methods of packaging/deploying (eg with maven2) are new for me, but i want to learn ;-)
    I have used eclipse 3.2 for creating some java projects and i can find my way in it ;-). I can work with both the svn cli program as with subclipse

    I want to write a desktop application (panels with reports, editable entries, draggable items, with in the datalayer hibernate and a SOAP client), using spring rich client but i have problems getting started

    1) how does SRC relate to spring (2) ? I've found out that SRC is a subproject of spring, and that src is meant to make programming of desktop applications easier, by providing an api which also simplifies working with swing. But i wonder: do you need spring or spring 2 when working with SRC? or does src on itself offer all the functionality one would wish for writing a desktop application?

    2) this depends a bit on the answer of 1), but i've tried to get started using spring 2 for desktop applications, so obviously i checked out http://www.springframework.org/documentation and did some further searching on the web, but my problem is that most, if not all tutorials/articles/howto's are about web applications (using *.wars, tomcat,...) and/or are outdated: they discuss spring 1 (understandable offcourse since spring 2 is so new). So my question basically is: can anyone point me to a good article/howto/tutorial or even ebook about using spring 2 for web applications? or am i searching way too far?

    3) despite my experience with writing other java projects (not using a framework but using hibernate), i have problems with just getting SRC to "run" by for example trying a sample project.
    Things i have tried:
    a)http://spring-rich-c.sourceforge.net...mentSetup.html
    Here is what i tried and what i got (you might want to start looking at the bottom first)
    http://users.edpnet.be/dieter/devsetup
    b) http://spring-rich-c.sourceforge.net...ngStarted.html
    i'm stuck here because i don't understand the principles of groupid and artifactid. I found this
    Do i need j2ee? i want to use j2se. I also don't have any experience with WAR, EAR, EJB and RAR stuff.
    c) I know there is also http://pa.rsons.org/node/3
    but this guy doesn't use eclipse, he uses ant (which is, afaik, not needed?) so i didn't try this method.

  • #2
    1) Spring-richclient iss build on top of the spring-framework. Unlike the very stable spring-framework it's still alpha, but some parts of it are mostly stable.

    2) Spring in action: In about 250 pages you 'll learn the spring-framework.
    There is no book about spring-richclient yet.

    3) Like described in the eclipse setup in the devSetup, M2_REPO should be set in Eclipse. I believe it's safe to close the project "archetype".

    Let us know how we can improve the devSetup guide and which other links should be put in our website.

    Comment


    • #3
      Hey ge0ffrey, guess which school i'm studying at...
      Maybe you remember i asked your help about hibernate last year ;-)
      Too bad you're not around anymore
      but anyway:

      i had a typo .. typed m2_HOME instead of M2_HOME .. d'oh

      Speaking of typo's, i found this one on the devsetup page: "export JAVAHOME=...." should be JAVA_HOME

      I'm now able to start some demo applications but they immediatly die after starting.
      petclinic-standalone:
      Code:
      2007-03-04 00:04:14,723 ERROR org.springframework.richclient.samples.petclinic.PetClinicStandalone - RuntimeException during startup
      org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.richclient.exceptionhandling.DelegatingExceptionHandler] for bean with name 'exceptionHandler' defined in class path resource [org/springframework/richclient/samples/petclinic/ctx/common/richclient-application-context.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.richclient.exceptionhandling.DelegatingExceptionHandler
      Caused by: 
      java.lang.ClassNotFoundException: org.springframework.richclient.exceptionhandling.DelegatingExceptionHandler
      	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      	at org.springframework.util.ClassUtils.forName(ClassUtils.java:183)
      	at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:317)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1044)
      	at org.springframework.beans.factory.support.AbstractBeanFactory.isBeanClassMatch(AbstractBeanFactory.java:1072)
      	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:165)
      	at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:691)
      	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:395)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
      	at org.springframework.richclient.application.ApplicationLauncher.loadRootApplicationContext(ApplicationLauncher.java:262)
      	at org.springframework.richclient.application.ApplicationLauncher.<init>(ApplicationLauncher.java:158)
      	at org.springframework.richclient.samples.petclinic.PetClinicStandalone.main(PetClinicStandalone.java:39)
      simpleApp gives this:
      Code:
      [INFO,SimpleApp,main] SimpleApp starting up
      [INFO,ApplicationLauncher,main] Loading startup context from classpath resource [/org/springframework/richclient/samples/simple/ctx/richclient-startup-context.xml]
      [INFO,CollectionFactory,main] JDK 1.4+ collections available
      [INFO,CollectionFactory,main] Commons Collections 3.x available
      [INFO,XmlBeanDefinitionReader,main] Loading XML bean definitions from class path resource [org/springframework/richclient/samples/simple/ctx/richclient-startup-context.xml]
      [INFO,ClassPathXmlApplicationContext,main] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=12217475]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [splashScreen]; root of BeanFactory hierarchy
      [INFO,ClassPathXmlApplicationContext,main] 1 beans defined in application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=12217475]
      [INFO,ClassPathXmlApplicationContext,main] Unable to locate MessageSource with name 'messageSource': using default [[email protected]6]
      [INFO,ClassPathXmlApplicationContext,main] Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@12611a7]
      [INFO,DefaultListableBeanFactory,main] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [splashScreen]; root of BeanFactory hierarchy]
      [INFO,XmlBeanDefinitionReader,main] Loading XML bean definitions from class path resource [org/springframework/richclient/samples/simple/ctx/richclient-application-context.xml]
      [INFO,ClassPathXmlApplicationContext,main] Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=15020576]: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [application,lifecycleAdvisor,initialView,contactView,contactDataStore,serviceLocator,applicationServices,applicationEventMulticaster,applicationDescriptor,applicationObjectConfigurer,lookAndFeelConfigurer,messageSource,imageResourcesFactory,imageSource,formComponentInterceptorFactory,rulesSource,conversionService]; root of BeanFactory hierarchy
      [INFO,ClassPathXmlApplicationContext,main] 17 beans defined in application context [org.springframework.context.support.ClassPathXmlApplicationContext;hashCode=15020576]
      [INFO,ClassPathXmlApplicationContext,main] Bean 'applicationServices' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      [INFO,ClassPathXmlApplicationContext,main] Bean 'serviceLocator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      [INFO,ClassPathXmlApplicationContext,main] Bean 'applicationObjectConfigurer' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
      [INFO,ClassPathXmlApplicationContext,main] Using MessageSource [org.springframework.context.support.ResourceBundleMessageSource: basenames=[org.springframework.richclient.samples.simple.ui.messages,org.springframework.richclient.application.messages]]
      [INFO,ClassPathXmlApplicationContext,main] Using ApplicationEventMulticaster [org.springframework.context.event.SimpleApplicationEventMulticaster@1b01afa]
      [INFO,DefaultListableBeanFactory,main] Pre-instantiating singletons in factory [org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [application,lifecycleAdvisor,initialView,contactView,contactDataStore,serviceLocator,applicationServices,applicationEventMulticaster,applicationDescriptor,applicationObjectConfigurer,lookAndFeelConfigurer,messageSource,imageResourcesFactory,imageSource,formComponentInterceptorFactory,rulesSource,conversionService]; root of BeanFactory hierarchy]
      [INFO,DefaultApplicationDescriptor,main] This labeled object's display name is not configured; returning 'displayName'
      [INFO,DefaultApplicationObjectConfigurer,main] The message source is unable to find message code [applicationDescriptor.label]. Ignoring and returning null.
      [INFO,ResourceMapFactoryBean,main] Loading properties file from class path resource [org/springframework/richclient/image/images.properties]
      [INFO,ResourceMapFactoryBean,main] Loading properties file from class path resource [org/springframework/richclient/samples/simple/ui/images.properties]
      [INFO,DefaultApplicationObjectConfigurer,main] Labelable object's image 'applicationDescriptor.image' does not exist in image bundle; continuing...
      [INFO,DefaultApplicationObjectConfigurer,main] The message source is unable to find message code [initialView.title]. Ignoring and returning null.
      [INFO,DefaultViewDescriptor,main] This labeled object's display name is not configured; returning 'displayName'
      [INFO,DefaultViewDescriptor,main] This labeled object's display name is not configured; returning 'displayName'
      [INFO,DefaultViewDescriptor,main] This labeled object's display name is not configured; returning 'displayName'
      [INFO,DefaultApplicationObjectConfigurer,main] The message source is unable to find message code [initialView.description]. Ignoring and returning null.
      [INFO,DefaultApplicationObjectConfigurer,main] Labelable object's image 'initialView.image' does not exist in image bundle; continuing...
      [INFO,DefaultViewDescriptor,main] This labeled object's display name is not configured; returning 'displayName'
      [INFO,DefaultApplicationObjectConfigurer,main] The message source is unable to find message code [contactView.description]. Ignoring and returning null.
      [INFO,DefaultApplicationObjectConfigurer,main] Labelable object's image 'contactView.image' does not exist in image bundle; continuing...
      Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
      	The constructor IllegalArgumentException(String, NoSuchBeanDefinitionException) is undefined
      	The constructor IllegalStateException(String, Throwable) is undefined
      
      	at org.springframework.richclient.application.ApplicationLauncher.launchMyRichClient(ApplicationLauncher.java:293)
      	at org.springframework.richclient.application.ApplicationLauncher.<init>(ApplicationLauncher.java:159)
      	at org.springframework.richclient.samples.simple.app.SimpleApp.main(SimpleApp.java:77)
      Last edited by Dieter@be; Mar 4th, 2007, 03:38 PM. Reason: added extra problem

      Comment


      • #4
        hmm i updated the svn WC to 1727, and installed mvn version 2.0.5 as required, I did the procedure again, tried both "mvn -Declipse.downloadSources=true eclipse:eclipse" and "mvn eclipse:eclipse". Both give the same behaviour as mentioned in my previous post

        I can add that i get these errors:
        Code:
        Severity and Description	Path	Resource	Location	Creation Time	Id
        The constructor IllegalArgumentException(String, IllegalAccessException) is undefined	spring-richclient-support/src/main/java/org/springframework/richclient/form/binding/swing	ListBinder.java	line 74	1173047912144	202534
        The constructor IllegalArgumentException(String, NoSuchBeanDefinitionException) is undefined	spring-richclient-support/src/main/java/org/springframework/richclient/application	ApplicationLauncher.java	line 293	1173047913468	202591
        The constructor IllegalArgumentException(String, NoSuchFieldException) is undefined	spring-richclient-support/src/main/java/org/springframework/richclient/form/binding/swing	ListBinder.java	line 76	1173047912144	202535
        The constructor IllegalStateException(String, Throwable) is undefined	spring-richclient-support/src/main/java/org/springframework/richclient/application	ApplicationLauncher.java	line 316	1173047913468	202592
        The method contains(String) is undefined for the type String	spring-richclient-support/src/main/java/org/springframework/richclient/form/builder	TableFormBuilder.java	line 261	1173047912051	202531
        The project cannot be built until its prerequisite spring-richclient-petclinic-gui is built. Cleaning and building all projects is recommended		spring-richclient-petclinic-standalone	Unknown	1173047915274	202628
        The project cannot be built until its prerequisite spring-richclient-tiger is built. Cleaning and building all projects is recommended		spring-richclient-petclinic-gui	Unknown	1173047915252	202627
        The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Enum. Fix the build path then try building this project		spring-richclient-tiger	Unknown	1173047914968	202626
        The type Class is not generic; it cannot be parameterized with arguments <T>	spring-richclient-core/src/test/java/org/springframework/richclient/util	EventListenerListHelperTests.java	line 1	1173047903971	202437
        The type Class is not generic; it cannot be parameterized with arguments <T>	spring-richclient-support/src/test/java/org/springframework/richclient/table	AbstractMutableTableModelTests.java	line 1	1173047913740	202623
        The type java.lang.Enum cannot be resolved. It is indirectly referenced from required .class files	spring-richclient-tiger/src/main/java/org/springframework/richclient/exceptionhandling	ShutdownPolicy.java	line 1	1173047914967	202625
        The type List is not generic; it cannot be parameterized with arguments <E>	spring-richclient-sandbox/src/main/java/org/springframework/binding/value/support	ObservableEventList.java	line 36	1173047914720	202624

        Comment


        • #5
          Okay, i fixed it

          for some reason eclipse had the (reserved) variable JRE_LIB set to some blackdown 1.4 jar, even though i had set sun jdk 1.5 as default jre (which should make eclipse update the JRE_LIB variable). After deleting the blackdown jre it updated, and now it's working
          (i'll report this too eclipse bugs )

          Comment


          • #6
            When Eclipse starts working against me, I use this:
            "mvn eclipse:clean eclipse:eclipse"

            Comment

            Working...
            X