Quantcast

dependencies: httpclient and Amazon's aws-java-sdk...

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
Hello,

I'd like to use the aws-java-sdk which has the latest version 1.3.6
I'm now struggling with the following runtime exception:

 java.lang.NoSuchMethodError: org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager: method <init>()V not found
        at com.amazonaws.http.ConnectionManagerFactory.createThreadSafeClientConnManager(ConnectionManagerFactory.java:26)

Obviously, one of AWS's dependencies is Apache's HTTPclient library. As I read on stackoverflow.com there is a problem with its version, so I made a dependency-report saying that aws-java-sdk in fact requires httpclient 4.2beta1 and commons-codec [1.3,1.5).
In order to narrow the problem down, I'm now using the following dependencies in BuildConfig:

dependencies {
        // specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
        runtime ('com.amazonaws:aws-java-sdk:1.3.6') {
            excludes 'httpclient'
            excludes 'httpcore'
            excludes 'commons-codec'
            excludes 'commons-httpclient'
        }

        // force to use an older httpclient lib
        runtime 'org.apache.httpcomponents:httpclient:4.1.1'
    }

The dependency report tells me now that the AWS SDK doesn't require the httpclient anymore, instead it's a single runtime dependency - so  that's fine for the moment.

When I'm understanding the above exception correctly, the exception contains the hint that Amazon's ConnectionManagerFactory tries to invoke the constructor of ThreadSafeClientConnManager which obvoiously doesn't exist anymore or at least cannot be found on the classpath.

However, I don't get behind the problem really:

The source of ConnectionManagerFactory (see http://grepcode.com/file/repo1.maven.org/maven2/com.amazonaws/aws-java-sdk/1.3.4/com/amazonaws/http/ConnectionManagerFactory.java#ConnectionManagerFactory in version 1.3.4) approves that the non-existing constructor is called.
I don't know about the constructor's params (probably none), but even the newer httpclient 4.2beta1 still has this constructor - even though it's deprecated. The sources are available here for example:
http://grepcode.com/file/repo1.maven.org/maven2/org.apache.httpcomponents/httpclient/4.2-beta1/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java#ThreadSafeClientConnManager

Do you have a clue what's been done wrong here and how to solve the issue?
Maybe you ran into a similar problem... :-/

Thanks & Best regards
 George
 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

bobbywarner
I'm not sure about the specific exception, but just curious why you are using the aws-sdk directly instead of via the plugin?  The plugin author might have already worked out these issues.  I don't know for sure though as I haven't used the plugin yet.

http://grails.org/plugin/aws


Thanks,
Bobby
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

lucastex
Yeah Bobby, 

With the plugin everything should work.
Thanks for it. :)

Georg, if you use the plugin, you can still import the classes and use the way you want.
If you want to check how is the plugin BuildConfig, you can check it here: https://github.com/blanq/grails-aws

[]s,





On Tue, Apr 3, 2012 at 9:55 PM, bobbywarner <[hidden email]> wrote:
I'm not sure about the specific exception, but just curious why you are using
the aws-sdk directly instead of via the plugin?  The plugin author might
have already worked out these issues.  I don't know for sure though as I
haven't used the plugin yet.

http://grails.org/plugin/aws


Thanks,
Bobby

--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4530620.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
Hey Bobby and Lucas,

thanks for your quick replies (BTW this is why I love this mailing list :-)).

There are two use cases for AWS:
1. send emails using Amazon SES
2. using S3 (planned)

