[Geoserver-devel] Help implementing a simple OWS service

Hi all,

I’ve been using the guide at http://docs.geoserver.org/latest/en/developer/programming-guide/ows-services/implementing.html to create the “hello” ows service, but am having some troubles. When I request the sayHello method from the URL, I get the following exception:

<ows:ExceptionReport version=“1.0.0” xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode=“InvalidParameterValue” locator=“service”>
ows:ExceptionTextNo service: ( hello )</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

I’ve searched the mailing list briefly to find a solution, but the answer I’ve seen frequently come up is to make sure the applicationContext.xml is included in the final jar archive. I’ve made sure it is there, and am not sure how to troubleshoot this further. Any help would be appreciated.

Cheers,
Andrew

Hi Andrew,

How are you running? Are you dropping the jar into an existing geoserver installation? Are you running from sources? More info and we should be able to track it down.

-Justin

On Mon, Jun 11, 2012 at 9:05 AM, Andrew Martin <Andrew.Martin@anonymised.com> wrote:

Hi all,

I’ve been using the guide at http://docs.geoserver.org/latest/en/developer/programming-guide/ows-services/implementing.html to create the “hello” ows service, but am having some troubles. When I request the sayHello method from the URL, I get the following exception:

<ows:ExceptionReport version=“1.0.0” xsi:schemaLocation="http://www.opengis.net/ows http://localhost:8080/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd">
<ows:Exception exceptionCode=“InvalidParameterValue” locator=“service”>
ows:ExceptionTextNo service: ( hello )</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

I’ve searched the mailing list briefly to find a solution, but the answer I’ve seen frequently come up is to make sure the applicationContext.xml is included in the final jar archive. I’ve made sure it is there, and am not sure how to troubleshoot this further. Any help would be appreciated.

Cheers,
Andrew


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


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


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hi Justin,

Sorry for the double response, at first I just responded to your email
instead of the mailing list.

I have checked out the 2.2-SNAPSHOT version of Geoserver from svn, and I
followed instructions on the Geoserver documentation to build with Maven and
import the project into Eclipse. So I have a Maven repository and a
geoserver source repository, and I can simply start and stop the server in
Eclipse.

I am dropping the jar file into the geoserver source directory, under
/src/web/app/target/geoserver/WEB-INF/lib

Thanks for the response, appreciate the help!

Andrew

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4980759.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi Andrew,

On Tue, Jun 12, 2012 at 4:52 AM, Andrew Martin <andrew.martin@anonymised.com> wrote:

Hi Justin,

Sorry for the double response, at first I just responded to your email
instead of the mailing list.

Now worries :slight_smile:

I have checked out the 2.2-SNAPSHOT version of Geoserver from svn, and I
followed instructions on the Geoserver documentation to build with Maven and
import the project into Eclipse. So I have a Maven repository and a
geoserver source repository, and I can simply start and stop the server in
Eclipse.

Ok, so when running from sources in eclipse the classpath is setup a bit differently. Rather than the usual WEB-INF/lib classpath the eclipse project classpath is used. So long story short you need to enable the dependency from the web-app module on your hello module. Like is done here:

http://docs.geoserver.org/latest/en/developer/programming-guide/ows-services/implementing.html#alternative-1-bundling-with-web-module

You can do that in the pom or just in eclipse by setting a project dependency directly.

I just looked over that doc with the 2 alternatives and indeed I can see why that was confusing. The two alternatives are misleading. The two alternatives should really just be:

  1. Running from Jetty
  2. Running from Eclipse

I am dropping the jar file into the geoserver source directory, under
/src/web/app/target/geoserver/WEB-INF/lib

Thanks for the response, appreciate the help!

Andrew


View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4980759.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


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


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Great info! Thanks a bunch. I've decided to just scrap using Eclipse as it
seems to complicate matters slightly. Now, I just have the Geoserver source
repository and built it with Maven. I then used Maven to install the "hello"
module, and after copying the jar into WEB-INF/lib, I am supposed to run the
following command:

[web]$ mvn jetty6:run-exploded

according to the second alternative on the guide. However, now I am getting
this error:

