Starting Tomcat problem

Hi,

I’ve got the problem when starting Tomcat (version 6 and 7 also). With the same as dhis.war file, it’s run successfully in other but mine is failed. Any one likes me and any thought ?

  • INFO 2012-03-14 10:39:34,173 Environment variable DHIS2_HOME points to d:\wor

king\DHIS2OH-2.0\config (DefaultLocationManager.java [main])

  • ERROR 2012-03-14 10:39:44,310 Context initialization failed (ContextLoader.jav

a [main])

org.springframework.beans.factory.BeanCreationException: Error creating bean wit

h name ‘org.hisp.dhis.resourcetable.ResourceTableService’ defined in URL [jar:fi

le:/C:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis

-service-administration-2.8-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot resol

ve reference to bean ‘org.hisp.dhis.organisationunit.OrganisationUnitService’ wh

ile setting bean property ‘organisationUnitService’; nested exception is org.spr

ingframework.beans.factory.BeanCreationException: Error creating bean with name

‘org.hisp.dhis.organisationunit.OrganisationUnitService’ defined in URL [jar:fil

e:/C:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-

service-core-2.8-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot resolve referenc

e to bean ‘org.hisp.dhis.organisationunit.OrganisationUnitStore’ while setting b

ean property ‘organisationUnitStore’; nested exception is org.springframework.be

ans.factory.BeanCreationException: Error creating bean with name 'org.hisp.dhis.

organisationunit.OrganisationUnitStore’ defined in URL [jar:file:/C:/Apache%20So

ftware%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-service-core-2.8-

SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot resolve reference to bean 'sessio

nFactory’ while setting bean property ‘sessionFactory’; nested exception is org.

springframework.beans.factory.BeanCreationException: Error creating bean with na

me ‘sessionFactory’ defined in URL [jar:file:/C:/Apache%20Software%20Foundation/

Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-support-hibernate-2.8-SNAPSHOT.jar!/M

ETA-INF/dhis/beans.xml]: Invocation of init method failed; nested exception is j

ava.lang.NoClassDefFoundError: org/hibernate/cache/TimestampsRegion

at org.springframework.beans.factory.support.BeanDefinitionValueResolver

.resolveReference(BeanDefinitionValueResolver.java:328)

···


Expert By Chance

Did you create this war-file yourself? if you did, can you try out
http://apps.dhis2.org/ci/job/dhis-web-trunk/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war
? remember to clean everything before trying out new war..

Also, are you sure your hibernate.properties file is correct? I see it
complains about sessionFactory..

···

--
Morten

On Wed, Mar 14, 2012 at 4:44 AM, Hieu Dang Duy <hieu.hispvietnam@gmail.com> wrote:

Hi,

I've got the problem when starting Tomcat (version 6 and 7 also). With the
same as dhis.war file, it's run successfully in other but mine is failed.
Any one likes me and any thought ?

* INFO 2012-03-14 10:39:34,173 Environment variable DHIS2_HOME points to
d:\wor
king\DHIS2OH-2.0\config (DefaultLocationManager.java [main])
* ERROR 2012-03-14 10:39:44,310 Context initialization failed
(ContextLoader.jav
a [main])
org.springframework.beans.factory.BeanCreationException: Error creating bean
wit
h name 'org.hisp.dhis.resourcetable.ResourceTableService' defined in URL
[jar:fi
le:/C:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis
-service-administration-2.8-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot
resol
ve reference to bean
'org.hisp.dhis.organisationunit.OrganisationUnitService' wh
ile setting bean property 'organisationUnitService'; nested exception is
org.spr
ingframework.beans.factory.BeanCreationException: Error creating bean with
name
'org.hisp.dhis.organisationunit.OrganisationUnitService' defined in URL
[jar:fil
e:/C:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-
service-core-2.8-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot resolve
referenc
e to bean 'org.hisp.dhis.organisationunit.OrganisationUnitStore' while
setting b
ean property 'organisationUnitStore'; nested exception is
org.springframework.be
ans.factory.BeanCreationException: Error creating bean with name
'org.hisp.dhis.
organisationunit.OrganisationUnitStore' defined in URL
[jar:file:/C:/Apache%20So
ftware%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-service-core-2.8-
SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot resolve reference to bean
'sessio
nFactory' while setting bean property 'sessionFactory'; nested exception is
org.
springframework.beans.factory.BeanCreationException: Error creating bean
with na
me 'sessionFactory' defined in URL
[jar:file:/C:/Apache%20Software%20Foundation/
Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-support-hibernate-2.8-SNAPSHOT.jar!/M
ETA-INF/dhis/beans.xml]: Invocation of init method failed; nested exception
is j
ava.lang.NoClassDefFoundError: org/hibernate/cache/TimestampsRegion
at
org.springframework.beans.factory.support.BeanDefinitionValueResolver
.resolveReference(BeanDefinitionValueResolver.java:328)

--
"Expert By Chance"

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

I think the problem is found out at this setting up on hibernate.properties

net.sf.ehcache.configurationResourceName = ehcache.xml

hibernate.cache.region.factory_class = net.sf.ehcache.hibernate.EhCacheRegionFactory

hibernate.cache.use_second_level_cache = true

hibernate.cache.use_query_cache = true

If try to comment all of them then everything is back to normal. But not sure the cache issue could be solved…

···

On Wed, Mar 14, 2012 at 2:35 PM, Morten Olav Hansen mortenoh@gmail.com wrote:

Did you create this war-file yourself? if you did, can you try out

http://apps.dhis2.org/ci/job/dhis-web-trunk/lastSuccessfulBuild/artifact/dhis-2/dhis-web/dhis-web-portal/target/dhis.war

? remember to clean everything before trying out new war…

Also, are you sure your hibernate.properties file is correct? I see it

complains about sessionFactory…

Morten

On Wed, Mar 14, 2012 at 4:44 AM, Hieu Dang Duy > > hieu.hispvietnam@gmail.com wrote:

Hi,

I’ve got the problem when starting Tomcat (version 6 and 7 also). With the

same as dhis.war file, it’s run successfully in other but mine is failed.

Any one likes me and any thought ?

  • INFO 2012-03-14 10:39:34,173 Environment variable DHIS2_HOME points to

d:\wor

king\DHIS2OH-2.0\config (DefaultLocationManager.java [main])

  • ERROR 2012-03-14 10:39:44,310 Context initialization failed

(ContextLoader.jav

a [main])

org.springframework.beans.factory.BeanCreationException: Error creating bean

wit

h name ‘org.hisp.dhis.resourcetable.ResourceTableService’ defined in URL

[jar:fi

le:/C:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis

-service-administration-2.8-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot

resol

ve reference to bean

‘org.hisp.dhis.organisationunit.OrganisationUnitService’ wh

ile setting bean property ‘organisationUnitService’; nested exception is

org.spr

ingframework.beans.factory.BeanCreationException: Error creating bean with

name

‘org.hisp.dhis.organisationunit.OrganisationUnitService’ defined in URL

[jar:fil

e:/C:/Apache%20Software%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-

service-core-2.8-SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot resolve

referenc

e to bean ‘org.hisp.dhis.organisationunit.OrganisationUnitStore’ while

setting b

ean property ‘organisationUnitStore’; nested exception is

org.springframework.be

ans.factory.BeanCreationException: Error creating bean with name

'org.hisp.dhis.

organisationunit.OrganisationUnitStore’ defined in URL

[jar:file:/C:/Apache%20So

ftware%20Foundation/Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-service-core-2.8-

SNAPSHOT.jar!/META-INF/dhis/beans.xml]: Cannot resolve reference to bean

'sessio

nFactory’ while setting bean property ‘sessionFactory’; nested exception is

org.

springframework.beans.factory.BeanCreationException: Error creating bean

with na

me ‘sessionFactory’ defined in URL

[jar:file:/C:/Apache%20Software%20Foundation/

Tomcat%206.0/webapps/dhis/WEB-INF/lib/dhis-support-hibernate-2.8-SNAPSHOT.jar!/M

ETA-INF/dhis/beans.xml]: Invocation of init method failed; nested exception

is j

ava.lang.NoClassDefFoundError: org/hibernate/cache/TimestampsRegion

    at

org.springframework.beans.factory.support.BeanDefinitionValueResolver

.resolveReference(BeanDefinitionValueResolver.java:328)

“Expert By Chance”


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Expert By Chance

We upgraded to hibernate 4.1.0 on Monday, sorry for not telling you.

1) make sure you upgrade and install all core modules fresh.

2) in local modules make sure you have no hard-coded references to
hibernate versions, but inherit from the root POM.

3) in local modules in all web.xml change the open session in view
filter from hibernate3 to hibernate4 so it reads:

<filter>
    <filter-name>OpenSessionInViewFilter</filter-name>
    <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
  </filter>

Hi boss, of course my core modules is the newest. I also try deleting the old repository lib and build up a new one.

We upgraded to hibernate 4.1.0 on Monday, sorry for not telling you.

  1. make sure you upgrade and install all core modules fresh.

  2. in local modules make sure you have no hard-coded references to

hibernate versions, but inherit from the root POM.

Not sure I’ve got your point at here. Could u please give me a example in "hard-coded references to

hibernate versions". Because in my own dhis.war file there has no any local module inside of the war.

By the way, with the same as war file and database but when running at the other person tomcat is fine and mine is failure…

···

2012/3/14 Lars Helge Øverland larshelge@gmail.com

  1. in local modules in all web.xml change the open session in view

filter from hibernate3 to hibernate4 so it reads:

<filter-name>OpenSessionInViewFilter</filter-name>

<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>


Expert By Chance

Hi all,

We’re encountering the same issue for the latest (from version 2.7 - after Feb 26) for 2 server (Cantho and HCMC) with TOMCAT (7.0.25):

Cantho’s server:
“Caused by: java.lang.NoClassDefFoundError: org/hibernate/cache/TimestampsRegion”

HCMC’s server:

  • it works for mysql database
  • error with postgres database with the error relating to cache…

P.S: Locally it works on the computer which dhis2 is built.

Any suggestions?

···

2012/3/14 Hieu Dang Duy hieu.hispvietnam@gmail.com

Hi boss, of course my core modules is the newest. I also try deleting the old repository lib and build up a new one.

2012/3/14 Lars Helge Øverland larshelge@gmail.com

We upgraded to hibernate 4.1.0 on Monday, sorry for not telling you.

  1. make sure you upgrade and install all core modules fresh.

  2. in local modules make sure you have no hard-coded references to

hibernate versions, but inherit from the root POM.

Not sure I’ve got your point at here. Could u please give me a example in "hard-coded references to

hibernate versions". Because in my own dhis.war file there has no any local module inside of the war.

By the way, with the same as war file and database but when running at the other person tomcat is fine and mine is failure…

  1. in local modules in all web.xml change the open session in view

filter from hibernate3 to hibernate4 so it reads:

<filter-name>OpenSessionInViewFilter</filter-name>

<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>


Expert By Chance


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Best regards,
Kim-Anh Vo

Hi I think this is a problem with ehcache and hibernate compatibility.
We have upgraded to hibernate 4 and hibernate's ehcache version in
trunk. So make sure you have not upgraded anything in local modules in
2.7.

Lars

···

2012/4/9 Kim-Anh Vo <catakim@gmail.com>:

Hi all,

We're encountering the same issue for the latest (from version 2.7 - after
Feb 26) for 2 server (Cantho and HCMC) with TOMCAT (7.0.25):

Cantho's server:
"Caused by: java.lang.NoClassDefFoundError:
org/hibernate/cache/TimestampsRegion"

HCMC's server:
+ it works for mysql database
+ error with postgres database with the error relating to cache...

P.S: Locally it works on the computer which dhis2 is built.

Any suggestions?

2012/3/14 Hieu Dang Duy <hieu.hispvietnam@gmail.com>

Hi boss, of course my core modules is the newest. I also try deleting the
old repository lib and build up a new one.

2012/3/14 Lars Helge Øverland <larshelge@gmail.com>

We upgraded to hibernate 4.1.0 on Monday, sorry for not telling you.

1) make sure you upgrade and install all core modules fresh.

2) in local modules make sure you have no hard-coded references to
hibernate versions, but inherit from the root POM.

Not sure I've got your point at here. Could u please give me a example in
"hard-coded references to
hibernate versions". Because in my own dhis.war file there has no any
local module inside of the war.

By the way, with the same as war file and database but when running at the
other person tomcat is fine and mine is failure...

3) in local modules in all web.xml change the open session in view
filter from hibernate3 to hibernate4 so it reads:

<filter>
<filter-name>OpenSessionInViewFilter</filter-name>

<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
</filter>

--
"Expert By Chance"

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

--
--
Best regards,
Kim-Anh Vo

thanks.
That’s okay now… that was the issue of incompatibility of the hibernate-default.properties files(cache atttributes)

···

2012/4/10 Lars Helge Øverland larshelge@gmail.com

Hi I think this is a problem with ehcache and hibernate compatibility.

We have upgraded to hibernate 4 and hibernate’s ehcache version in

trunk. So make sure you have not upgraded anything in local modules in

2.7.

Lars

2012/4/9 Kim-Anh Vo catakim@gmail.com:

Hi all,

We’re encountering the same issue for the latest (from version 2.7 - after

Feb 26) for 2 server (Cantho and HCMC) with TOMCAT (7.0.25):

Cantho’s server:

"Caused by: java.lang.NoClassDefFoundError:

org/hibernate/cache/TimestampsRegion"

HCMC’s server:

  • it works for mysql database
  • error with postgres database with the error relating to cache…

P.S: Locally it works on the computer which dhis2 is built.

Any suggestions?

2012/3/14 Hieu Dang Duy hieu.hispvietnam@gmail.com

Hi boss, of course my core modules is the newest. I also try deleting the

old repository lib and build up a new one.

2012/3/14 Lars Helge Øverland larshelge@gmail.com

We upgraded to hibernate 4.1.0 on Monday, sorry for not telling you.

  1. make sure you upgrade and install all core modules fresh.
  1. in local modules make sure you have no hard-coded references to

hibernate versions, but inherit from the root POM.

Not sure I’ve got your point at here. Could u please give me a example in

"hard-coded references to

hibernate versions". Because in my own dhis.war file there has no any

local module inside of the war.

By the way, with the same as war file and database but when running at the

other person tomcat is fine and mine is failure…

  1. in local modules in all web.xml change the open session in view

filter from hibernate3 to hibernate4 so it reads:

OpenSessionInViewFilter

org.springframework.orm.hibernate4.support.OpenSessionInViewFilter

“Expert By Chance”


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Best regards,

Kim-Anh Vo

Best regards,
Kim-Anh Vo