Grails and web service development with Metro

I searched through my blog entries, and realized that I somehow forgot to blog about the Metro Plugin for Grails framework I introduced in the beginning of this year. So, this is an attempt to do a (late) little advertising.

If you use Grails, you are certainly aware of it's plugin system. I decided to wrote a little Metro plugin which enables you to expose your Groovy/Grails classes as Metro web services in a simple and easy way using natural Grails commands, such as

grails create-service

and natural Metro annotations, such as @WebService, like this:

import javax.jws.\*
@WebService(targetNamespace="http://com.calculator")
class CalculatorService {
@WebMethod
def int add(int i, int j) {
return i+j;
}
@WebMethod
def multiply(int i, int j) {
return i\*j;
}
}

Those are the only things you need to do to develop web services with Grails after installing the plugin. You can find exact installation/how to use instructions at plugin website. Currently I host the plugin as a subproject of JAX-WS Commons project, but am working on making sure it is hosted at Grails plugin site as well.

Btw, I recently found also these instructions on how to use the Metro Grails plugin to develop contract-first (WSDL first) web services, which gives exactly the areas where I planned to improve the plugin in. So in future, the instructions might get even more simple.

Comments:

hi
i follow the metro Metro Plugin for Grails framework instruction to install metro but i got following message could you help me?
[message]
Failed to install plug-in [metro-1.0]. Missing dependencies: ["services"]

Posted by terence on July 01, 2008 at 03:43 AM CEST #

Hi,

I'm hitting exactly the same problem. I'd be really interested in hearing if anyone can explain what the problem is.

Thanks,
ngu

Posted by New Grails User on July 07, 2008 at 10:43 AM CEST #

I'm getting the same error. It seems there is problem downloading the zip as it's only 1kb.

Are you still planning to migrate the plugin to the Grails Plugin repository and upgrade it to Grails 1.0.3?

Cheers,
Marcel

Posted by Marcel Overdijk on July 08, 2008 at 04:07 AM CEST #

Hi,
I found a solution for grails metro plugin.
Extrcact grails-metro-1.0.zip in {your-grails-app-dir}\\plugins\\metro-1.0 and in the file
plugins\\metro-1.0\\MetroGrailsPlugin.groovy comment row 44. "//def dependsOn = [services: '1.0.1']"
that's all, it works in my grails project

Posted by ilyas Turkben on July 08, 2008 at 06:43 AM CEST #

Hi guys,
thanks for comments. I published an updated version 1.0.1 which updates to Grails 1.0.3 and fixes the 'services' dependency. I also updated the installation instructions, as the direct installation doesn't seem to work fine - so you need to download first.
Check it out at:

https://jax-ws-commons.dev.java.net/grails

Posted by MartinG on July 15, 2008 at 11:04 AM CEST #

I followed the instructions for then Calculator sample to the letter (using grails 1.0.3 and groovy 1.5.4) and I get this when running "grails run-app":

[0] spring.GrailsWebApplicationContext Bean factory for application context [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext@1fc6eed]: org.springframework.beans.factory.support.DefaultListableBeanFactory@98d70d
java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.management.MBeanServer.isRegistered(Ljavax/management/ObjectName;)Z" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, com/sun/xml/ws/server/JMXAgent, and the class loader (instance of <bootloader>) for resolved class, javax/management/MBeanServer, have different Class objects for the type javax/management/ObjectName used in the signature
at com.sun.xml.ws.server.JMXAgent.init(JMXAgent.java:72)
...

Any idea?

Posted by Martin Meyer on July 16, 2008 at 11:45 AM CEST #

No idea, but it might not be caused by the plugin as those are some Linkage errors. If you could send the project, I'll try to look if it works for me.

Posted by MartinG on July 16, 2008 at 12:02 PM CEST #

Oops, I had all groovy .jar files on my CLASSPATH.

Posted by Martin Meyer on July 17, 2008 at 01:46 PM CEST #

Hi,

I'm using the istructions to the following link for a wsdl webservice

http://docs.codehaus.org/pages/viewpage.action?pageId=88342530

However I'm having some problems, please see comment#1 in the previous link,

do you have some suggestions?

thanks
Nicola

Posted by Nicola on September 16, 2008 at 03:40 AM CEST #

Need help please -- I tried all the steps, install the plug-in and generate the source code. I am missing the jws classes because they are not found. What plug-in do I need to install first.

Posted by Quiter on May 22, 2009 at 04:15 PM CEST #

Installing the plug-in in grails 1.1 and starting with an empty application it is not working any input?

Posted by Paflex on May 22, 2009 at 04:47 PM CEST #

Hi Martin,

The plugin is not compatible with Grails 1.1. I was wondering if you had any plans to update the plugin or if you'd be open to taking patches? Also, I'd like to see this plugin available in the Grails central plugin repo so it can be installed easier by users. I'd be willing to help make that happen if ok with you.

John

Posted by John Wagenleitner on June 03, 2009 at 12:52 AM CEST #

Hi,
my time left to spend on the plugin these days is very limited (better say there's none), so any contribution here is welcome. And having it in the central grails repo would be just awesome.
MartiNG

Posted by Martin Grebac on June 10, 2009 at 07:55 AM CEST #

sfd

Posted by guest on April 19, 2010 at 09:43 PM CEST #

Post a Comment:
Comments are closed for this entry.
About

The views expressed on this [blog; Web site] are my own and do not necessarily reflect the views of Oracle.

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today
Bookmarks