[Mifos-developer] Deployment problem

52 views
Skip to first unread message

Shahiduzzaman

unread,
Jul 7, 2010, 2:16:21 AM7/7/10
to Mifos software development
Hi All,
Recently I fall into a problem deploying Mifos master branch. I am
trying to deploy it on a Ubuntu 9.04 using tomcat 6.0.26 (standalone
version, not the one came with Ubuntu). The only difference from my
recent deployment attempt with previous successful attempts that now I
am using standalone tomcat version. I got following output in
catalina.out:

=============================================================================
log4j:ERROR Could not parse file
[/usr/local/apache-tomcat-6.0.26/webapps/mifos/WEB-INF/classes/org/mifos/config/resources/loggerconfiguration.xml].
java.lang.NullPointerException
at java.lang.String.indexOf(String.java:1733)
at org.apache.log4j.helpers.OptionConverter.substVars(OptionConverter.java:385)
at org.apache.log4j.xml.DOMConfigurator.subst(DOMConfigurator.java:951)
at org.apache.log4j.xml.DOMConfigurator.subst(DOMConfigurator.java:936)
at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:847)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:682)
at org.mifos.framework.components.logger.MifosDOMConfigurator.doConfigure(MifosDOMConfigurator.java:41)
at org.mifos.framework.components.logger.MifosXMLWatchdog.doOnChange(MifosXMLWatchdog.java:50)
at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:89)
at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:58)
at org.mifos.framework.components.logger.MifosXMLWatchdog.<init>(MifosXMLWatchdog.java:40)
at org.mifos.framework.components.logger.MifosDOMConfigurator.configureAndWatch(MifosDOMConfigurator.java:56)
at org.mifos.framework.components.logger.MifosLogManager.readConfiguration(MifosLogManager.java:188)
at org.mifos.framework.components.logger.MifosLogManager.configure(MifosLogManager.java:68)
at org.mifos.framework.components.logger.MifosLogManager.configureLogging(MifosLogManager.java:202)
at org.mifos.framework.components.logger.MifosLogManager.getLoggerHelper(MifosLogManager.java:133)
at org.mifos.framework.components.logger.MifosLogManager.getLogger(MifosLogManager.java:112)
at org.mifos.framework.components.logger.MifosLogManager.getLogger(MifosLogManager.java:96)
at org.mifos.framework.components.batchjobs.MifosScheduler.<clinit>(MifosScheduler.java:51)
.................................................
==============================================================================

localhost log contains the stack trace like: http://pastebin.com/aWw7Wdwx
And catalina log contains the stack trace like: http://pastebin.com/v2dSyGeu

In all three logs, there are some error/exceptions, its really hard to
track the exact problem. If anybody faced similar problems ....please
let me know.

Thanks for your help.

Regards
Shahid

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

Udai Gupta

unread,
Jul 7, 2010, 3:10:52 AM7/7/10
to Mifos software development
Hi Shahid,

I think this is something due to in-build dynamic logger (MifosLogger)
trying to register logger repository. The easy workaround for this is
to delete you tomcat/work folder, delete the exploded mifos folder in
webapps and restart the tomcat.

Udai

Shahiduzzaman

unread,
Jul 7, 2010, 5:07:53 AM7/7/10
to Mifos software development
Hi Udai,

Thanks for your reply. but, I have already tried that cycle (delete
work and exploded folder and restart tomcat) several times, getting
same logs.


Shahid

Kalyan Akella

unread,
Jul 7, 2010, 8:26:50 AM7/7/10
to Mifos software development
Hi,

Can you please attach the tomcat logs (compressed .zip or .rar).

Sincere Regards,
Buddy

Shahiduzzaman

unread,
Jul 7, 2010, 9:54:31 PM7/7/10
to Mifos software development
Hi,

Tried to sent you the logs, but the total size is over 100KB, so got
caught in list moderation. Anyway, I went back to Ubuntu Tomcat from
standalone Tomcat (at least I have successful history of running this
in Ubuntu tomcat) and still getting errors, but those are not like
previous. Those are related with application initialization code where
some query is executed. Here is the stack trace:
http://pastebin.com/RJPJL0UG

Regards
Shahid

Shahiduzzaman

unread,
Jul 7, 2010, 7:22:34 PM7/7/10
to Mifos software development
Hi,

