[Geoserver-devel] Backup-Restore without embedded GWC

Hi all,

Been playing around with the backup-restore community module (great job Alessio & co on it BTW). I'm trying to use it in an environment that doesn't include embedded GWC and running into a slight issue:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'gwcGeoServervConfigPersister' available
  at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
  at org.geoserver.platform.GeoServerExtensions.getBean(GeoServerExtensions.java:238) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
  at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:293) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
  at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:284) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
  at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.hardRestore(CatalogBackupRestoreTasklet.java:415) ~[gs-backup-restore-core-2.10-20170209.133347-845.jar:2.10-SNAPSHOT]
  at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.doRestore(CatalogBackupRestoreTasklet.java:290) ~[gs-backup-restore-core-2.10-20170209.133347-845.jar:2.10-SNAPSHOT]
  ... 5 common frames omitted

but looking at the code it seems like the intent was for this to actually work without GWC available? There is a null check at that point in the code for the gwcGeoServervConfigPersister, it just seems to fail because an exception is thrown instead.

// Restore GWC Configuration bits
if (GeoServerExtensions.bean("gwcGeoServervConfigPersister") != null) {
    restoreGWCSettings(sourceRestoreFolder, dd.get(Paths.BASE));

Would there be any objection to adding a catch block for NoBeanDefinitionFoundException? The only issue I see there is that it would mean that the fact that GWC restore failed in that specific instance. Maybe there would be a better way to do it?

Cheers,
Devon

Hi Devon,
good catch. Yes the “NoBeanDefinitionFound” Exception should be catch there and maybe on some other places where similar checks are made.

I will prepare a patch asap and update the community module hopefully today.

Thanks,
Alessio.

···

On Tue, Feb 14, 2017 at 8:43 PM, Devon Tucker <dtucker@anonymised.com> wrote:

Hi all,

Been playing around with the backup-restore community module (great job Alessio & co on it BTW). I’m trying to use it in an environment that doesn’t include embedded GWC and running into a slight issue:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘gwcGeoServervConfigPersister’ available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.geoserver.platform.GeoServerExtensions.getBean(GeoServerExtensions.java:238) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:293) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:284) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.hardRestore(CatalogBackupRestoreTasklet.java:415) ~[gs-backup-restore-core-2.10-20170209.133347-845.jar:2.10-SNAPSHOT]
at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.doRestore(CatalogBackupRestoreTasklet.java:290) ~[gs-backup-restore-core-2.10-20170209.133347-845.jar:2.10-SNAPSHOT]
… 5 common frames omitted

but looking at the code it seems like the intent was for this to actually work without GWC available? There is a null check at that point in the code for the gwcGeoServervConfigPersister, it just seems to fail because an exception is thrown instead.

// Restore GWC Configuration bits
if (GeoServerExtensions.bean(“gwcGeoServervConfigPersister”) != null) {
restoreGWCSettings(sourceRestoreFolder, dd.get(Paths.BASE));

Would there be any objection to adding a catch block for NoBeanDefinitionFoundException? The only issue I see there is that it would mean that the fact that GWC restore failed in that specific instance. Maybe there would be a better way to do it?

Cheers,
Devon


Check out the vibrant tech community on one of the world’s most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.com.366…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

Best Regards,
Alessio Fabiani.

==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.

Ing. Alessio Fabiani
@alfa7691
Founder/Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 331 6233686

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Hi Devon,
commit done

https://github.com/geoserver/geoserver/commit/a9573b74f9c6840131f2d4a37b7c24e330d8337c

Cheers,
Alessio.

···

On Wed, Feb 15, 2017 at 9:53 AM, Alessio Fabiani <alessio.fabiani@anonymised.com> wrote:

Hi Devon,
good catch. Yes the “NoBeanDefinitionFound” Exception should be catch there and maybe on some other places where similar checks are made.

I will prepare a patch asap and update the community module hopefully today.

Thanks,
Alessio.

Best Regards,
Alessio Fabiani.

==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.

Ing. Alessio Fabiani
@alfa7691
Founder/Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 331 6233686

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


Best Regards,
Alessio Fabiani.

==
GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information.

Ing. Alessio Fabiani
@alfa7691
Founder/Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 331 6233686

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


On Tue, Feb 14, 2017 at 8:43 PM, Devon Tucker <dtucker@anonymised.com> wrote:

Hi all,

Been playing around with the backup-restore community module (great job Alessio & co on it BTW). I’m trying to use it in an environment that doesn’t include embedded GWC and running into a slight issue:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘gwcGeoServervConfigPersister’ available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:687) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1207) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:275) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1081) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE]
at org.geoserver.platform.GeoServerExtensions.getBean(GeoServerExtensions.java:238) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:293) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
at org.geoserver.platform.GeoServerExtensions.bean(GeoServerExtensions.java:284) ~[gs-platform-2.10-20170209.132836-1205.jar:2.10-SNAPSHOT]
at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.hardRestore(CatalogBackupRestoreTasklet.java:415) ~[gs-backup-restore-core-2.10-20170209.133347-845.jar:2.10-SNAPSHOT]
at org.geoserver.backuprestore.tasklet.CatalogBackupRestoreTasklet.doRestore(CatalogBackupRestoreTasklet.java:290) ~[gs-backup-restore-core-2.10-20170209.133347-845.jar:2.10-SNAPSHOT]
… 5 common frames omitted

but looking at the code it seems like the intent was for this to actually work without GWC available? There is a null check at that point in the code for the gwcGeoServervConfigPersister, it just seems to fail because an exception is thrown instead.

// Restore GWC Configuration bits
if (GeoServerExtensions.bean(“gwcGeoServervConfigPersister”) != null) {
restoreGWCSettings(sourceRestoreFolder, dd.get(Paths.BASE));

Would there be any objection to adding a catch block for NoBeanDefinitionFoundException? The only issue I see there is that it would mean that the fact that GWC restore failed in that specific instance. Maybe there would be a better way to do it?

Cheers,
Devon


Check out the vibrant tech community on one of the world’s most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot


Geoserver-devel mailing list
Geoserver-devel@anonymised.comrge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel