[Geoserver-users] Feature collection import into GeoServer through WPS

Dear all,
I am having trouble trying to import a feature collection into GeoServer
2.5.2 through the usage of the WPS 'gs:Import'.

In my WPS there are some chained process and at the end I would like to
import the result of the operations, which I've checked and it's correct.
When I run it on a localhost server it works. It take several minutes, about
7 or 8, but it does import the new create collection into GeoServer.
When I run it on a remote server it returns this error:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /geoserver/TestWfsPost.

Reason: Error reading from remote server

Apache/2.4.7 (Ubuntu) Server at my-remote-server Port 80

But I noticed that the WPS doesn't stop and keeps running, indeed on
GeoServer log there are no errors.
At the end I still get the feature collection imported on GeoServer but I
need the WPS to return the name of the new layer as 'gs:Import' does.

What could be the problem? Do you know how to solve it?

Thanks for the help,
Matteo

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Feature-collection-import-into-GeoServer-through-WPS-tp5211576.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Thu, Jun 18, 2015 at 10:32 AM, matteo.eccher <matteo.eccher@anonymised.com

wrote:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /geoserver/TestWfsPost.

Reason: Error reading from remote server

Apache/2.4.7 (Ubuntu) Server at my-remote-server Port 80

It looks like you're using the request demo builder, or the demo requests
page (no reason to end up hitting TestWfsPost
otherwise), both are not really meant for production, just for simple tests
and learning the protocol.

It could be it's not working because of the apache proxy you setup... it
could
be that you haven't setup the "proxy base" in your configuration, but it's
also
possible that the demo pages simply do not work in a proxied enviroment.

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 Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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.

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

Thanks for the reply,

I forgot to mention that I also tried to call the WPS by a POST request from
a client on the same remote machine.
The error is almost the same, except the request url:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /geoserver/wps.

Reason: Error reading from remote server

Apache/2.4.7 (Ubuntu) Server at my-remote-server Port 80

I have the same test client on my local machine and calling the local WPS
works.
Also, I don't know if it's relevant but if I remove the WPS 'gs:Import' from
the process chaining everything works.
Now I'll check the proxy configuration and come back with news.

Regards,
Matteo

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Feature-collection-import-into-GeoServer-through-WPS-tp5211576p5211596.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Matteo,
when you do the chaining, are you using the special URLs that will make
GeoSeverver avoid calling onto itself using HTTP?
It’s “http://geoserver/wps”, and it’s recognized to be the internal WPS, without
the need to make extra network calls.

Cheers
Andrea

···

On Thu, Jun 18, 2015 at 11:40 AM, matteo.eccher <matteo.eccher@anonymised.com> wrote:

Thanks for the reply,

I forgot to mention that I also tried to call the WPS by a POST request from
a client on the same remote machine.
The error is almost the same, except the request url:

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request POST /geoserver/wps.

Reason: Error reading from remote server

Apache/2.4.7 (Ubuntu) Server at my-remote-server Port 80

I have the same test client on my local machine and calling the local WPS
works.
Also, I don’t know if it’s relevant but if I remove the WPS ‘gs:Import’ from
the process chaining everything works.
Now I’ll check the proxy configuration and come back with news.

Regards,
Matteo


View this message in context: http://osgeo-org.1560.x6.nabble.com/Feature-collection-import-into-GeoServer-through-WPS-tp5211576p5211596.html

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



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

==
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 Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

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.


Hello Andrea,
I think what I'm doing is not proper "chaining" because I don't use any URL
inside my WPS.
Just to be sure I am doing the right thing I'll briefly explain you the
process.

The WPS I created "chains" some WPS together in Java by using the
ProcessFactory class.
I call the Process.execute method of the WPS I want to execute.
I take the result and put it in another Map then use it as input for the
next WPS.
Here an example:

Iterator<ProcessFactory> it = factories.iterator();
while(it.hasNext()) {
    ProcessFactory fact = (ProcessFactory) it.next();
    Name processName = new NameImpl("gs", "Unique");
    Set<Name> names = fact.getNames();
    if(names.contains(processName)) {
        Process p = fact.create(processName);

        inputs.put("features", collection);
        inputs.put("attribute", attribute1 + year2);

        outputs = p.execute(inputs, pl);

        results.put("uniqueResult", outputs.get("result"));
    }
}

Then I build my WPS with Maven and put the '.jar' file in the Geoserver
WEB-INF/lib.

To call the WPS I make a POST request to the URL:
'http://my-remote-server/geoserver/wps’, as data I pass the XML containing
the wps:Execute the input and the putputs of the WPS.
By chaining the processes inside the WPS code, I have only one Execute in my
XML file.

I've done other WPSes like this and they seems to work.
I hope I've explained myself well.

Thanks again,
Matteo

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Feature-collection-import-into-GeoServer-through-WPS-tp5211576p5211617.html
Sent from the GeoServer - User mailing list archive at Nabble.com.