problem with wms output using R process

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with wms output using R process

soshi
Hi all,
I wrote a process using R and set configuration (wms Generator using link: https://wiki.52north.org/Geoprocessing/StoreWPSOutputsInGeoserver), but there isn't any wms format in DescriptionProcess for the process and I got error in execute response:

<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" version="1.0.0">
<ows:Exception exceptionCode="NoApplicableCode">
<ows:ExceptionText>
Error while executing the embedded process for: org.n52.wps.server.r.NDVI
</ows:ExceptionText>
</ows:Exception>
<ows:Exception exceptionCode="JAVA_StackTrace">
<ows:ExceptionText>
org.n52.wps.server.ExceptionReport: Error while executing the embedded process for: org.n52.wps.server.r.NDVI at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:716) at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:92) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.RuntimeException: org.n52.wps.server.ExceptionReport: Could not determine output format at org.n52.wps.server.request.ExecuteRequest.updateStatus(ExecuteRequest.java:872) at org.n52.wps.server.request.ExecuteRequest.updateStatusSuccess(ExecuteRequest.java:841) at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:694) ... 5 more Caused by: org.n52.wps.server.ExceptionReport: Could not determine output format at org.n52.wps.server.response.ResponseData.<init>(ResponseData.java:166) at org.n52.wps.server.response.OutputDataItem.<init>(OutputDataItem.java:92) at org.n52.wps.server.response.ExecuteResponseBuilder.generateComplexDataOutput(ExecuteResponseBuilder.java:325) at org.n52.wps.server.response.ExecuteResponseBuilder.update(ExecuteResponseBuilder.java:165) at org.n52.wps.server.request.ExecuteRequest.updateStatus(ExecuteRequest.java:858) ... 7 more
</ows:ExceptionText>
</ows:Exception>
<ows:Exception exceptionCode="JAVA_RootCause">
<ows:ExceptionText>
org.n52.wps.server.ExceptionReport: Could not determine output format
</ows:ExceptionText>
<ows:ExceptionText>
java.lang.RuntimeException: org.n52.wps.server.ExceptionReport: Could not determine output format at org.n52.wps.server.request.ExecuteRequest.updateStatus(ExecuteRequest.java:872) at org.n52.wps.server.request.ExecuteRequest.updateStatusSuccess(ExecuteRequest.java:841) at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:694) at org.n52.wps.server.request.ExecuteRequest.call(ExecuteRequest.java:92) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.n52.wps.server.ExceptionReport: Could not determine output format at org.n52.wps.server.response.ResponseData.<init>(ResponseData.java:166) at org.n52.wps.server.response.OutputDataItem.<init>(OutputDataItem.java:92) at org.n52.wps.server.response.ExecuteResponseBuilder.generateComplexDataOutput(ExecuteResponseBuilder.java:325) at org.n52.wps.server.response.ExecuteResponseBuilder.update(ExecuteResponseBuilder.java:165) at org.n52.wps.server.request.ExecuteRequest.updateStatus(ExecuteRequest.java:858) ... 7 more
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

but the output ran with Rserve and showed the output in seperate window.
how can I store output in wms geoserver, anyone can help, please.....
thanks in advance...

wps_config.xml:

<Generator name="WMSGenerator"
                                 className="org.n52.wps.io.datahandler.generator.GeoserverWMSGenerator"
  active="true">
  </Generator>

wps_config_geotools.xml:

