-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception while initializing AmazonS3Client #555
Comments
Our minimum version of Jackson required is 2.5.3. We've only recently added code that uses new APIs in Jackson. |
Hi, I am using jackson version 2.8.0 but the problem still persists. I am trying to upload some files onto amazon S3. I'm using aws-java-sdk-1.11.15 Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.enable([Lcom/fasterx For this piece of code - s3client.putObject(new PutObjectRequest(bucketName, keyName, file)); |
Hi samyuktr, I think you are using older version of jackson in the project. |
Our new minimum is 2.6 but if you are using 2.8 it should be fine. Are you positive that 2.8 is being used at runtime or is it possible that your application is pulling in an older version. Can you try printing this to see where the Jackson classes are being loaded from? |
@KumareshBabuNS I have removed all older versions of jackson. I currently have only 2.8 @shorea Could you please expand on how to check where the jackson classes are being loaded from? |
@samyuktr If you using eclipse IDE, you need to add jackson jar file into Deployment Assembly. |
@KumareshBabuNS I'm using CLI. No IDE. |
Here's a complete example. |
@shorea Fixed it! |
Glad we could help. Thanks for commenting on the same issue instead of creating a new one. Helps keep the conversation in one place and helps other people fix their issues faster. |
Hi there, I'm still experiencing this issue when deploying in Beanstalk. I followed the steps mentioned here and it seems that the problem is in glassfish (the system.out.print returned file:/usr/local/glassfish4/glassfish/modules/jackson-databind.jar in beanstalk), is there something I can do to fix this? |
@jorba-tradedoubler I don't know a whole lot about glassfish - never used it before - does it bundle in versions of common jars? How does it do dependency resolution? What version of the SDK are you using? Minimum required Jackson version is 2.6.6 as of 1.11.1 of the SDK. |
I met this issue too with aws-java-sdk-dynamodb 1.11.49. Adding jackson-databind 2.8.4 can fix this error. |
glassfish 4.1.1 does bunde in some jackson jars: ./glassfish/modules/jackson-jaxrs-base.jar
./glassfish/modules/jackson-annotations.jar
./glassfish/modules/jersey-media-json-jackson.jar
./glassfish/modules/jackson-databind.jar
./glassfish/modules/jackson-jaxrs-json-provider.jar
./glassfish/modules/jackson-core.jar jackson-core.jar is at version 2.3.2 so this is why our glassfish deployed app is getting problems. Not sure if I can safely override any of this, I'll see. |
overriding is easy. Add
Despite the references to 3.1 in DOCTYPE it works fine with 4.1.1. |
@davidmoten I have a big project that is heavily dependant on the bundled jars in glassfish. Would you know a way that I can isolate just the bundled jackson jars, or update the jars in the bundle itself? |
Hi I use aws sdk in glassfish too and to avoid classpath problems with
Jackson libs you need to set a special value in a glassfish xml file that
goes in the WEB-INF directory of your app. Google classpath isolation
glassfish or I can give you the info later.
…On Thu, 24 Nov 2016, 23:58 the-esculator ***@***.***> wrote:
@davidmoten <https://github.com/davidmoten> I have a big project that is
heavily dependant on the bundled jars in glassfish. Would you know a way
that I can isolate just the bundled jackson jars, or update the jars in the
bundle itself?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#555 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATa60YE2R9eQRHHWkkSJ1YT62Mndmjiks5rBYnugaJpZM4Giq5W>
.
|
Ah jeepers this is the very thread where I suggest the solution. No need to
look further. I would not override the classpath of the glassfish
container because that might have effects globally. Just use my
suggestion.
…On Fri, 25 Nov 2016, 18:44 Dave Moten ***@***.***> wrote:
Hi I use aws sdk in glassfish too and to avoid classpath problems with
Jackson libs you need to set a special value in a glassfish xml file that
goes in the WEB-INF directory of your app. Google classpath isolation
glassfish or I can give you the info later.
On Thu, 24 Nov 2016, 23:58 the-esculator ***@***.***> wrote:
@davidmoten <https://github.com/davidmoten> I have a big project that is
heavily dependant on the bundled jars in glassfish. Would you know a way
that I can isolate just the bundled jackson jars, or update the jars in the
bundle itself?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#555 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AATa60YE2R9eQRHHWkkSJ1YT62Mndmjiks5rBYnugaJpZM4Giq5W>
.
|
If upgrading jackson jar's in your project is not an option and you still want to use AmazonS3 functions, I would recommend to use aws-sdk-1.2.7.jar. That aws jar is compatible with my Jackson 1.9.2 jars |
@samyuktr |
i m using latest jackson(2.8.9) but still i am getting the same error. let me know anyone got any fix for the same |
Which is your deployment server? Wildfly, Tomcat etc In case of wildfly the location where you may need to manually change the jar file for required version is Please refer "#1120" for more detail. |
So I am getting this error and what I do not understand is that the jar (aws-java-sdk) according to Maven doesn't have any dependencies. Why is the jackson dependency not correctly associated to this jar in the Maven repos? Hmm, actually looks correct in the repo, guess it is my Eclipse tool that is not showing the dependencies, odd |
@rmundkowsky dependencies are a fickle business. Can you run mvn:dependencyTree to see how things are being resolved? |
Tree output from a sample project is below. My guess is that maven does not handle "modules" properly. Maybe there is a maven option I need to use. aws dependency:
INFO] ------------------------------------------------------------------------ |
I likely do not understand what "modules" means in maven. It seems it might just be to note that you need to build other sub-modules for a project, and not that they are dependencies. I would think it would be a good idea to have them as dependencies as well, otherwise pulling aws-java-sdk from a maven repo gets you the aws jars without any of the dependencies. |
WARNING: The legacy profile format requires the 'profile ' prefix before the profile name. The latest code does not require such prefix, and will consider it as part of the profile name. Please remove the prefix if you are seeing this warning. Process finished with exit code 1 The POM.XML File |
Hi, i also have the same problem. That i am use the glassfish server and the aws sdk is 1.11.271. And i print the jar location during the runtime: the error log as below: |
Hi, I was having this problem using GlassFish Server 4.1 and aws-java-sdk-s3 - 1.11.371, In my case the jackson libraries were being loaded from Glassfish modules folder (C:\Program Files\glassfish-4.1\glassfish\modules) even if I was including them explicity in my POM:
So, in my case the solution that @davidmoten posted on #555 (comment) helped me (Thanks a lot @davidmoten ) Regards. |
When calling:
This exception occurs:
"com.amazonaws" % "aws-java-sdk" % "1.10.34"
The text was updated successfully, but these errors were encountered: