2012 Pre-release topics

Use this forum for all questions related to the source code of OpenEMM

Moderator: moderator

unhuman
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm

2012 Pre-release topics

Post by unhuman »

I created this so we can vocalize back to OpenEMM any problems we find in the source distributions.

I'll start it off with:
1. I noticed that in the JARs, 2 versions of aspectjrt are included. The old 1.2.1 and the updated 1.5.4.
2. The UPDATE.txt file says to run:
mysql -u root -p openemm_cms < /home/openemm/USR_SHARE/openemm_cms-2012.sql
which is not provided. There is a update_openemm-2011-2012.sql script, but when I run that I get an error
for data truncation:
ERROR 1265 (01000) at line 18: Data truncated for column 'dynamic_template' at row 1
but then I run it again and get:
ERROR 1060 (42S21) at line 15: Duplicate column name 'openaction_id'
At this point, I believe my database to be corrupted, I get the following error:
Hibernate: select admin0_.admin_id as admin1_2_, admin0_.username as username2_, admin0_.pwd_hash as pwd3_2_, admin0_.company_id as company4_2_, admin0_.fullname as fullname2_, admin0_.admin_lang as admin6_2_, admin0_.admin_country as admin7_2_, admin0_.admin_lang_variant as admin8_2_, admin0_.admin_timezone as admin9_2_, admin0_.default_import_profile_id as default10_2_, admin0_.creation_date as creation11_2_, admin0_.admin_group_id as admin12_2_, admin0_.layout_id as layout13_2_, admin0_.preferred_list_size as preferred14_2_ from admin_tbl admin0_ where admin0_.username=? and pwd_hash=?
Hibernate: select company0_.company_id as company1_1_0_, company0_.creator_company_id as creator2_1_0_, company0_.shortname as shortname1_0_, company0_.description as descript4_1_0_, company0_.xor_key as xor5_1_0_, company0_.rdir_domain as rdir6_1_0_, company0_.mailloop_domain as mailloop7_1_0_, company0_.status as status1_0_, company0_.mailtracking as mailtrac9_1_0_, company0_.max_login_fails as max10_1_0_, company0_.login_block_time as login11_1_0_, company0_.uid_version as uid12_1_0_, company0_.max_recipients as max13_1_0_ from company_tbl company0_ where company0_.company_id=?
2012-04-18 17:00:04,384: WARN [http-8080-2] org.hibernate.util.JDBCExceptionReporter - SQL Error: 1054, SQLState: 42S22
2012-04-18 17:00:04,384: ERROR [http-8080-2] org.hibernate.util.JDBCExceptionReporter - Unknown column 'company0_.max_recipients' in 'field list'
2012-04-18 17:00:04,387: ERROR [http-8080-2] org.agnitas - execute: org.springframework.dao.InvalidDataAccessResourceUsageException: could not load an entity: [Company#1]; nested exception is org.hibernate.exception.SQLGrammarException: could not load an entity: [Company#1]
org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630)
org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424)
org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:921)
org.agnitas.dao.impl.AdminDaoImpl.getAdminByLogin(AdminDaoImpl.java:91)
org.agnitas.web.LogonAction.logon(LogonAction.java:283)
org.agnitas.web.LogonAction.execute(LogonAction.java:109)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

2012-04-18 17:00:04,441: WARN [http-8080-2] org.apache.struts.util.PropertyMessageResources - Resource messages_en_US.properties Not Found.
After that, I modified the sql script to skip the erroneous lines. I can now log in and add users, but the mail-related operations all fail... Rather than attach a huge exception, it shows up directly in my browser with:
An error occurred
Cause: org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: Mailing.dynTags
-H
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: 2012 Pre-release topics

Post by maschoff »

Thanks for your feedback, we will look into it!
OpenEMM Maintainer
unhuman
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm

Re: 2012 Pre-release topics

Post by unhuman »

Awesome, thank you.

Also, we are noticing that Spring initializes doubly (with 2011, anyway)....

We see 2 lines for "Initializing Spring root WebApplicationContext" every time we start up. We've detected that it is loading everything twice.... Looking into it - we find that propertyConfigurer defined in both cmsContext.xml *AND* applicationContext.xml. Not sure if that's the cause yet, unlikely, but... Probably shouldn't have the same name....
unhuman
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm

Re: 2012 Pre-release topics

Post by unhuman »

The double initialization is caused by the configuration in the server-level web.xml:
<Context docBase="openemm" path="" reloadable="true" />

This, obviously, tells the server to load OpenEMM as the root application... Causing the double-load. either OpenEMM should be made the ROOT application or another solution found (which I'm looking into).

-H
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: 2012 Pre-release topics

Post by maschoff »

Yes, that is right. We have already fixed this in OpenEMM 2012:

Code: Select all

    <Engine name="Catalina" defaultHost="OpenEMM">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
      <Host name="OpenEMM"  appBase="webapps-empty" autoDeploy="true" unpackWARs="false" xmlValidation="false" xmlNamespaceAware="false">
        <Alias>localhost</Alias>
        <Valve className="org.apache.catalina.valves.FastCommonAccessLogValve"
               resolveHosts="false" directory="${catalina.base}/logs/access/" rotatable="true" buffered="true"
               prefix="" suffix="-access_openemm.log" fileDateFormat="yyyyMMdd"
               pattern='%a %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' />
        <Context cookies="false" docBase="/home/openemm/webapps/openemm" path="" reloadable="true" />
      </Host>
    </Engine>
OpenEMM Maintainer
maschoff
Site Admin
Posts: 2597
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: database problems

Post by maschoff »

I could not reproduce your database problem. I tried

Code: Select all

mysqladmin -u root -p create openemm_test
mysql -u root -p openemm_test < openemm-2011.sql
mysql -u root -p openemm_test < update_openemm-2011-2012.sql
and it worked just fine. Do you have any further info? (The error message of your 2nd try is displayed because openaction_id was created by the 2st run.)
OpenEMM Maintainer
unhuman
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm

Re: 2012 Pre-release topics

Post by unhuman »

Awesome. I will try again to see.

Thanks for following up.
unhuman
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm

Re: 2012 Pre-release topics

Post by unhuman »

I have reproduced it. The update script gives the data truncation error ONLY on Windows - but not Linux.

For some testing I was doing - since I only have 2 PCs - I was hoping to do this testing on Windows.

* Edit - got it working on windows. Did an update on an openemm_test database and then dumped the patched database and imported it directly into windows (so no update required) and it worked perfectly. 2012 M2a now running.

Thanks!

-H
Post Reply