2 Replies Latest reply on Oct 25, 2013 7:55 AM by xiang yingbing

    transfer client application class entity exception: java.lang.ClassNotFoundException: org.hibernate.proxy.pojo.javassist.SerializableProxy

    Владимир Козачук Newbie

      Server JBoss as 7

      there bean Stateless

       

        • @Stateless
        • @Remote(FindZapravRemote.class)
        • @LocalBean
        • public class FindZaprav implements FindZapravRemote {
        •   @PersistenceContext()
        •   private EntityManager em;
        • @Override
        •   public List<Zaprav> getZaprav() {
        •   List<Zaprav> resultList = new ArrayList<Zaprav>( em.createQuery("select z from Zaprav z order by " + fieldOrder).getResultList());
        •   return resultList;
        •   }
        • }

      there bean Entity (describes the table mysql)

       

        • @Entity
        • @Table(name = "zaprav", catalog = "blackbox_ejb")
        • public class Zaprav implements java.io.Serializable {
        • ...

      and client application that invokes the (public List<Zaprav> getZaprav())

       

        • List<Zaprav> zl = ejb.getZaprav();
        •   for(int i = 0; i < zl.size(); i++) {
        •   Zaprav zap = (Zaprav)zl.get(i);
        •   System.out.println("zapr " + zap.getStartDateTime());
        •      }

      at which execution occurs exception

      Exception in thread "main" java.lang.reflect.UndeclaredThrowableException

        at com.sun.proxy.$Proxy0.getZaprav(Unknown Source)

        at test.RunItTest.main(RunItTest.java:129)

      Caused by: java.lang.ClassNotFoundException: org.hibernate.proxy.pojo.javassist.SerializableProxy

        at java.net.URLClassLoader$1.run(Unknown Source)

       

      I see that the server has fulfilled the request but does not send a response to the client or the client can not get it. though entity implements java.io.Serializable. how to get?