java - Error activating Bean Validation Integration - Hibernate -
i have been working on project, simple spring, hibernate, jsf,mysql integration; , run on eclipse. aim of program add person(id, first name, last name, gender, age etc.) database on mysqlworkbench , run on server.i used spring4, hibernate4 , eclipse luna tools.and constructed project maven.i try overcome different errors due different reasons while.
my updated-application: https://github.com/fsel/spring-hibernate-jsf-mysql-eclipse-integration
when run on server on eclipse, gives "error activating bean validation integration" error.i see due "classnotfoundexception: com.hibernate.data.person".but don't know how solve it.
apr 23, 2015 12:31:41 org.apache.tomcat.util.digester.setpropertiesrule begin warning: [setpropertiesrule]{server/service/engine/host/context} setting property 'source' 'org.eclipse.jst.jee.server:spring-hibernate-jsf-mysql-example' did not find matching property. apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: server version: apache tomcat/7.0.61 apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: server built: mar 27 2015 12:03:56 utc apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: server number: 7.0.61.0 apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: os name: mac os x apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: os version: 10.9.5 apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: architecture: x86_64 apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: java home: /library/java/javavirtualmachines/jdk1.8.0_31.jdk/contents/home/jre apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: jvm version: 1.8.0_31-b13 apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: jvm vendor: oracle corporation apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: catalina_base: /users/fulden/documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0 apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: catalina_home: /library/tomcat apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dcatalina.base=/users/fulden/documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0 apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dcatalina.home=/library/tomcat apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dwtp.deploy=/users/fulden/documents/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: command line argument: -djava.endorsed.dirs=/library/tomcat/endorsed apr 23, 2015 12:31:41 org.apache.catalina.startup.versionloggerlistener log info: command line argument: -dfile.encoding=utf-8 apr 23, 2015 12:31:41 org.apache.catalina.core.aprlifecyclelistener lifecycleevent info: apr based apache tomcat native library allows optimal performance in production environments not found on java.library.path: /users/fulden/library/java/extensions:/library/java/extensions:/network/library/java/extensions:/system/library/java/extensions:/usr/lib/java:. apr 23, 2015 12:31:41 org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["http-bio-8083"] apr 23, 2015 12:31:41 org.apache.coyote.abstractprotocol init info: initializing protocolhandler ["ajp-bio-8011"] apr 23, 2015 12:31:42 org.apache.catalina.startup.catalina load info: initialization processed in 435 ms apr 23, 2015 12:31:42 org.apache.catalina.core.standardservice startinternal info: starting service catalina apr 23, 2015 12:31:42 org.apache.catalina.core.standardengine startinternal info: starting servlet engine: apache tomcat/7.0.61 apr 23, 2015 12:31:43 org.apache.catalina.core.standardcontext addapplicationlistener info: listener "com.sun.faces.config.configurelistener" configured context. duplicate definition has been ignored. apr 23, 2015 12:31:43 org.apache.catalina.core.applicationcontext log info: no spring webapplicationinitializer types detected on classpath apr 23, 2015 12:31:43 org.apache.catalina.core.applicationcontext log info: initializing spring root webapplicationcontext info : org.springframework.web.context.contextloader - root webapplicationcontext: initialization started info : org.springframework.web.context.support.xmlwebapplicationcontext - refreshing root webapplicationcontext: startup date [thu apr 23 00:31:43 eest 2015]; root of context hierarchy info : org.springframework.beans.factory.xml.xmlbeandefinitionreader - loading xml bean definitions servletcontext resource [/web-inf//applicationcontext.xml] error: org.hibernate.assertionfailure - hhh000099: assertion failure occured (this may indicate bug in hibernate, more due unsafe use of session): java.lang.classnotfoundexception: com.hibernate.data.person warn : org.springframework.web.context.support.xmlwebapplicationcontext - exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.beancreationexception: error creating bean name 'sessionfactory' defined in servletcontext resource [/web-inf//applicationcontext.xml]: invocation of init method failed; nested exception org.hibernate.cfg.beanvalidation.integrationexception: error activating bean validation integration @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1574) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:539) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:476) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:303) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:299) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:736) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:757) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:480) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:403) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:306) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:106) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:5016) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5528) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1575) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1565) @ java.util.concurrent.futuretask.run(futuretask.java:266) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) @ java.lang.thread.run(thread.java:745) caused by: org.hibernate.cfg.beanvalidation.integrationexception: error activating bean validation integration @ org.hibernate.cfg.beanvalidation.beanvalidationintegrator.integrate(beanvalidationintegrator.java:154) @ org.hibernate.internal.sessionfactoryimpl.<init>(sessionfactoryimpl.java:312) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1857) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1928) @ org.springframework.orm.hibernate4.localsessionfactorybuilder.buildsessionfactory(localsessionfactorybuilder.java:372) @ org.springframework.orm.hibernate4.localsessionfactorybean.buildsessionfactory(localsessionfactorybean.java:454) @ org.springframework.orm.hibernate4.localsessionfactorybean.afterpropertiesset(localsessionfactorybean.java:439) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1633) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1570) ... 21 more caused by: org.hibernate.assertionfailure: entity class not found @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:187) @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:159) @ org.hibernate.cfg.beanvalidation.typesafeactivator.activate(typesafeactivator.java:111) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.hibernate.cfg.beanvalidation.beanvalidationintegrator.integrate(beanvalidationintegrator.java:148) ... 29 more caused by: java.lang.classnotfoundexception: com.hibernate.data.person @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1720) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:344) @ org.hibernate.internal.util.reflecthelper.classforname(reflecthelper.java:171) @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:184) ... 36 more error: org.springframework.web.context.contextloader - context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'sessionfactory' defined in servletcontext resource [/web-inf//applicationcontext.xml]: invocation of init method failed; nested exception org.hibernate.cfg.beanvalidation.integrationexception: error activating bean validation integration @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1574) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:539) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:476) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:303) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:299) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:736) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:757) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:480) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:403) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:306) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:106) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:5016) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5528) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1575) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1565) @ java.util.concurrent.futuretask.run(futuretask.java:266) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) @ java.lang.thread.run(thread.java:745) caused by: org.hibernate.cfg.beanvalidation.integrationexception: error activating bean validation integration @ org.hibernate.cfg.beanvalidation.beanvalidationintegrator.integrate(beanvalidationintegrator.java:154) @ org.hibernate.internal.sessionfactoryimpl.<init>(sessionfactoryimpl.java:312) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1857) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1928) @ org.springframework.orm.hibernate4.localsessionfactorybuilder.buildsessionfactory(localsessionfactorybuilder.java:372) @ org.springframework.orm.hibernate4.localsessionfactorybean.buildsessionfactory(localsessionfactorybean.java:454) @ org.springframework.orm.hibernate4.localsessionfactorybean.afterpropertiesset(localsessionfactorybean.java:439) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1633) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1570) ... 21 more caused by: org.hibernate.assertionfailure: entity class not found @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:187) @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:159) @ org.hibernate.cfg.beanvalidation.typesafeactivator.activate(typesafeactivator.java:111) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.hibernate.cfg.beanvalidation.beanvalidationintegrator.integrate(beanvalidationintegrator.java:148) ... 29 more caused by: java.lang.classnotfoundexception: com.hibernate.data.person @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1720) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:344) @ org.hibernate.internal.util.reflecthelper.classforname(reflecthelper.java:171) @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:184) ... 36 more apr 23, 2015 12:31:45 org.apache.catalina.core.standardcontext listenerstart severe: exception sending context initialized event listener instance of class org.springframework.web.context.contextloaderlistener org.springframework.beans.factory.beancreationexception: error creating bean name 'sessionfactory' defined in servletcontext resource [/web-inf//applicationcontext.xml]: invocation of init method failed; nested exception org.hibernate.cfg.beanvalidation.integrationexception: error activating bean validation integration @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1574) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:539) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:476) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:303) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:299) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:194) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:736) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:757) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:480) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:403) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:306) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:106) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:5016) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5528) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1575) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1565) @ java.util.concurrent.futuretask.run(futuretask.java:266) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:617) @ java.lang.thread.run(thread.java:745) caused by: org.hibernate.cfg.beanvalidation.integrationexception: error activating bean validation integration @ org.hibernate.cfg.beanvalidation.beanvalidationintegrator.integrate(beanvalidationintegrator.java:154) @ org.hibernate.internal.sessionfactoryimpl.<init>(sessionfactoryimpl.java:312) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1857) @ org.hibernate.cfg.configuration.buildsessionfactory(configuration.java:1928) @ org.springframework.orm.hibernate4.localsessionfactorybuilder.buildsessionfactory(localsessionfactorybuilder.java:372) @ org.springframework.orm.hibernate4.localsessionfactorybean.buildsessionfactory(localsessionfactorybean.java:454) @ org.springframework.orm.hibernate4.localsessionfactorybean.afterpropertiesset(localsessionfactorybean.java:439) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeinitmethods(abstractautowirecapablebeanfactory.java:1633) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1570) ... 21 more caused by: org.hibernate.assertionfailure: entity class not found @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:187) @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:159) @ org.hibernate.cfg.beanvalidation.typesafeactivator.activate(typesafeactivator.java:111) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:483) @ org.hibernate.cfg.beanvalidation.beanvalidationintegrator.integrate(beanvalidationintegrator.java:148) ... 29 more caused by: java.lang.classnotfoundexception: com.hibernate.data.person @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1720) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571) @ java.lang.class.forname0(native method) @ java.lang.class.forname(class.java:344) @ org.hibernate.internal.util.reflecthelper.classforname(reflecthelper.java:171) @ org.hibernate.cfg.beanvalidation.typesafeactivator.applyrelationalconstraints(typesafeactivator.java:184) ... 36 more apr 23, 2015 12:31:45 com.sun.faces.config.configurelistener contextinitialized info: initializing mojarra 2.2.10 ( 20150205-0906 https://svn.java.net/svn/mojarra~svn/tags/2.2.10@14334) context '/spring-hibernate-jsf-mysql-example' apr 23, 2015 12:31:45 com.sun.faces.spi.injectionproviderfactory createinstance info: jsf1048: postconstruct/predestroy annotations present. managedbeans methods marked these annotations have said annotations processed. apr 23, 2015 12:31:46 org.primefaces.webapp.postconstructapplicationeventlistener processevent info: running on primefaces 5.0 apr 23, 2015 12:31:46 org.apache.catalina.core.standardcontext startinternal severe: error listenerstart apr 23, 2015 12:31:46 org.apache.catalina.core.standardcontext startinternal severe: context [/spring-hibernate-jsf-mysql-example] startup failed due previous errors apr 23, 2015 12:31:46 org.apache.catalina.core.applicationcontext log info: closing spring root webapplicationcontext apr 23, 2015 12:31:46 org.apache.coyote.abstractprotocol start info: starting protocolhandler ["http-bio-8083"] apr 23, 2015 12:31:46 org.apache.coyote.abstractprotocol start info: starting protocolhandler ["ajp-bio-8011"] apr 23, 2015 12:31:46 org.apache.catalina.startup.catalina start info: server startup in 4203 ms
screen shot:
domain-classes.hbm.xml:
<?xml version="1.0"?> <!doctype hibernate-mapping public "-//hibernate/hibernate mapping dtd 3.0//en" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class table="person" lazy="false" name="com.hibernate.data.person"> <id column="person_id" type="int" name="id"> <generator class="increment" /> </id> <property name="firstname" column="person_firstname" type="string" /> <property name="lastname" column="person_lastname" type="string" /> <property name="gender" column="person_gender" type="string" /> <property name="age" column="person_age" type="int" /> </class> </hibernate-mapping>
hibernate.cfg.xml:
<?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- database connection settings --> <property name="hibernate.connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/persondb</property> <property name="hibernate.connection.username">fulden</property> <property name="hibernate.connection.password">secret_pass</property> <!-- sql dialect --> <property name="hibernate.dialect">org.hibernate.dialect.mysqldialect</property> <!-- show sql --> <property name="show_sql">true</property> <!-- specify session context --> <property name="hibernate.current_session_context_class">thread</property> <!-- jdbc connection pool (use built-in) --> <property name="connection.pool_size">1</property> <!-- autocommit --> <property name="hibernate.connection.autocommit">false</property> <!-- referring mapping file --> <mapping resource="domain-classes.hbm.xml" /> </session-factory> </hibernate-configuration>
how can fix this?
thanks suggestion..
problem com.hibernate.data.person class not there. have it, , configured hibernate entity