При попытке использовать следующий фрагмент в приложении Grails 1.3.5 (вы можете проверить это через консоль) ...:
import com.amazonaws.services.ec2.model.*
def ec2 = ctx.ec2Client
def rir = new RunInstancesRequest("<some-ami-id>", 1, 1)
Placement placement = new Placement()
placement.setGroupName("<yourPlacementGroup>")
rir.setPlacement(placement)
rir.setKeyName("<yourKeyPairName>")
RunInstancesResult result = ec2.runInstances(rir)
Я получаю следующую трассировку стека:
Возникло исключение
java.lang.LinkageError: loader constraint violation: when resolving field "NODE" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the referring class, javax/xml/xpath/XPathConstants, and the class loader (instance of <bootloader>) for the field's resolved type, javax/xml/namespace/QName, have different Class objects for that type
at com.amazonaws.util.XpathUtils.asNode(XpathUtils.java:319)
at com.amazonaws.util.XpathUtils.evaluateAsString(XpathUtils.java:363)
at com.amazonaws.util.XpathUtils.asString(XpathUtils.java:120)
at com.amazonaws.transform.LegacyErrorUnmarshaller.parseErrorCode(LegacyErrorUnmarshaller.java:96)
at com.amazonaws.transform.LegacyErrorUnmarshaller.unmarshall(LegacyErrorUnmarshaller.java:62)
at com.amazonaws.transform.LegacyErrorUnmarshaller.unmarshall(LegacyErrorUnmarshaller.java:29)
at com.amazonaws.http.DefaultErrorResponseHandler.handle(DefaultErrorResponseHandler.java:76)
at com.amazonaws.http.DefaultErrorResponseHandler.handle(DefaultErrorResponseHandler.java:36)
at com.amazonaws.http.HttpClient.handleErrorResponse(HttpClient.java:508)
at com.amazonaws.http.HttpClient.execute(HttpClient.java:215)
at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:3804)
at com.amazonaws.services.ec2.AmazonEC2Client.runInstances(AmazonEC2Client.java:267)
at ConsoleScript2.run(ConsoleScript2:10)
В моем BuildConfig.groovy есть следующее:
runtime 'com.amazonaws:aws-java-sdk:1.1.0'
Есть идеи, что может вызвать это?