Attached. Thanks.

Regards
Shahid

logs.tar.gz

Kalyan Akella

unread,
Jul 8, 2010, 1:06:07 AM7/8/10
to Mifos software development
Hi,

I see the following 4 exceptions all over your logs (in the order of importance):

1. 2010-07-07/12:42:11.495/EST ERROR, org.hibernate.util.JDBCExceptionReporter, ?, ?, ?, Table 'mifos.currency' doesn't exist
2010-07-07/12:42:11.498/EST ERROR, org.mifos.framework, ApplicationInitializer, init, 206, unable to start Mifos web application
java.lang.RuntimeException: org.hibernate.exception.SQLGrammarException: could not execute query
    at org.mifos.config.persistence.ConfigurationPersistence.getCurrency(ConfigurationPersistence.java:57)
    at org.mifos.config.AccountingRules.getMifosCurrency(AccountingRules.java:90)
    at org.mifos.config.AccountingRules.getMifosCurrency(AccountingRules.java:86)
    at org.mifos.framework.ApplicationInitializer.init(ApplicationInitializer.java:144)
    at org.mifos.framework.ApplicationInitializer.contextInitialized(ApplicationInitializer.java:125)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
    at java.lang.Thread.run(Thread.java:619)

The SQL grammar exception is because you don't seem to have the Currency table. If this recurs, log on to MySQL console and do the following:

drop database mifos;
create database mifos;
source <your-code-path>/application/src/main/sql/latest-schema.sql
source <your-code-path>/application/src/main/sql/latest-data.sql
source <your-code-path>/application/src/main/sql/init_mifos_password.sql
commit;
exit;

Then redeploy mifos and you're good to go.

2. SEVERE: Error initializing endpoint
java.net.BindException: Address already in use <null>:8080
    at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549)
    at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
    at org.apache.catalina.connector.Connector.initialize(Connector.java:1014)
    at org.apache.catalina.core.StandardService.initialize(StandardService.java:680)
    at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:795)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:524)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:548)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

This is simple. You are either trying to start tomcat without stopping it first or port 8080 on your machine is already in use and so tomcat isn't able to bind to it. If you notice this next time try this to see who's using 8080.

On Wndows:

netstat -a -b -n -p TCP

On Linux:

sudo netstat -anltp|grep :8080

3. INFO: ConfigurationLocator found configuration file: /usr/local/apache-tomcat-6.0.26/webapps/mifos/WEB-INF/classes/org/mifos/config/resources/loggerconfiguration.xml

log4j:ERROR Could not parse file [/usr/local/apache-tomcat-6.0.26/webapps/mifos/WEB-INF/classes/org/mifos/config/resources/loggerconfiguration.xml].
java.lang.NullPointerException
    at java.lang.String.indexOf(String.java:1733)
    at org.apache.log4j.helpers.OptionConverter.substVars(OptionConverter.java:385)
    at org.apache.log4j.xml.DOMConfigurator.subst(DOMConfigurator.java:951)
    at org.apache.log4j.xml.DOMConfigurator.subst(DOMConfigurator.java:936)
    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:847)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:682)
    at org.mifos.framework.components.logger.MifosDOMConfigurator.doConfigure(MifosDOMConfigurator.java:41)

Please ignore this. This doesn't affect your application.

4. - Could not obtain connection to query metadata
java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
    at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:527)
    at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)

This started since a couple of weeks back and hasn't yet had any impact on the application. We aren't sure yet what's causing this at the moment but something to watch out for !!

Sincere Regards,
Buddy

Adam Monsen

unread,
Jul 12, 2010, 2:50:42 PM7/12/10
to Mifos Developer Discussions
> I see the following 4 exceptions all over your logs (in the order of
> importance):

Spot on, Buddy!

Shahid, were you able to fix what is likely a database problem and get
Mifos to start?

It's unfortunate that log4j error shows up, I've also been confused by
that from time to time. It takes focus away from database issues, the
more likely cause of startup failure.

signature.asc

Shahiduzzaman

unread,
Jul 12, 2010, 5:32:02 PM7/12/10
to Mifos software development
Hi,

Well, later the DB problems are also not showing in logs, but I got
the hint from Buddy. So I recreated the mifos database and seemed it
solved the problems.

Thanks.

Shahid

Reply all
Reply to author
Forward
0 new messages