[Geoserver-users] Reg Map not printed in mapfish print WMS layer is Secured

Hi

I got around the printing authenticated layers issue by creating a user
in Geoserver called printer with access to all layers.

You can then add this security block in your config.yaml to send all
print requests as a specified user:

Security:
  - !basicAuth
    Matcher: !dnsMatch
      host: geoserver
      port: 8080
    username: printer
    password: password
    preemptive: true

As for the filename there's an outputFilename: parameter you can put in
the config.yaml, I'm guessing you can substitute any variable that
you're sending to mapfish in there as you do elsewhere:

outputFilename: '${customfilename}'

Hope this helps

Tom

Date: Fri, 28 Feb 2014 18:07:38 +0530
From: geo gis <gisgeoserver@anonymised.com>
Subject: [Geoserver-users] Fwd: Reg Map not printed in mapfish print
  when WMS layer is Secured
To: geoserver-users@lists.sourceforge.net
Message-ID:
  
<CAG2EM7kN-Aiv4-rBunnj0CR1zcpf5MnZRxuBg=di9GApam9VWw@anonymised.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi,

In GeoEXT print ,map is not printed When WMS layer is secured and
getting *java.io.IOException:
The byte array is not a recognized imageformat.* But the same print is
working fine when layer is public and also how to change output filename
dymanically form javascript.Please guide wt i have to do..Give some
suggestions.
Herewith i have enclosed sample YAML file for reference..
-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.yaml
Type: application/octet-stream
Size: 3721 bytes
Desc: not available

------------------------------

Hi Thomas, just for your info, in latest MapFish-print 2.0 SNAPSHOT, you can also add this to the config.yaml:

headers: [‘Cookie’, ‘Referer’, ‘Authorization’]

···

to let MapFish forward the basic auth to geoserver. This obviously works if your app and geoserver are under the same basic auth domain.

This feature is still not documented on the MapFish site.

Mauro

Hi maurao,

GeoEXT Mappanel,Map is not printed When WMS layer is secured and getting
Error like *java.io.IOException:The byte array is not a recognized
imageformat.* But the same print is working fine when layer is not secured.

• We have used geoserver-2.6-SNAPSHOT-printing-plugin jar files and put it
in GeoServer 2.4.3\webapps\geoserver\WEB-INF\lib folder and we experimented
in windows platform.
Security:
  - !basicAuth
    Matcher: !dnsMatch
    host: localhost
    port: 80
    username: abc
    password: def
    preemptive: true

• we specified the above set of security blocks in our config.yaml file.This
is alos not working.Again ,We have used the headers block headers:
['Cookie', 'Referer', 'Authorization'].But again we got the same error
*java.io.IOException:The byte array is not a recognized imageformat.*

• Geoserver Details
    Version 2.4.3
    Build Date 18-Dec-2013 06:12
    GeoTools Version 10.3
    GeoWebCache Version 1.5.0

Any help is highly appreciated because we are unable to proceed further..

With regards,
Mahalakshmi Narayanan
NIC, Chennai, MCIT, Govt of India

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5131119.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Mahalakshmi,
the functionality you are looking for (headers) is not available in the current printing plugin.

We will probably make it available soon on master, so please stay tuned.
In the meantime, if you wish, you can try to replace the print-lib jar you have in your geoserver WEB-INF\lib folder with the one you find here: http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar

Mauro

···

2014-03-26 7:28 GMT+01:00 mhln25 <mhln25@…84…>:

Hi maurao,

GeoEXT Mappanel,Map is not printed When WMS layer is secured and getting
Error like java.io.IOException:The byte array is not a recognized
imageformat.
But the same print is working fine when layer is not secured.

• We have used geoserver-2.6-SNAPSHOT-printing-plugin jar files and put it
in GeoServer 2.4.3\webapps\geoserver\WEB-INF\lib folder and we experimented
in windows platform.

Security:

  • !basicAuth
    Matcher: !dnsMatch

host: localhost
port: 80
username: abc
password: def
preemptive: true

• we specified the above set of security blocks in our config.yaml file.This
is alos not working.Again ,We have used the headers block headers:
[‘Cookie’, ‘Referer’, ‘Authorization’].But again we got the same error

java.io.IOException:The byte array is not a recognized imageformat.

• Geoserver Details
Version 2.4.3
Build Date 18-Dec-2013 06:12
GeoTools Version 10.3
GeoWebCache Version 1.5.0

Any help is highly appreciated because we are unable to proceed further…

With regards,
Mahalakshmi Narayanan
NIC, Chennai, MCIT, Govt of India


View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5131119.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hello,

I tried to replace existing print-lib jar with jar from http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar in geoserver lib folder.

I am using GeoServer 2.4.5 windows installer on Windows Server 2008 R2 x64 on java 1.6 x32.

Got the following error:

Failed to load resource: the server responded with a status of 500 (Error occurred while reading configuration file ‘C:\Program Files (x86)\GeoServer 2.4.5\data_dir\printing\config.yaml’: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.mapfish.print.MapPrinter] is defined: expected single bean but found 0:)

Is this the problem with configuration in config.yaml file or with components to read that config file?

Config.yaml was generated after I started geoserver with print-lib-2.0.0.jar. Maybe some other reference files need to be replaced?

Thanks for any help.

Sincerely,

Paulius

From: Mauro Bartolomeoli [mailto:maurobartolomeoli@anonymised.com]
Sent: Wednesday, March 26, 2014 1:04 PM
To: mhln25
Cc: GeoServer Mailing List List
Subject: Re: [Geoserver-users] Reg Map not printed in mapfish print WMS layer is Secured

Hi Mahalakshmi,

the functionality you are looking for (headers) is not available in the current printing plugin.

We will probably make it available soon on master, so please stay tuned.

In the meantime, if you wish, you can try to replace the print-lib jar you have in your geoserver WEB-INF\lib folder with the one you find here: http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar

Mauro

2014-03-26 7:28 GMT+01:00 mhln25 <mhln25@anonymised.com>:

Hi maurao,

GeoEXT Mappanel,Map is not printed When WMS layer is secured and getting
Error like java.io.IOException:The byte array is not a recognized
imageformat.
But the same print is working fine when layer is not secured.

• We have used geoserver-2.6-SNAPSHOT-printing-plugin jar files and put it
in GeoServer 2.4.3\webapps\geoserver\WEB-INF\lib folder and we experimented
in windows platform.

Security:

  • !basicAuth
    Matcher: !dnsMatch

host: localhost
port: 80
username: abc
password: def
preemptive: true

• we specified the above set of security blocks in our config.yaml file.This
is alos not working.Again ,We have used the headers block headers:
[‘Cookie’, ‘Referer’, ‘Authorization’].But again we got the same error

java.io.IOException:The byte array is not a recognized imageformat.

• Geoserver Details
Version 2.4.3
Build Date 18-Dec-2013 06:12
GeoTools Version 10.3
GeoWebCache Version 1.5.0

Any help is highly appreciated because we are unable to proceed further…

With regards,
Mahalakshmi Narayanan
NIC, Chennai, MCIT, Govt of India


View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5131119.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Is there any more errors in the log?

···

On Thu, Apr 3, 2014 at 3:39 PM, Paulius Litvinas <paulius@anonymised.com> wrote:

Hello,

I tried to replace existing print-lib jar with jar from http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar in geoserver lib folder.

I am using GeoServer 2.4.5 windows installer on Windows Server 2008 R2 x64 on java 1.6 x32.

Got the following error:

Failed to load resource: the server responded with a status of 500 (Error occurred while reading configuration file ‘C:\Program Files (x86)\GeoServer 2.4.5\data_dir\printing\config.yaml’: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.mapfish.print.MapPrinter] is defined: expected single bean but found 0:)

Is this the problem with configuration in config.yaml file or with components to read that config file?

Config.yaml was generated after I started geoserver with print-lib-2.0.0.jar. Maybe some other reference files need to be replaced?

Thanks for any help.

Sincerely,

Paulius

From: Mauro Bartolomeoli [mailto:maurobartolomeoli@anonymised.com]
Sent: Wednesday, March 26, 2014 1:04 PM
To: mhln25
Cc: GeoServer Mailing List List
Subject: Re: [Geoserver-users] Reg Map not printed in mapfish print WMS layer is Secured

Hi Mahalakshmi,

the functionality you are looking for (headers) is not available in the current printing plugin.

We will probably make it available soon on master, so please stay tuned.

In the meantime, if you wish, you can try to replace the print-lib jar you have in your geoserver WEB-INF\lib folder with the one you find here: http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar

Mauro

2014-03-26 7:28 GMT+01:00 mhln25 <mhln25@anonymised.com…>:

Hi maurao,

GeoEXT Mappanel,Map is not printed When WMS layer is secured and getting
Error like java.io.IOException:The byte array is not a recognized
imageformat.
But the same print is working fine when layer is not secured.

• We have used geoserver-2.6-SNAPSHOT-printing-plugin jar files and put it
in GeoServer 2.4.3\webapps\geoserver\WEB-INF\lib folder and we experimented
in windows platform.

Security:

  • !basicAuth
    Matcher: !dnsMatch

host: localhost
port: 80
username: abc
password: def
preemptive: true

• we specified the above set of security blocks in our config.yaml file.This
is alos not working.Again ,We have used the headers block headers:
[‘Cookie’, ‘Referer’, ‘Authorization’].But again we got the same error

java.io.IOException:The byte array is not a recognized imageformat.

• Geoserver Details
Version 2.4.3
Build Date 18-Dec-2013 06:12
GeoTools Version 10.3
GeoWebCache Version 1.5.0

Any help is highly appreciated because we are unable to proceed further…

With regards,
Mahalakshmi Narayanan
NIC, Chennai, MCIT, Govt of India


View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5131119.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-users mailing list
Geoserver-users@anonymised.comnet
https://lists.sourceforge.net/lists/listinfo/geoserver-users



Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi Paulius, to use the new jar you also need to make a change in geoserver WEB-INF/lib/web.xml to load the mapfish spring application context.
Locate this section in the file:

contextConfigLocation classpath*:/applicationContext.xml classpath*:/applicationSecurityContext.xml

and add classpath*:/mapfish-spring-application-context.xml so that it looks like:

···

2014-04-03 15:39 GMT+02:00 Paulius Litvinas <paulius@anonymised.com>:

Hello,

I tried to replace existing print-lib jar with jar from http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar in geoserver lib folder.

I am using GeoServer 2.4.5 windows installer on Windows Server 2008 R2 x64 on java 1.6 x32.

Got the following error:

Failed to load resource: the server responded with a status of 500 (Error occurred while reading configuration file ‘C:\Program Files (x86)\GeoServer 2.4.5\data_dir\printing\config.yaml’: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.mapfish.print.MapPrinter] is defined: expected single bean but found 0:)

Is this the problem with configuration in config.yaml file or with components to read that config file?

Config.yaml was generated after I started geoserver with print-lib-2.0.0.jar. Maybe some other reference files need to be replaced?

Thanks for any help.

Sincerely,

Paulius

From: Mauro Bartolomeoli [mailto:maurobartolomeoli@anonymised.com]
Sent: Wednesday, March 26, 2014 1:04 PM
To: mhln25
Cc: GeoServer Mailing List List
Subject: Re: [Geoserver-users] Reg Map not printed in mapfish print WMS layer is Secured

Hi Mahalakshmi,

the functionality you are looking for (headers) is not available in the current printing plugin.

We will probably make it available soon on master, so please stay tuned.

In the meantime, if you wish, you can try to replace the print-lib jar you have in your geoserver WEB-INF\lib folder with the one you find here: http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar

Mauro

2014-03-26 7:28 GMT+01:00 mhln25 <mhln25@anonymised.com.>:

Hi maurao,

GeoEXT Mappanel,Map is not printed When WMS layer is secured and getting
Error like java.io.IOException:The byte array is not a recognized
imageformat.
But the same print is working fine when layer is not secured.

• We have used geoserver-2.6-SNAPSHOT-printing-plugin jar files and put it
in GeoServer 2.4.3\webapps\geoserver\WEB-INF\lib folder and we experimented
in windows platform.

Security:

  • !basicAuth
    Matcher: !dnsMatch

host: localhost
port: 80
username: abc
password: def
preemptive: true

• we specified the above set of security blocks in our config.yaml file.This
is alos not working.Again ,We have used the headers block headers:
[‘Cookie’, ‘Referer’, ‘Authorization’].But again we got the same error

java.io.IOException:The byte array is not a recognized imageformat.

• Geoserver Details
Version 2.4.3
Build Date 18-Dec-2013 06:12
GeoTools Version 10.3
GeoWebCache Version 1.5.0

Any help is highly appreciated because we are unable to proceed further…

With regards,
Mahalakshmi Narayanan
NIC, Chennai, MCIT, Govt of India


View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5131119.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-users mailing list
Geoserver-users@anonymised.comnet
https://lists.sourceforge.net/lists/listinfo/geoserver-users

contextConfigLocation classpath*:/applicationContext.xml classpath*:/applicationSecurityContext.xml classpath*:/mapfish-spring-application-context.xml

then restart Geoserver.