[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-jetty6-plugin' does not
exist or no valid version could be found

I'm very new to the use of Maven, so I apologise if there is something
straightforward that I'm missing. Thanks again for the help!

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4980876.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hey Andrew,

Again that doc is really leading you down a rabbit hole, i apologize for that. So first off the jetty6 maven plugin is not longer, and its just “jetty”. So you can run “mvn jetty:run-exploded” but there is currently an issue with running geoserver this way and i can’t actually get it to work. So the ways i would recommend running geoserver for the purposes of testing out your extension would be running it from eclipse like you were before.

You can also just grab a pre-built geoserver package (from a night build or an official release) and install your hello service plugin as you would a normal geoserver plugin. The downside here is that it will be hard to debug that way. So again I recommend the eclipse approach.

If you can hop on the geoserver IRC channel i would be glad to help you there as well.

-Justin

On Tue, Jun 12, 2012 at 9:22 AM, Andrew Martin <andrew.martin@anonymised.com> wrote:

Great info! Thanks a bunch. I’ve decided to just scrap using Eclipse as it
seems to complicate matters slightly. Now, I just have the Geoserver source
repository and built it with Maven. I then used Maven to install the “hello”
module, and after copying the jar into WEB-INF/lib, I am supposed to run the
following command:

[web]$ mvn jetty6:run-exploded

according to the second alternative on the guide. However, now I am getting
this error:

[ERROR] BUILD ERROR
[INFO]

[INFO] The plugin ‘org.apache.maven.plugins:maven-jetty6-plugin’ does not
exist or no valid version could be found

I’m very new to the use of Maven, so I apologise if there is something
straightforward that I’m missing. Thanks again for the help!


View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4980876.html

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


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


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


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Hey, thanks again for the response. I seem to be having some troubles
connecting to any IRC server at work, which might be a firewall issue, so
for now I'll have to manage by email.

I've set up everything again with Eclipse and tried to include the
dependency in the web/pom.xml, but that still gave me the same error. I
will try to give you all the information on my setup right now to avoid
having to bounce too many questions back and forth :slight_smile:

I am using Ubuntu 12.04 64-bit, just for background. Here is how I set up
geoserver on my system.

I followed the instructions exactly as given at
http://docs.geoserver.org/latest/en/developer/quickstart/index.html to
install geoserver and run from Eclipse.

Then, I follow the instructions at
http://docs.geoserver.org/latest/en/developer/programming-guide/ows-services/implementing.html,
up to copying the jar file into
geoserver/src/web/app/target/geoserver/WEB-INF/lib. After this, I edited
geoserver/src/web/pom.xml to include this dependency:

<dependency>
    <groupId>org.geoserver</groupId>
    <artifactId>hello</artifactId>
    <version>1.0</version>
</dependency>

Finally, inside the web directory I execute an mvn clean install. Upon
starting geoserver from Eclipse after this point and trying to request the
service, I got the same error as before.

Apologies for the rather long explanation, but hopefully this should give
you some insight into what the problem might be. Thanks again,

Andrew

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4981164.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hey Andrew,

Thanks for the info, and sorry that tutorial is soo poorly written at this point. It would be great if perhaps you could clean it up!

That said, here are the steps you will need to follow to run your service from eclipse.

  1. Set up geoserver for eclipse, which really means compiling it with maven and then running mvn eclipse:eclipse:

[geoserver/src]% mvn clean install -DskipTests
[geoserver/src]% mvn eclipse:eclipse

  1. Import geoserver modules into eclipse
  2. Import your “hello” module into eclipse
  • ensure that the applicationContext.xml file is included as a source resource. If you put it in src/main/java this shoudl happen automatically. IF you put it in src/main/resources then you might have to include that source directory manually
  1. In eclipse modify the build properties of the “web-app” module, and add the “hello” module as a project dependency
  2. In the web-app module run the Start.java class, located under src/test/java/ in the org.geoserver.web package.

At this point you should have a geoserver running with your plugin setup on the classpath and registered via its spring application context.

Let me know how that works.

-Justin

On Wed, Jun 13, 2012 at 8:37 AM, Andrew Martin <andrew.martin@anonymised.com> wrote:

Hey, thanks again for the response. I seem to be having some troubles
connecting to any IRC server at work, which might be a firewall issue, so
for now I’ll have to manage by email.

I’ve set up everything again with Eclipse and tried to include the
dependency in the web/pom.xml, but that still gave me the same error. I
will try to give you all the information on my setup right now to avoid
having to bounce too many questions back and forth :slight_smile:

I am using Ubuntu 12.04 64-bit, just for background. Here is how I set up
geoserver on my system.

I followed the instructions exactly as given at
http://docs.geoserver.org/latest/en/developer/quickstart/index.html to
install geoserver and run from Eclipse.

Then, I follow the instructions at
http://docs.geoserver.org/latest/en/developer/programming-guide/ows-services/implementing.html,
up to copying the jar file into
geoserver/src/web/app/target/geoserver/WEB-INF/lib. After this, I edited
geoserver/src/web/pom.xml to include this dependency:

org.geoserver hello 1.0

Finally, inside the web directory I execute an mvn clean install. Upon
starting geoserver from Eclipse after this point and trying to request the
service, I got the same error as before.

Apologies for the rather long explanation, but hopefully this should give
you some insight into what the problem might be. Thanks again,

Andrew


View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4981164.html

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


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


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


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Justin,

Thanks so much for your help here. I followed your instructions and it
worked like a charm! I will most definitely clean up and edit these
tutorials as soon as I have some spare time.

Many thanks,
Andrew

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4981750.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi Justin,

I'm a co-worker of Andrew, and after following your steps I'm still unable
to run the Hello World module. I'm running a Fedora Core 17 x64 system with
Eclipse Juno 4.2.0 and Maven 2.2.1. Is there any other methods I might be
able to try to get this running? Or even a method to get a compiled Hello
World JAR running with the binary installation under Tomcat?

Thanks,
Devin Binnie

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4982101.html
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Hi Devin,

I just updated the tutorial online, it should be more accurate now and contain a section dedicated to running from eclipse. I also removed the jetty section.

http://docs.geoserver.org/latest/en/developer/programming-guide/ows-services/implementing.html

Notice the notes in each section describing common pitfalls and how to verify things. Once you have things in eclipse basically just verify that the web-app module actually depends (as a project dependency) on the hello module.

Hope that helps.

-Justin

On Mon, Jun 18, 2012 at 7:50 AM, Devin Binnie <devin.binnie@anonymised.com> wrote:

Hi Justin,

I’m a co-worker of Andrew, and after following your steps I’m still unable
to run the Hello World module. I’m running a Fedora Core 17 x64 system with
Eclipse Juno 4.2.0 and Maven 2.2.1. Is there any other methods I might be
able to try to get this running? Or even a method to get a compiled Hello
World JAR running with the binary installation under Tomcat?

Thanks,
Devin Binnie


View this message in context: http://osgeo-org.1560.n6.nabble.com/Help-implementing-a-simple-OWS-service-tp4980501p4982101.html

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


Live Security Virtual Conference
Exclusive live event will cover all the ways today’s security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/


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


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.