Menu

ugly class cast error

Help
2007-04-30
2013-05-02
  • emerytelcom

    emerytelcom - 2007-04-30

    I downloaded the NO framework snap shot from the NO development repository today. I can't start the application due to what appears to be an error in the framework. Look at this stack trace. What could the problem be?

    9967  [NakedObjectsSystem   main       ERROR]  client start up problem  -- org.nakedobjects.system.NakedObjectsSystem.showClient(NakedObjectsSystem.java:549)
    java.lang.ClassCastException: org.nakedobjects.nof.core.adapter.map.ObjectLoaderImpl cannot be cast to org.nakedobjects.nos.store.hibernate.HibernateObjectLoaderImpl
            at org.nakedobjects.nos.store.hibernate.HibernateObjectStore.loadObjects(HibernateObjectStore.java:321)
            at org.nakedobjects.nos.store.hibernate.HibernateObjectStore.getInstances(HibernateObjectStore.java:224)
            at org.nakedobjects.nos.store.hibernate.HibernateObjectStore.getInstances(HibernateObjectStore.java:192)
            at org.nakedobjects.nof.persist.objectstore.ObjectStorePersistor.getInstances(ObjectStorePersistor.java:127)
            at org.nakedobjects.nof.core.persist.AbstractObjectPersistor.findInstances(AbstractObjectPersistor.java:43)
            at org.nakedobjects.nof.core.context.NakedObjectsContext.getPerspective(NakedObjectsContext.java:79)
            at org.nakedobjects.nof.core.context.NakedObjectsContext.getPerspective(NakedObjectsContext.java:67)
            at org.nakedobjects.nos.client.dnd.viewer.DndClient.init(DndClient.java:143)
            at org.nakedobjects.system.NakedObjectsSystem.showClient(NakedObjectsSystem.java:547)
            at org.nakedobjects.nof.boot.NakedObjects.main(NakedObjects.java:188)

     
    • Dan Haywood

      Dan Haywood - 2007-04-30

      Hi,
      This problem has since been fixed, I suspect Rob will be posting an update shortly to the main snapshot.

      However, if you want you might want to try out the new Eclipse-based NO IDE.  If you follow the instructinos on the wiki this will let you install a version of the NOF that has the fix.  You'll also get some cool development tools for free.

      Let us know how you get on
      Dan

       
    • emerytelcom

      emerytelcom - 2007-05-01

      I installed the NO IDE. It looks like a time saving tool.

      I haven't used IDEs in Eclipse at all. Is the naked objects nature supposed to resolve all of the NO libraries? It can't find the org.nakedobjects.nof.reflect.java.fixture.JavaFixture class.

       
      • Dan Haywood

        Dan Haywood - 2007-05-01

        No - the NO nature merely enables NO refactoring and also the NO project builder.

        Under Eclipse we recommend that you have your projects as plugin-projects: this makes setting up the classpath (in the manifest.mf) really easy.  There are details in the help file.  But you need to do that by hand.  That said...

        ... the way I've designed the NO IDE is to have 3 separate projects, and there is a project wizard for each.  The application project is minimally dependent on the NO applib and nothing else. The fixture project depends on NOF itself - so you should be able to find JavaFixture there.  And the client project depends on the NOF too, to be able to run the clients or to run the tests.

        So what I suggest what you do is create three new projects, then copy your existing code into the appropriate project (your domain classes into the application project, your fixture into the fixture project, and you tests into the client project).  Use the example code that is already there to guide you.

        Let us know how you get on.
        Dan

         
    • emerytelcom

      emerytelcom - 2007-05-01

      Wow, really cool. I wish that I would have used this for initial development.

       
      • Dan Haywood

        Dan Haywood - 2007-05-01

        Glad you like it!  But I guess you couldn't have used it before cos it's hot off the press.

        Please use bugzilla for bug reports and feature requests.

        Dan

         
    • emerytelcom

      emerytelcom - 2007-05-01

      The IDE is the bomb. It launches so fast. It will save me hours of idle internet browsing that I used to do while I waited for ant to start the application.

       

Log in to post a comment.

MongoDB Logo MongoDB