In log by GEOTOOLS_DEVELOPER_LOGGING:

2014-04-04 16:04:21,589 ERROR [org.mapfish.print.servlet.BaseMapServlet] - Error occurred while reading configuration file

org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.mapfish.print.MapPrinter] is defined: expected single bean but found 0:

at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:276)

at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1113)

at org.mapfish.print.servlet.BaseMapServlet.getMapPrinter(BaseMapServlet.java:150)

at org.mapfish.print.servlet.MapPrinterServlet.getInfo(MapPrinterServlet.java:260)

at org.mapfish.print.servlet.MapPrinterServlet.doGet(MapPrinterServlet.java:92)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:159)

at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)

at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)

at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)

at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:82)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)

at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:134)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:43)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:324)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

Pagarbiai,

Paulius Litvinas

GIS konsultantas

line



map



S. Žukausko g. 17,
LT-08234 Vilnius, Lietuva



telephone



Tel. + 370 5 278 8456
Mob. +370 656 10 089



mail_and_earth



paulius@anonymised.com
www.infoera.lt

info_era_autodesk

From: Jesse Eichar [mailto:jesse.eichar@anonymised.com]
Sent: Thursday, April 03, 2014 5:44 PM
To: Paulius Litvinas
Cc: geoserver-users@anonymised.come.net
Subject: Re: [Geoserver-users] Reg Map not printed in mapfish print WMS layer is Secured

Is there any more errors in the log?

On Thu, Apr 3, 2014 at 3:39 PM, Paulius Litvinas <paulius@anonymised.com> wrote:

Hello,

I tried to replace existing print-lib jar with jar from http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar in geoserver lib folder.

I am using GeoServer 2.4.5 windows installer on Windows Server 2008 R2 x64 on java 1.6 x32.

Got the following error:

Failed to load resource: the server responded with a status of 500 (Error occurred while reading configuration file ‘C:\Program Files (x86)\GeoServer 2.4.5\data_dir\printing\config.yaml’: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [org.mapfish.print.MapPrinter] is defined: expected single bean but found 0:)

Is this the problem with configuration in config.yaml file or with components to read that config file?

Config.yaml was generated after I started geoserver with print-lib-2.0.0.jar. Maybe some other reference files need to be replaced?

Thanks for any help.

Sincerely,

Paulius

From: Mauro Bartolomeoli [mailto:maurobartolomeoli@anonymised.com]
Sent: Wednesday, March 26, 2014 1:04 PM
To: mhln25
Cc: GeoServer Mailing List List
Subject: Re: [Geoserver-users] Reg Map not printed in mapfish print WMS layer is Secured

Hi Mahalakshmi,

the functionality you are looking for (headers) is not available in the current printing plugin.

We will probably make it available soon on master, so please stay tuned.

In the meantime, if you wish, you can try to replace the print-lib jar you have in your geoserver WEB-INF\lib folder with the one you find here: http://central.maven.org/maven2/org/mapfish/print/print-lib/2.0.0/print-lib-2.0.0.jar

Mauro

2014-03-26 7:28 GMT+01:00 mhln25 <mhln25@anonymised.com>:

Hi maurao,

GeoEXT Mappanel,Map is not printed When WMS layer is secured and getting
Error like java.io.IOException:The byte array is not a recognized
imageformat.
But the same print is working fine when layer is not secured.

• We have used geoserver-2.6-SNAPSHOT-printing-plugin jar files and put it
in GeoServer 2.4.3\webapps\geoserver\WEB-INF\lib folder and we experimented
in windows platform.

Security:

  • !basicAuth
    Matcher: !dnsMatch

host: localhost
port: 80
username: abc
password: def
preemptive: true

• we specified the above set of security blocks in our config.yaml file.This
is alos not working.Again ,We have used the headers block headers:
[‘Cookie’, ‘Referer’, ‘Authorization’].But again we got the same error

java.io.IOException:The byte array is not a recognized imageformat.

• Geoserver Details
Version 2.4.3
Build Date 18-Dec-2013 06:12
GeoTools Version 10.3
GeoWebCache Version 1.5.0

Any help is highly appreciated because we are unable to proceed further…

With regards,
Mahalakshmi Narayanan
NIC, Chennai, MCIT, Govt of India


View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5131119.html
Sent from the GeoServer - User mailing list archive at Nabble.com.


Learn Graph Databases - Download FREE O’Reilly Book
“Graph Databases” is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users