<Generator name="WMSGenerator" className="org.n52.wps.io.datahandler.generator.GeoserverWMSGenerator" active="true">
        <Format mimetype="application/WMS"/>
        <Property name="Geoserver_host" active="true">localhost</Property>
        <Property name="Geoserver_password" active="true">geoserver</Property>
        <Property name="Geoserver_port" active="true">8080</Property>
        <Property name="Geoserver_username" active="true">admin</Property>
      </Generator>
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
The version of 52north wps is (3.6.2) but according this link (http://geoprocessing.forum.52north.org/Reading-raster-data-inputs-with-wpsr-td4026006.html), I tried that version (52n-wps-r-3.3.2-SNAPSHOT.jar), but it hasn't been solved.
I still cann't see application/wms in my R process (Describe Process) but there is in some process like:
org.n52.wps.server.r.test.geo
org.n52.wps.server.r.geo.poly.intersection
org.n52.wps.server.algorithm.coordinatetransform.CoordinateTransformAlgorithm
org.n52.wps.server.algorithm.simplify.DouglasPeuckerAlgorithm
org.n52.wps.server.algorithm.intersection.IntersectionAlgorithm
org.n52.wps.server.algorithm.convexhull.ConvexHullAlgorithm
org.n52.wps.server.algorithm.SimpleBufferAlgorithm
org.n52.wps.demo.ConvexHullDemo
org.n52.wps.server.algorithm.raster.AddRasterValues

could anyone help me, please...






Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

BenjaminPross
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
I tested that solution with link(https://github.com/bpross-52n/WPS/tree/feature/wps-3.x-geoserveruploadfor4) and build wps again, it successfully build but it got error but I didn't mind it,

[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building 52North WPS Web Application 3.6.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- buildnumber-maven-plugin:1.1:create (default) @ 52n-wps-webapp ---
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] ShortRevision tag detected. The value is '8'.
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify --short=8 HEAD"
[INFO] Working directory: D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp
[INFO] Storing buildNumber: 0 at timestamp: 2017-08-07 19:27:39
[INFO] ShortRevision tag detected. The value is '8'.
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify --short=8 HEAD"
[INFO] Working directory: D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp
[INFO] Storing buildScmBranch: UNKNOWN_BRANCH
[INFO]
[INFO] --- license-maven-plugin:2.2:check (default) @ 52n-wps-webapp ---
[INFO] Checking licenses...
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 52n-wps-webapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ 52n-wps-webapp ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 52n-wps-webapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 22 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ 52n-wps-webapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ 52n-wps-webapp ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jgit-buildnumber-plugin:1.2.7:extract-buildnumber (git-buildnumber) @ 52n-wps-webapp ---
[ERROR]
java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:582)
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:550)
        at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:89)
        at ru.concerteza.util.buildnumber.BuildNumberExtractor.extract(BuildNumberExtractor.java:38)
        at ru.concerteza.util.buildnumber.JGitBuildNumberMojo.execute(JGitBuildNumberMojo.java:118)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ 52n-wps-webapp ---
