java.lang.NoClassDefFoundError when already imported jar files to android studio - json

I receive the error java.lang.NoClassDefFoundError: org.codehaus.jackson.map.ObjectMapper even after adding the Jackson jar files. In Android Studio?
Also tried a few links. Namely this, which did not help.
Edit:
After some research I discovered the root of the error. The dynamo-geo.jar library that is provided by Amazon is inherently flawed in that it refers to some sort of outdated Jackson version. Upon looking in I can see that the class that is called geoJsonMapper refers to a deprecated version of ObjectMapper from the old 1.x.x versions of Jackson. I opened source code from dynamo-geo.jar here and I edited the ObjectMapper import from the outdated version to import com.fasterxml.jackson.databind.ObjectMapper;.
Now the issue I have is I am not sure if there is a way to compile a JAR file in Android Studio? In order to get the newly updated library into my other Android Studio project?
EDIT:
Solution - read this.

If you are using Jackson 2 then you will want to import com.fasterxml.jackson.databind.ObjectMapper instead of org.codehaus.jackson.map.ObjectMapper. You may also have a mix of Jackson 1 and Jackson 2 JAR files in your classpath.
You should be able to fork dynamodb-geo, make your changes, and use Maven to package the new JAR file (run the command mvn clean package). The new JAR file would be located in /dynamodb-geo/target/.

Related

How do I import Primefaces 6.0 source as maven project in Eclipse?

I followed Building From Source https://github.com/primefaces/primefaces/wiki/Building-From-Source instructions. Building the SNAPSHOT version project from command works well.
However, importing it into eclipse using the Existing Maven Projects wizard gives me a lot of errors in the Problems view. I fixed the lifecycle mappings by setting all to ignore.
I realized the generated source code in the target/generated-sources/maven-jsf-plugin directory but it was not picked up by the m2e plugins as a source folder automatically. So I included it into the eclipse build path manually. But then again, many compile errors show up in the generated code.
Does anybody use eclipse as IDE for primefaces development? How do you setup the eclipse project to develop primefaces?
The eclipse project uses Java Compiler compliance level 1.5 derived from the pom.xml maven-compiler-plugin settings. Setting the Java Compiler compliance level to 1.6 solved the issue for me.

java-wrapper-1.1.1-jar-with-dependencies.jar conflicts with newer httpcore-4.4.5.jar?

I'm getting an odd error that seems to point to httpcore conflicts. While I have only one httpcore-4.4.5.jar in the classpath, I also have the java-wrapper-1.1.1-jar-with-dependencies.jar for Watson services access. It seems to carry a bunch of Apache http* classes. Is there a newer version of the java-wrapper.jar that is compatible with the newer Apache jar files? The error in the Liberty 16.0.0.4 ffdc file is: Stack Dump = java.lang.NoSuchFieldError: INSTANCE at org.apache.http.conn.ssl.SSLConnectionSocketFactory.(SSLConnectionSocketFactory.java:144)
I suppose I can overwrite the classes in the java-wrapper jar file with newer versions but was hoping this had been done already.
Solved by removing org.apache packaged classes from the java-wrapper jar file and using the proper versions of the http*.jar files from the Apache website instead.

using jain sip in OSGI bundle

I try to use jain sip API in an OSGi bundle, when i use it in a standard java application, it seems to work when I import the log4j jar. But when i don't import it, i catch an exception when I use the Sipfactory.createStack(Properties p) function. From what i saw in my researches it's because the log4j jar is absent.
Now when i try with an OSGi environment i have the same problem, even when I try to put the lib log4j with the jainsip jars. I just don't know how to make it work, maybe there is a specific manipulation to be able to use log4j.
Moreover i already have another plugin using log4j, i tried to export the log4j lib from this bundle and to import it in my jainsip bundle but it didn't work too.
JAIN-SIP uses log4j-1.2.15.jar. Have you checked if that version of log4j makes any difference?

gwtprojsonserializer 1.0.4 jar - error serializing arraylist

I am using gwtprojsonserializer to convert objects to JSON. I've added the version 1.0.4 jar I downloaded from the website http://code.google.com/p/gwtprojsonserializer/ but although the source code on the website includes functionality for serializing arraylists, it is not included in the jar and hence i get the following error:
com.kfuntak.gwt.json.serialization.client.SerializationException: Can't find object serializer for java.util.ArrayList
Does anyone know how I can update the jar or use their latest source code?
Thanks in advance.
Its open source project. The entire source code can be easily downloaded from http://code.google.com/p/gwtprojsonserializer/source/browse/#svn%2Ftrunk
I am assuming the required code for serializing arraylists is in trunk. You can add/remove/modify on you local copy. Build the jar ( it just requires mvn clean install command)
If you are having local repository, use mvn deploy. Ensure your version id is different to avoid confusion.

Spring 3 MVC on JBoss 5.1: ConflictingBeanDefinitionException

When I try to deploy my application on JBoss 5.1 Spring 3 MVC throw me this stack trace: http://pastebin.com/Aah386PJ
Telling me that I have two definition of the same bean in two different packages. The thing is I don't have this IntershipConfigurationController in the controller package, but I have it in controller.internshipConfiguration. I previously add it under the root of controller but I deleted it from SVN and it doesn't appear anymore in the tree.
I cleaned JBoss, Eclipse's project, tried to redeploy it, to restart JBoss, Eclipse, etc. but I can't get this project working while my mates with the same repository can run it with no issue.
I don't know what to do this is really annoying.
I know this can be frustrating sometimes but you might want to know why this could happen. Spring annotation based ant path matcher checks for the class-path with a URI pattern to search for controllers or components. In your case the class-path either has a jar having the previous version of your class or some referencing .class file in your build path.
Make sure you have your project cleaned up and if possible disconnect
from SVN and download the project again.
You could also try CTRL+SHIFT+T to see if your controller is
referenced from any other library.
I finally deleted my JBoss folder, removed the projects from JBoss in Eclipse, extract a proper JBoss, made a clean on JBoss in Eclipse and then redeployed my projects and it's now working.
Nonetheless it's a really strange issue...
Edit :
It was in fact because the build folder at the root of my project was versioned and the old classes were still present.
Now the folder is ignored and removed from the SVN and I've deleted the old classes from my FS.