Custom Process - Maven problem

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

Custom Process - Maven problem

Roman Wössner
Hey 52n community!

First of all, I am totally new to the 52°North WPS (and unfortunately Maven), but I just want to give it a try.
I've read this [1] tutorial and managed to set up an Eclipse workspace with the 3.1 tag of the WPS server.
Afterwards, I came accross this [2] tutorial and the appropriate wiki page [3] and wrote a simple algorithm using the "out-of-the-box Eclipse Project". Everything went fine, the process was listed in the GetCapabilities response and I was also successfull in executing it.

Now, I'm struggling with the Maven solution described in [2] and [3].
My current pom.xml is listed in [4]. I adapted the <version> element to "3.1-SNAPSHOT" - expecting this to be the correct way to use it in the 3.1 tag.
Maven stops with the following error:
[ERROR] Failed to execute goal on project test: Could not resolve dependencies for project de.rwoessner:test:jar:0.0.1-SNAPSHOT: Could not find artifact org.n52.wps:52n-wps-webapp:jar:3.1-20130129.230147-53 in n52-snapshots (http://52north.org/maven/repo/snapshots/) -> [Help 1]

I would really appreciate any help on that issue.

I'm wondering if it is necessary to use the ProcessDevelopmentKit. Is is also possible to add custom processes directly into the workspace which is described in [1]?

Thanks and regards,
Roman

[1] http://wiki.52north.org/bin/view/Processing/TutorialWpsEclipseIndigo
[2] http://52north.org/communities/geoprocessing/wps/tutorials/ProcessDevlopmentKit.html
[3] http://wiki.52north.org/bin/view/Processing/TutorialProcessDevelopmentKit
[4]

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>de.rwoessner</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>org.n52.wps</groupId>
      <artifactId>52n-wps-webapp</artifactId>
      <version>3.1-SNAPSHOT</version>
        </dependency> 
  </dependencies>
  <repositories>
    <repository>
      <id>n52-snapshots</id>
      <name>n52-snapshots</name>
      <url>http://52north.org/maven/repo/snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
</project>
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Matthes Rieke (52North)
Hi Roman,

the problem you are facing is related to the packaging (~= binary type) of 52n-wps-webapp. The project build tries to resolve 52n-wps-webapp-*.jar. As the webapp artifact is a .war file, defining the type should do the trick:

    <dependency>
      <groupId>org.n52.wps</groupId>
      <artifactId>52n-wps-webapp</artifactId>
      <version>3.1-SNAPSHOT</version>
      <type>war</type>
     </dependency>

If you really want to use the binaries of the 3.1 release, you should adjust your project to resolve the 3.1.0 release (not the snapshot). Your final pom.xml could look like the following:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>de.rwoessner</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>org.n52.wps</groupId>
      <artifactId>52n-wps-webapp</artifactId>
      <version>3.1.0</version>
      <type>war</type>
  </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>n52-releases</id> <!-- use releases instead -->
      <name>n52-releases</name>
      <url>http://52north.org/maven/repo/releases/</url>
    </repository>
  </repositories>
</project>

Please let us know if this works for you. We then can adjust the tutorial as it obviously has some mistakes in it.

Best,
Matthes



2013/4/2 Roman Wössner <[hidden email]>
Hey 52n community!

First of all, I am totally new to the 52°North WPS (and unfortunately
Maven), but I just want to give it a try.
I've read this [1] tutorial and managed to set up an Eclipse workspace with
the 3.1 tag of the WPS server.
Afterwards, I came accross this [2] tutorial and the appropriate wiki page
[3] and wrote a simple algorithm using the "out-of-the-box Eclipse Project".
Everything went fine, the process was listed in the GetCapabilities response
and I was also successfull in executing it.

Now, I'm struggling with the Maven solution described in [2] and [3].
My current pom.xml is listed in [4]. I adapted the <version> element to
"3.1-SNAPSHOT" - expecting this to be the correct way to use it in the 3.1
tag.
Maven stops with the following error:
[ERROR] Failed to execute goal on project test: Could not resolve
dependencies for project de.rwoessner:test:jar:0.0.1-SNAPSHOT: Could not
find artifact org.n52.wps:52n-wps-webapp:jar:3.1-20130129.230147-53 in
n52-snapshots (http://52north.org/maven/repo/snapshots/) -> [Help 1]

I would really appreciate any help on that issue.

I'm wondering if it is necessary to use the ProcessDevelopmentKit. Is is
also possible to add custom processes directly into the workspace which is
described in [1]?

Thanks and regards,
Roman

[1] http://wiki.52north.org/bin/view/Processing/TutorialWpsEclipseIndigo
[2]
http://52north.org/communities/geoprocessing/wps/tutorials/ProcessDevlopmentKit.html
[3]
http://wiki.52north.org/bin/view/Processing/TutorialProcessDevelopmentKit
[4]

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>de.rwoessner</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <dependencies>
    <dependency>
      <groupId>org.n52.wps</groupId>
      <artifactId>52n-wps-webapp</artifactId>
      <version>3.1-SNAPSHOT</version>
        </dependency>
  </dependencies>
  <repositories>
    <repository>
      <id>n52-snapshots</id>
      <name>n52-snapshots</name>
      <url>http://52north.org/maven/repo/snapshots/</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
</project>




--
View this message in context: http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250.html
Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org



--
Matthes Rieke
52° North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-51
Fax: +49-(0)-251–396371-11

http://52north.org/
Follow us on Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Roman Wössner
Hi Matthes,

thanks for your quick response!
Your fix with the <type> element did it in a first step - the Maven build was just successful! :)

I've just added a new package and copied my process from the working "out-of-the-box Eclipse Project" into my new Maven Project, which resulted in several Eclipse errors. I think, Eclipse is still not able to resolve the dependencies. All the errors look similar to the following:

"The import org.n52 cannot be resolved."
"AbstractSelfDescribingAlgorithm cannot be resolved to a type"
...

Did I miss any Maven command or anythink else?

Thanks and regards
Roman
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Daniel
Am 02.04.2013 17:18, schrieb Roman Wössner:

> I've just added a new package and copied my process from the working
> "out-of-the-box Eclipse Project" into my new Maven Project, which resulted
> in several Eclipse errors. I think, Eclipse is still not able to resolve the
> dependencies. All the errors look similar to the following:
>
> "The import org.n52 cannot be resolved."
> "AbstractSelfDescribingAlgorithm cannot be resolved to a type"
> ...
>
> Did I miss any Maven command or anythink else?

Did you update the Maven configuration in Eclipse? (right click on
project > Maven > Update project...)

I can also imagine Maven cannot resolve the dependencies in the
workspace because you have different version numbers (i.e. using the
snapshots vs. using tag 3.1) in the pom.xml files. Could you post the
pom file of your algorithm project please?

/Daniel



> --
> View this message in context: http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250p4025252.html
> Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
> _______________________________________________
> Geoprocessingservices mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/geoprocessingservices
> http://geoprocessing.forum.52north.org
>


--
Daniel Nüst
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-36
Fax: +49-(0)-251–396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Matthes Rieke (52North)
In reply to this post by Roman Wössner
Hi Roman,

I just checked the project template. I am not sure how it has been created (probably by maven) and I am not a big fan of eclipse project templates as they are often hard-wired to some user-specific settings. I propose to follow a different approach using the m2e plugin [1].

This is very straightforward an involves only little steps to create a maven-managed project.

1. Create a new general project in Eclipse (New/Project -> General/Project)
2. drop your pom.xml in the root of that project
3. add a folder for java source (New/Folder -> src/main/java)
4. right-click on the new project and select Configure/Convert to Maven Project

If you have setup m2e correctly (which is also quite straightforward), the project should be decorated with a little "M" after a few moments. Also, the src/main/java folder should be added to the build path automatically and the maven dependencies (= 52n-wps-webapp and transient dependencies) are resolved on-the-fly.

HTH,
Matthes

[1] http://eclipse.org/m2e/download/

2013/4/2 Roman Wössner <[hidden email]>
Hi Matthes,

thanks for your quick response!
Your fix with the <type> element did it in a first step - the Maven build
was just successful! :)

I've just added a new package and copied my process from the working
"out-of-the-box Eclipse Project" into my new Maven Project, which resulted
in several Eclipse errors. I think, Eclipse is still not able to resolve the
dependencies. All the errors look similar to the following:

"The import org.n52 cannot be resolved."
"AbstractSelfDescribingAlgorithm cannot be resolved to a type"
...

Did I miss any Maven command or anythink else?

Thanks and regards
Roman




--
View this message in context: http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250p4025252.html
Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org



--
Matthes Rieke
52° North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-51
Fax: +49-(0)-251–396371-11

http://52north.org/
Follow us on Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Roman Wössner
Hi Daniel, hi Matthes,

thanks for your dedicated help!
@Daniel: I'm using the pom.xml posted by Matthes above. Maven -> Update Project does not have any effect on the errors.
@Matthes:
I also prefer not to use the template to create new algorithms, because of its "static" character. Therefore it would be nice to work with the Maven solution. :)
Until now, my project has been directly created as Maven project (New -> Project -> Maven -> Maven Project).
Following the four steps you've posted, was also successful ("M" decoration appeared). The import of "org.52n.wps.*" inside a new class is still accompanied with the same dependency error.

Some research on the web led me to [1]. Is it a general problem with the war dependency?
I'm wondering, if it is also possible to create a new algorithm in a project which depends on the local sources created in [2]?

[1] http://stackoverflow.com/questions/5597327/maven-war-dependency-cannot-resolve-package
[2] https://wiki.52north.org/bin/view/Processing/TutorialWpsEclipseIndigo

Thanks and regards
Roman
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Matthes Rieke (52North)

2013/4/3 Roman Wössner <[hidden email]>
Hi Daniel, hi Matthes,

thanks for your dedicated help!
@Daniel: I'm using the pom.xml posted by Matthes above. Maven -> Update
Project does not have any effect on the errors.
@Matthes:
I also prefer not to use the template to create new algorithms, because of
its "static" character. Therefore it would be nice to work with the Maven
solution. :)
Until now, my project has been directly created as Maven project (New ->
Project -> Maven -> Maven Project).
Following the four steps you've posted, was also successful ("M" decoration
appeared). The import of "org.52n.wps.*" inside a new class is still
accompanied with the same dependency error.

Some research on the web led me to [1]. Is it a general problem with the war
dependency?

Alright, I see. The tutorial has some unintented drawbacks ;-) It totally makes sense that a war-dependency does not provide what we want. So here is the alternative:

        <dependency>
            <groupId>org.n52.wps</groupId>
            <artifactId>52n-wps-io</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.n52.wps</groupId>
            <artifactId>52n-wps-algorithm</artifactId>
            <version>3.1.0</version>
        </dependency>

By defining these dependencies you are able to implement your own Algorithms as well as (data) Parsers and Generators.

I'm wondering, if it is also possible to create a new algorithm in a project
which depends on the local sources created in [2]?

Sure, no problem. You just have to adjust the version of the WPS deps to match you local project. Assuming its the current trunk, use 3.2.0-SNAPSHOT. m2e should take care of the rest as it is capable of resolving deps as local eclipse projects. If not, check if the project is configured correctly: Right-click / Maven / Enable/Disable workspace resolution. To verify if it worked, check the "Maven Dependencies" in your project. It should have the local projects instead of jars at the bottom of that list.

Best,
Matthes


[1]
http://stackoverflow.com/questions/5597327/maven-war-dependency-cannot-resolve-package
[2] https://wiki.52north.org/bin/view/Processing/TutorialWpsEclipseIndigo

Thanks and regards
Roman




--
View this message in context: http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250p4025255.html
Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org



--
Matthes Rieke
52° North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-51
Fax: +49-(0)-251–396371-11

http://52north.org/
Follow us on Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Daniel
Just an aside: Please consider updating the tutorial in the Wiki if it
is not working any more/can be improved.

/Daniel

Am 03.04.2013 10:43, schrieb Matthes Rieke (52North):

>
> 2013/4/3 Roman Wössner <[hidden email] <mailto:[hidden email]>>
>
>     Hi Daniel, hi Matthes,
>
>     thanks for your dedicated help!
>     @Daniel: I'm using the pom.xml posted by Matthes above. Maven -> Update
>     Project does not have any effect on the errors.
>     @Matthes:
>     I also prefer not to use the template to create new algorithms,
>     because of
>     its "static" character. Therefore it would be nice to work with the
>     Maven
>     solution. :)
>     Until now, my project has been directly created as Maven project (New ->
>     Project -> Maven -> Maven Project).
>     Following the four steps you've posted, was also successful ("M"
>     decoration
>     appeared). The import of "org.52n.wps.*" inside a new class is still
>     accompanied with the same dependency error.
>
>     Some research on the web led me to [1]. Is it a general problem with
>     the war
>     dependency?
>
>
> Alright, I see. The tutorial has some unintented drawbacks ;-) It
> totally makes sense that a war-dependency does not provide what we want.
> So here is the alternative:
>
>         <dependency>
>             <groupId>org.n52.wps</groupId>
>             <artifactId>52n-wps-io</artifactId>
>             <version>3.1.0</version>
>         </dependency>
>         <dependency>
>             <groupId>org.n52.wps</groupId>
>             <artifactId>52n-wps-algorithm</artifactId>
>             <version>3.1.0</version>
>         </dependency>
>
> By defining these dependencies you are able to implement your own
> Algorithms as well as (data) Parsers and Generators.
>
>     I'm wondering, if it is also possible to create a new algorithm in a
>     project
>     which depends on the local sources created in [2]?
>
>
> Sure, no problem. You just have to adjust the version of the WPS deps to
> match you local project. Assuming its the current trunk, use
> 3.2.0-SNAPSHOT. m2e should take care of the rest as it is capable of
> resolving deps as local eclipse projects. If not, check if the project
> is configured correctly: Right-click / Maven / Enable/Disable workspace
> resolution. To verify if it worked, check the "Maven Dependencies" in
> your project. It should have the local projects instead of jars at the
> bottom of that list.
>
> Best,
> Matthes
>
>
>     [1]
>     http://stackoverflow.com/questions/5597327/maven-war-dependency-cannot-resolve-package
>     [2]
>     https://wiki.52north.org/bin/view/Processing/TutorialWpsEclipseIndigo
>
>     Thanks and regards
>     Roman
>
>
>
>
>     --
>     View this message in context:
>     http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250p4025255.html
>     Sent from the 52° North - Geoprocessing Community Forum mailing list
>     archive at Nabble.com.
>     _______________________________________________
>     Geoprocessingservices mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     http://list.52north.org/mailman/listinfo/geoprocessingservices
>     http://geoprocessing.forum.52north.org
>
>
>
>
> --
> Matthes Rieke
> 52° North Initiative for Geospatial Open Source Software GmbH
> Martin-Luther-King-Weg 24
> 48155 Münster, Germany
> E-Mail: [hidden email] <mailto:[hidden email]>
> Fon: +49-(0)-251–396371-51
> Fax: +49-(0)-251–396371-11
>
> http://52north.org/
> Follow us on Twitter: @FiveTwoN
>
> General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
> Local Court Muenster HRB 10849
>
>
> _______________________________________________
> Geoprocessingservices mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/geoprocessingservices
> http://geoprocessing.forum.52north.org
>


--
Daniel Nüst
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-36
Fax: +49-(0)-251–396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Roman Wössner
In reply to this post by Matthes Rieke (52North)
Hi Matthes,

thank you again for the help!
The new dependencies finally solved it. :)
It's time to update the wiki pages respectively the tutorials.

I even recognized that the local sources are getting already used in the build process (workspace resolution is enabled).

Roman

Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Daniel
Am 03.04.2013 14:17, schrieb Roman Wössner:
> It's time to update the wiki pages respectively the tutorials.

Do you volunteer? :-)

/Daniel

--
Daniel Nüst
52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-36
Fax: +49-(0)-251–396371-11

http://52north.org/
Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Roman Wössner
First, I want to be sure to work with the ideal solution. :)
There's at least one more problem - I will tell you tomorrow.

Roman

Am 03.04.2013 14:30, schrieb Daniel Nüst:
> Am 03.04.2013 14:17, schrieb Roman Wössner:
>> It's time to update the wiki pages respectively the tutorials.
> Do you volunteer? :-)
>
> /Daniel
>

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Roman Wössner
Hey guys,

I encountered another problem, which is probably related to the Maven dependencies.
During the process of testing the algorithm using a JUnit test class (as described in the tutorial) the following error occured:

java.lang.RuntimeException: Could not find and load wps_config.xml
        at org.n52.wps.commons.WPSConfig.getConfigPath(WPSConfig.java:304)
        at org.n52.wps.commons.WPSConfig.getInstance(WPSConfig.java:200)
        at org.n52.wps.io.datahandler.parser.AbstractParser.<init>(AbstractParser.java:58)
        at org.n52.wps.io.datahandler.parser.GML3BasicParser.<init>(GML3BasicParser.java:88)
        at ...

To avoid it, I copied the wps_config.xml into the test ressources of my algorithm project.
Do you have any idea for a solution using some kind of additional dependencies in Maven?

Thanks and regards,
Roman

Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Matthes Rieke (52North)
Hi Roman,

this is probably due to the fact that the 52n-wps-webapp does not work as a dependency. I just checked, and adding the wps_config.xml from the Template Eclipse project to /src/test/resources does the job for me. Could you check if this works for you as well?

Best,
Matthes

2013/4/4 Roman Wössner <[hidden email]>
Hey guys,

I encountered another problem, which is probably related to the Maven
dependencies.
During the process of testing the algorithm using a JUnit test class (as
described in the tutorial) the following error occured:

java.lang.RuntimeException: Could not find and load wps_config.xml
        at org.n52.wps.commons.WPSConfig.getConfigPath(WPSConfig.java:304)
        at org.n52.wps.commons.WPSConfig.getInstance(WPSConfig.java:200)
        at
org.n52.wps.io.datahandler.parser.AbstractParser.<init>(AbstractParser.java:58)
        at
org.n52.wps.io.datahandler.parser.GML3BasicParser.<init>(GML3BasicParser.java:88)
        at ...

To avoid it, I copied the wps_config.xml into the test ressources of my
algorithm project.
Do you have any idea for a solution using some kind of additional
dependencies in Maven?

Thanks and regards,
Roman





--
View this message in context: http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250p4025261.html
Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org



--
Matthes Rieke
52° North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-51
Fax: +49-(0)-251–396371-11

http://52north.org/
Follow us on Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Roman Wössner
Hi Matthes,
 
To avoid it, I copied the wps_config.xml into the test ressources of my
algorithm project.

Yes, it works for me as well. :)
Thanks! The workspace seems to be quite stable with this configuration.

Roman


"Matthes Rieke (52North)" <[hidden email]> hat am 5. April 2013 um 10:31 geschrieben:
Hi Roman,

this is probably due to the fact that the 52n-wps-webapp does not work as a dependency. I just checked, and adding the wps_config.xml from the Template Eclipse project to /src/test/resources does the job for me. Could you check if this works for you as well?

Best,
Matthes

2013/4/4 Roman Wössner <[hidden email]>
Hey guys,

I encountered another problem, which is probably related to the Maven
dependencies.
During the process of testing the algorithm using a JUnit test class (as
described in the tutorial) the following error occured:

java.lang.RuntimeException: Could not find and load wps_config.xml
        at org.n52.wps.commons.WPSConfig.getConfigPath(WPSConfig.java:304)
        at org.n52.wps.commons.WPSConfig.getInstance(WPSConfig.java:200)
        at
org.n52.wps.io.datahandler.parser.AbstractParser.<init>(AbstractParser.java:58)
        at
org.n52.wps.io.datahandler.parser.GML3BasicParser.<init>(GML3BasicParser.java:88)
        at ...

To avoid it, I copied the wps_config.xml into the test ressources of my
algorithm project.
Do you have any idea for a solution using some kind of additional
dependencies in Maven?

Thanks and regards,
Roman





--
View this message in context: http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250p4025261.html
Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org



--
Matthes Rieke
52° North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-51
Fax: +49-(0)-251–396371-11

http://52north.org/
Follow us on Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

 

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Matthes Rieke (52North)
Great! Thanks for testing this. If you have the time and commitment you could adjust the tutorial on your own, would be highly appreciated :-) If not, no problem - just let us know and we will do a rewrite asap.

Best,
Matthes

2013/4/5 "Roman Wössner" <[hidden email]>
Hi Matthes,
 
To avoid it, I copied the wps_config.xml into the test ressources of my
algorithm project.

Yes, it works for me as well. :)
Thanks! The workspace seems to be quite stable with this configuration.

Roman


"Matthes Rieke (52North)" <[hidden email]> hat am 5. April 2013 um 10:31 geschrieben:
Hi Roman,

this is probably due to the fact that the 52n-wps-webapp does not work as a dependency. I just checked, and adding the wps_config.xml from the Template Eclipse project to /src/test/resources does the job for me. Could you check if this works for you as well?

Best,
Matthes

2013/4/4 Roman Wössner <[hidden email]>
Hey guys,

I encountered another problem, which is probably related to the Maven
dependencies.
During the process of testing the algorithm using a JUnit test class (as
described in the tutorial) the following error occured:

java.lang.RuntimeException: Could not find and load wps_config.xml
        at org.n52.wps.commons.WPSConfig.getConfigPath(WPSConfig.java:304)
        at org.n52.wps.commons.WPSConfig.getInstance(WPSConfig.java:200)
        at
org.n52.wps.io.datahandler.parser.AbstractParser.<init>(AbstractParser.java:58)
        at
org.n52.wps.io.datahandler.parser.GML3BasicParser.<init>(GML3BasicParser.java:88)
        at ...

To avoid it, I copied the wps_config.xml into the test ressources of my
algorithm project.
Do you have any idea for a solution using some kind of additional
dependencies in Maven?

Thanks and regards,
Roman





--
View this message in context: http://geoprocessing.forum.52north.org/Custom-Process-Maven-problem-tp4025250p4025261.html
Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org



--
Matthes Rieke
52° North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: <a href="tel:%2B49-%280%29-251%E2%80%93396371-51" value="+4925139637151" target="_blank">+49-(0)-251–396371-51
Fax: <a href="tel:%2B49-%280%29-251%E2%80%93396371-11" value="+4925139637111" target="_blank">+49-(0)-251–396371-11

http://52north.org/
Follow us on Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

 

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org



--
Matthes Rieke
52° North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
48155 Münster, Germany
E-Mail: [hidden email]
Fon: +49-(0)-251–396371-51
Fax: +49-(0)-251–396371-11

http://52north.org/
Follow us on Twitter: @FiveTwoN

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Lvw
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Lvw
Hey guys,

I've been going through this thread and have done the following stuff:

1. Create a new general project in Eclipse (New/Project -> General/Project)
2. drop your pom.xml in the root of that project
3. add a folder for java source (New/Folder -> src/main/java)
4. right-click on the new project and select Configure/Convert to Maven Project

The pom.xml reads:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>org.n52.wps-extension</groupId>
        <artifactId>process-extensions</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <repositories>
                <repository>
                        <id>n52-releases</id>
                        <name>n52-releases</name>
                        <url>http://52north.org/maven/repo/releases/</url>
                        <snapshots>
                                <enabled>true</enabled>
              </snapshots>
            </repository>
    </repositories>
    <dependencies>
            <dependency>
            <groupId>org.n52.wps</groupId>
            <artifactId>52n-wps-io</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.n52.wps</groupId>
            <artifactId>52n-wps-algorithm</artifactId>
            <version>3.1.0</version>
        </dependency>
        </dependencies>
</project> 

I have created the following class:

package my.algorithm.sample;

import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.n52.wps.io.data.GenericFileData;
import org.n52.wps.io.data.IData;
import org.n52.wps.io.data.binding.complex.GenericFileDataBinding;
import org.n52.wps.server.AbstractSelfDescribingAlgorithm;

/*
 * This is a sample 52North WPS Process Class.
 * It inherits from AbstractSelfDescribingAlgorithm to automcatically create the ProcessDescription document.
 */
public class SampleProcess extends AbstractSelfDescribingAlgorithm{

       
        @Override
        public List<String> getInputIdentifiers() {
                ..
        }

       
        @Override
        public List<String> getOutputIdentifiers() {
                ..
        }
       
        @Override
        public Class getInputDataType(String identifier) {
                ..
        }

        @Override
        public Class getOutputDataType(String identifier) {
                ..
        }

        @Override
        public Map<String, IData> run(Map<String, List<IData>> inputMap) {
                ..
        }
}

And now comes the problem:


It actually reads the dependencies more or less correctly and does not make a problem over the imports in the SampleProcess. However, it states that the methods: getInputDataType, getOutputDataType and run are not overriding a superclass method. So its basically only recognizing the abstract classes from AbstractSelfDescribingAlgorithm itself (getInputIdentifier and getOutputIdentifier). I found that these three methods come from IAlgorithm, which is an interface implemented by AbstractAlgorithm (which in turn is inherited by AbstractSelfDescribingAlgorithm..)

How can I resolve this?

Best,
Lucas






Lvw
Reply | Threaded
Open this post in threaded view
|

Re: Custom Process - Maven problem

Lvw
Ok, solved it by setting java version to 1.7.. found this on stackoverflow:

I can't immediately tell you why the issue goes away, but typically this compiler error indicates that you're attempting to compile Java 6-compliant code (which allows @Override on implementations of interfaces) with a compiler set to Java 5 compliance (which only allows @Override when overriding a concrete method from a super class).