[INFO] Packaging webapp
[INFO] Assembling webapp [52n-wps-webapp] in [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\target\52n-wps-webapp-3.6.2-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp webResources [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\src/main/webapp/WEB-INF] to [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\target\52n-wps-webapp-3.6.2-SNAPSHOT]
[INFO] Copying webapp webResources [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\src/main/webapp/config] to [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\target\52n-wps-webapp-3.6.2-SNAPSHOT]
[INFO] Copying webapp webResources [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\src/main/webapp/] to [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\target\52n-wps-webapp-3.6.2-SNAPSHOT]
[INFO] Copying webapp webResources [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\src/main/webapp/webAdmin] to [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\target\52n-wps-webapp-3.6.2-SNAPSHOT]
[INFO] Copying webapp resources [D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\src\main\webapp]
[INFO] Webapp assembled in [4102 msecs]
[INFO] Building war: D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\target\52n-wps-webapp-3.6.2-SNAPSHOT.war
[INFO] WEB-INF\web.xml already added, skipping
[INFO]
[INFO] --- maven-site-plugin:2.3:attach-descriptor (attach-descriptor) @ 52n-wps-webapp ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ 52n-wps-webapp ---
[INFO] Installing D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\target\52n-wps-webapp-3.6.2-SNAPSHOT.war to C:\Users\win8.1\.m2\repository\org\n52\wps\52n-wps-webapp\3.6.2-SNAPSHOT\52n-wps-webapp-3.6.2-SNAPSHOT.war
[INFO] Installing D:\SOFTWARES\Apache Maven\wps\WPS-feature-wps-3.x-geoserveruploadfor4\52n-wps-webapp\pom.xml to C:\Users\win8.1\.m2\repository\org\n52\wps\52n-wps-webapp\3.6.2-SNAPSHOT\52n-wps-webapp-3.6.2-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.724 s
[INFO] Finished at: 2017-08-07T19:27:46+04:30
[INFO] Final Memory: 26M/347M
[INFO] ------------------------------------------------------------------------


I saw just application/wms (not application/wcs , application/wfs ) in Describe Process for the R process, I received response :
<wps:ExecuteResponse xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ows="http://www.opengis.net/ows/1.1" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsExecute_response.xsd" serviceInstance="http://localhost:8080/wps/WebProcessingService?REQUEST=GetCapabilities&SERVICE=WPS" xml:lang="en-US" service="WPS" version="1.0.0">
<wps:Process wps:processVersion="">
<ows:Identifier>org.n52.wps.server.r.RGB_Raster</ows:Identifier>
<ows:Title>RGB Image for raster</ows:Title>
</wps:Process>
<wps:Status creationTime="2017-08-07T19:59:07.935+04:30">
<wps:ProcessSucceeded>Process successful</wps:ProcessSucceeded>
</wps:Status>
<wps:ProcessOutputs>
<wps:Output>
<ows:Identifier>output</ows:Identifier>
<ows:Title>id</ows:Title>
<wps:Data>
<wps:ComplexData encoding="UTF-8" mimeType="application/WMS">
<![CDATA[
<OWSResponse type="WMS"><ResourceID>N52:rgb.tif_97f09d1c-5bfd-4459-b54a-d6ddbbce338d</ResourceID><GetCapabilitiesLink>http://localhost:8080/geoserver/wms?Service=WMS&amp;Request=GetCapabilities&amp;Version=1.1.1</GetCapabilitiesLink></OWSResponse>
]]>

</wps:ComplexData>
</wps:Data>
</wps:Output>
</wps:ProcessOutputs>
</wps:ExecuteResponse>

and I didn't find any output file on geoserver (actually nothing has been saved). but the output file  had been saved in earlier release.
I'm going to test all of (wms,wfs,wcs) services in geoserver as output process format in wps 52north,
thanks....
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

BenjaminPross
Right, there was something missing in the WPS code.. The GeoTiff was never uploaded. I added a fix to the branch. If the file you are creating in R ends with tif or tiff and is a valid GeoTiff, it should work now.
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
I downloaded the branch (using earlier link) again and built it and hadn't any error, I added my R process as well but unfortunately there is no application/wms in Describe Process...
I think it has a bug again...

Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

BenjaminPross
Did you activate the GeoServerWMSGenerator?
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
Yes, I did, actually I activated wms generator on wps_config_geotools.xml .
but it's strange, application/wms is activated for some process in Describe Process (for 8 processes) but when I add my R process, there isn't application/wms on my process in describe process,

process:
# calculate RGB for raster ,

###########################################################

#wps.des: RGB_Raster, RGB Image for raster;
#wps.in: Blue, geotiff;
#wps.in: Green, geotiff;
#wps.in: Red, geotiff;


library(RStoolbox);
library(sp);
library(raster);


# import separate Landsat files into single RasterStack
blue = raster(Blue)
green = raster(Green)
red = raster(Red)

out = stack(red,green,blue)

rgb = brick(out)

r = writeRaster(rgb,filename = 'rgb.tif',overwrite=TRUE)

output = "rgb.tif"

#wps.out: output, geotiff;

and request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wps:Execute service="WPS" version="1.0.0"
        xmlns:wps="http://www.opengis.net/wps/1.0.0"
        xmlns:ows="http://www.opengis.net/ows/1.1"
        xmlns:xlink="http://www.w3.org/1999/xlink"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0
  http://schemas.opengis.net/wps/1.0.0/wpsExecute_request.xsd">
        <ows:Identifier>org.n52.wps.server.r.RGB_Raster</ows:Identifier>
        <wps:DataInputs>
                <wps:Input>
                        <ows:Identifier
                                xmlns:ns1="http://www.opengis.net/ows/1.1">Blue</ows:Identifier>
                        <wps:Reference xlink:href="http://localhost:8080/uav/IMG_0503_1.tif" mimeType="application/geotiff" />
                </wps:Input>
                <wps:Input>
                        <ows:Identifier
                                xmlns:ns1="http://www.opengis.net/ows/1.1">Green</ows:Identifier>
                        <wps:Reference xlink:href="http://localhost:8080/uav/IMG_0503_2.tif" mimeType="application/geotiff" />
                </wps:Input>
                <wps:Input>
                        <ows:Identifier
                                xmlns:ns1="http://www.opengis.net/ows/1.1">Red</ows:Identifier>
                        <wps:Reference xlink:href="http://localhost:8080/uav/IMG_0503_3.tif" mimeType="application/geotiff" />
                </wps:Input>
        </wps:DataInputs>
        <wps:ResponseForm>
                <wps:ResponseDocument> 
                            <wps:Output mimeType="application/WMS"> 
                                   <ows:Identifier>output</ows:Identifier> 
                                   <ows:Title>output</ows:Title> 
                                   <ows:Abstract>output</ows:Abstract> 
                            </wps:Output> 
            </wps:ResponseDocument>
        </wps:ResponseForm>
</wps:Execute>
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

BenjaminPross
Works for me with the script. Please re-check your settings.
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
I checked everything again, it seems everything is ok, and I didn't understand what the problem is.

in Tomcat log:

2017-08-08 16:33:32,857 [localhost-startStop-1] ERROR org.n52.wps.server.r.util.RConnector: Could not connect to RServe.
org.rosuda.REngine.Rserve.RserveException: Cannot connect: Connection refused: connect
        at org.rosuda.REngine.Rserve.RConnection.<init>(RConnection.java:90) ~[Rserve-1.8.1.jar:na]
        at org.rosuda.REngine.Rserve.RConnection.<init>(RConnection.java:60) ~[Rserve-1.8.1.jar:na]
        at org.n52.wps.server.r.FilteredRConnection.<init>(FilteredRConnection.java:180) ~[52n-wps-r-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.r.util.RConnector.getNewConnection(RConnector.java:88) [52n-wps-r-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.r.util.RConnector.getNewConnection(RConnector.java:62) [52n-wps-r-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.r.R_Config.openRConnection(R_Config.java:405) [52n-wps-r-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.r.LocalRAlgorithmRepository.checkStartUpConditions(LocalRAlgorithmRepository.java:101) [52n-wps-r-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.r.LocalRAlgorithmRepository.<init>(LocalRAlgorithmRepository.java:79) [52n-wps-r-3.6.2-SNAPSHOT.jar:na]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.8.0_77]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [na:1.8.0_77]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [na:1.8.0_77]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:423) [na:1.8.0_77]
        at java.lang.Class.newInstance(Class.java:442) [na:1.8.0_77]
        at org.n52.wps.server.RepositoryManager.loadAllRepositories(RepositoryManager.java:115) [52n-wps-server-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.RepositoryManager.<init>(RepositoryManager.java:64) [52n-wps-server-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.RepositoryManager.getInstance(RepositoryManager.java:170) [52n-wps-server-3.6.2-SNAPSHOT.jar:na]
        at org.n52.wps.server.WebProcessingService.init(WebProcessingService.java:159) [52n-wps-server-3.6.2-SNAPSHOT.jar:na]
        at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1194) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1110) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1000) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4918) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5228) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952) [catalina.jar:9.0.0.M4]
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823) [catalina.jar:9.0.0.M4]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_77]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_77]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_77]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_77]
        at java.lang.Thread.run(Thread.java:745) [na:1.8.0_77]
