Ok, I/it failed again. Here's what I did.
* Created a new Spring modular project
* went into the dir: mvn
* went into core: mvn install eclipse:eclipse
* went into web: mvn install eclipse:eclipse
* copied my model classes into the project: they are annoted for
JPA/Hibernate
* Updated applicationContext.xml with additional settings:
+ see below
* went into core: mvn appfuse:gen -Dentity=Country
+ Ok, I see a manager added, but no DAO. Not sure if that's supposed to
happen.
* went into root: mvn install
+ runs ok, but reports some test Failures on a testclass I had previously
created. Shouldn't be an issue I would say
+ also see some db-errors but they are all of the variety "table doesn't
exist" when it actually does. Probably a timing issue. Doesn't seem to lead
to problems. The database gets created ok.
* went into web: mvn appfuse:gen -Dentity=Country
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Unable to load class declared as <mapping
class="nl.msw.compraventa.model
.Archive"/> in the configuration:
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.hibernate.MappingException: Unable to load class declared as <mapping
class=
"nl.msw.compraventa.model.Archive"/> 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)
<?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 -->
<!--CountryManager-START-->
<bean id="countryManager"
class="org.appfuse.service.impl.GenericManagerImpl">
<constructor-arg>
<bean class="org.appfuse.dao.hibernate.GenericDaoHibernate">
<constructor-arg value="nl.msw.compraventa.model.Country"/>
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
</constructor-arg>
</bean>
<!--CountryManager-END-->
<!-- Add new Managers here -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.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>
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</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.show_sql">true</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="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:jdbc.properties</value>
<value>classpath:mail.properties</value>
</list>
</property>
</bean>
<bean id="MyDataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"
value="${jdbc.driverClassName}" />
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
</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>
mschipperheyn wrote:
>
> Ok. I did try adding the new DAOs here comment before. Not the other one.
> I'll start over on a fresh install and see what happens and post it here.
>
> cheers,
>
> Marc
>
>
>
> mraible wrote:
>>
>> There's a couple comments that AMP looks for in
>> core/src/main/resources/applicationContext.xml. Maybe that's causing
>> the problem?
>>
>> <!-- Add new DAOs here -->
>>
>> <!-- Add new Managers here -->
>>
>> Matt
>>
>> On 1/11/08, mschipperheyn <[EMAIL PROTECTED]> wrote:
>>>
>>> Well, I generated the project two or three days ago, so it should be the
>>> latest version. I did use the src directory of my "old project" because
>>> I
>>> wanted to continue developing it. Perhaps this is the reason?
>>>
>>> cheers,
>>>
>>> Marc
>>>
>>>
>>> mraible wrote:
>>> >
>>> > What version of AppFuse are you using? This should've been fixed in
>>> > 2.0.1.
>>> >
>>> > Matt
>>> >
>>> > On Jan 11, 2008, at 5:42 AM, mschipperheyn wrote:
>>> >
>>> >>
>>> >> Hi,
>>> >>
>>> >> I have a Spring modular project and I'm trying to run appfuse:gen
>>> >> from the
>>> >> web module.
>>> >> I have run appfuse:gen from the core module and then mvn install
>>> >> from the
>>> >> root (I also tried from core).
>>> >>
>>> >> I get
>>> >> [INFO] Unable to load class declared as <mapping class="xyz.model
>>> >> .Archive"/> in the configuration:
>>> >>
>>> >> this POJO is the first one mentioned if the hibernate.cfg.xml file
>>> >> in core.
>>> >>
>>> >> The full stack trace is below. You can see that it actually find
>>> >> the correct
>>> >> hibernate.cfg.xml file containing the relevant mapping.
>>> >>
>>> >> Thanks,
>>> >>
>>> >> Marc
>>> >>
>>> >> [INFO] [appfuse:gen]
>>> >> [INFO] [AppFuse] Assuming 'core' has hibernate.cfg.xml in its
>>> >> src/main/resources
>>> >> directory
>>> >> [INFO]
>>> >> D:\Projects\Java\Mercado\web/../core/src/main/resources/
>>> >> hibernate.cfg.xml
>>> >> not found within the project. Trying absolute path.
>>> >> [INFO] Configuration XML file loaded:
>>> >> D:\Projects\Java\Mercado\web\..\core\src\m
>>> >> ain\resources\hibernate.cfg.xml
>>> >> [INFO]
>>> >> D:\Projects\Java\Mercado\web/../core/src/main/resources/
>>> >> hibernate.cfg.xml
>>> >> not found within the project. Trying absolute path.
>>> >> [INFO] Configuration XML file loaded:
>>> >> D:\Projects\Java\Mercado\web\..\core\src\m
>>> >> ain\resources\hibernate.cfg.xml
>>> >> [INFO]
>>> >>
>>> ----------------------------------------------------------------------
>>> >> --
>>> >> [ERROR] FATAL ERROR
>>> >> [INFO]
>>> >>
>>> ----------------------------------------------------------------------
>>> >> --
>>> >> [INFO] Unable to load class declared as <mapping
>>> >> class="nl.msw.compraventa.model
>>> >> .Archive"/> in the configuration:
>>> >> [INFO]
>>> >>
>>> ----------------------------------------------------------------------
>>> >> --
>>> >> [INFO] Trace
>>> >> org.hibernate.MappingException: Unable to load class declared as
>>> >> <mapping
>>> >> class=
>>> >> "nl.msw.compraventa.model.Archive"/> 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)
>>> >> --
>>> >> View this message in context: http://www.nabble.com/Unable-to-load-
>>> >> class-declared-as-xyz-from-Spring-web-module-
>>> >> tp14753917s2369p14753917.html
>>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>>> >>
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> > For additional commands, e-mail: [EMAIL PROTECTED]
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Unable-to-load-class-declared-as-xyz-from-Spring-web-module-tp14753917s2369p14760615.html
>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>>
>
>
any ideas?
--
View this message in context:
http://www.nabble.com/Unable-to-load-class-declared-as-xyz-from-Spring-web-module-tp14753917s2369p14761725.html
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]