ncthuc / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
0 stars 0 forks source link

JPABaseDAO - java.lang.NoSuchMethodError #106

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi. I'm getting java.lang.NoSuchMethodError exception in dao.save method. 
Please help me..

Here is full eception:
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: 
org.hibernate.metadata.ClassMetadata.getIdentifier(Ljava/lang/Object;Lorg/hibern
ate/engine/spi/SessionImplementor;)Ljava/io/Serializable;
    at com.googlecode.genericdao.search.hibernate.HibernateEntityMetadata.getIdValue(HibernateEntityMetadata.java:58)
    at com.googlecode.genericdao.search.hibernate.HibernateMetadataUtil.getId(HibernateMetadataUtil.java:63)
    at com.googlecode.genericdao.dao.jpa.JPABaseDAO._persistOrMerge(JPABaseDAO.java:258)
    at com.googlecode.genericdao.dao.jpa.GenericDAOImpl.save(GenericDAOImpl.java:113)
    at dto.Service.KampanyaServiceImpl.save(KampanyaServiceImpl.java:27)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
    at sun.proxy.$Proxy22.save(Unknown Source)
    at app.KampanyaYonetim.KampanyaEkleDuzenle$1.actionPerformed(KampanyaEkleDuzenle.java:52)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at com.jtattoo.plaf.BaseButtonListener.mouseReleased(BaseButtonListener.java:60)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

@Transactional
public class KampanyaServiceImpl implements KampanyaService {
    KampanyaDAO dao;

    @Autowired
    public void setDao(KampanyaDAO dao) {
            this.dao = dao;
    }

    public void persist(Kampanya kampanya) {
        dao.persist(kampanya);
    }

    public void save(Kampanya kampanya) {
        dao.save(kampanya);
    }

    public void save(Kampanya ... kampanyas) {
            dao.save(kampanyas);
    }

    public List<Kampanya> findAll() {
            return dao.findAll();
    }

    public Kampanya findByName(String name) {
            if (name == null)
                    return null;
            return dao.searchUnique(new Search().addFilterEqual("name", name));
    }

    public void flush() {
            dao.flush();
    }

    public Kampanya find(int selectedId) {
        return this.dao.find(selectedId);
    }

    public Kampanya[] find(Integer ... selectedIds) {
        return this.dao.find(selectedIds);
    }

    public void delete(Kampanya kampanya) {
        this.dao.remove(kampanya);
    }

    public void delete(Kampanya ... kampanyas) {
        this.dao.remove(kampanyas);
    }

}

Original issue reported on code.google.com by aege...@gmail.com on 26 Jun 2013 at 2:01

GoogleCodeExporter commented 8 years ago
Is this relevant anymore?

Original comment by pablit...@gmail.com on 14 Jun 2014 at 7:04

GoogleCodeExporter commented 8 years ago
No reply from reporter.

Original comment by pablit...@gmail.com on 8 Jul 2014 at 3:21