Caused by: java.net.ConnectException: Connection refused: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[na:1.8.0_77]
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) ~[na:1.8.0_77]
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_77]
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_77]
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_77]
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[na:1.8.0_77]
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_77]
        at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_77]
        at java.net.Socket.connect(Socket.java:538) ~[na:1.8.0_77]
        at java.net.Socket.<init>(Socket.java:434) ~[na:1.8.0_77]
        at java.net.Socket.<init>(Socket.java:211) ~[na:1.8.0_77]
        at org.rosuda.REngine.Rserve.RConnection.<init>(RConnection.java:85) ~[Rserve-1.8.1.jar:na]
        ... 32 common frames omitted
2017-08-08 16:33:32,862 [localhost-startStop-1] INFO  org.n52.wps.server.r.util.RConnector: Attempting to start RServe.
2017-08-08 16:33:32,866 [localhost-startStop-1] INFO  org.n52.wps.server.r.util.RStarter: Started R.

it always happen when I start Tomcat.
..
.
.
2017-08-08 16:37:30,240 [http-nio-8080-exec-10] DEBUG org.n52.wps.server.WebProcessingService: POST request contained  632 characters
2017-08-08 16:37:30,240 [http-nio-8080-exec-10] DEBUG org.n52.wps.server.WebProcessingService: POST request form variable removed
2017-08-08 16:37:30,241 [http-nio-8080-exec-10] DEBUG org.n52.wps.server.WebProcessingService: Decoded of POST:
<?xml version="1.0" encoding="UTF-8"?>
<wps:DescribeProcess service="WPS" version="1.0.0"
  xmlns:wps="http://www.opengis.net/wps/1.0.0" xmlns:ows="http://www.opengis.net/ows/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_request.xsd">
  <ows:Identifier>org.n52.wps.server.r.RGB_Raster</ows:Identifier>
