Я не понимаю, что здесь происходит. Это исключение я получаю:Hibernate-Component класс не найден
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [file:/C:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/demoBancoWeb/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.component.PojoComponentTuplizer]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
.
.
.
Caused by: java.lang.ClassNotFoundException: co.edu.icesi.demo.modelo.ConsignacionesId
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1305)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1139)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:193)
at org.hibernate.mapping.Component.getComponentClass(Component.java:138)
... 42 more
Первый блок трассировки стека является исключением Hibernate и второй блок следа является отношение с моими классами.
Этот класс, ConsignacionesId был автоматически сгенерирован Hibernate как идентификатор с несколькими атрибутами.
Это мой спящий режим cfg.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.password">admin</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/banco</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.search.autoregister_listeners">false</property>
<property name="show_sql">true</property>
<mapping resource="co/edu/icesi/demo/modelo/Clientes.hbm.xml"/>
<mapping resource="co/edu/icesi/demo/modelo/Cuentas.hbm.xml"/>
<mapping resource="co/edu/icesi/demo/modelo/TiposUsuarios.hbm.xml"/>
<mapping resource="co/edu/icesi/demo/modelo/TiposDocumentos.hbm.xml"/>
<mapping resource="co/edu/icesi/demo/modelo/Consignaciones.hbm.xml"/>
<mapping resource="co/edu/icesi/demo/modelo/Usuarios.hbm.xml"/>
<mapping resource="co/edu/icesi/demo/modelo/Retiros.hbm.xml"/>
<mapping resource="co/edu/icesi/demo/modelo/Consultas.hbm.xml"/>
</session-factory>
</hibernate-configuration>
И, наконец, это мои классы генерируются Hibernate:
Как вы можете видеть, ConsignacionesId там. Любая помощь приветствуется.
ли все ваши классы составлены правильно? – shankarsh15
Да, они это сделали. Я нашел решение, но оно не кажется очень продолжительным. Я добавил папку класса «modelo» в путь сборки, и он сработал. Я понятия не имею, почему это произошло. –
проверить, что вы публикуете свой полный стек исключения? –