[Geoserver-users] configuring JNDI for GeoServer on Jetty

Hi,

I'm looking for pointers on how to configure JNDI for a GeoServer
(2.13.4) standalone install (Jetty) - playing around with postgresql
to get an idea how it's supposed to work, but the final goal would be
to have data served from SQLServer with an AD user credentials (it
should be achievable with JNDI, right?).

I've looked into Jetty's own docs on JNDI config[1][2] but somehow my
geoserver/WEB-INF/jetty-env.xml never even seems to get picked up
during geoserver startup (checked by "breaking" the xml and there's no
org.xml.sax.SAXParseException thrown which is the case for example
with etc/jetty.xml).

From the (Jetty) docs I understand that if the file exists, it should

be loaded+parsed. Is there way I can force this file to be loaded? Are
there modules / jars / some other config maybe not present with the gs
distribution? Or am I trying to achieve a non-sensible thingy here :slight_smile:
?

All the best,
Tõnis

[1] https://www.eclipse.org/jetty/documentation/9.2.22.v20170531/jndi-datasource-examples.html#postgreSQL-pooled-datasource
[2] https://www.eclipse.org/jetty/documentation/9.2.22.v20170531/jndi-configuration.html#configuring-datasources

--
@tkardi

Hi Tonis,
I might be wrong, but it may well be that the “bin” distribution of GeoServer, and by extension,
the windows installer, are not capable of supporting JNDI.

These two builds come with a minified Jetty container that lacks a lot of features, I believe
that in order to have JNDI support a jetty-jndi jar would have to be in the list, along with
possibly other configuration files.

The package is meant as a “demo”, for serious production use I’d suggest to switch to a
full Tomcat installation and deploy the GeoServer war in there instead.
Or, if you want, you figure out what the missing bits are and contribute a change to the
GeoServer release packaging to add them. For reference:

Cheers
Andrea

···

Regards, Andrea Aime == GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Hi all,

These two builds come with a minified Jetty container that lacks a lot of features [..]

Andrea, thanks for the lead! I think I might have found a way (somehow
I had missed the start.ini file...), still need to walk it though a
couple of times more.

[..] and by extension, the windows installer, [..]

sry, yes, yesterday in a haste forgot to mention that it's a
linux-based environment that this would end up eventually.

Or, if you want, you figure out what the missing bits are and contribute a
change to the GeoServer release packaging to add them

yes, that was my original intetion aswell. And a section to the docs
aswell maybe - tomcat has a dedicated jndi setup tutorial page, why
not jetty aswell then :slight_smile:

All the best,
Tõnis

Kontakt Andrea Aime (<andrea.aime@anonymised.com>) kirjutas
kuupäeval K, 30. jaanuar 2019 kell 11:09:

Hi Tonis,
I might be wrong, but it may well be that the "bin" distribution of GeoServer, and by extension,
the windows installer, are not capable of supporting JNDI.

These two builds come with a minified Jetty container that lacks a lot of features, I believe
that in order to have JNDI support a jetty-jndi jar would have to be in the list, along with
possibly other configuration files.

The package is meant as a "demo", for serious production use I'd suggest to switch to a
full Tomcat installation and deploy the GeoServer war in there instead.
Or, if you want, you figure out what the missing bits are and contribute a change to the
GeoServer release packaging to add them. For reference:
- directions at https://github.com/geoserver/geoserver/blob/master/CONTRIBUTING.md
- packaging configuration at https://github.com/geoserver/geoserver/tree/master/src/release

Cheers
Andrea

Yep, that would be great, thank you!

Cheers
Andrea

···

== GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime @geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it ------------------------------------------------------- Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia. This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.