</wps:DescribeProcess>

2017-08-08 16:37:30,261 [http-nio-8080-exec-10] INFO  org.n52.wps.server.r.GenericRProcess: Initializing description for GenericRProcess [script = D:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\wps\R\scripts\RGB_Raster.R]
2017-08-08 16:37:30,265 [http-nio-8080-exec-10] INFO  org.n52.wps.server.r.LocalRAlgorithmRepository: Algorithm under name 'org.n52.wps.server.r.RGB_Raster' added: GenericRProcess [script = null, annotations = [RAnnotation [type=DESCRIPTION, attributeHash={title=RGB Image for raster, id=RGB_Raster}], RAnnotation [type=INPUT, attributeHash={id=Blue, type=geotiff}], RAnnotation [type=INPUT, attributeHash={id=Green, type=geotiff}], RAnnotation [type=INPUT, attributeHash={id=Red, type=geotiff}], RAnnotation [type=OUTPUT, attributeHash={id=output, type=geotiff}]]]
2017-08-08 16:37:30,265 [http-nio-8080-exec-10] INFO  org.n52.wps.server.request.Request: Handled Request successfully for: org.n52.wps.server.r.RGB_Raster,


It might cause the problem, in C:R-3.4.1\bin\R.exe :
Starting Rserve...
 "C:\R-34~1.1\library\Rserve\libs\x64\Rserve.exe"
Rserve: Ok, ready to answer queries.
[WPS4R @ Aug 8, 2017 4:33:33 PM] New connection from WPS4R
[WPS4R @ Aug 8, 2017 4:33:33 PM] Closing connection.

Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
wps_config_geotools.xml :

<Repository name="LocalRAlgorithmRepository" className="org.n52.wps.server.r.LocalRAlgorithmRepository" active="true">
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.idw</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.image</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.interpolation.jsclient</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.meuse.rdata</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.pegelReport</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.sweaveFoo</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.timeseriesPlot</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.uniform.simple</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.demo.uniform.table</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.enviroCar_osmMatching</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.eo2hAirQuality</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.geo.poly.attribute-sum</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.geo.poly.intersection</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.highlight</Property>
      <Property active="true" name="Algorithm">org.n52.wps.server.r.NDVI</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.netCDF_aggregation</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.RGB_Raster</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.calculator</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.csv</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.defaults</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.echo</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.geo</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.image</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.resources</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.session</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.warnings</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.test.wpsOff</Property>
      <Property name="Algorithm" active="true">org.n52.wps.server.r.uncertweb.make-realizations</Property>
      <Property name="R_cacheProcesses" active="true">true</Property>
      <Property name="R_datatypeConfig" active="true">R/R_Datatype.conf</Property>
      <Property name="R_enableBatchStart" active="true">true</Property>
      <Property name="R_resourceDirectory" active="true">R/resources</Property>
      <Property name="R_RserveHost" active="true">localhost</Property>
      <Property name="R_RservePassword" active="true">123456</Property>
      <Property name="R_RservePort" active="true">6311</Property>
      <Property name="R_RserveUser" active="true">admin</Property>
      <Property name="R_scriptDirectory" active="true">R/scripts</Property>
      <Property name="R_session_memoryLimit" active="true">1000</Property>
      <Property name="R_wdName" active="true">myName</Property>
      <Property name="R_wdStrategy" active="true">default</Property>
    </Repository>

