Я получаю TypeNotPresentException в моем приложении grails. Фрагмент StackTrace нижеОшибка установки Grails "java.lang.TypeNotPresentException: Тип org.apache.http.client.methods.HttpRequestBase нет"
[INFO] [groovyc] java.lang.TypeNotPresentException: Type org.apache.http.client.methods.HttpRequestBase not present
[INFO] [groovyc] at sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:98)
[INFO] [groovyc] at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
[INFO] [groovyc] at sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
[INFO] [groovyc] at sun.reflect.generics.reflectiveObjects.WildcardTypeImpl.getUpperBounds(WildcardTypeImpl.java:112)
[INFO] [groovyc] at org.codehaus.groovy.vmplugin.v5.Java5.configureWildcardType(Java5.java:122)
[INFO] [groovyc] at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:85)
[INFO] [groovyc] at org.codehaus.groovy.vmplugin.v5.Java5.configureTypeArguments(Java5.java:154)
[INFO] [groovyc] at org.codehaus.groovy.vmplugin.v5.Java5.configureParameterizedType(Java5.java:134)
[INFO] [groovyc] at org.codehaus.groovy.vmplugin.v5.Java5.configureType(Java5.java:87)
[INFO] [groovyc] at org.codehaus.groovy.vmplugin.v5.Java5.makeClassNode(Java5.java:374)
[INFO] [groovyc] at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:315)
[INFO] [groovyc] at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:263)
[INFO] [groovyc] at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:341)
[INFO] [groovyc] at org.codehaus.groovy.ast.ClassNode.declaresInterface(ClassNode.java:929)
[INFO] [groovyc] at org.codehaus.groovy.ast.ClassNode.implementsInterface(ClassNode.java:909)
[INFO] [groovyc] at org.codehaus.groovy.ast.ClassNode.isDerivedFromGroovyObject(ClassNode.java:899)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.isGroovyObject(AsmClassGenerator.java:2741)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitPropertyExpression(AsmClassGenerator.java:2717)
[INFO] [groovyc] at org.codehaus.groovy.ast.expr.PropertyExpression.visit(PropertyExpression.java:55)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitAndAutoboxBoolean(AsmClassGenerator.java:4111)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.makeCallSite(AsmClassGenerator.java:2171)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.makeCall(AsmClassGenerator.java:2008)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.makeCall(AsmClassGenerator.java:1994)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitStaticMethodCallExpression(AsmClassGenerator.java:2404)
[INFO] [groovyc] at org.codehaus.groovy.ast.expr.StaticMethodCallExpression.visit(StaticMethodCallExpression.java:43)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitAndAutoboxBoolean(AsmClassGenerator.java:4111)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.evaluateExpression(AsmClassGenerator.java:1437)
[INFO] [groovyc] at org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:1398)
[INFO] [groovyc] at org.codehaus.groovy.ast.stmt.ReturnStatement.visit(ReturnStatement.java:47)
[INFO] [groovyc] at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
Мой файл buildconfig.groovy имеет следующий код
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
// compile('com.cm:admanager:1.4.8') {
// transitive = false
// }
compile('org.codehaus.groovy.modules.http-builder:http-builder:0.5.0') {
excludes 'httpclient', 'groovy', 'nekohtml', 'ezmorph', 'commons-logging'
}
compile('org.apache.httpcomponents:httpclient:4.0.1') {
excludes 'commons-logging'
}
compile('org.perf4j:perf4j:0.9.16')
compile('com.thoughtworks.xstream:xstream:1.4.4')
compile('com.google.guava:guava:16.0.1')
test('org.hamcrest:hamcrest-all:1.3')
}
.sh файл используется для запуска проекта
rm -rf "$HOME/.ivy2/cache/com.cm/nci-autodata"
rm -rf "$HOME/.m2/repository/com/cm/nci-autodata"
mvn -f build.xml -Pdev -X clean install
HttpClient-4.0.1 должен иметь требуемый класс, но он все еще дает мне это исключение. Я проверил папку .ivy2, и у вас есть необходимый файл jar в правильном месте. Любая идея, что здесь происходит?
Это проект, который я получил на своей новой работе. Я не написал этот код, и тот, кто это сделал, покинул компанию.
Thanks
какая версия grails? как вы его используете? –
1.3.7. Я включаю в себя файл .sh, который я использую для запуска проекта – BrownTownCoder