Geoserver-users mailing list
Geoserver-users@anonymised.comge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Hi maurao,

Thanks for the prompt reply. However, regret for the delayed reply from our
end.. But we tried the jar file you had shared. But still we are still
facing the same problem.

Which GeoServer version and the corresponding jar file we should use for
bringing map print functionality for secured GS layers?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5133494.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi,

as I answered to Paulius, it’s not enough to use the latest jar, you also have to:

  1. update geoserver web.xml to include the mapfish-print Spring application context:

"to use the new jar you also need to make a change in geoserver WEB-INF/lib/web.xml to load the mapfish spring application context.
Locate this section in the file:

contextConfigLocation classpath*:/applicationContext.xml classpath*:/applicationSecurityContext.xml

and add classpath*:/mapfish-spring-application-context.xml so that it looks like:

··· contextConfigLocation classpath*:/applicationContext.xml classpath*:/applicationSecurityContext.xml classpath*:/mapfish-spring-application-context.xml

then restart Geoserver.
"

  1. if you have basic authentication in your app, forward it to Geoserver adding this to your config.yaml:

headers: [‘Cookie’, ‘Referer’, ‘Authorization’]

  1. if you don’t use basic authentication, follow Thomas advice and add something like the following to your config.yaml:

Security:

  • !basicAuth
    Matcher: !dnsMatch
    host: geoserver
    port: 8080
    username: printer
    password: password
    preemptive: true

This should work with geoserver 2.4.x or geoserver 2.5.

Mauro

2014-04-07 7:36 GMT+02:00 mhln25 <mhln25@anonymised.com>:

Hi maurao,

Thanks for the prompt reply. However, regret for the delayed reply from our
end… But we tried the jar file you had shared. But still we are still
facing the same problem.

Which GeoServer version and the corresponding jar file we should use for
bringing map print functionality for secured GS layers?


View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5133494.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Thank you Mauro - looks like it works now.

Sincerely,

Paulius Litvinas

GIS consultant

line



map



S. Žukausko str. 17,
LT-08234 Vilnius, Lithuania



telephone



Tel. + 370 5 278 8456
Mob. +370 656 10 089



mail_and_earth



paulius@anonymised.com
www.infoera.lt

info_era_autodesk

From: Mauro Bartolomeoli [mailto:maurobartolomeoli@anonymised.com]
Sent: Monday, April 07, 2014 10:08 AM
To: mhln25
Cc: GeoServer Mailing List List
Subject: Re: [Geoserver-users] Reg Map not printed in mapfish print WMS layer is Secured

Hi,

as I answered to Paulius, it’s not enough to use the latest jar, you also have to:

  1. update geoserver web.xml to include the mapfish-print Spring application context:

"to use the new jar you also need to make a change in geoserver WEB-INF/lib/web.xml to load the mapfish spring application context.

Locate this section in the file:

contextConfigLocation

classpath*:/applicationContext.xml classpath*:/applicationSecurityContext.xml

and add classpath*:/mapfish-spring-application-context.xml so that it looks like:

contextConfigLocation

classpath*:/applicationContext.xml classpath*:/applicationSecurityContext.xml classpath*:/mapfish-spring-application-context.xml

then restart Geoserver.

"

  1. if you have basic authentication in your app, forward it to Geoserver adding this to your config.yaml:

headers: [‘Cookie’, ‘Referer’, ‘Authorization’]

  1. if you don’t use basic authentication, follow Thomas advice and add something like the following to your config.yaml:

Security:

  • !basicAuth
    Matcher: !dnsMatch
    host: geoserver
    port: 8080
    username: printer
    password: password
    preemptive: true

This should work with geoserver 2.4.x or geoserver 2.5.

Mauro

2014-04-07 7:36 GMT+02:00 mhln25 <mhln25@anonymised.com…84…>:

Hi maurao,

Thanks for the prompt reply. However, regret for the delayed reply from our
end… But we tried the jar file you had shared. But still we are still
facing the same problem.

Which GeoServer version and the corresponding jar file we should use for
bringing map print functionality for secured GS layers?


View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5133494.html

Sent from the GeoServer - User mailing list archive at Nabble.com.


Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees_APR


Geoserver-users mailing list
Geoserver-users@anonymised.come.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Thanks for the kind reply.. It is working now. Regret again for the delayed
reply..

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Re-Reg-Map-not-printed-in-mapfish-print-WMS-layer-is-Secured-tp5106623p5136192.html
Sent from the GeoServer - User mailing list archive at Nabble.com.