and I put xercesImpl-2.7.1.jar in lib folder of Tomcat...
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

BenjaminPross
In reply to this post by soshi
The exceptions are not normal. It seems that Rserve is not started. If that is the case, the process description of the R scripts will work, but execution will fail. Maybe restarting your computer and building the WPS again after running maven clean will help. With the code from the branch it should work. I tested it several times myself.
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
I built it again, when I run (install -Dwps.config.file=/config/wps_config.xml) in eclipse, I got error but build was successfull...(also when I run on cmd, it hasn't any error)...

[ERROR]
java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:582)
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:550)
        at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:89)
        at ru.concerteza.util.buildnumber.BuildNumberExtractor.extract(BuildNumberExtractor.java:38)
        at ru.concerteza.util.buildnumber.JGitBuildNumberMojo.execute(JGitBuildNumberMojo.java:118)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

and also run (install -Dinclude.wps.config.file=/config/wps_config.xml) on ${workspace_loc:/52n-wps-webapp}, I got error but build was successfull.

[ERROR]
java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:582)
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:550)
        at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:89)
        at ru.concerteza.util.buildnumber.BuildNumberExtractor.extract(BuildNumberExtractor.java:38)
        at ru.concerteza.util.buildnumber.JGitBuildNumberMojo.execute(JGitBuildNumberMojo.java:118)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

and also when I run install without skip test, it got error in eclipse:
java.lang.IllegalArgumentException: One of setGitDir or setWorkTree must be called.
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.requireGitDirOrWorkTree(BaseRepositoryBuilder.java:582)
        at org.eclipse.jgit.lib.BaseRepositoryBuilder.setup(BaseRepositoryBuilder.java:550)
        at org.eclipse.jgit.storage.file.FileRepositoryBuilder.build(FileRepositoryBuilder.java:89)
        at ru.concerteza.util.buildnumber.BuildNumberExtractor.extract(BuildNumberExtractor.java:38)
        at ru.concerteza.util.buildnumber.JGitBuildNumberMojo.execute(JGitBuildNumberMojo.java:118)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

but there is application/wms in Describe Process, and the image had successfully saved in geoserver but it didn't show any image when I got wms request because I think it might be large tiff image:

message in url (http://localhost:8080/geoserver/gwc/rest/seed/N52:rgb.tif_5f965f24-95e8-45e4-a8e9-12f163eac602) is:
Thread 45 Unknown layer N52:rgb. Check the logfiles, it may not have loaded properly.


never mind,thanks anyway for your help, instead I'm going to save output image using defined tag in client (html Browser), actually server send file to client and show in browser, how can I do this things, is it possible in wps 52 north???
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

BenjaminPross
Sure it is possible, you may have a look at the WPS JavaScript client API or the client that we have build on the API:

API: https://github.com/52North/wps-js 
Client: https://github.com/52North/wps-js-client
Reply | Threaded
Open this post in threaded view
|

Re: problem with wms output using R process

soshi
Thank you so much,
I installed wps-js according the link(https://github.com/52North/wps-js), and deploy dist folder on Tomcat.
should I set all the configuration (GetCapabilities Request, response , ....) on WpsService.js ??
the instruction is confusing.....
could you help me more,
thanks...