I'm using the amazon-sdk actually only for one reason, namely because I had another Grails2 project (without any other dependencies) where Amazon SES worked :-).  
(If your interested, read this blog post:  http://roshandawrani.wordpress.com/2011/04/06/grails-using-mail-plugin-with-amazon-email-service/)

Lucas, I realized that there is your plugin and I installed it. However I got an error message like 'NoSuchProviderException "aws"'. I'm not sure whether this is merely a configuration error or a subsequent error from the dependency issue.
Note that I'm also using the Cloudbees plugin, whose reference to the http libraries I disabled. Seems to be a bit tricky...

Considering https://github.com/blanq/grails-aws/blob/master/grails-app/conf/BuildConfig.groovy with special regard to this line...
compile 'commons-httpclient:commons-httpclient:3.1'
... I'm going to check this afternoon to work with the aws-plugin again and will notify you about what I've found out.

If you've got any other ideas or related experiences, please post them :-).

Thanks
 Georg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

lucastex
Hi Georg,

Sorry about the bad experience you're having using the plugin and grails2.
Can you file a Jira task for it?

here, we're still under grails 1.3.7, and this is probably some issue with the new grails 2 structure.

[]s,





On Wed, Apr 4, 2012 at 5:55 AM, Georg S. <[hidden email]> wrote:
Hey Bobby and Lucas,

thanks for your quick replies (BTW this is why I love this mailing list
:-)).

There are two use cases for AWS:
1. send emails using Amazon SES
2. using S3 (planned)

I'm using the amazon-sdk actually only for one reason, namely because I had
another Grails2 project (without any other dependencies) where Amazon SES
worked :-).
(If your interested, read this blog post:
http://roshandawrani.wordpress.com/2011/04/06/grails-using-mail-plugin-with-amazon-email-service/)

Lucas, I realized that there is your plugin and I installed it. However I
got an error message like 'NoSuchProviderException "aws"'. I'm not sure
whether this is merely a configuration error or a subsequent error from the
dependency issue.
Note that I'm also using the Cloudbees plugin, whose reference to the http
libraries I disabled. Seems to be a bit tricky...

Considering
https://github.com/blanq/grails-aws/blob/master/grails-app/conf/BuildConfig.groovy
with special regard to this line...
compile 'commons-httpclient:commons-httpclient:3.1'
... I'm going to check this afternoon to work with the aws-plugin again and
will notify you about what I've found out.

If you've got any other ideas or related experiences, please post them :-).

Thanks
 Georg

--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4531270.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
Hi Lucas,

yes,  I'll file a bug, but before I'd like to know if you've been able to reproduce the exception that I've described above?

Please let me know if you need more information (e.g. what other plugins I'm using that might interfere with aws' dependencies).

Best regards
 Georg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

lucastex
Georg,

I haven't tested it yet with grails2.
Can you just create an empty grails2 project, install the plugin and check if you still get the error?

Thanks,

[]s,




On Wed, Apr 4, 2012 at 9:23 AM, Georg S. <[hidden email]> wrote:
Hi Lucas,

yes,  I'll file a bug, but before I'd like to know if you've been able to
reproduce the exception that I've described above?

Please let me know if you need more information (e.g. what other plugins I'm
using that might interfere with aws' dependencies).

Best regards
 Georg


--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4531695.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
yes, that's exactly what I considered as next step (hope to find time in the afternoon...).
I'll inform you about the results.

best regards
 Georg

Am 04.04.2012 um 14:38 schrieb lucastex [via Grails]:

> Georg,
>
> I haven't tested it yet with grails2.
> Can you just create an empty grails2 project, install the plugin and check if you still get the error?
>
> Thanks,
>
> []s,
>
> Lucas Teixeira
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

lucastex
Thank you!

[]s,




On Wed, Apr 4, 2012 at 9:44 AM, Georg S. <[hidden email]> wrote:
yes, that's exactly what I considered as next step (hope to find time in the afternoon...).
I'll inform you about the results.

best regards
 Georg

Am 04.04.2012 um 14:38 schrieb lucastex [via Grails]:

> Georg,
>
> I haven't tested it yet with grails2.
> Can you just create an empty grails2 project, install the plugin and check if you still get the error?
>
> Thanks,
>
> []s,
>
> Lucas Teixeira


View this message in context: Re: dependencies: httpclient and Amazon's aws-java-sdk...

Sent from the Grails - user mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
Lucas,

I didn't get a step further yet, still the same exception, be it with or without the plugin.
However I've seen that commons-code is chosen in version 1.5 by org.grails.internal, while aws-java-sdk (in the selected version 1.2.12) asks for version 1.4, net.java.dev.jets3t wants version 1.3 and commons-httpclient would like 1.2.
What a mess of versions ;-).

So at this point of time, these are just "suspicious dependencies".
If you get further, please let me know.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
In reply to this post by lucastex
Hey Lucas,

it works.
There was an old httpclient.jar (NOT commons-httpclient) in version 4.0 on my classpath - the tricky part was to *find* it because it wasn't referenced anywhere. I just kicked it. In IntelliJ it appeared under External Libraries > Grails User Library (grailsPlugins), in the project view.
 
I haven't figured out where it came from, but chances are high that it could be an old dependency from the cloudbees-plugin.

By the way I've just updated to Grails 2.0.3 so that we know that your aws-plugin works with Grails 2.0 with very high probability :-)

Kind regards
 Georg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

lucastex
Thanks a lot Georg!

I'll soon test it more with grails 2.x

Thanks for the hard work on it.

[]s,




On Wed, Apr 4, 2012 at 6:30 PM, Georg S. <[hidden email]> wrote:
Hey Lucas,

it works.
There was an old httpclient.jar (NOT commons-httpclient) in version 4.0 on
my classpath - the tricky part was to *find* it because it wasn't referenced
anywhere. I just kicked it. In IntelliJ it appeared under External Libraries
> Grails User Library (grailsPlugins), in the project view.

I haven't figured out where it came from, but chances are high that it could
be an old dependency from the cloudbees-plugin.

By the way I've just updated to Grails 2.0.3 so that we know that your
aws-plugin works with Grails 2.0 with very high probability :-)

Kind regards
 Georg

--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4533240.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
Hello Lucas,

I've now identified the offender! It was not the cloud-bees plugin but ckeditor which in turn requires release-1.0.0.M2 - and this has a dependency to the outdated version 0.5.0 of http-builder.

At this point of time I don't need ckeditor so I uninstalled it again.
But if you know how to "globally" exclude a dependency this would be very helpful to me.
I tried this:

grails.project.dependency.resolution = {
    // inherit Grails' default dependencies
    inherits("global") {
        excludes 'org.apache.httpcomponents:httpclient:4.0'
    }


Kind regards and happy Easter days
 Georg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Georg S.
This post was updated on .
Oh, and a correction:

The fact that the release plugin will be exported to the runtime class path seems to be just one missing line in a plugin's dependencies.groovy:

In the simple-modal plugin I discovered that "export = false" seems to be missing, unlike the declaration found in the ckeditor plugin.
I'll write a JIRA issue...

Bye
 Georg
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

mashiana
Hi , I am working on a grails project which deals with storing files on amazon S3 and came across the following error in the server. I was able to run it locally but throws an error in the  staging server.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.http.AmazonHttpClient
        at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)


The call to getTemporaryCredentials sets the was creds and passes them to the token service client. We verified the same creds are used locally and on the staging server.

Previously we also saw the following in the stack trace logs:

java.lang.ClassNotFoundException: org.apache.http.conn.scheme.SchemeSocketFactory
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
        at com.amazonaws.http.AmazonHttpClient.<clinit>(AmazonHttpClient.java:86)
        at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
        at com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)

We did not see the ClassNotFoundException when we triggered the error today, just the NoClassDefFoundError.

We can see that the httpclient jar file is the same both locally and on staging server and the aws grails plugin is the same version on both machines.


We also have same versions of aws-java-sdk-1.2.12.jar on both machines.

I am not sure on how to fix it.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

mashiana
Hi , I am working on a grails project which deals with storing files on
amazon S3 and came across the following error in the server. I was able to
run it locally but throws an error in the  staging server.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.amazonaws.http.AmazonHttpClient
        at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)


The call to getTemporaryCredentials sets the was creds and passes them to
the token service client. We verified the same creds are used locally and on
the staging server.

Previously we also saw the following in the stack trace logs:

java.lang.ClassNotFoundException:
org.apache.http.conn.scheme.SchemeSocketFactory
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
        at
com.amazonaws.http.AmazonHttpClient.<clinit>(AmazonHttpClient.java:86)
        at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)

We did not see the ClassNotFoundException when we triggered the error today,
just the NoClassDefFoundError.

We can see that the httpclient jar file is the same both locally and on
staging server and the aws grails plugin is the same version on both
machines.


We also have same versions of aws-java-sdk-1.2.12.jar on both machines.

I am not sure on how to fix it.



--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4644805.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

mashiana
In reply to this post by Georg S.
Hi , I am working on a grails project which deals with storing files on
amazon S3 and came across the following error in the server. I was able to
run it locally but throws an error in the  staging server.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.amazonaws.http.AmazonHttpClient
        at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)


The call to getTemporaryCredentials sets the was creds and passes them to
the token service client. We verified the same creds are used locally and on
the staging server.

Previously we also saw the following in the stack trace logs:

java.lang.ClassNotFoundException:
org.apache.http.conn.scheme.SchemeSocketFactory
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
        at
com.amazonaws.http.AmazonHttpClient.<clinit>(AmazonHttpClient.java:86)
        at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
        at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
        at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
        at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
        at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
        at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)

We did not see the ClassNotFoundException when we triggered the error today,
just the NoClassDefFoundError.

We can see that the httpclient jar file is the same both locally and on
staging server and the aws grails plugin is the same version on both
machines.


We also have same versions of aws-java-sdk-1.2.12.jar on both machines.

I am not sure on how to fix it



--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4644806.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Benoit HEDIARD
Hi,

You might have some conflicts between http-builder and aws-java-sdk dependencies.
Try to add this in your buildConfig.groovy and use the latest version of the AWS Grails plugin / AWS Java SDK (1.4.3):
 dependencies {
                // Workaround to resolve dependency issue with aws-java-sdk and http-builder (dependent on httpcore:4.0)
                build 'org.apache.httpcomponents:httpcore:4.1'
                build 'org.apache.httpcomponents:httpclient:4.1'
                runtime 'org.apache.httpcomponents:httpcore:4.1'
                runtime 'org.apache.httpcomponents:httpclient:4.1'
}

If you still have an issue, run the grails dependency-report to check the dependencies.

Benoit Hediard

Le 15 mai 2013 à 20:27, mashiana <[hidden email]> a écrit :

Hi , I am working on a grails project which deals with storing files on
amazon S3 and came across the following error in the server. I was able to
run it locally but throws an error in the  staging server.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.amazonaws.http.AmazonHttpClient
       at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
       at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
       at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)


The call to getTemporaryCredentials sets the was creds and passes them to
the token service client. We verified the same creds are used locally and on
the staging server.

Previously we also saw the following in the stack trace logs:

java.lang.ClassNotFoundException:
org.apache.http.conn.scheme.SchemeSocketFactory
       at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
       at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
       at
com.amazonaws.http.AmazonHttpClient.<clinit>(AmazonHttpClient.java:86)
       at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
       at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
       at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)

We did not see the ClassNotFoundException when we triggered the error today,
just the NoClassDefFoundError.

We can see that the httpclient jar file is the same both locally and on
staging server and the aws grails plugin is the same version on both
machines.


We also have same versions of aws-java-sdk-1.2.12.jar on both machines.

I am not sure on how to fix it



--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4644806.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

Durgarao
hi 

 this link may be helpful for you http://aws.amazon.com/articles/Amazon-S3/4000  here you will find grails application to communicating with amazon s3 bucket


On Thu, May 16, 2013 at 1:00 AM, Benoit HEDIARD <[hidden email]> wrote:
Hi,

You might have some conflicts between http-builder and aws-java-sdk dependencies.
Try to add this in your buildConfig.groovy and use the latest version of the AWS Grails plugin / AWS Java SDK (1.4.3):
 dependencies {
                // Workaround to resolve dependency issue with aws-java-sdk and http-builder (dependent on httpcore:4.0)
                build 'org.apache.httpcomponents:httpcore:4.1'
                build 'org.apache.httpcomponents:httpclient:4.1'
                runtime 'org.apache.httpcomponents:httpcore:4.1'
                runtime 'org.apache.httpcomponents:httpclient:4.1'
}

If you still have an issue, run the grails dependency-report to check the dependencies.

Benoit Hediard

Le 15 mai 2013 à 20:27, mashiana <[hidden email]> a écrit :

Hi , I am working on a grails project which deals with storing files on
amazon S3 and came across the following error in the server. I was able to
run it locally but throws an error in the  staging server.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.amazonaws.http.AmazonHttpClient
       at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
       at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
       at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)


The call to getTemporaryCredentials sets the was creds and passes them to
the token service client. We verified the same creds are used locally and on
the staging server.

Previously we also saw the following in the stack trace logs:

java.lang.ClassNotFoundException:
org.apache.http.conn.scheme.SchemeSocketFactory
       at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
       at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
       at
com.amazonaws.http.AmazonHttpClient.<clinit>(AmazonHttpClient.java:86)
       at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
       at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
       at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)

We did not see the ClassNotFoundException when we triggered the error today,
just the NoClassDefFoundError.

We can see that the httpclient jar file is the same both locally and on
staging server and the aws grails plugin is the same version on both
machines.


We also have same versions of aws-java-sdk-1.2.12.jar on both machines.

I am not sure on how to fix it



--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4644806.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dependencies: httpclient and Amazon's aws-java-sdk...

mashiana
Thank You, I was able to sort the issue by updating my dependencies
-Mandeep


On Thu, May 16, 2013 at 1:31 AM, Durgarao [via Grails] <[hidden email]> wrote:
hi 

 this link may be helpful for you http://aws.amazon.com/articles/Amazon-S3/4000  here you will find grails application to communicating with amazon s3 bucket


On Thu, May 16, 2013 at 1:00 AM, Benoit HEDIARD <[hidden email]> wrote:
Hi,

You might have some conflicts between http-builder and aws-java-sdk dependencies.
Try to add this in your buildConfig.groovy and use the latest version of the AWS Grails plugin / AWS Java SDK (1.4.3):
 dependencies {
                // Workaround to resolve dependency issue with aws-java-sdk and http-builder (dependent on httpcore:4.0)
                build 'org.apache.httpcomponents:httpcore:4.1'
                build 'org.apache.httpcomponents:httpclient:4.1'
                runtime 'org.apache.httpcomponents:httpcore:4.1'
                runtime 'org.apache.httpcomponents:httpclient:4.1'
}

If you still have an issue, run the grails dependency-report to check the dependencies.

Benoit Hediard

Le 15 mai 2013 à 20:27, mashiana <[hidden email]> a écrit :

Hi , I am working on a grails project which deals with storing files on
amazon S3 and came across the following error in the server. I was able to
run it locally but throws an error in the  staging server.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class
com.amazonaws.http.AmazonHttpClient
       at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
       at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
       at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)


The call to getTemporaryCredentials sets the was creds and passes them to
the token service client. We verified the same creds are used locally and on
the staging server.

Previously we also saw the following in the stack trace logs:

java.lang.ClassNotFoundException:
org.apache.http.conn.scheme.SchemeSocketFactory
       at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
       at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
       at
com.amazonaws.http.AmazonHttpClient.<clinit>(AmazonHttpClient.java:86)
       at
com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:59)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:126)
       at
com.amazonaws.services.securitytoken.AWSSecurityTokenServiceClient.<init>(AWSSecurityTokenServiceClient.java:107)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
       at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
       at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:102)
       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
       at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:190)
       at
spokewebapp.S3TokenService.getTemporaryCredentials(S3TokenService.groovy:48)

We did not see the ClassNotFoundException when we triggered the error today,
just the NoClassDefFoundError.

We can see that the httpclient jar file is the same both locally and on
staging server and the aws grails plugin is the same version on both
machines.


We also have same versions of aws-java-sdk-1.2.12.jar on both machines.

I am not sure on how to fix it



--
View this message in context: http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4644806.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email







If you reply to this email, your message will be added to the discussion below:
http://grails.1312388.n4.nabble.com/dependencies-httpclient-and-Amazon-s-aws-java-sdk-tp4530442p4644819.html
To unsubscribe from dependencies: httpclient and Amazon's aws-java-sdk..., click here.
NAML

Loading...