Search code examples
javagrailswsdlwsdl2java

Grails: Unable to import classes from wsdl2java


I'm new to Grails, and I have a problem importing some classes from an external wsdl . I used wsdl2java to create a class called MacroArgument

package xxxx.MacroArgument;
public class MacroArgument {
...
@XmlElement(name = "MacroArgument")
protected String macroArg;
@XmlElement(name = "ID", required = true, type = String.class)
@XmlJavaTypeAdapter(Adapter1 .class)
@XmlSchemaType(name = "long")
protected Long myParamOverrideID;
....getters/setters...
}

I created a new domain called TestDomainMacro

package it.xxx
import xxxx.MacroArgument;

class TestDomain {
MacroArgument testMacro
static constraints = {
}

}

In eclipse I don't have any problem, while running the application with the command "grails run-app" I have this error:

| Error Compilation error: startup failed:
C:\..pathtofile..\TestDomain.groovy: 3: unable to resolve class xxxx.MacroArgument 
@ line 3, column 1.
import xxxx.MacroArgument;

Does anyone have an idea of how to solve my problem?


Solution

  • I solved my problem by inserting my class MacroArgument in an external library and then adding the library to the project. Then I imported the class extending a domain of my Grails application.