2012 Pre-release topics

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

Moderator: moderator

2012 Pre-release topics

Postby unhuman » Wed Apr 18, 2012 4:02 pm

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
unhuman
 
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm

Re: 2012 Pre-release topics

Postby maschoff » Thu Apr 19, 2012 8:17 pm

Thanks for your feedback, we will look into it!
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 2144
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Re: 2012 Pre-release topics

Postby unhuman » Fri Apr 20, 2012 10:02 pm

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

Postby unhuman » Mon Apr 30, 2012 3:03 pm

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
unhuman
 
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm

Re: 2012 Pre-release topics

Postby maschoff » Tue May 01, 2012 8:25 am

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: 2144
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Re: database problems

Postby maschoff » Tue May 01, 2012 11:18 am

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
maschoff
Site Admin
 
Posts: 2144
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany

Re: 2012 Pre-release topics

Postby unhuman » Tue May 01, 2012 7:48 pm

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

Postby unhuman » Wed May 02, 2012 7:21 pm

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
unhuman
 
Posts: 46
Joined: Mon Jan 23, 2012 10:29 pm


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest