0 Replies Latest reply on Feb 22, 2010 9:54 AM by William Woodman

    seam project cant find my groovy entity class - help required

    William Woodman Master

      having a problem using groovy within seam project


      I have installed jboss tools 3.1cr1, eclipse, groovy plugin, seam 2.2 and as5.1


      i create a seam project in eclipse (generates 4 projects on the disk) and enabled groovy on the ejb project and the web project.


      i created a standard entity in java using the menus - no problem


      I then create another entity as asubclass as a groovy entity see below


      package org.domain.forsterslist.session;
      
      import org.domain.forsterslist.entity.Person;
      import org.jboss.seam.annotations.Begin;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.web.RequestParameter;
      import org.jboss.seam.framework.EntityHome;
      
      @Name("personHome")
      class PersonHome extends EntityHome<Person>
      {
           @RequestParameter Long personId;
           
           @Override
           public Object getId()
           {
                if (personId == null)
                {
                     return super.getId()
                }
                else
                {
                     return personId
                }
           }
           
           @Override @Begin
           public void create() 
           {
                super.create()
           }
      }
      



      this compiles ok and classes get generated into build/classes subdirectories


      however when i deploy on the server i get class not found exception.  class loader cant find my groovy compiled class


      how do i fix this?



      Caused by: java.lang.ClassNotFoundException: org.domain.forsterslist.entity.Person from BaseClassLoader@12c08c7{VFSClassLoaderPolicy@1f44aa6{name=vfsfile:/C:/jboss/jboss-5.1.0.GA/server/default/conf/jboss-service.xml domain=ClassLoaderDomain@10a5c21{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@506411} ...
           at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:247)
           at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:135)
           at org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1009)
           at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1081)
           ... 60 more