Hi again!
In my RHEL 5.8 environment:
· I reverted to jdk1.6.0_39,
· I removed my old jboss and did a clean install of jboss7.1.0
· I also deployed a clean install of geoserver 2.2.4 war from http://geoserver.org/display/GEOS/GeoServer+2.2.4
· I unzipped the following into the WEB-INF/lib directory and overwrote the existing jars with the new ones
o wps plugin http://downloads.sourceforge.net/geoserver/geoserver-2.2.4-wps-plugin.zip
o geoserver-2.4-SNAPSHOT-python-plugin.zip
· I see the created data_dir/scripts folder
· I added the data_dir/scripts/wps folder
· I added the data_dir/scripts/wps/buffer.py script
Now when I try to hit the wps getCapabilities I see the following error in the browser and I attached the geoserver log output:
<ows:ExceptionReport version=“1.1.0” xsi:schemaLocation=“http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd”>
<ows:Exception exceptionCode=“NoApplicableCode”>
ows:ExceptionText
java.lang.RuntimeException: java.io.IOException: javax.script.ScriptException: ImportError: No module named types in /h/data/geoserver_data/scripts/wps/buffer.py at line number 1
java.io.IOException: javax.script.ScriptException: ImportError: No module named types in /h/data/geoserver_data/scripts/wps/buffer.py at line number 1
javax.script.ScriptException: ImportError: No module named types in /h/data/geoserver_data/scripts/wps/buffer.py at line number 1
ImportError: No module named types in /h/data/geoserver_data/scripts/wps/buffer.py at line number 1
null
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
Again the python script is:
from geoserver.wps import process
from com.vividsolutions.jts.geom import Geometry
@process(
title=‘Buffer’,
description=‘Buffers a geometry’,
inputs={
‘geom’: (Geometry, ‘The geometry to buffer’),
‘distance’:(float,‘The buffer distance’)
},
outputs={
‘result’: (Geometry, ‘The buffered geometry’)
}
)
def run(geom, distance):
return geom.buffer(distance);
Maybe I’m missing something when I installed the python plugin? All I did was unzip the contents of the zip file into geoserver/WEB-INF/lib. Do I actually need to install python? Or do I need to add jars to the lib directory created under data_dir/scripts? If you want I could directly email you the geoserver.war. I’m not sure the users group would want it.
Thanks
Dom
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: Wednesday, February 27, 2013 7:27 AM
To: Bessette-Halsema, Dominique E
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] python scripting hook
Thanks Dominique. I wonder if Java 7 might be the issue, i know from time to time things are found not to work with it, it could be something in javax.script that has changed. Or perhaps something related to invokedynamic that was added in java 7.
It would interesting if you could try on java 6 to see if the problem still exists, that way we can at least rule it out.
On Sun, Feb 24, 2013 at 1:54 PM, Bessette-Halsema, Dominique E <Dominique.Bessette@anonymised.com> wrote:
Hi
i just updated my VM to java1.7, geoserver 2.2.4 and the python scripting hook from http://gridlock.opengeo.org/geoserver/master/community-latest/
I unzip the contents of the python scripting zip file to my geoserver/WEB-INF/lib directory and restarted the server.
I see the created scripts/wps folders under my geoserver data dir, and added the buffer.py file from the example page http://docs.geoserver.org/stable/en/user/community/scripting/hooks.html under the wps folder and made sure it had the correct permissions.
I do not see the the py:buffer in the WPS get capabilities document http://localhost:8080/geoserver/ows?service=wps&version=1.0.0&request=GetCapabilities but I do see it under the WPS Request Builder dropdown which is odd.
When I try to run the wps via the following rest call and when I hit the py:buffer wps in the dropdown on the WPS builder request page i see the following error in the geoserver logs:
http://localhost:8080/geoserver/wps?service=WPS&version=1.0.0&request=Execute&identifier=py:buffer&datainputs=geom=POINT%280%200%29@anonymised.com=application/wkt;distance=10
Caused by: java.io.IOException: javax.script.ScriptException: ImportError: No module named types in /h/data/gis/geoserver/external/scripts/wps/buffer.py at line number 1
at org.geoserver.script.ScriptFileWatcher.parseFileContents(ScriptFileWatcher.java:58) [script-core-2.4-SNAPSHOT.jar:2.4-SNAPSHOT]
at org.geoserver.script.ScriptFileWatcher.parseFileContents(ScriptFileWatcher.java:26) [script-core-2.4-SNAPSHOT.jar:2.4-SNAPSHOT]
at org.geoserver.platform.FileWatcher.read(FileWatcher.java:53) [platform-2.2.4.jar:]
at org.geoserver.script.ScriptFileWatcher.readIfModified(ScriptFileWatcher.java:44) [script-core-2.4-SNAPSHOT.jar:2.4-SNAPSHOT]
at org.geoserver.script.wps.ScriptProcess.getInputs(ScriptProcess.java:69) [script-core-2.4-SNAPSHOT.jar:2.4-SNAPSHOT]
at org.geoserver.script.wps.ScriptProcessFactory.getParameterInfo(ScriptProcessFactory.java:119) [script-core-2.4-SNAPSHOT.jar:2.4-SNAPSHOT]
… 79 more
Caused by: javax.script.ScriptException: ImportError: No module named types in /h/data/gis/geoserver/external/scripts/wps/buffer.py at line number 1
at org.python.jsr223.PyScriptEngine.scriptException(PyScriptEngine.java:191) [jython-2.5.2.jar:]
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:42) [jython-2.5.2.jar:]
at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:47) [jython-2.5.2.jar:]
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:249) [rt.jar:1.7.0]
at org.geoserver.script.ScriptFileWatcher.parseFileContents(ScriptFileWatcher.java:56) [script-core-2.4-SNAPSHOT.jar:2.4-SNAPSHOT]
… 84 more
Caused by: Traceback (most recent call last):
File “/h/data/gis/geoserver/external/scripts/wps/buffer.py”, line 1, in
from geoserver.wps import process
File “pyclasspath/geoserver/wps.py”, line 1, in
ImportError: No module named types
at org.python.core.Py.ImportError(Py.java:290) [jython-2.5.2.jar:]
at org.python.core.imp.import_first(imp.java:750) [jython-2.5.2.jar:]
at org.python.core.imp.import_name(imp.java:834) [jython-2.5.2.jar:]
at org.python.core.imp.importName(imp.java:884) [jython-2.5.2.jar:]
at org.python.core.ImportFunction.call(builtin.java:1220) [jython-2.5.2.jar:]
at org.python.core.PyObject.call(PyObject.java:357) [jython-2.5.2.jar:]
at org.python.core.builtin.import(builtin.java:1173) [jython-2.5.2.jar:]
at org.python.core.imp.importOne(imp.java:903) [jython-2.5.2.jar:]
at geoserver.wps$py.f$0(pyclasspath/geoserver/wps.py:35)
at geoserver.wps$py.call_function(pyclasspath/geoserver/wps.py)
at org.python.core.PyTableCode.call(PyTableCode.java:165) [jython-2.5.2.jar:]
at org.python.core.PyCode.call(PyCode.java:18) [jython-2.5.2.jar:]
at org.python.core.imp.createFromCode(imp.java:386) [jython-2.5.2.jar:]
…
Heres the buffer.py contents
from geoserver.wps import process
from com.vividsolutions.jts.geom import Geometry
@process(
title=‘Buffer’,
description=‘Buffers a geometry’,
inputs={
‘geom’: (Geometry, ‘The geometry to buffer’),
‘distance’:(float,‘The buffer distance’)
},
outputs={
‘result’: (Geometry, ‘The buffered geometry’)
}
)
def run(geom, distance):
return geom.buffer(distance);
The python scripting app directory works. If I add a hello world app under data_dir/scripts/apps/hello/main.py and hit it via a rest call I see the correct output. Although I had to create the apps directory myself the python scripting hook created a functions directory. So it just seems that its the wps python scripting function that isnt working.
Do I need to add a geoserver.wps jar to the lib directory under data_dir/scripts/lib ?
Do I need to add geoscript python jars? http://geoscript.org/py/
Thank You
Dominique
From: Justin Deoliveira [jdeolive@anonymised.com]
Sent: Thursday, February 07, 2013 8:26 AM
To: Bessette-Halsema, Dominique E
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] python scripting hook
Hmmm… ok. What version of Geoserver and the scripting extension are you running?
On Wed, Feb 6, 2013 at 5:50 PM, Bessette-Halsema, Dominique E <Dominique.Bessette@anonymised.com> wrote:
It looks like this. It’s the same one as the example http://docs.geoserver.org/stable/en/user/community/scripting/hooks.html
from geoserver.wps import process
from geoscript.geom import Geometry
@process(
title=‘Buffer’,
description=‘Buffers a geometry’,
inputs={‘geom’: (Geometry, ‘The geometry to buffer’),
‘distance’:(float,‘The buffer distance’)},
outputs={‘result’: (Geometry, ‘The buffered geometry’)}
)
def run(geom, distance):
return geom.buffer(distance)
Thank You
Dom
From: Justin Deoliveira [mailto:jdeolive@anonymised.com671…]
Sent: Monday, February 04, 2013 8:06 AM
To: Bessette-Halsema, Dominique E
Cc: geoserver-users@anonymised.comorge.net
Subject: Re: [Geoserver-users] python scripting hook
Hmmm… any chance you can make the script available, I can take a closer look.
On Fri, Feb 1, 2013 at 8:49 AM, Bessette-Halsema, Dominique E <Dominique.Bessette@anonymised.com> wrote:
Hi
I’m having trouble installing the python scripting hook. I unzip the contents of geoserver-2.2-SNAPSHOT-python-plugin.zip into my geoserver-2.2/WEB-INF/lib file. In my GEOSERVER_DATA_DIR is see a scripts/lib and scripts/function directory. I created a scripts/wps directory and made the buffer.py example from http://docs.geoserver.org/stable/en/user/community/scripting/hooks.html
When I go into the WPS request builder and try to run the buffer.py script I see the following error in geoserver.
15:46:38,593 ERROR [org.apache.wicket.RequestCycle] (http–0.0.0.0-8080-1) java.io.IOException: javax.script.ScriptException: ImportError: No module named types in /gis/geoserver/external/scripts/wps/demo.py at line number 1: java.lang.RuntimeException: java.io.IOException: javax.script.ScriptException: ImportError: No module named types in /gis/geoserver/external/scripts/wps/demo.py at line number 1
Line number 1 is
from geoserver.wps import process
what am I missing?
Thank you
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
–
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
–
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
geoserver.ouput.txt (55.4 KB)