Hi,
I have a fresh modular Spring project where I'm trying to run appfuse:gen
-Dentity=xyz.core.model.Barrio from the web directory. The database is
getting generated fine and all that but generating the CRUD screens fails.
I keep getting
[WARNING] POM for 'org.hibernate:jtidy:pom:r8-20060801:runtime' is invalid.
It w
ill be ignored for artifact resolution. Reason: Parse error reading POM.
Reason:
TEXT must be immediately followed by END_TAG and not START_TAG (position:
START
_TAG seen ...<licenses>\n\t\t\t<license>... @12:13)
[INFO] [appfuse:gen]
[INFO] [AppFuse] Assuming 'core' has hibernate.cfg.xml in its
src/main/resources
directory
[INFO]
D:\Java\Projects\CompraVenta\web/../core/src/main/resources/hibernate.cfg
.xml not found within the project. Trying absolute path.
[INFO] Configuration XML file loaded:
D:\Java\Projects\CompraVenta\web\..\core\s
rc\main\resources\hibernate.cfg.xml
[INFO]
D:\Java\Projects\CompraVenta\web/../core/src/main/resources/hibernate.cfg
.xml not found within the project. Trying absolute path.
[INFO] Configuration XML file loaded:
D:\Java\Projects\CompraVenta\web\..\core\s
rc\main\resources\hibernate.cfg.xml
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Unable to load class declared as <mapping class="xyz.core.
model.Barrio"/> in the configuration:
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.hibernate.MappingException: Unable to load class declared as <mapping
class=
"nl.msw.compraventa.core.model.Barrio"/> in the configuration:
at
org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(Annotat
ionConfiguration.java:545)
at
org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.jav
a:1479)
at
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
at
org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1432)
at
org.hibernate.cfg.Configuration.configure(Configuration.java:1386)
at
org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura
tion.doConfiguration(AbstractComponentConfiguration.java:74)
at
org.codehaus.mojo.hibernate3.configuration.AbstractComponentConfigura
tion.getConfiguration(AbstractComponentConfiguration.java:37)
at
org.appfuse.mojo.HibernateExporterMojo.configureExporter(HibernateExp
orterMojo.java:180)
at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.configureExporter(AppF
useGeneratorMojo.java:218)
at
org.appfuse.mojo.HibernateExporterMojo.doExecute(HibernateExporterMoj
o.java:228)
at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.doExecute(AppFuseGener
atorMojo.java:251)
at
org.appfuse.mojo.HibernateExporterMojo.execute(HibernateExporterMojo.
java:138)
at
org.appfuse.mojo.exporter.AppFuseGeneratorMojo.execute(AppFuseGenerat
orMojo.java:204)
[...]
My spring config looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
default-lazy-init="true">
<!-- Add new DAOs here -->
<!-- Add new Managers here -->
<bean id="barrioManager"
class="org.appfuse.service.impl.GenericManagerImpl">
<constructor-arg>
<bean
class="org.appfuse.dao.hibernate.GenericDaoHibernate"
autowire="byType">
<constructor-arg
value="xyz.core.model.Barrio" />
</bean>
</constructor-arg>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="configLocation">
<value>classpath:hibernate.cfg.xml</value>
</property>
<property name="hibernateProperties">
<ref bean="hibernateProperties" />
</property>
<property name="dataSource">
<ref bean="MyDataSource" />
</property>
</bean>
<bean id="hibernateProperties"
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="hibernate.hbm2ddl.auto">update</prop>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.query.substitutions">
F
</prop>
<prop key="hibernate.show_sql">
@@hibernate.show_sql@@
</prop>
<prop key="hibernate.c3p0.minPoolSize">5</prop>
<prop key="hibernate.c3p0.maxPoolSize">20</prop>
<prop key="hibernate.c3p0.timeout">600</prop>
<prop
key="hibernate.c3p0.max_statement">50</prop>
<prop
key="hibernate.c3p0.testConnectionOnCheckout">
false
</prop>
</props>
</property>
</bean>
<bean id="MyDataSource"
class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/xyz</value>
</property>
</bean>
<bean id="hibernateTemplate"
class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="hibernateInterceptor"
class="org.springframework.orm.hibernate3.HibernateInterceptor">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
</beans>
++++hibernate++++
<hibernate-configuration>
<session-factory>
<mapping class="org.appfuse.model.User"/>
<mapping class="org.appfuse.model.Role"/>
<mapping class="xyz.core.model.Barrio"/>
</session-factory>
</hibernate-configuration>
Any ideas?
Thanks,
Marc
--
View this message in context:
http://www.nabble.com/app%3Agen--Unable-to-load-class-declared-as-mapping-class%3D%22xyz%22-in-the-configuration-tf4700458s2369.html#a13437588
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]