1. java.rmi
    • Look into Java RMI if it makes sense to have the same object definition on both ends, and in case you're interested in invoking methods on the remote object.
    • Explore all reviews
  2. resteasy
    • I have used both Jackson and Gson for the JSON support with RESTEasy and it is quite simple.
    • Another really great part of RESTEasy is the good support for multipart form data.
    • Explore all reviews
  3. net.logstash.logback
    • But I guess it's not the best way to do it (serialize, deserialize the JSON...) .
    • Explore all reviews
  4. acris
    • So if you are using it to transfer data between your rest service and GWT front-end then its fine.To save Student JSON notation you can convert it to POJO using many available library like URL_http://jersey.java.net/nonav/documentation/latest/json.html [jersey] or URL_http://code.google.com/p/acris/wiki/GWTJsonizer [GWTJsonizer] and can store easily that to DB.
    • Explore all reviews
  5. ormlite
    • With the default caching everything works as expected.
    • But OrmLite doesn't seem to like the array of objects.
    • The ORMLite annotations and the Jackson annotations should be able to play well together.
    • To be concrete I need to deserialize CODETERM3 from ORMLite, so I should be able to programatically create CODETERM4 and add values into it.
    • I also want to do opposite - get data from server in JSON and convert it to Java class and save this class to SQLite using ORMLite.
    • Explore all reviews
  6. jcouchdb
    • I have some JSon documents that I'd like to parse into Java classes - with Svenson, used in jcouchdb, and then put those parsed objects into DB.
    • Explore all reviews
  7. com.fasterxml.staxmate
    • But if not, perhaps you should build a DOM tree from Stax, using URL_http://staxmate.codehaus.org [link-text] , like URL_http://www.cowtowncoder.com/blog/archives/2009/06/entry%5F270.html [this- article] explains?
    • Explore all reviews
  8. serialized-php-parser
    • I would like to thank URL_http://stackoverflow.com/users/1953082/loris [Loris] , for giving me the idea of an PHP serialize() result, and URL_http://stackoverflow.com/users/887590/matt-taylor [Matt-Taylor] for trying to help me solve this problem.
    • Found a nice solution using the URL_http://code.google.com/p/serialized-php- parser/ [serialized-php-parser] lib: CODESNIPPET_JAVA1 .
    • Explore all reviews
  9. org.eclipse.jdt
    • The Community Edition of URL_http://www.jetbrains.com/idea/ [IntelliJ-IDEA] and URL_http://eclipse.org/ [Eclipse] are both popular and free IDEs.
    • Explore all reviews
  10. net.databinder
  11. ksoap2
  12. org.primefaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  13. vertx-junit-annotations
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • Explore all reviews
  14. com.jayway.restassured
    • I found the answer :) Use URL_http://code.google.com/p/rest- assured/wiki/Usage#JSON_%28using_JsonPath_%29 [JsonPath] or URL_http://code.google.com/p/rest-assured/wiki/Usage#XML_%28using_XmlPath_%29 [XmlPath] (in case you have XML) to get data from the response body.
    • Explore all reviews
  15. richfaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  16. simple-excel
    • URL_http://baddotrobot.com/blog/2012/09/14/diff-excel-with-java-and-hamcrest/ [simple-excel] offers verification of generated excel files and brings it's own Hamcrest matchers for this.
    • Explore all reviews
  17. spring-finance-manager
    • Check this one out URL_http://stsmedia.net/spring-finance-part-7-adding-support-for-json-and-xml- views/ [Adding-support-for-JSON-and-XML-views] URL_http://code.google.com/p/spring-finance-manager/ [Source-code-for-Spring- Finance-Manager] .
    • Explore all reviews
  18. name.pehl
    • Also if i had a string "2011-12-08" can i not specify a formatter that will return a date such as what piriti allows you to do this using @Mapping(value "date", format "dd.MM.yyyy"), as shown here URL_http://code.google.com/p/piriti/wiki/ExternalMappings [ URL_http://code.google.com/p/piriti/wiki/ExternalMappings ] .
    • Explore all reviews
  19. com.sun.tools.jxc.maven2
    • URL_https://jaxb.dev.java.net/guide/Mapping_your_favorite_class.html#HashMap ["JAXB-spec-defines-a-special-handling-for-Map-when-it's-used-as-a-property- of-a-bean."]
    • Explore all reviews
  20. spring-social
    • If your problem is just with Twitter, you can look for dedicated APIs like Twiiter4J or Spring Social, that should provides ready java beans for tweets.
    • Explore all reviews
  21. io.restx
  22. petr
    • I will add one more tip for excelent JSON<->JAVA binding lib PoJSON, it is written specifically for the URL_http://netbeans.org [NetBeans-IDE] (by Petr Hrebejk) and thus it is used in production on large project.
    • Explore all reviews
  23. neo4j-graphdb
    • Check out URL_http://neo4j.org/ [neo4J] The internal representation of the graph would be then delegated to the database and people have been working on this for years, so I would expect the representation to be efficient and performant.
    • Explore all reviews
  24. jooq
    • You don't have to use all of jOOQ's features to take advantage of some useful JDBC extensions.
    • Explore all reviews
  25. jvm-serializers
    • But from running this locally, I don't think it supports statements of being super fast.
    • Explore all reviews
  26. hamcrest-matchers
    • URL_http://baddotrobot.com/blog/2012/09/14/diff-excel-with-java-and-hamcrest/ [simple-excel] offers verification of generated excel files and brings it's own Hamcrest matchers for this.
    • Explore all reviews
  27. colander
    • You said "what it would look like".
    • Did you verify that it does look like that?
    • Explore all reviews
  28. jets3t
    • However, you saying this made me look at something else I just did using a JetS3t utility, and I fixed it, thanks.
    • Explore all reviews
  29. javacsv
    • I used the JSON.simple library from here URL_https://code.google.com/p/json- simple/ [ URL_https://code.google.com/p/json-simple/ ] to read the JSON string to keep the order of keys and use JavaCSV library from here URL_http://sourceforge.net/projects/javacsv/ [ URL_http://sourceforge.net/projects/javacsv/ ] to convert to CSV format.
    • Explore all reviews
  30. shiro
    • My preference is to stick with Java (or maybe Scala or Groovy) since I'm using tools like Drools for rules and Shiro for security.
    • If you are building ajax/json/nosql solutions, I'd like to hear details about what tools you are using and any pros/cons you've found to using them.
    • Explore all reviews
  31. json-antlr
    • If your main reason for writing a parser is learning how to do it, this is probably a good starting point.
    • Explore all reviews
  32. nate
  33. hamcrest
    • You need to split this problem into two: reading the name/value pairs from Excel into a map, and then building a matcher from this map.
    • ), it is useful that CODETERM6 supports JSON text (as CODETERM7 ), as well as natively supporting objects from Douglas Crockford's JSON library CODETERM8 .
    • It is well documented, tested, and supported.
    • Finally, if you are not using JUnit, you can use Hamcrest directly for assertions.
    • AFAIK there is no Excel integration included in Hamcrest.
    • URL_http://baddotrobot.com/blog/2012/09/14/diff-excel-with-java-and-hamcrest/ [simple-excel] offers verification of generated excel files and brings it's own Hamcrest matchers for this.
    • Explore all reviews
  34. org.apache.maven
    • This worked for me and I'm using: Apache Maven 3.0.4 (r1232337; 2012-01-17 01:44:56-0700) org.springframework version 3.1.2.RELEASE spring-security version 3.1.0.RELEASE.
    • Explore all reviews
  35. spring-data-mongodb
    • The most clean solution I found so far: use the build-in MappingMongoConverter of spring-data-mongodb.
    • Explore all reviews
  36. xalan
  37. com.restfb
    • You may want to look at URL_http://restfb.com/ [RestFB] as a good choice for a library to use.
    • Explore all reviews
  38. com.google.code
    • It is easy to make it work with URL_http://www.mongodb.org/display/DOCS/Java+Tutorial [java] and it has a nice mapper from java objects to mongo called URL_http://code.google.com/p/morphia/ [morphia] .
    • Explore all reviews
  39. org.apache.myfaces.trinidad
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  40. boon
    • It also has the fastest JSON to JavaBean mode too.
    • It is new, but if speed and simple API is what you are looking for, I don't think there is a faster or more minimalist API.
    • Explore all reviews
  41. org.drools
    • My preference is to stick with Java (or maybe Scala or Groovy) since I'm using tools like Drools for rules and Shiro for security.
    • If you are building ajax/json/nosql solutions, I'd like to hear details about what tools you are using and any pros/cons you've found to using them.
    • Explore all reviews
  42. spring-mvc-rest
  43. com.sun.xml.bind
  44. com.intellij
    • The Community Edition of URL_http://www.jetbrains.com/idea/ [IntelliJ-IDEA] and URL_http://eclipse.org/ [Eclipse] are both popular and free IDEs.
    • Explore all reviews
  45. simpleconverter
    • Create a system property - i.e System.setProperty("jettison.mapped.typeconverter.class", "org.codehaus.jettison.mapped.SimpleConverter"); So jettison uses simple converter and output values as string.
    • Explore all reviews
  46. tjws
    • That is, it includes the parent fields, as well as the fields in ExtendsContentProviderBean.
    • Explore all reviews
  47. com.facebook.api
    • Alright, So I make an Graph API Call and parse the JSON request.Using a link like this I make a HttpGet request: URL_http://graph.facebook.com/me/feed?=access_token= [ URL_http://graph.facebook.com/me/feed?=access_token= ] "MYACCESSTOKEN" This works fine, but the problem arises maintaining the same access token throughout.
    • Explore all reviews
  48. org.springframework.ws
  49. ezmorph
    • Thank you works fantastically :).
    • It seems like a lot of libs for just JSON parsing :S.
    • Explore all reviews
  50. apache-io
    • I was just hoping for some other solution as doing something like this kinda defeats the performance benefits of using the streaming parser.
    • Explore all reviews
  51. commons-exec
    • I need to communicate with MongoDB shell via Java To explain in short, I am using something like Runtime.exec (commons exec specifically) to call URL_http://www.mongodb.org/display/DOCS/Scripting+the+shell [MongoDB-shell-in eval-mode] Using this approach, I am able to successfully invoke MongoDB commands, retrieve the output into a stream (and print to stdout for example) All is well till this point.
    • Explore all reviews
  52. jflex
    • MUCH easier to use than antlr, jflex or others since you write your grammars in pure Java.
    • Explore all reviews
  53. jboss-logmanager
    • ... because if I am writing affiliate.setEmployees(null), it is working fine.
    • Explore all reviews
  54. hamcrest-json
    • ), it is useful that CODETERM6 supports JSON text (as CODETERM7 ), as well as natively supporting objects from Douglas Crockford's JSON library CODETERM8 .
    • Explore all reviews
  55. batch-import
    • I think the most effective format is something like a node- and edgelist, see URL_https://github.com/jexp/batch-import [ URL_https://github.com/jexp/batch - import] for a CSV version, D3 does something similar in Javascript, see the D3 examples that read in JSON.
    • Explore all reviews
  56. org.apache.xmlrpc
    • As for a client, well, I am using Apache XMLRPC, so it should be easy to implement.
    • Explore all reviews
  57. openfaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  58. odata4j
    • If you are looking to consume a ado.net data service(now renamed WCF Data Service) from android client, I would recommend you to have a look at the URL_http://code.google.com/p/odata4j/ [OData4j] library.
    • Explore all reviews
  59. aalto-xml
    • ); but for async nothing yet that I am aware of.The lib you refer to seems badly named; it does not seem to do real asynchronous processing, but merely allow one to parse sequence of JSON documents (which multiple other libs allow doing as well) If there were people who really wanted this, writing one is not impossible -- for XML there is URL_http://wiki.fasterxml.com/AaltoHome [Aalto] , and handling JSON is quite a bit simpler than XML.For what it is worth, there is actually URL_http://jira.codehaus.org/browse/JACKSON-39 [this-feature-request] to add non-blocking parsing mode for URL_http://jackson.codehaus.org [Jackson] ; but very few users have expressed interest in getting that done (via voting for the feature request).
    • Explore all reviews
  60. com.sun.grizzly
    • here is my problem:i have jquery that creates json that needs to be posted in jersey, a server running by grizzly that has a REST webservice gets incoming json object which need to be outputed.Im giving a try but not sure how to implement this correctly, please check and correct me, thanks!
    • Explore all reviews
  61. org.glassfish
    • JsonObject and JsonReader API can be used in two different ways: Use a Java EE 7 compliant application server, such as URL_http://glassfish.org [GlassFish-4] .
    • You can use NetBeans, Eclipse or IntelliJ and if the server runtime is configured properly then it just works.
    • A good set of samples for using this API are available at URL_https://github.com/arun-gupta/javaee7-samples/tree/master/json [ URL_https://github.com/arun-gupta/javaee7-samples/tree/master/json ] .
    • I believe the best practice should be to go through the official java JSON API: URL_http://json-processing-spec.java.net/ [ URL_http://json-processing - spec.java.net/] which are still work in progress.
    • Explore all reviews
  62. org.directwebremoting
    • The latest version of DWR has json support, you need to enable in your web.xml by passing init-param for the DWR Servlet, more information can be found URL_http://directwebremoting.org/dwr/introduction/remoting_options.html [at] , also for DWR there is a nice Book named 'DWR Java AJAX Applications'.
    • For some of your requirements other libraries may be suitable, but DWR is useful if you have a Java backend.
    • Explore all reviews
  63. javadb
    • If you don't want a full-featured database, use something like HSQLDB or JavaDB.
    • Explore all reviews
  64. org.squeryl
    • One version supports Jerkson and the other Squeryl (or any other usage).
    • My models are also used as db schema (squeryl), and the fields must be "Date" to map correctly.
    • Squeryl supports "@Transient", which does the same for persistance.
    • Explore all reviews
  65. jdbchelper
    • Since you are not creating the query dynamically, you don't need to use StringBuffer/StringBuilder.
    • Explore all reviews
  66. commons-logging
  67. as-code-completion
    • It's still in draft (not finalised) but it's close to completion and is now a viable tool specifying your structural rules I've recently started a new open source project specifically intended to solve your problem: URL_http://code.google.com/p/jsonschema2pojo/ [jsonschema2pojo] .
    • The project is not yet mature but already provides coverage of the most useful parts of json schema.
    • Explore all reviews
  68. org.codehaus.castor
    • This is true, but POJO -> XML -> JSON would work with an additional library.
    • Explore all reviews
  69. com.jgeppert.struts2.jquery
    • By far, this is the best answer or suggested solution I found all around so far.
    • Not necessary, If you are using Struts 2 why not to use URL_http://code.google.com/p/struts2-jquery/ [struts2-jquery-plugin] and make grids more easier like described URL_http://code.google.com/p/struts2-jquery/wiki/GridTag [here] .
    • Explore all reviews
  70. anjsonserializer
    • Some pull parser like GSON oder jackson would suit your task better (jackson claims to be faster, but also heavier jars and more dependencies - I prefer GSON) You may also consider simple databinding library: URL_https://github.com/ko5tik/jsonserializer [ URL_https://github.com/ko5tik/jsonserializer ] ( jars available from maven central ) With it parsing of JSON becomes looks this way: URL_https://github.com/ko5tik/accmeter/blob/master/src/main/java/de/pribluda/a ndroid/accmeter/file/SampleReader.java [ URL_https://github.com/ko5tik/accmeter/blo b/master/src/main/java/de/pribluda/android/accmeter/file/SampleReader.java] ( just provide java.io.Reader and class to fill fields in ) .
    • EDIT:Maybe URL_https://github.com/ko5tik/jsonserializer [ URL_https://github.com/ko5tik/jsonserializer ] would be useful UPDATE:FYI so I looked at jsonschema2pojo but that only creates pojos from a schema, and I didnt actually have a json schema, just the actual json.
    • So I then tried following the example and created a POJO based on the json data I had and it was quite easy, then I then tried full data binding using this and it worked first time.
    • Explore all reviews
  71. com.squareup.retrofit
    • And yes, we are exposing a lot details of the implementation here, it means every change you have to change tests as well I would probably also convert requests to url and bodies.
    • Explore all reviews
  72. commons-codec
    • No need to use Commons Codec; DatatypeConverter is part of the standard (JAXB).
    • 1. you could add the required characters in code (padding, etc) 2. you can use commons-codec 1.5 ( new Base64(true)), where they added support for this encoding.
    • Explore all reviews
  73. apache-commons-jxpath
    • I kind of remember there is such a component in A URL_http://commons.apache.org/ [pache-Commons] , but can't remember its name.
    • Explore all reviews
  74. org.apache.solr
    • Then you would have a POJO like this CODESNIPPET_JAVA2 .
    • 2. fetch search result from Solr in form of POJO's described in my project** I know that point CODETERM5 can be done by CODETERM6 , but i don't want to write separate logic to index, I am using Solrj in my project to extract information, so I want to know can solrj use my POJO definition to parse the search results** also any possible workflow for above working scenario, and tools required (I am new to solrj).
    • In particular, Im interested in putting a nice, clean API over a SOLR server, which serves up json data.
    • Explore all reviews
  75. cassandra
    • Thank you so much man you are always so thorough in your answers and explanations.
    • My use cases : I use jackson as serialization when I need to save blobs to storage systems (Redis, Cassandra, Mongo, ... sometime mysql too).
    • In Cassandra, writes are much more efficient than reads so it is beneficial to avoid reads before writes if possible.
    • In conclusion, there could be significant performance advantages to using separate columns if you have to update your data or if you only want to read parts at once.
    • I am actually tempted to do this to all of my data.
    • Cassandra is adding support for JSON-like maps, lists, and sets in 1.2: URL_https://issues.apache.org/jira/browse/CASSANDRA-3647 [ URL_https://issues.apache.org/jira/browse/CASSANDRA-3647 ] .
    • Explore all reviews
  76. org.jglue.fluent-json
    • Lastly there is mapping support in the API which allows you to map your domain objects to JSON.
    • I recently created a library for creating Gson objects fluently: URL_http://jglue.org/fluent-json/ [ URL_http://jglue.org/fluent-json/ ] It works like this: CODESNIPPET_JAVA1 .
    • The goal being when Java8 is released you'll be able to do something like this: CODESNIPPET_JAVA3 .
    • Explore all reviews
  77. hessian
    • There are even simpler packages; Hessian for example has rather simple reflection-based serializer/deserializer.
    • And then accessing fields/methods dynamically.
    • Explore all reviews
  78. com.google.code.svenson
    • which could be parsed again with code like this CODESNIPPET_JAVA3 .
    • I realize this is off-topic, but I'd like to present a solution in URL_http://code.google.com/p/svenson/ [svenson-JSON] .
    • Apart from having to use properties, svenson can handle cases like this with a more simple JSON output with a discriminator property CODESNIPPET_JAVA1 .
    • would output JSON like CODESNIPPET_JAVA2 .
    • I wrote a JSON library to do just that.. URL_http://code.google.com/p/svenson/ [ URL_http://code.google.com/p/svenson/ ] With svenson you would do something like: CODESNIPPET_JAVA1 .
    • That sounds like an interesting approach, the only improvements I'd want is a way to not have to manually map classes to string field names when parsing it back (is there any support to infer class names, maybe output could be more verbose and contain the fulle package and class name).The public fields were just an example (although with serialization your private data is your public interface).
    • Explore all reviews
  79. org.apache.cxf.dosgi
    • URL_http://cxf.apache.org/ [An-Open-Source-Services-Framework-From-Apache] -**CXF** has been designed to provide a pluggable architecture that supports not only XML but also non-XML type bindings, such as JSON and CORBA, in combination with any type of transport.
    • I have not used it, but according to URL_http://cxf.apache.org CXF supports both SOAP and REST/HTTP bindings and XML, JSON and FastInforset message formats.
    • If you want the ability to support a SOAP service as well as a RESTful one, check out URL_http://cxf.apache.org/ [Apache-CXF] .
    • Explore all reviews
  80. symmetricds
    • For an example, can use URL_http://www.symmetricds.org/ [SymmetricDS] (Open source available) to replicate data between client and server database.
    • Explore all reviews
  81. ektorp
  82. beanfactory
    • It's fairly easy to annotate controllers with some annotation, and then hook up the BeanFactory bootstrap process to register the controllers within some handler mapping process.
    • Explore all reviews
  83. jaxb
    • Actually, any XML package that can use Stax API can use Jettison -- JAXB does, so there's no extra work involved (same is mostly true for XStream too, although it may have some additional support).
    • JAXB 2.0 also has support for JSON serialization using Jettison.
    • Explore all reviews
  84. io.netty
    • I have worked with a netty server with a lesser hardware configuration than yours and supported many thousands msgs/sec.
    • Explore all reviews
  85. jmustache
    • Note that this is a very simple implementation and you may need to extend it to fit your needs: CODESNIPPET_JAVA3 .
    • So the JSON model would look something like this: CODESNIPPET_JAVA2 .
    • Explore all reviews
  86. jms-ws-transport
    • WADL doesnt appear to support my unique use of the JMS transport either, though i don't see why the wadl:resource and wadl:path would not work with jms endpoints.
    • Explore all reviews
  87. google-api-translate-java
    • There is a URL_http://code.google.com/p/google-api-translate-java [library] which retains the encoding of the http response (Czech expressions) with JSon message like this : CODESNIPPET_JAVA1 .
    • Explore all reviews
  88. io.spray
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • Explore all reviews
  89. spring-integration
    • I ended up upgrading to Jackson 2, which required me to upgrade another tool (Spring Integration) to an unofficial release - but all works.
    • To be complete honest, I don't find the Spring integration all that compelling, which isn't really a big deal.Much like Spring MVC versus Struts, I'm not really expecting a lot of change with the Spring Rest JSON functionality, I'm just trying to figure out if it actually exists so I can try it out.
    • Explore all reviews
  90. org.jdom
    • The new JSR-353 (part of JEE 7) could be useful to you , you could try URL_http://www.jdom.org/ [ URL_http://www.jdom.org/ ] just to mention two.
    • Explore all reviews
  91. org.jvnet.ws.wadl
    • Also there are tools like URL_http://wadl.java.net/wadl2java.html [CODETERM1] .
    • Explore all reviews
  92. org.scribe
    • Authentication is via Oauth - I recommend using URL_https://github.com/fernandezpablo85/scribe-java [Scribe] .
    • Explore all reviews
  93. glassfish
    • Oracle has produced a standard JSON API (JSR 353) for Java EE 6 which is available in Maven, and the reference implementation used in Glassfish is also available in Maven.
    • Explore all reviews
  94. de.l3s.boilerpipe
    • I am using URL_http://code.google.com/p/boilerpipe/ [boilerpipe] and it seems great, but I want to output JSON.
    • Explore all reviews
  95. spring-roo
    • Tools used: Spring-Roo: for rapid prototyping ( URL_http://projects.spring.io/spring-roo/ [ URL_http://projects.spring.io/spring-roo/ ] ) Spring Tool Suite Spring Maven Tomcat SqlServer Hibernate All of these tools work really well together to develop a web service.
    • Explore all reviews
  96. org.icefaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  97. javax.persistence
    • (also I can't read those hieroglyphics that you posted above; I see no Java persistence code there either, like pm.makePersistent).
    • Then you can use standard Java persistence tools and libraries to save it out to/read it in from your database, and it will handle all your escaping automatically.
    • Explore all reviews
  98. org.apache.jena
    • What I want is to extract each article and convert it to RDF/JSON (I know how to write a model) using Apache Jena, so I can have a separate document for each article, and later import them all to a index like CouchDB or Elasticsearch to perform searches.
    • Explore all reviews
  99. apacheyay
    • Of course, one of the advantages of using POST data is that there is typically no limit on the size of the arguments you can send.
    • Explore all reviews
  100. org.jdbi
    • Aside from Jersey (and other JAX-RS impls like RESTeasy), which use Jackson, you might also benefit from using something like URL_http://jdbi.org/ [jDBI] for binding relational data in POJOs first.It does many things bigger ORMs (like Hibernate) do, but is simpler to use for most common tasks.
    • Explore all reviews
  101. com.google.gdata
    • It's probably can't be fully explained in the answer, so a link (or a few) would be appreciated.
    • Explore all reviews
  102. jxls
    • the result will be list, and you just write the property that you want to display in excel format that will be read by jxls.
    • if you need helper to convert into xls, you can use jxls, it can convert java bean (or list) into excel with expression language.
    • Explore all reviews
  103. com.sdicons.jsontools
    • Curious if anyone has any other suggestions on a good way to accomplish this (from what it seems), simple task that need, or if I perhaps need to stick with the 2nd option from above?
    • Through searching, I have found the following 2 promising libraries for accomplishing this: URL_http://jsontools.berlios.de/ [ URL_http://jsontools.berlios.de/ ] URL_https://github.com/fge/json-schema-validator [ URL_https://github.com/fge/json - schema-validator] However, the first one seems fairly outdated with poor support.
    • Similar story with the 2nd one, which seems to be up-to-date with good test code.
    • Here you can find a URL_http://jsontools.berlios.de/ [tool] that can validate a JSON file, or you could just deserialize your JSON file with any JSON library and if the operation is successful then it should be valid ( URL_http ://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/index.html [google- json] for example that will throw an exception if the input it is parsing is not valid JSON).
    • I've used URL_http://jsontools.berlios.de/ [JSON-Tools-library] and it works well.
    • Explore all reviews
  104. opencsv
    • @user2524908 Before you go and fix how the CSV parsing happens, try to write the String out yourself with proper escaping and checking if that works for you.
    • I like the OpenCSV solution.
    • Explore all reviews
  105. com.nebhale.jsonpath
    • A Java implementation: URL_https://github.com/nebhale/JsonPath [ URL_https://github.com/nebhale/JsonPath ] It seems well maintained and works fine.
    • Explore all reviews
  106. thrift-protobuf-compare
    • I figured I would use URL_http://jettison.codehaus.org/ [Jettison] as it seems it would be URL_http://blog.bdoughan.com/2011/04/jaxb-and-json-via-jettison.html [easier- to-implement] since it actually works with JAXB; however, looking at URL_http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking [Older- benchmarks] in which Jettison was not included I have found URL_http://code.google.com/p/kryo/ [Kryo] produces smaller files and Serialized and DeSerialized quicker than some alternatives.
    • Explore all reviews
  107. bson4jackson
    • You might be interested in URL_https://github.com/michel-kraemer/bson4jackson [bson4jackson] project, which allows you to use Jackson data binding to work with BSON (create POJOs from BSON, write as BSON) -- especially since Jackson also work with JSON.
    • Explore all reviews
  108. uk.co.datumedge
    • ), it is useful that CODETERM6 supports JSON text (as CODETERM7 ), as well as natively supporting objects from Douglas Crockford's JSON library CODETERM8 .
    • Explore all reviews
  109. org.glassfish.webservices
    • WebServices and their security), so any newbie-tweaks to my question are very welcome._ .
    • Explore all reviews
  110. codegist-crest
    • Update After 1.5 years, I still think it's really good solution.
    • If you don't mind, that's cool.
    • Explore all reviews
  111. spring-ws
    • Obviously, in a web project, like a Spring web services project, it is important to have POJO's, but just for unit tests couldn't you just use a generic Jackson JsonNode object?
    • Explore all reviews
  112. org.atmosphere.plugins
    • try URL_https://github.com/Atmosphere/atmosphere- extensions/blob/master/spring/samples/spring- websocket/src/main/java/org/atmosphere/samples/pubsub/dto/BaseCommand.java [this] it works CODESNIPPET_JAVA1 .
    • After that, it worked!
    • Explore all reviews
  113. httpzoid
    • Too much code for this task, checkout this library URL_https://github.com/kodart/Httpzoid [ URL_https://github.com/kodart/Httpzoid ] It uses GSON internally and provides API that works with objects.
    • Explore all reviews
  114. javafx
  115. io.gatling
    • It can parse JSON to Maps and Lists faster than any other lib can parse to a JSON DOM and that is without Index Overlay mode.
    • It also has a very fast JSON lax mode and a PLIST parser mode.
    • :) But gatling is not, and the results are the same.
    • Explore all reviews
  116. org.jboss.jbossas
  117. sonar
    • I tried it but when I execute I get this error "java.lang.NoClassDefFoundError: org/json/simple/JSONValue".
    • If this JSON is the result of a call from a Sonar Web Service, then you do not need to parse it: just use the Sonar Java Web Service Client component, this will do all that for you and you won't need to care about JSON at all URL_http://docs.codehaus.org/display/SONAR/Using+the+Web+Service+Java+client [ URL_http://docs.codehaus.org/display/SONAR/Using+the+Web+Service+Java+client ] .
    • Explore all reviews
  118. hibernate
    • FlexJSON shines with its deepSerialize method that can properly handle serializing all get methods presented in a bean obtained from Hibernate (lazy loaded).
    • Might be worth checking out, especially if you use an ORM solution.
    • Explore all reviews
  119. jsonschema2pojo
    • FYI, jsonschema2pojo also supports generating types from an example JSON document (not schema) as of v0.3.3.
    • The jsonschema2pojo tool takes a json schema document and generates DTO-style Java classes (in the form of .java source files).
    • jsonschema2pojo.org was exactly what I was looking for!.
    • A detailed solution would be to use a tool such as jsonschema2pojo to autogenerate the required Domain Classes such as Student from the Schema of the json Response.
    • At the moment the best solution is probably URL_https://code.google.com/p/jsonschema2pojo/ [JsonSchema2Pojo] : It does the job from the seldom used Json Schema but also with plain Json.
    • EDIT:Maybe URL_https://github.com/ko5tik/jsonserializer [ URL_https://github.com/ko5tik/jsonserializer ] would be useful UPDATE:FYI so I looked at jsonschema2pojo but that only creates pojos from a schema, and I didnt actually have a json schema, just the actual json.
    • Explore all reviews
  120. com.github.fge
    • Curious if anyone has any other suggestions on a good way to accomplish this (from what it seems), simple task that need, or if I perhaps need to stick with the 2nd option from above?
    • Load this as a schema, validate your input against it: if it validates, you know you need to deserialize against your fruit class.
    • Through searching, I have found the following 2 promising libraries for accomplishing this: URL_http://jsontools.berlios.de/ [ URL_http://jsontools.berlios.de/ ] URL_https://github.com/fge/json-schema-validator [ URL_https://github.com/fge/json - schema-validator] However, the first one seems fairly outdated with poor support.
    • Similar story with the 2nd one, which seems to be up-to-date with good test code.
    • Hier is a working parsing method based on the version of fge but improved as 1. it used jode's DateTime with the correct timezone initialized 2. minor change to pattern to accept +0200 too CODESNIPPET_JAVA1 .
    • Very cool additional piece -- thanks for sharing.
    • Explore all reviews
  121. commons-beanutils
    • But a project I'm working on has a really big JSON to manage and its structure changes a lot by time.
    • But in case if you get arbitrary JSON objects and you would like process them in the way you described, I would suggest combine URL_http://jackson.codehaus.org/ [Jackson-JSON-processor] along with Apache's URL_http://commons.apache.org/proper/commons-beanutils/ [Commons-Beanutils] .
    • Thank you works fantastically :).
    • So you may use it something like this: CODESNIPPET_JAVA1 .
    • It seems like a lot of libs for just JSON parsing :S.
    • Use BeanUtils recursively to walk your entire object graph - be careful of cycles - you'll need a Set or something on the side to keep track of what you've already seen XML: Look at XMLEncoder - it works using JavaBean properties to create XML For reading: One approach might be to use existing libs (for JSON or XML) to create objects then deal with merging the properties between objects.
    • Explore all reviews
  122. simple-http
    • Imagine a servlet that is triggered by a simple HTTP request with the URL /getCustomers.
    • (note - if I exclude the cookies during the POST I do get plain html back from the server w/ a valid "access denied" message) Full code for this solution is below CODESNIPPET_JAVA1 .
    • RequestFactory is very much like that but offers additional facilities.
    • I would like to make a simple HTTP POST using JSON in Java.
    • I don't know exact value to do this but I would give UTF-8 a go first.
    • I'm doing what should be a simple http post that includes a json string as the http body.
    • Explore all reviews
  123. gwt-platform
    • I tried to output a table, that would contain the JSON values, taken with a help of Piriti mappers.
    • Here are the two presenters that are involved in this procedure: The CODETERM1 (that uses CODETERM2 , that is a widget, I'm not sure that widget should be used here, but, according to URL_http://groups.google.com/group/gwt- platform/browse_thread/thread/1bec69f557fda229/57135899295ae4bf [this- conversation] , widget may do the trick): CODESNIPPET_JAVA1 .
    • It's not a real project's code, it's just an attempt to understand GWTP, so this may be not the most beautiful solution (in fact, it's not one for sure).
    • Here is what happens with this code: the first row with CODETERM5 appears, then it changes to the first row that contains CODETERM6 's values, then again it contains CODETERM7 's values, then again CODETERM8 's, after that the second row with CODETERM9 appears, then it changes to the second row that contains CODETERM10 's values, then again it contains CODETERM11 's values, then again CODETERM12 's.
    • So, there are two products and two rows, and in this code the values are changed twice, but in the end the table contains only CODETERM13 's values.
    • But I haven't yet figured out how to make the correct output.
    • Explore all reviews
  124. spring-framework-issues
    • It's fixed in Spring 3.1 - use @RequestMapping(method RequestMethod.GET, value "foo/bar", produces "application/json"), see [SPR-7353]( URL_https://jira.springsource.org/browse/SPR-7353) .
    • URL_https://jira.springsource.org/browse/SPR-7543 Automatically expose @PathVariables in the Model causes all methods that have {@PathVariable} parameters to include the {@PathVariable}'s in the model, so the model always contains more than 1 item, so {extractValueFromSingleKeyModel} doesn't work.
    • Ok, I've opened a Spring Source JIRA request for this one, perhaps it is a much needed improvement: URL_https://jira.springsource.org/browse/SPR-10552 [ URL_https://jira.springsource.org/browse/SPR-10552 ] Or else, it is a case of leveraging the Jackson conversion capabilities in clever ways which sounds like a lot of plumbing.
    • You'll need to change your pom.xml if you're migrating from 1.x (Step 1: Update Maven / JAR dependencies from URL_http://www.cowtowncoder.com/blog/archives/2012/04/entry_469.html is all you need for the builtin support to latch on).
    • Support for Jackson 2 has been added in Spring 3.2, and has also backported to Spring 3.1.2 ( URL_https://jira.springsource.org/browse/SPR-9507 [SPR-9507] ) .
    • See URL_http://blog.springsource.org/2011/02/21/spring-3-1-m1-mvc-namespace- enhancements-and-configuration/ [Spring-3.1-MVC-Namespace-Improvements] See URL_https://jira.springsource.org/browse/SPR-7504?focusedCommentId=62730&p age=com.atlassian.jira.plugin.system.issuetabpanels%3acomment-tabpanel [SPR-7504] Make it easier to add new Message Converters to AnnotationMethodHandlerAdapter Exemple: CODESNIPPET_JAVA1 .
    • Explore all reviews
  125. com.eclipsesource.minimal-json
    • Are you using any kind of JSON library?
    • Problem is, there is absolutely no response after printing the raw JSON output.
    • URL_https://github.com/ralfstx/minimal-json - I cannot seem to find a suitable method!.
    • Generally speaking, you'd parse the JSON into it's "object" representation in your language, then ask for the key of interest.
    • CODETERM2 Well, you get the idea...I just need to extract the key value for "first_aired_iso" for each episode.
    • Not sure what you mean exactly by minimal JSON, personally I find the CODETERM1 package simple and straightforward (i.e.
    • Explore all reviews
  126. smartgwt
    • i use smartgwt 2.5. i have a databound treegrid which fetches a json from the database and builds the tree.
    • I'm afraid that UI components in SmartGWT and ExtGWT have very specific JSON format for fetching, updating, filtering, etc, and it would be very painful implement servlet-based service.
    • Thanks, I've just understood that I should remove GWT and left only SmartGWT and ExtGWT in question.
    • But I think that it's not very good idea.
    • I know that client's UI components in SmartGWT and ExtGWT can work with JSON, but have for this quite specific format.
    • I think that there are should be some approaches in ExtGWT / SmartGWT, but I couldn't find them.
    • Explore all reviews
  127. jsoup
    • In short, it's not a very fluid API in the style of, say, JSoup, it appears to be a tool that comes from the era where everything was XML, and then it was retrofitted for JSON.
    • I don't think Jsoup will execute Javascript.
    • I was not sure if the JSON string will be wrapped in a body tag or if it would be removed to suit a well formed document.
    • Is there JSoup like libraries for JSON ?
    • Thank you very much.I had a doubt about this and I posted the question, your suggest is only way to get json string without to find it in html code.
    • URL_http://jsoup.org [JSoup] may however be URL_http://stackoverflow.com/questions/2835505/how-to-scan-a-website-or-page- for-info-and-bring-it-into-my-program/2835555#2835555 [useful] in this.
    • Explore all reviews
  128. vanilla
    • Everything has worked really well so far with the vanilla setup and the JsonProperty, JsonIgnore, and JsonFilter annotations.I'll check it out though, thanks.
    • vanilla JSON parser supplied with android can parse data, unfortunatelyit builds full JSON model in memory (like DOM parser for XML ) - this works fine forsmall data amounts, but is not practicable for slightly bigger data as it allocates and hogs a lot of memory.
    • It turns out that vanilla Struts2 doesn't accept query strings in the format CODETERM1 (feel free to correct me on this).
    • JSON.stringify(jsonObj) before passing it to the query string, a la CODETERM4 - which in this case, I can't do since Kendo UI grid doesn't seem to have an interceptor-like event to let me change the query parameters.
    • Gson 1.7.1 and 2.0 both respect final field assignments during vanilla deserialization operations, and the initial final field assignments are not altered.
    • Its the same reason you wouldn't forgo classes in a java program in favor of passing around a bunch of HashMaps.
    • Explore all reviews
  129. morphia
    • The process seems standard to me.
    • But I think that I'am doing something wrong, because this code throws the following exception: CODESNIPPET_JAVA2 .
    • I'm looking for a 'clean' answer to this as well.
    • It seems like that the following line is throwing this exception: CODESNIPPET_JAVA3 .
    • Good, hope someone has a solution.
    • All my MongoDB query's are through Morphia to keep the code clean.
    • Explore all reviews
  130. org.jibx
    • It's pretty awesome!I'm just looking for an equivalent JSON framework that can bind multiple JSON structures into the same class.
    • Most do not extend the flexibility of mapping complex Java hierarchies into any arbitrary chosen JSON object representation.
    • These frameworks include Castor, JiBX and the like.
    • The configuration is usually pretty limited.
    • If my Java domain classes changes in any way, my json responses will change as well, causing any service clients, expecting the old version of json responses, to break.
    • Explore all reviews
  131. json-smart
    • If you want to keep JSON, look for other frameworks like "json-smart": URL_http://code.google.com/p/json-smart/ [ URL_http://code.google.com/p/json - smart/] They claim to be 2-3 times faster than Jackson.
    • What's more, you can retrieve a specific object inside a JSON object may it be another object, an array and convert it to a String or manipulate the way you want.
    • @KwintenP Try using the URL_https://code.google.com/p/json-smart/ [json-smart- library] .
    • I did a pretty extensive evaluation of json-java libraries a few months ago, and chose json-smart: URL_http://code.google.com/p/json-smart/ [ URL_http://code.google.com/p/json-smart/ ] Has been working well.
    • URL_http://code.google.com/p/json-smart/ [json-smart] Both of these libraries work as required by your implementation with a String "null" value.
    • Explore all reviews
  132. apache-wink
    • and the server returns only "Hello World!".
    • I encode the whole structure at once (about 10 MB) and I have a problem finding out what leads to this weird exception.
    • Do you know how best to debug this and what might typically lead to it?
    • I use plain java and Apache Wink for JSON.
    • I've been working with Apache Wink and for that I have needed to use a JSON provider, such as Jettison (a colleague has been using Jackson).
    • Explore all reviews
  133. mule
    • Using on Mule 3.4.1 and it is working like a charm!.
    • But in one of my JAVA Object , i have a CODETERM8 and since in JSON Object , Integer cannot be keys, CODETERM9 library is giving an Exception : CODESNIPPET_JAVA1 .
    • CODETERM2 can be anything..another CODETERM3 , OR CODETERM4 etc ..Now i have to convert it into CODETERM5 (and removing all those keys that have value as NULL)..
    • When i use a given Mule Transformer , CODETERM6 , it is converting into appropriate JSON..but not able to remove NULL value..And i could not find any properties to set in Custom-transformer that will remove NULL values..!!
    • So then, i wrote a custom transformer**, that uses the CODETERM7 library and i am able to remove NULL values.
    • Explore all reviews
  134. castor
    • This is true, but POJO -> XML -> JSON would work with an additional library.
    • Most do not extend the flexibility of mapping complex Java hierarchies into any arbitrary chosen JSON object representation.
    • These frameworks include Castor, JiBX and the like.
    • The configuration is usually pretty limited.
    • If my Java domain classes changes in any way, my json responses will change as well, causing any service clients, expecting the old version of json responses, to break.
    • Explore all reviews
  135. stringtree
    • Talking about tools, if you're looking for some tools outside of Java, you can always feel free to try URL_http://jsonlint.com/ [JSONLint] .
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Quicker, simpler and clearer error message but it's a web-based.
    • URL_http://www.stringtree.org/stringtree-json.html [This] is a good library for handling JSON.
    • URL_http://www.JSON.org/java/index.html [org.json] is the canonical one, but I prefer URL_http://www.stringtree.org/stringtree-json.html [Stringtree] personally.
    • Explore all reviews
  136. org.apache.avro
    • @chris-gerken and all: this is not asking to recommend a tool.
    • I generate this JSON objects with AVRO ( URL_http://avro.apache.org ) JSon Encoder, they seem to be ok, but apparently other parsers have problems with them.
    • There isn't much for guiding documentation or examples out there, but here are a couple decent looking ones: Here's a tutorial for using the socket server: URL_http://gbif.blogspot.com/2011/06/getting-started-with-avro-rpc.html [ URL_http://gbif.blogspot.com/2011/06/getting-started-with-avro-rpc.html ] Here's an open source project/demo for using Avro over http: URL_http://code.google.com/p/avro-http-example/ [ URL_http://code.google.com/p /avro-http-example/] .
    • Gotchas: It is sometimes challenging to convert Java generics, like TreeMap.
    • Other libraries like Protocol Buffers: Apache Avro, Apache Thrift.
    • This can be useful if you want your service to be consumed by Javascript code, where JSON is often the easiest thing to deal with.
    • Explore all reviews
  137. robospice
    • I need to send a POST HTTP request** using Robospice for Android that will have data in the following format: Content-Type: application/json {'var1':'var1val','telNumber':'var2val'} There may be other HTTP headers inside but this is the only header required by the server - I've tested it with a simple HelloWorld request that doesn't require any specific objects in the body.
    • I know I could get the data in a different way but I want to still use my listener and be able to make CODETERM6 block that way.
    • Doing it this way, I keep getting CODETERM4 and I am pretty sure it is related to format of the body.
    • Note that I was testing the very same request with both Chrome app for sending REST requests and CODETERM6 (worked fine).
    • With the default caching everything works as expected.
    • Explore all reviews
  138. freebase-java-api
    • You're correct, as it currently stands the standard Google Java client library doesn't offer a lot of benefit over just making the Freebase API calls yourself.
    • I had a problem with the input geolocation when I used the latitude and longitude from wikipedia.
    • NB: eventually I would like to query for larger amounts of data; the above query is just a simple example.
    • Question What would a basic example of querying Freebase with MQL from the Java Freebase API (google-api-services-freebase) look like and what is the recommended way for processing the resulting data?
    • Im especially wondering how to correctly use URL_https://developers.google.com/resources/api-libraries/documentation/freeba se/v1/java/latest/com/google/api/services/freebase/Freebase.html [the- CODETERM1-class] .
    • Explore all reviews
  139. dropwizard
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • And I know that I could use a real CODETERM4 instead of the annotation and do it by hand, so I'm just asking if there's some elegant shortcut for this problem.
    • I'd like to accept JSON on an REST endpoint and convert it to the correct type for immediate validation.
    • I know I could create different endpoints for all kind of cars, but thats does not seem DRY.
    • But what is usually used is URL_http://docs.oracle.com/javaee/6/tutorial/doc/gircz.html [Bean-Validation- API] implementation.The nice thing about this is decoupling between data format handling, and validation logic.This is what frameworks like DropWizard use; and it's the direction JAX-RS (like Jersey) are taking things for JAX-RS 2.0. .
    • Explore all reviews
  140. xmlrpc
    • As for a client, well, I am using Apache XMLRPC, so it should be easy to implement.
    • I have found a python example but am struggling to find a java version.
    • Bonus points (not really) but if anyone could provide one where the the transport mechanism is abstracted out so the two are interchangable, I would be eternally in their favour.
    • Hi dfa - it's not an ongoing consultancy - it's just asking for a word from the wise about libraries that are tried and tested, as opposed to me going down a route that ends up with "version x.y of z lib needs version a.b of c lib and they don't work together".
    • Believe me, if someone could give me references to 2 x xmlrpc libs (1 client, 1 server) and 2 x json (ditto) then I'd be a happy man !.
    • Explore all reviews
  141. com.jayway.jsonpath
    • only giving reference of any external link is not taken as a good answer.
    • default type used by jayway jsonpath?
    • Nice.
    • I think you have to add these dependencies to your project: URL_https://code.google.com/p/json-path/downloads/detail?name=json- path-0.8.0-dependencies.zip&can=2&q= [ URL_https://code.google.com/p/json - path/downloads/detail?name=json-path-0.8.0-dependencies.zip&can=2&q=] In particular json-smart-1.1.jar where the missing Exception class is contained.
    • Aha, that was it!
    • This will solve my problem for sure :).
    • Explore all reviews
  142. java.beans
    • @RequestBody is perfectly capable of parsing nested JSON, however you have to adhere to the Java Beans specification.
    • It just converts JSON format to Java beans and vice versa.
    • All you will need is the servlet engine - which provides a way to host threaded Java code over an HTTP interface.
    • Hi,chubbsondubs,I had a similar problem.Does it affect if your getter and setters are private or your constructor is private?
    • By the way, I recommend that you don't expose the Java Beans themselves - in domain driven development terms this is your _core model_.
    • Primitives are now serialized to valid JSON ( CODETERM8 ), but "normal" Java beans are also wrapped which is undesired ( CODETERM9 instead of CODETERM10 ).
    • Explore all reviews
  143. com.pubnub
    • I've opened a new question which is compliant with SO's requirements here: URL_http://stackoverflow.com/questions/20547815/java-is-there-a-convenient-way-to - extract-data-from-the-mtgox-pubnub-json-api .
    • Trying to extract bits of information directly from a CODETERM2 produces ugly code with lots of calls to CODETERM3 , for which again exceptions might need to be handled.
    • The Concept** For me, the best solution was to convert the CODETERM1 s from the PubNub API to bean classes which I found in the MtGox module of the URL_https://github.com/timmolter/XChange [XChange-library] .
    • This approach has the disadvantage that I have to write my own POJO classes, e.g.
    • Most is standard code for using PubNub.
    • PubNub Java Class for MtGox JSON API It's easy to create a ready made Java Class for ingesting the live feed provided by Mt.Gox This is a work-in-progress post to show you how to access the PubNub Data Feed from Mt.Gox as shown in the Dev Console live feed!
    • Explore all reviews
  144. jdbc
    • are you using Hibernet or or simple jdbc or any other orm tool.
    • For a long time you had to specify the charset in the jdbc connection string for MySQL.
    • You don't have to use all of jOOQ's features to take advantage of some useful JDBC extensions.
    • This uses POJOs and annotations to provide a more complex structure to your objects.
    • Maybe you can improve a lot the total processing time by optimizing the query itself but its a different story.
    • For me its usually worth to maintain something between the db and remote client, it just sounds right.
    • Explore all reviews
  145. javax.json
    • It would be fairly easy to wrap URL_http://docs.oracle.com/javaee/7/api/javax/json/JsonObject.html [JsonObject] and URL_http://docs.oracle.com/javaee/7/api/javax/json/JsonArray.html [JsonArray] in a JSObject implementation.
    • Edit 1 As it turns out the URL_http://hg.openjdk.java.net/jdk8/jdk8-gate/nashorn/file /fbd21b00197b/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java [ScriptObjectMirror] class can be used as a go-by or as a default implementation of JSObject itself.
    • Edit 1 @Vik Gamov, By interoperability, I mean a way to inject javascript / JSON objects into the script at runtime.
    • As it turns out, they have also provided a default implementation for URL_http ://hg.openjdk.java.net/jdk8/jdk8-gate/nashorn/file/38378024a332/src/jdk/nashor n/api/scripting/JSObject.java [JSObject] with URL_http://hg.openjdk.java.net/j dk8/jdk8-gate/nashorn/file/fbd21b00197b/src/jdk/nashorn/api/scripting/ScriptOb jectMirror.java [ScriptObjectMirror] .
    • I know Nashorn allows for objects from other JVM languages, like standard Java objects.
    • will Nashorn include native support for javax.json.spi.JsonObject)?
    • Explore all reviews
  146. org.jboss.resteasy
    • Thanks for the post, I've gotten quite a bit further, but still haven't cracked the nut.
    • And now to open a RESTEasy bug.
    • it's better you have a RESTful framework like [Jersey]( URL_https://jersey.java.net /) or [resteasy]( URL_http://www.jboss.org/resteasy) .
    • Yes, my exception mapper works, but not for those...
    • I know that implementation works in Jersey, RestEASY and Spring 3.
    • Don't really know about Jersey, but in RESTEasy exception mappers to classes like Exception and Throwable have, by design, no effect.
    • Explore all reviews
  147. xstream
    • See JavaDoc - toXML: Serialize an object to a pretty-printed XML String.
    • XStream seems somewhat less flexible, and it's fairly slow.
    • I tried Xstream as well but I was not able to .Btw the name of the xml tag will change Dynamically .
    • I tried to solve your problem using XStream all the ways I could think of and I have failed.
    • I like XStream very much.
    • Since escaping new lines / quotes etc can make this a little tricky, why not just use [XStream]( URL_http://xstream.codehaus.org /) to convert the object to XML and wrap the [HTML in a CDATA section]( URL_http://www.w3schools.com/xml/xml_cdata.asp ) ?
    • Explore all reviews
  148. com.google.code.guice
    • You need to hook it (or a subclass such as CODETERM2 ) in the Jersey- recognized IoC container (its own by default, but I personally prefer Guice), or otherwise get it registered as an CODETERM3 .
    • Now I glossed over getting the Provider and MessageBodyReader registered with your JAX-RS Application configuration, but that could vary greatly depending upon if you're using Jersey's servlet, using a custom Application, using Guice, or any number of other ways of setting up your JAX-RS stack.
    • Remember that erasure is URL_http://www.angelikalanger.com/Gener icsFAQ/FAQSections/TechnicalDetails.html#FAQ101 [replacing-type-parameters-by- their-leftmost-bound] and that a URL_http://gafter.blogspot.com/2006/12/super- type-tokens.html [super-type-token] (which is what that TypeToken is, as used in Guice & Gson and various other places) is basically a trick that lets you get access to the parameterized type information of the superclass via reflection.
    • I was using Jersey and Guice so was a little hard to find out how, but I did it.
    • But I'd like to have my dependencies injected with Guice.
    • So my question is how to resolve this situation and have Jersey, Guice and JSON play nicely together?
    • Explore all reviews
  149. ognl
    • To make this working you need to add CODETERM3 parameter in the JSON result CODESNIPPET_JAVA1 .
    • It doesn't work because firstly the value CODETERM1 in the list attribute is used to evaluate the OGNL expression, then when failed it's used as a name of JSON array (if a map is used then to the JSON object).
    • The other option is to build an EL bridge between JSONObjects and something like MVEL or OGNL, which would give you the more-familiar dot notation.
    • The json-path project I mentioned earlier uses too many regular expression which makes me a bit skeptical about its performance.
    • Update about Ognl: it works!
    • But then I tried CODETERM4 which works and in the same way CODETERM5 also should work which implements CODETERM6 interface.
    • Explore all reviews
  150. quick-json
    • yeah but it it's in the correct format from what i can tell so I don't know why it's telling it it's not.
    • The user facing service (using URL_https://code.google.com/p/quick-json/ [quick-json] ) prevents the user from making the backend (using URL_https://code.google.com/p/json-simple/ [json-simple] ) do bad stuff.
    • As you can see, it works as intended: CODESNIPPET_JAVA2 .
    • I figured this one out myself, the documentation for Quick-JSON is a bit rough, but I figured it out.
    • That works as well.
    • I'm trying to parse this stock info at: URL_http://www.google.com/finance/info?client=ig&q=csco [ URL_http://www.google.com/finance/info?client=ig&q=csco ] that's in JSON format to a map, essentially following this tutorial I saw using the quick-json jar but it keeps giving me an exception and I can't figure out why.
    • Explore all reviews
  151. ireport
    • Once your field is defined you can use its computed value in a text field or whatever: Hope that helps some people.
    • below is the json source and jrxml file.
    • They should be the JSON path from the root of the JSON input file using standard dot notation.
    • On _iReport_, values are correctly displayed on both parameter and data fields, but when run thru the codes below only the parameter fields are displayed.
    • Explore all reviews
  152. jython
    • Jython sounds like a possible solution.
    • Alternately if you just want to remove comments I believe you can do it trivially in Python, which you can just call with Jython.
    • Hey guys, I'm still a noob to Android-related coding and StackOverflow in general, so don't be too harsh on me but I haven't been able to find a question like this asked on here already.
    • Well actually two arrays.
    • Explore all reviews
  153. restfb
    • I used Graph API Explorer to see if my search was working and to check if "count" appeared on the results, and it does: CODESNIPPET_JAVA2 .
    • But, it's resulting into the error: CODESNIPPET_JAVA5 .
    • Facebook restfb using jsonObject stopped getting likes count.
    • I can see the problem is occuring due to conversion of CODETERM8 class object to String by CODETERM9 .
    • I am using restfb to get the number of likes in an specific post, and it was working well.
    • Somehow, this morning it stopped working, and I didn't change anything in the code.
    • Explore all reviews
  154. org.springframework.security
    • The flow is that when receive a call to /entry.html, it will check and choose to redirect to CODETERM1 handled by spring security and then redirect to CODETERM2 response JSON resolve to view CODETERM3 , which is a jsp contain only a json string I would like to know if I can use CODETERM4 in CODETERM5 without using an jsp to write just a json value?
    • My personal choice would be: Either of the following:** Spring WebServices (XML) Spring MVC (JSON) Secured with:** Spring Security OAuth provider - (AFAIK, a little complicated compared to Google's provider, but lots of tutorials on integrating with the above two).
    • I am fully willing to abandon the ".json" URL's entirely, and would prefer to have a simple way to specify controller methods that return JSON, than add a security aspect that is necessary because of a small subset of controller methods.
    • If you're using a framework like Spring Security you can control that some URL like .json can only be reached by some users (for instance the administrator, if they're only used in the admin pages).
    • Explore all reviews
  155. regexp
    • I'll accept his solution (since the question has regexp) but use yours, Thank you.
    • The reason why this pattern is safe is that new lines are invalid in String values (they must be escaped using CODETERM2 ) so you can safely remove whitespace around them.
    • I used like this: s.replaceAll("\\s*\\n\\s","") but there was a new line in output.
    • I'm trying to change some back-end code without screwing around much with the front-end... and the front end doesn't seem to like quotation marks.
    • Explore all reviews
  156. jersey
    • If one existed I'd prefer a HTTP framework that worked with Gson instead of Jersey as I'm more comfortable with it.
    • Yes, I'm very familiar with Gson, and Jersey already uses Jackson, but converting JSON to and from POJOs is only one part of the problem, I'm looking for an alternative to Jersey, which is a framework for building REST-HTTP APIs.
    • I need to build the server side of a JSON-REST API, and I've been playing with Jersey to do it (using it's JSON-POJO mapping feature).
    • The problem is that even testing the simplest possible use-case has required several questions here on SO, and quite a bit of hunting around.
    • Explore all reviews
  157. org.apache.thrift
    • Other libraries like Protocol Buffers: Apache Avro, Apache Thrift.
    • It's hard to say from your text what you really want.
    • This can be useful if you want your service to be consumed by Javascript code, where JSON is often the easiest thing to deal with.
    • Where do things like "Apache Thrift" come in and what are the benefits?
    • Explore all reviews
  158. org.mongodb
    • And when I say paging is the standard way of doing this, this applies to SQL databases as well as Mongo.
    • That does in fact work, though I wound up with a different solution.
    • @brainOverflow That is what I thought was easy.
    • I mean storing Json as an String field is not very useful, as it does not allow you to query or aggregate your data.
    • Good, hope someone has a solution.
    • /} is not valid JSON, so I doubt you'll find any JSON parser/marshaller that will generate that.
    • Explore all reviews
  159. elasticsearch
    • If this is something you must have you can just convert all the values of this field to string.
    • So when some data have CODETERM12 as CODETERM13 , like CODETERM14 , then it is throwing exception, as the type is mapped to CODETERM15 .
    • You can't have a field that contains different types of values.
    • But it will disable type mapping for all fields.
    • A bit longer - ElasticSearch is not schema-less - it's dynamic.
    • So if there are 20 fields in JSON, I bother for types of 4 fields, for other 16 fields if they are considered as String, I am OK with that.
    • Explore all reviews
  160. org.jboss
    • Thanks for the post, I've gotten quite a bit further, but still haven't cracked the nut.
    • I had no problem reading the contents of the custom class' instance, nor a problem while returning it to my client.
    • i would like to using only JAXB(native for JBOSS AS 7) for best performance, avoiding others "jar".
    • The following servlet is a demo of how you can use this (I am running it on a JBoss 7.1.1): CODESNIPPET_JAVA1 .
    • i would like to using only JAXB(native for JBOSS AS 7) for best performance, avoiding others "jar".
    • NOTE: If you are deploying this in JBoss 7 do not set the CODETERM4 context parameter as it is enabled by default.
    • Explore all reviews
  161. org.antlr
    • Pity that it is not well known enough.
    • ANTLR has the disadvantage that it complicates the build process a lot, though.
    • Examples are JAVACC, CUP and my preferred tool, ANTLR.
    • ANTLR is very powerful but can be difficult to start with.
    • JSON is relatively simple and it would be a useful exercise.
    • With DMS you can define the JSON syntax, build ASTs, and then write source-to- source tranformatinos to map that to XML representing your schema.
    • Explore all reviews
  162. genson
    • This is a good answer, but if you don't want to use other libraries, you could also add a private member to GeneralTemplate which contains the class name as string.
    • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version.
    • Thanks, it works.
    • you can also have a look at genson URL_http://code.google.com/p/genson /, it is easy to use, provides streaming api/databinding, can deserialize even if there is no default ctr and much more.
    • @mgibson great you like it :) yeah sure if you use maven use the dependency from here URL_http://code.google.com/p/genson/wiki/GettingStarted Download, if you just want to dl the jar you can find it here URL_http://mvnrepository.com/artifact/com.owlike/genson/0.94 (you have a download link there).
    • The classes include: URL_https://code.google.com/p/genson/source/browse/src/test/java/com/owlike/ge nson/bean/Feed.java?r=2b80106be551560dd27cef4197de0d0500e93439 [Feed.java] - which has an id field URL_https://code.google.com/p/genson/source/browse/src/t est/java/com/owlike/genson/bean/Link.java?r=2b80106be551560dd27cef4197de0d0500 e93439 [Link.java] - which has a href field Genson will integrate with URL_https://code.google.com/p/genson/wiki/SpringIntegration [Spring-MVC] and URL_https://code.google.com/p/genson/wiki/JerseyIntegration [Jersey-for-JAX- RS] .
    • Explore all reviews
  163. junit
    • that's good, sound like you're including the libraries correctly then...maybe it's the arguments that are being passed to assertThat causing the problem then.
    • So basically I would like to build up my unit test for this something like: Mock the CODETERM2 (somehow) to correctly generate JSON results based on the requests.Correct me if I'm wrong but I could marshal back the JSON result if I build up the mocked object hierarchy.My problem here is that I need to create the hierarchy for every single request, but I guess I cannot do anything fancier here.I should assert that the CODETERM3 method invoked with the expected device ID.
    • I was thinking of maybe this method should be broken apart to two methods, but I can't see any clean and good solution because this method will be used as an access point from other components in the system, therefore one method should accomplish one thing.
    • I've been battling this today and your question inspired me to make it bloody work :D The annotations are here: URL_https://github.com/FasterXML/jackson- annotations/wiki/Jackson-Annotations [ URL_https://github.com/FasterXML/jackson - annotations/wiki/Jackson-Annotations] See JUnit test here: URL_https://gist.github.com/TomDemeranville/7009250 [ URL_https://gist.github.com/TomDemeranville/7009250 ] .
    • I hope I can get something better, I don't like these argument captors and generally too much code is needed to simply describe this case and there will be many types of the requests.
    • The solution that I used in the end was to change to sourceforge.net json parser, a couple of code tweaks and my JUnit tests still worked and Tomcat did not complain.
    • Explore all reviews
  164. org.apache.xmlbeans
    • upvoted just for saying that XMLBeans "seems like a lot of faffing around".
    • What formats and libraries are people using in production systems these days, is anyone else trying to avoid the URL_http://www.codinghorror.com/blog/archives/001114.html [angle-bracket-tax] ?
    • We've also looked at URL_http://xmlbeans.apache.org/ [XMLBeans] , but it seems like a lot of faffing around.
    • What formats and libraries are people using in production systems these days, is anyone else trying to avoid the URL_http://www.codinghorror.com/blog/archives/001114.html [angle-bracket-tax] ?
    • _Edit: really needs to be a cross platform solution: Linux, Windows, Solaris etc.
    • We've also looked at URL_http://xmlbeans.apache.org/ [XMLBeans] , but it seems like a lot of faffing around.
    • Explore all reviews
  165. com.googlecode.json-simple
    • It should be pretty simple to check if the string begins and ends with [].
    • According to my reading of both the code and comments of the JSONObject class ( URL_https://code.google.com/p/json - simple/source/browse/trunk/src/main/java/org/json/simple/JSONObject.java), it doesn't do anything to preserve the order of the keys.
    • You can use [json-simple]( URL_http://code.google.com/p/json-simple /) which is simple, as the name implies.
    • Thanks :) currently looking at Gson, I'm using this json-simple lib, which I suspect is lacking a few good feature I need.
    • @mabuzer Gave up...just using Gson (for pretty-print) + json-simple for everything else.
    • According to my reading of both the code and comments of the JSONObject class ( URL_https://code.google.com/p/json - simple/source/browse/trunk/src/main/java/org/json/simple/JSONObject.java), it doesn't do anything to preserve the order of the keys.
    • Explore all reviews
  166. com.google.appengine
    • Do I have to write from scratch a servlet that manages the jSON handling or there is a library or something like the SOAP support for web services?
    • This is way too vague.
    • However I can parse for Category CODETERM5 Once, I get the Category JSONObject, I can parse for Item like this CODETERM6 fine.
    • I have created a JSONArray of Category object which include Item object List(JSONArray) in google appengine, thus, using CODETERM1 I validate the resulting String here URL_http://jsonformatter.curiousconcept.com/ [ URL_http://jsonformatter.curiousconcept.com/ ] and it fails.
    • App Engine has some very nice tutorials on their website, I'd recommend starting there: URL_https://developers.google.com/appengine/docs/java/gettingstarted/creating [ URL_https://developers.google.com/appengine/docs/java/gettingstarted/creating ] I'd just create a simple form which you would POST to a servlet.
    • my requirements: i want a webform where i can enter student news and events and that should be stored on webservice(json).this webservice must be comapatible with appengine.please help me i strucked with that i con't move work.. sorry for my english.
    • Explore all reviews
  167. javax.script
    • I just ran your code and it works fine.
    • I was adding quotes in java script which was causing problem and I didn't even think about to look JS file.
    • use the java script in the client side of your application and pass the selected values to server.
    • I have a large amount of data being sent from server to java script, which is taking quite a long time to load.
    • XSS paradise O_O Load them from server, instead of from client :////.
    • Hi guys I am having problem with my jquery function what I am trying to achieve is to populate data in a listbox The java script funtion CODESNIPPET_JAVA1 .
    • Explore all reviews
  168. jstl
    • If it's valid JSON it should work correctly.
    • I'm trying to load the JSON object when the page loads, but I've been unsuccessful with various different ways... c:set var, body onload, mixing JSTL and JS... Is there a way to load JSON objects as the page loads?
    • Obviously it didn't work, I kind of screwed it up, please help.
    • We are currently using JSP with JSTL for our view, but our designer doesn't know JSP so it's been a real pain to merge his design changes into the source.
    • It worked!
    • If you're using JSTL c:out, ensure that its escapeXml attribute is set to false.
    • Explore all reviews
  169. org.apache.axis2
    • Following this small tutorial: URL_http://code.google.com/p/jsonp-support-for- axis2/wiki/OneStopPage [ URL_http://code.google.com/p/jsonp-support-for - axis2/wiki/OneStopPage] I was able to configure my Axis 2 web service correctly.
    • well actually i modified the source for the message builder and it solved the problem atleast for now..
    • The problem is that the returned JSON, doesn't look like a standard JSON representation (Not even in badgerfish format).
    • If you don't wish to build or manipulate the message within the ESB, you can use message relay message builder/formatter for application/json in place of default axis2 builder/formatter pair.Have a look at [this]( URL_http://docs.wso2.org/display/ESB403/Message+Relay) .
    • This is because JSON is mapped to XML-like datastructure, and XML must have a root, so the first key-value pair is considered as root.
    • Typically this means a RESTful API with JSON.Theres one issue weve come across, where were dealing with an existing Web API which is presenting in JSON.The problem is where arrays are incorrectly serialized in certain cases.
    • Explore all reviews
  170. twitter4j
    • This looks like a toString representation of the object, it would be better if you could write it in the format you need as you receive results.
    • Thanks for the reply i am using twitter4j and i am facing the exception java.lang.NoClassDefFoundError: javax/crypto/Mac .I am using maven for building.
    • Works like a charm!
    • It is a twitter4J dump (entities as called in twitter4J - UserJSONImpl ).
    • Thanks heaps, Love your work with Twitter4J, keep it up!
    • the isTruncated=false, so JSON would be isTruncated : false, but you can't simply substitute '=' for ':' , because the equals - sign could be part of a literal text, though I don't understand why Twitter4J doesn't use JSON.
    • Explore all reviews
  171. javax.xml
    • I pretty much look for anything you've written when dealing with MOXy or JAXB.
    • I think I ended up tracing through it and found that it was a problem in the json provider.
    • yes I see that before sending the request an OPTIONS call is send It's normal now I decided to make it as simple with text/xml and mapped it to objects with jaxb .thanks anyway.
    • There also must be a way of doing this using PropertyNamingStrategy, the problem I am facing with it is that Spring MVC is handling it somehow differently than serializing something directly with ObjectMapper from JAXB objects.
    • In the past I remember working with XML files, using the JAXB compiler to automatically generate Java classes, and those tags where automatically generated, so I guess some tools to generate code do this, while others do not.
    • My classes have jaxb annotations and the system application provider seems to interfere with the jackson json provider.
    • Explore all reviews
  172. jetty
    • Thanks for the answer,Ron, but I am really looking for a Java solution since my code is in Java.
    • You can catch the exception, but not sure if that helps a lot -- parser probably won't read the whole thing.
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • Tangent answer, but I've found python + gunicorn to be really speedy for making quick REST mockups when I'm integrating with a 3rd party service.
    • So I would like to hear what IDE/Plugins + J2EE Technology stack + Server(If that matters) is a good combination for my usecase and why.
    • I get this regardless of what CODETERM1 and CODETERM2 annotations I add to my methods though they should both be CODETERM3 .
    • Explore all reviews
  173. com.extjs
    • Probably in other situation it will not be useful approach but for me works great!
    • Sorry I don't have a work around, but the infinite grid in the latest ExtJS release is really buggy..
    • can you suggest the solution with respect to extjs version i am using.
    • You would need to give more details then, because right now I can't imagine why escaping the slashes would make problems, but escaping the quotes wouldn't.
    • The grid works excellent aside from this one defect.
    • I am wondering if there is a way to work around the exception thrown in ExtJS and whether or not there is something abnormal which I am doing to trigger this behavior.
    • Explore all reviews
  174. com.google.protobuf
    • Or [Protocol Buffers]( URL_http://code.google.com/p/protobuf /) since it's supported by almost any language, results in smaller serialized data and you don't even have to write a single line of code to parse / serialize it.
    • simplify the problem then...take out protobuf-java-format and instead add code like Exception e new InvalidProtocolBufferException() to see if that works first.
    • What do you mean "my object writer would pass it"?Also, all you have to do is call build() on the world that you serialize, and then you can do something like "toByteArray()" or something like that, take a look at the protobuf javadoc for the best serialization method.
    • Actually, I disagree on your "scalability" and "maintenace" / "change" points re protobuf: protobuf is specifically designed for scalability, with dense output (smaller than json etc), and cheap processing (especially compared to text protocols).
    • The protobuf objects have serialization methods to bytes, it's very efficient and compresses really well.
    • Another very useful method to play around with when debugging is XXXXX.class.getProtectionDomain().getCodeSource().getLocation() replace XXXXX with a class that exists in protobuf like that Exception class that your class is having no problem loading and protobuf-java-format is having a problem loading and also any class from protobuf-java-format.
    • Explore all reviews
  175. weka
    • Let me warn you that I'm quite new to Weka :) I _havent_ found a way to get direct access to the J48s Root Tree (appears to be private w/in the class)are you aware of a way to get at it?
    • If not, the closest Ive found as a way to get at the data bit hackish: use J48.toString() to dump the tree-as-string, and then convert that back into a Tree Structure and then convert that into a JSON string (YUK).
    • It seems that this use-case is not unusual, so I'm wondering if any of you all have already solved this problem .
    • Explore all reviews
  176. org.msgpack
    • I just went to the following link and thought of stream compression URL_http://tech.3scale.net/2012/07/25/fun-with - redis-replication/.
    • Even if one use MessagePack, should one consider compressing data on Network stream also so as to decrease the latency.
    • You should consider using MessagePack as it is full compatible with Redis and Lua, it is a great compression on JSON: URL_http://msgpack.org/ [ URL_http://msgpack.org/ ] It implies some Lua code to compress and uncompress, but the cost should be small.
    • Explore all reviews
  177. org.neo4j
    • Can somebody help me to get values inside "data" element: I have json output from neo4j as follows: CODESNIPPET_JAVA2 .
    • Nodes can be unique per-index (meaning, if you index a property, you can enforce only one node existing for that property) - see URL_http://docs.neo4j.org/chunked/stable/rest-api-unique-indexes.html [ URL_http://docs.neo4j.org/chunked/stable/rest-api-unique-indexes.html ] for the documentation to do this via the REST API.
    • Check out URL_http://neo4j.org/ [neo4J] The internal representation of the graph would be then delegated to the database and people have been working on this for years, so I would expect the representation to be efficient and performant.
    • Explore all reviews
  178. jmeter
    • when I use jmeter try got data is correct,but falue at android (use RestTemplate)please help me how to fix it, thanks!
    • This is my SQL- CODETERM5 But after trying to insert, I am getting this exception- CODESNIPPET_JAVA3 .
    • I am working on the project in which I need to make a connection to database and insert lot of rows in that Database.
    • Explore all reviews
  179. org.mediawiki
    • (MediaWiki recommends adding the &indexpageids parameter to assist with parsing, however I can't see how it would be useful to me.)
    • I tried using the CODETERM3 and CODETERM4 annotations as well but they don't appear to help, throwing the same exception CODETERM5 .
    • Thanks for any and all assistance.
    • Explore all reviews
  180. spring-android
    • Spring Android has a RestTemplate that is pretty easy to use.
    • This error happens when the jackson engine tries to parse the json response from the server.I am using Spring Android to serialise/deserialise objects to and from json.This problem seems to be related to the default encoding UTF-8.
    • try out Spring Android - is has very handy class RestTemplate.
    • Explore all reviews
  181. dozer
    • (If there's a lot to map, you could use a Framework like Dozer to do it for you).
    • I was rather hoping to avoid having to merge beans, past experience of this king was rather bad.
    • The OP also wants a succinct configuration-based transformation facility, and for that you might try Dozer (which also operates on plain Java objects.
    • Explore all reviews
  182. rhino
    • I could recommend embedding Rhino, enabling the user to write javascript.
    • This is saying roughly the same thing (use JSON2):[Java 6 + JSON2.parse()]( URL_http://stackoverflow.com/questions/2405410/java-6-scriptengine - and-json-parse-problem).
    • You've also got the advantage that if your problem requires it, you may well be able to set it up so that the same expressions will happily run client or server side.
    • Important point here, 100GB won't fit into main memory, so I/O performance might be the bottleneck and should be optimized rather than the processing code.
    • Embedding Rhino and exposing a limited set of objects was a great way to enable all sorts of user scripting in a past project and that was some years ago, Rhino is quite mature now.
    • Important point here, 100GB won't fit into main memory, so I/O performance might be the bottleneck and should be optimized rather than the processing code.
    • Explore all reviews
  183. net.sourceforge.jena
    • You might need to have a look at the Turtle spec document to understand how this gets build, it is kind of intuitive anyway.
    • You can use any of the libraries listed URL_http://json.org/java/ [here] to parse your JSON document and URL_http://jena.sourceforge.net/tutorial/RDF_API/ [Jena] to create the RDF triples.
    • Bear in mind that there are several ways to serialize RDF triples, RDF/Turtle is the most readable.
    • Explore all reviews
  184. org.codehaus.woodstox
    • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping.
    • Explore all reviews
  185. org.yaml
    • What you can do is that 1.ask the server side to return a valid json format to you, 2. or you can use YAML library to extract the key- pair value.
    • Besides the consuming side would have to periodically poll the file to look for new input, which means you're already losing time.
    • Writing to a file on the filesystem is almost never going to be as fast as a socket connection.
    • Adding dependencies can be a hassle.
    • wish I could upvote this more.
    • The messiness inside the CODETERM7 method is for making sure you only ever get a Double or an Integer or a Long, and probably could be better, or at least simplified if you're okay with getting BigDecimals, which I believe is the default.
    • Explore all reviews
  186. org.springframework.build
    • I am trying to parse JSON data being sent from UI in my Controller using Spring build Jackson support and this is my code CODESNIPPET_JAVA1 .
    • i checked the JSON format using some online services and it seems valid, while tryin gto parse JSON data i am getting following exception CODESNIPPET_JAVA3 .
    • my CODETERM1 class contains simple properties for for CODETERM2 , CODETERM3 etc with a no argument constructor .
    • Explore all reviews
  187. org.apache.sling
    • turns out you can do: JSONObject json new JSONObject(slingHttpServletRequest.getParameterMap()); as well - your method does give a bit more control over what is allowed into the json object (such as introducing a white/black list) - which is nice.
    • I would also iterate over the request params but instead of using an arbitrary json library use the JSONObject that is provided by sling.
    • Use the built in pretty printer in Sling's JSONObject: URL_http://sling.apache .org/apidocs/sling5/org/apache/sling/commons/json/JSONObject.html#toString(int [ URL_http://sling.apache.org/apidocs/sling5/org/apache/sling/commons/json/JSONObje ct.html#toString(int] ) public java.lang.String toString(int indentFactor) throws JSONException Make a prettyprinted JSON text of this JSONObject.
    • Ideally I would like to use a URL_http://sling.apache.org/site/index.html [Apache-Sling] library (as they are exposed in my container naturally).
    • I am using the Apache Sling JSONObject to model my JSON Object and turn it into a String, so if the Sling JSONObject can be set to output a tidy string (which i dont think it can) that would work too.
    • i looking also for a good implementation.
    • Explore all reviews
  188. zookeeper
    • So the final JSON String will look like this - CODESNIPPET_JAVA4 .
    • You can do it, in limited cases, by doing the obvious string manipulations, but it's far better, in the general case, to deserialize the JSON, modify the resulting Map, and then reserialize the Map.
    • What's the best and efficient way to do this?
    • Explore all reviews
  189. com.google.guava
    • @MattBall Thanks, I was just about to edit and improve that part :).
    • Also, it's currently got a hard dependency on Google Collections which I want to remove and it's probably too heavyweight for your needs, but it allows you to interact with your JSON data in the way you're looking for: CODESNIPPET_JAVA1 .
    • And maybe I'll clean up the code I have and try to create a standard.
    • Explore all reviews
  190. org.simpleframework
    • For xml we use simple ( URL_http://simple.sourceforge.net [simple.sourceforge.net] ) .
    • Why would you want to limit it to a single server, which has obvious problems in terms of outages etc as well as handling that many requests per second.
    • It depends of what you are willing to do with your loaded datas (how you want / need to process them), but if you are willing in the end to load XML elements into java beans, i'm a big fan of URL_http://simple.sourceforge.net [SimpleXML] , way simpler and quicker than anything else (imho).
    • If you work out how to scale out, it'll kill two birds with one stone.
    • The choice of SAX/DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences-between- dom-and.html [ URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences - between-dom-and.html] Even if you don't use SAX/DOM there are still simple options available to you, take a look at Simple : ) URL_http://simple.sourceforge.net/ [ URL_http://simple.sourceforge.net/ ] You may also want to consider STaX.
    • URL_http://simple.sourceforge.net/ [Simple] apparently can deal with more complex object graphs, but XStream seems more popular, does JSON and will probably suit my needs (I won't be ever having cyclic references).
    • Explore all reviews
  191. javax.xml.parsers
    • Also handy if you want to read, query, make changes and write the DOM back out as a modified XML file.
    • 2nd slowest and fairly memory-intense, but necessary if you want/need the XML DOM to stick around in memory so you can operate on it.
    • It is basically like a chatty person telling you everything they are doing AS they do it.
    • Explore all reviews
  192. org.apache.camel
    • I have a Java project that currently returns a map to Camel without any nested key,value pairs, and the Jackson library marshalls it just fine into JSON using the Jackson library.
    • Unfortunately this didn't helped me :-/ Any other suggestion?
    • How can I get Camel to marshall a Java object with nested key,value pairs?
    • Changed constructor to use Upper case as per 'HourlySalesFigures' in both the argument and constructor body, same thing again.
    • How do I marshall nested key,value pairs into JSON with Camel and Jackson library?
    • I modified my ApplicationContext.xml to add these changes( also updated the xml above), and now I get the following error: Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 30 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 25; cvc-complex-type.2.4.a: Invalid content was found starting with element 'camel:dataFormats'.
    • Explore all reviews
  193. net.java
    • You're welcome, glad that it worked out for you.
    • This is essential when configuring JerseyTest too, otherwise only the server part of a JerseyTest will work with POJOs and the client in your test class will fail: URL_https://java.net/projects/jersey/lists/users/archive/2011-07/message/43 .
    • Here is the download page for the reference implementation jar of JSR-000353 URL_https://java.net/projects/jsonp/downloads/directory/ri [ URL_https://java.net/projects/jsonp/downloads/directory/ri ] If you are using JSON I recommend the Jackson JSON library.
    • I found where the code is now: URL_http://java.net/projects/meapplicationdevelopers/sources/svn/show .
    • URL_https://java.net/jira/browse/JERSEY-753 [ URL_https://java.net/jira/browse/JERSEY-753 ] This method of producing JSON has some limitations and may not be what your ultimately want.
    • Probably best to do this by filing an issue at URL_http://java.net/jira/browse/JERSEY and attach the file there.
    • Explore all reviews
  194. org.w3c.dom
    • The above example works, so, please, be more precise.
    • (note that keeping a reference to your document builder will speed things up if you need to parse multiple files) Then you use the function in URL_http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Document.html [org.w3c.dom.Document] to read or manipulate the contents.
    • I've used org.w3c.dom.Element maybe using another one may help navigate through the response (if jaxb supports it).
    • Explore all reviews
  195. com.dyuproject.protostuff
    • it says: A serialization library with built-in support for forward-backward compatibility (schema evolution) and validation.available formats: protostuff (native), protobuff, json ...
    • @Eric support for generics and circular references is not part of the google spec; protobuf-net and protostuff essentially cheat with extensions (that fit the wire spec); I have no idea if the approaches taken for the two are even remotely similar.
    • protostuff could probably fit with your requirements, see URL_http://code.google.com/p/protostuff/ [ URL_http://code.google.com/p/protostuff/ ] it takes a special language describing the base data structure an produces tidy java classes with annotations.
    • Explore all reviews
  196. com.fasterxml.jackson
    • Since you are using Jackson I would recommend to store your object as [JsonNode]( URL_http://fasterxml.github.com/jackson - databind/javadoc/2.1.0/com/fasterxml/jackson/databind/JsonNode.html).
    • 2) There's apparently a bug in Jackson 2.2.2 that prevents the null serializer from being called on null nodes using the Tree Model; it only gets called for POJOs.
    • The post part works correctly for other request, and i do imported Jackson.
    • I'll use a CustomDeserializers, it's gonna save me a lot of headaches!I'll also be able to apply my versioning strategies in there with very little modifications.
    • What would you expect Jackson to map the value of b to in both situations?
    • Could you debunk my fear?
    • Explore all reviews
  197. commons-httpclient
    • It worked!
    • As a first debugging step I'd dump out the contents of builder and see exactly what the server is sending you - "< at position 0" could be an XML response instead of JSON or it could be an HTML error page.
    • Corrected it to catch both.
    • As a first debugging step I'd dump out the contents of builder and see exactly what the server is sending you - "< at position 0" could be an XML response instead of JSON or it could be an HTML error page.
    • [With Apache HttpClient]( URL_http://hc.apache.org/httpclient - legacy/performance.html#Request_Response_entity_streaming) it may [not be that simple]( URL_http://stackoverflow.com/questions/10146692/how-do-i-write-to-an - outpustream-using-defaulthttpclient) indeed, but please keep searching.
    • @IanRoberts, I must be more attentive, I made a mistake in URL -> streamS instead of stream :).
    • Explore all reviews
  198. org.springframework
    • Thanks Sean,MediaType is from Spring 3.0,there i will mention application/json.But CharStreams and Closeables api is from google code.IS there any way to write same functionlity with native java code.
    • I'm new to Spring MVC and was having a really hard time figuring out how to return JSON.
    • Thanks the solution works.
    • URL_https://jira.springsource.org/browse/SPR-7543 Automatically expose @PathVariables in the Model causes all methods that have {@PathVariable} parameters to include the {@PathVariable}'s in the model, so the model always contains more than 1 item, so {extractValueFromSingleKeyModel} doesn't work.
    • This is extremely easy with Spring MVC but it all depends on your back end.
    • That last part isn't really clear yet.
    • Explore all reviews
  199. org.glassfish.jersey
    • I created a new question for this that I'd like you to answer here: URL_http://stackoverflow.com/questions/18646747/how-to-produce-json-output-with - jersey-1-17-1-using-jaxb This can help others.
    • Thanks I had this problem for quite a while, I saw somewhere in the jersey documenation that it would scan the classpath for providers and the JacksonProvider would be automatically discovered but this appears to be incorrect.
    • One of the best ways to use Jersey is using IoC.
    • I kept searching for a much more complex cause.
    • By the way, in my last Jersey project I didn't use @XmlRootElement property, I just had an ordinary JavaBean, and all worked fine (i.e.
    • Don't really know about Jersey, but in RESTEasy exception mappers to classes like Exception and Throwable have, by design, no effect.
    • Explore all reviews
  200. org.json
    • Ah ok so I could just catch a ClassCastException, thanks!
    • it is incredibly hard to _research_ this.
    • @TEG: I'm using the library from URL_http://www.json.org/java/index.html I'll be looking into removing stuff but I'm working with a ~20K lines text file for very basic extraction and analysis of the parts of the tweets.
    • My bad, I thought that would refer to the "simple" reference implementation of json.org.
    • GSON is a very powerful library for convert JSON-Java Object and viceversa..
    • This doesn't work for me, since a JSONArray is not iterable.
    • Explore all reviews
  201. javax.jms
    • Our system is a large, in-house warehouse management system with a lot of process that commonly have both synchronous and asynchronous flows.
    • As a result, we use JMS to expose endpoints for our services.
    • Since we like JMS, and we like the ability to 'fall back' to HTTP for other clients, we prefer JSON messages as messages payload.
    • No support for example auto-generation, and in fact examples are a pain because they have to be xml encoded in the WADL.
    • This gives a lot of the same benefits of REST services, but provides the reliability of JMS.
    • In our case, I dont want to generate service objects from the WADL file, so using WADL means duplicating my method/parameter names in the WADL after i code them in java, which is harder than using javadoc.
    • Explore all reviews
  202. com.google.code.gson
    • Ok, figured it out.Gson is causing it...using json.toString() instead doesn't add the key.Thanks for the replies.
    • The problem is not the inizialitation of Map, Gson does this for you!
    • No, I am also planning to use the values in calculations and other stuff...
    • Otherwise it is very difficult to know what to look for.
    • Well first of all your jsonString is not a valid json.
    • The problem I think is that it's not compatible with GAE.
    • Explore all reviews
  203. org.mvel
    • So the user cannot do something as simple as: CODESNIPPET_JAVA2 .
    • And lock up my app, or access unwanted resources.
    • Or recommending the user to either use an existing library such as JEXL, MVEL, or any other from this list: URL_http://java-source.net/open-source/expression- languages [ URL_http://java-source.net/open-source/expression-languages ] But they all seem to rely on a trusted user (ex.
    • After doing a little bit of my own research, both JEXL and MVEL seem to be out.
    • But in my case, I want my expression evaluation to run in a secure sandbox.
    • All the ones I found are very complex, and implement things like loops, import statements etc.
    • Explore all reviews
  204. sax
    • For this sort of translation from one format to another, SAX is ideal.
    • establishing a context that lets you know when a JSON string has finished syntactically, without loading the whole thing into memory), you could look into event-based parsers (similar to what SAX does with XML).
    • It's like SAX parsing for XML.
    • Yes, JSON does have a toXML and you can make JSON.XMLtoJSON, but i need to add extra bits, and change a few bits around to satisfy the dojo requirements.As the quick bursts will be very strict in format, and typically be 3/4 lines line (50 at the most a (a recurring set of 3/4 line elements) holding in memory will not be too much of an issue..Thanks again for the comments so far..
    • To prevent all the object creation, look at event driven xml and json handling like URL_http://www.saxproject.org/ [SAX] for XML and URL_http://code.google.com/p/json-simple/ [Json-Simple] and/or URL_http://jackson.codehaus.org/ [Jackson] for JSON.
    • If it's the size of the file you're worried about, then you should use the 'SAX' style example.
    • Explore all reviews
  205. eclipselink
    • @BDoughan : Yes I have tried this with eclipseLink and it works well.
    • Thanks for quick response I am facing javax.xml.bind.JAXBException: property "eclipselink.media-type" is not supported exception.
    • Works fine, but I have to do it in this way inside the resource method: JAXBContext context JAXBContextFactory.createContext(new Class[] {ONIXMessage.class}, null); How can I fetch the eclipselink JAXBContext from Jersey?
    • Ah, thankyou sorry I thought you were just reiterating the answer to my other question URL_http://stackoverflow.com/questions/16931910/with-eclipselink-moxy - how-do-i-map-xml-content-to-a-name-different-to-value and because I used the alternative solution you gave I didnt see the need for it.I don't fully understand this but its now working :).
    • This is also one of the good solutions.
    • The exception being thrown is an RI exception (com.sun.xml.internal.bind.v2.runtime package) so EclipseLink MOXy is not being picked up as the JAXB provider.
    • Explore all reviews
  206. com.google.gwt
    • AutoBeans works, but they are some kind of buggy especially if you use Maps or Lists.
    • that could be a problem, I will try and get back in a day .. :).
    • I've pretty much used this method, as mentioned in my own answer.
    • @Christian Kuetbach you can deserializing/serialize with GWT AutoBean framework at client/server side, but i have not tried with complex Java Map.
    • i will do it like u said!.
    • My doubt is I want java class to bind with GWT components(Student).
    • Explore all reviews
  207. org.apache.cxf
    • For some reason cxf just preferred for me to call .flush() and not .close().
    • Also the conversion from pojo to json and vice-versa is handled itself by the CXF apis.
    • @Prabhathkesav it works with collection and single element: URL_http://pastebin.com/j8RbYkc3 .
    • My main problem was sending multiple parameters to my web service method, expecting the web service to consume them as JSon.
    • I am using Apache CXF which supports JSON through Jettison.
    • The problem I was having was that any exception I threw from within the filtering step was getting turned into a different exception by CXF (the one about the unknown writer for octet-stream).
    • Explore all reviews
  208. stax
    • Since it converts StAX events to/from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects.
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX).
    • JAXB (JSR-222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to/from JSON).
    • StAXON can convert JSON to XML using either XSLT with default templates or StAX event API URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to- XML [ URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to-XML ] Here's a simple example: INPUT FILE: CODESNIPPET_JAVA1 .
    • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it.
    • Explore all reviews
  209. net.sf.flexjson
    • Yep I've been much happier with FlexJSON than GSON in Play too.
    • URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html [ URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html ] I'm unfamiliar with Jackson's methods for doing similar things, but I can say that FlexJSON is very performant, and in general intuitive to use during serialization/deserialziation steps.
    • @SJuan76 well, yes and no.
    • URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html [ URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html ] I'm unfamiliar with Jackson's methods for doing similar things, but I can say that FlexJSON is very performant, and in general intuitive to use during serialization/deserialziation steps.
    • I tried this for Map, with and without include("values"), but the json result is the same; I was expecting to see class type data in the json for different Object type in the map when using "values"?
    • I think the reason you are getting a List instead of List is a bug in Flexjson.
    • Explore all reviews
  210. javax.portlet
    • Now i think its better i create a servlet returning JSONObject string and calling that from the JSP... atleast that works fine :)any suggestions?
    • thanks, i found the jira link for the bug also but i was not sure.
    • I want to make spring MVC 3.0.3 portlet using DispatcherPortlet class With JSON support.
    • portlet**.HandlerAdapter You have to make sure that you use the right one - the servlet and portlet APIs are completely incompatible.
    • text/html Without this, if i use the 'InternalResourceViewResolver' only then it runs fine and i am able to use the portlet.
    • Explore all reviews
  211. dumbledroid
    • I really liked your pretndo library and use it whenever you have to read a JSON or XML.
    • People could use it for bad purposes, and your key can be blocked!
    • So, if you correct these issues, Dumbledroid will work.
    • I've been researching and error must be because the JSON received contains an Object and not an Array, but as the JSON is generated by the Tumblr API, I have no control over it, and do not go out and solve this my problem.
    • : it's good to remove your Tumblr API key from your question.
    • Explore all reviews
  212. java.lang.reflect
    • It's just simple recursion: introspect one type (with super-types etc) for fields, methods (see JDK javadocs for Class); find actual values of fields using java.lang.reflect.Field, rinse repeat.And if you want to get fancy, keep track of already resolved objects to handle cycles (or shared refs).
    • It is not working for me java.lang.reflect.Type listOfTestObject new TypeToken>(){}.getType();String str gson.toJson(commentInfo, listOfTestObject);JsonElement commentObj gson.toJsonTree(str); and myObj.add("commentInfo", commentObj);out.println(myObj.toString()); Is it correct.
    • to use JavaType, you need to construct method by passing java.lang.reflect.Type into TypeFactory (check out JavaDocs for details), respectively: CODESNIPPET_JAVA2 .
    • I think there is no java.lang.reflect package in MIDP 2.0.Will make hard to make a generic parser...
    • If J2ME has java.io.IOException; java.io.Writer; java.lang.reflect.Field; java.lang.reflect.Modifier; java.lang.reflect.Method; java.util.Collection; java.util.HashMap; java.util.Iterator; java.util.Map; java.util.TreeSet;, then you could use the first one, as they are simple java classes.
    • Explore all reviews
  213. voldemort
    • This seems quite straightforward.
    • JSON Serializer for arbitrary HashMaps in Voldemort.
    • While Voldemort does support its "JSON-like" storage (it's not JSON but simple binary dictionaries, as far as I know), there isn't much benefit to using it in my opinion, since you can not query on it or request subsets of document.
    • To indicate that I want to store a HashMap representation of a Java bean, but with constraints on allowed keys (only CODETERM1 , CODETERM2 , CODETERM3 and CODETERM4 ) and their types.
    • I am trying to set up the configuration for Voldemort key-value store.
    • Explore all reviews
  214. kryo
    • Well both projects actually are games which is why Kryo appealed to me.
    • Since it sounds like you are using the format to archive data, human- readability and the use of a standard long-lived format is probably more important than efficiency, so I suspect you will want to choose the JSON route.
    • Use it if you need to interoperte with a JSON (human-readable) data format Kryo is for efficient binary serialisation.
    • Human readability can be sacrificed since I don't plan on reading the files only processing them .
    • I figured I would use URL_http://jettison.codehaus.org/ [Jettison] as it seems it would be URL_http://blog.bdoughan.com/2011/04/jaxb-and-json-via-jettison.html [easier- to-implement] since it actually works with JAXB; however, looking at URL_http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking [Older- benchmarks] in which Jettison was not included I have found URL_http://code.google.com/p/kryo/ [Kryo] produces smaller files and Serialized and DeSerialized quicker than some alternatives.
    • Explore all reviews
  215. struts1
    • If I use some properties, it works fine.
    • @HiwayChe I add this and keep getting error.
    • I use excludeProperties on result, you can refer to URL_http://struts.apache.org/release/2.2.x/docs/json - plugin.html.
    • Use the Struts URL_http://struts.apache.org/release/2.3.x/docs/json- plugin.html ["JSON-Plugin"] .
    • Declare the field you'd like to return as JSON string like the field of your action, provide the getter and setter.
    • my problem is my data in action is always equal to null.
    • Explore all reviews
  216. mongojack
    • This is the easiest (and, I believe, most correct) way to do something like this.
    • Even if I wanted to, writing a custom serializer for OtherClass would be extremely complex because it is an abstract root class.
    • To accomplish this, I created a very simple custom serializer: CODESNIPPET_JAVA2 .
    • This makes me almost sure that the problem lies in my custom serializer, but I am not sure how else I am supposed to write it.
    • However, if you are working exclusively with JSON, you might want to investigate third party libraries like URL_http://mongojack.org/ [MongoJack] - this uses the Java driver under the covers, but translates the results of your query directly into JSON for you.
    • Explore all reviews
  217. alfresco
    • @Gagravarr um, thank you, after i trying to find classes loaded, for some reason , JSONParser class not loaded, alfresco didn't see that.
    • I'd check your classpath, and ensure you only have one copy of each of the jars - my hunch is you may have both old and new copies of at least one and that's confusing it.
    • I will talking throw codes line with a few words, In alfresco I need to create a reports using its Workflows APIs that response as JSON, I found the solution for using JSON as a Data Source in this link (this will be good reference to full understand my issue) : URL_http://www.birt-exchange.org/org/devshare/designing-birt-reports/1053 -scripted-data-source-using-json/ [ URL_http://www.birt-exchange.org/org/devshare /designing-birt-reports/1053-scripted-data-source-using-json/] I downloaded the source and I understand how its works, and finally I was having a problem "authentication issue" and solved it by editing source file 'JSONParser.java', anyway I have another problem now, I have the following code in Java thats working: CODESNIPPET_JAVA1 .
    • @Gagravarr I think all jars is copied, I downloaded "httpcomponents client 4.0" and put all as external jars on eclipse for my project, and copied it to WEB-INF/lib on alfresco (with JSONParser classes as a jar file), I forgot to put them first and I got Class Not Found Exception, but now you see my problem that I got after that ...
    • and fetch rows in data set table like : CODESNIPPET_JAVA4 .
    • To get exception I uploaded it to Alfresco integrated with BIRT, and I got : CODESNIPPET_JAVA5 .
    • Explore all reviews
  218. commons-jexl
    • Or recommending the user to either use an existing library such as JEXL, MVEL, or any other from this list: URL_http://java-source.net/open-source/expression- languages [ URL_http://java-source.net/open-source/expression-languages ] But they all seem to rely on a trusted user (ex.
    • And lock up my app, or access unwanted resources.
    • But in my case, I want my expression evaluation to run in a secure sandbox.
    • After doing a little bit of my own research, both JEXL and MVEL seem to be out.
    • So the user cannot do something as simple as: CODESNIPPET_JAVA2 .
    • All the ones I found are very complex, and implement things like loops, import statements etc.
    • Explore all reviews
  219. jsonrpc4j
    • It would be better if you post ONLY the relevant portion of code, it's too lengthy to read..!.
    • This is a minimum working example and I can not think of one line to omit in this case - if you could point out any irrelevant portions i am maybe able to improve my question.
    • If you have a complicated API, it can help greatly.
    • I tried to enable default typing and to annotate (with @JsonTypeInfo) the _Object.class_ via mix-in, but both failed (exceptions below).
    • If i call _remoteService.getNut()_ everything works as expected, the log prints: CODESNIPPET_JAVA7 .
    • Explore all reviews
  220. org.everit.osgi.bundles
    • and paste all the downloaded codes there, and have fun.
    • it is ok, but it's an ugly hack and I dislike it.
    • I feel this to be the best and the most easiest JSON Decoding.
    • I have seen URL_https://github.com/douglascrockford/JSON-java/issues/5 [this- bug-report] , but I don't see a solution.
    • The reason that I do it this way is an attempt to make it easier to follow whats happening.
    • Explore all reviews
  221. restlet
    • here the code to prevent using chunked http request in restlet.ClientResource.setEntityBuffering(true);.
    • It doesn't expose an InputStream so you can't even roll your own event-driven parsing.
    • Is there any config in Restlet that i can set to let StringRepresentation class treat "type" as a common attribute name?
    • I'm using the restlet library and Jackson to send JSON data, and I cannot get the following to return a json object for a List, I get null out of it and no errors: CODESNIPPET_JAVA1 .
    • Indeed, without using varnish and making my app contacting directly my rest server everything works fine.
    • As for your mapping, I would think an exception should be at least thrown, but right off the bat it looks like you are expecting the albums list to map to the "results" JSON node, but there isn't anything to make this association.
    • Explore all reviews
  222. org.glassfish.main.core
    • It works now.
    • The fact that you're using Java and GlassFish are really irrelevant - these two technologies are capable of publishing all kinds of services.
    • The default location of java ee 7 jars of Windows, C:\glassfish4\glassfish\modules, But you should not use jar this way, best way is include server from your IDE.
    • Exposing your core model is known as _spilling your guts_** - if you change this then all subscribers to your service will need to change too.
    • (recommended for mobile).
    • The problem is, I don't really understand the linkage method between the server and the iOS device.
    • Explore all reviews
  223. java.io
    • Obviously it depends on the average line size of the output, but that could very well be fewer batches than one per line.
    • The exotic versions of java.io and javax.servlet packages that I use include few methods that make data just pop into memory as Strings, and this forces me to work with streams.
    • Doing this way, I could GZIP the bytes also, it will still binary, is that a good practice?
    • If you have multiple contexts where you use the same field, and you want it serialized in one (JSON, for example), and not serialized in another (java.io, for example) then you should create a custom serializer for the case where you don't want it, rather than abuse the keyword.
    • I chose this _binary_ approach over JSON because even though you _could_ transmit the CODETERM18 with JSON almost as efficiently as in binary, it would defeat the very purpose of JSON: being human-readable.
    • I suspected that too, but the only missing characters are apparently ]}.
    • Explore all reviews
  224. org.codehaus.jettison
    • I have edited your questions title and tags to include Jettison to try and attract the answer you are looking for.
    • also I can't see any bug in here.if it has please explain more.
    • @Afrin this one also work for simple query.
    • But I need to implement it using JETTISON :( .Plz guide me to achieve this using JETTISON.
    • I am using Apache CXF which supports JSON through Jettison.
    • "the java.io.IOException: Stream closed" exception that I'm getting happens when I use Jackson instead of Jettison.
    • Explore all reviews
  225. jax-ws
    • It has support for jax-ws annotations, and it's easy to use.
    • I tried servlet but it became complex to use webservice with it.
    • thank you, your solution saved me.In real i wanted to serve some complex data as json which was not easily possible without managedBean.
    • URL_http://reddymails.blogspot.com/2012/05/solving-cross-domain-problem- using.html [ URL_http://reddymails.blogspot.com/2012/05/solving-cross-domain - problem-using.html] .
    • It can be used standalone and is the standard binding layer for JAX-WS (SOAP) and JAX-RS (RESTful) Web Services.
    • But I strongly recommend to look at JAX-RS or JAX-WS instead of abusing JSF as a JSON web service.
    • Explore all reviews
  226. net.sf.spring-json
    • Thanks, right now I saw 4 solutions - spring-json, jackson (delivered with Spring-MVC), FlexJson (delivered with SpringRoo) and gson... After few hours of play with first 3 of them i found that FlexJSON is fastest in setting up, spring-json has best docs and Spring-mvc jackson has working samples on spring svn.
    • The Spring-JSON project is great, but it unfortunately relies on Spring 2.5.
    • I can't say much about Spring-JSON, but I've found Jackson to be an extremely mature and flexible solution.
    • I'm trying to use a Json View for Spring ( URL_http://spring- json.sourceforge.net/ [ URL_http://spring-json.sourceforge.net/ ] ) (org.springframework.web.servlet.view.json.JsonView) but whenever I write a controller class that extends CODETERM1 I get the following Error: java.lang.IllegalStateException: ApplicationObjectSupport instance [org.springframework.web.servlet.view.json.JsonView] does not run in an ApplicationContext The weird thing is, that when I implement the Controller interface directly and do not inherit, _it is fine_.
    • It's reasonably fast, and has good documentation.
    • I'm trying to use a Json View for Spring ( URL_http://spring- json.sourceforge.net/ [ URL_http://spring-json.sourceforge.net/ ] ) (org.springframework.web.servlet.view.json.JsonView) but whenever I write a controller class that extends CODETERM1 I get the following Error: java.lang.IllegalStateException: ApplicationObjectSupport instance [org.springframework.web.servlet.view.json.JsonView] does not run in an ApplicationContext The weird thing is, that when I implement the Controller interface directly and do not inherit, _it is fine_.
    • Explore all reviews
  227. ph.samson
    • Your post helps me a lot and finally I landed it in getting success.
    • Do you need to serve up the resource as a _real_ text/plain to any clients or can you live with telling lies for good reasons?
    • There are pretty much easy to understand tutorials.
    • Both of these libraries solve several problems, so that you do not have to deal with low level implementation.
    • The best library json I've ever found is URL_http://software.dzhuvinov.com /json-rpc-2.0-base.html [that] For making requests you will need URL_http://software.dzhuvinov.com/json- rpc-2.0-base.html [base] part of library.
    • so I need to force my application to respond with _text/plain_ in the header but still projecting my classes to _json_ output.
    • Explore all reviews
  228. google-threadlocal
    • Try using another one by setting the correct JVM OPTS: CODESNIPPET_JAVA4 .
    • As a second guess you may also have a HashTable memory leak that can be caused even in Java when not cleaning up a HashTable of Java objects correctly (somewhere in the web-apps server code).
    • well, but its still just a "guess".
    • So, in my case i solved the problem by designing the database connection in a per thread basis using ThreadLocal generic.
    • Yes, very good detective work.
    • If that problem applies to you an you add a similar fix to the one i mentioned, your problems will dissapear.
    • Explore all reviews
  229. ch.qos.logback
    • I'm pretty sure Logback itself doesn't have anything like that, so you'd want to look at wherever you got the Appender from instead if that's your problem.
    • I found a somewhat hacky soluation and added something that should resemble an SSCCE!.
    • It's works now!
    • Logback doesn't do anything unusual with JSON.
    • I want to log to JSON in such a way that my message is not encoded again but printed raw into the logfile: At the moment it looks like this: CODESNIPPET_JAVA1 .
    • Java: How to log raw JSON as JSON and avoid escaping during logging with logback / slf4j.
    • Explore all reviews
  230. json-p
    • If so can get a 200 but if not CORS enabled or setup for jsonp will not trigger success.
    • Hi Aymen, if you have a solution that is significantly different than what others provided, it's definitely okay to answer your own question, but you should show code and describe in detail what the solution was so that when other users with the same problem find this question from a google search, they'll actually find an answer that helps them solve their problem too.
    • Edit 1 @Vik Gamov, By interoperability, I mean a way to inject javascript / JSON objects into the script at runtime.
    • Could you elaborate what type of interoperability are you talking about?Currently, API of JSON-P is very low level.
    • I have checked it with Google Chrome's debugger and I do!
    • I am using CODETERM1 but I always get failures (timeouts) since this is a JSON no JSONP.
    • Explore all reviews
  231. org.hibernate
    • That Really Cool, but i already have my ready thin client in java SE, i need to move the logic & SQL statement to server side, so the client just have the GUI.
    • It's very strage: I previously set this parameter but I got an "out of memory" error.
    • Means its perfect now when the hibernate executes the query for Project insertion as insert into primavera.project (endDate, projectDesc, projectName, projectTitle, startDate) values (?, ?, ?, ?, ?)
    • Hibernate can spend a lot of time doing dirty checking on flush if your session is huge.
    • I used Collection instead, see my answer but it is nice to know that it is not possible.
    • I have learned that PostgreSQL has a URL_http://www.postgresql.org/docs/9.2/static/datatype-json.html [JSON] data type, so I want to use this datatype instead of string (varchar).
    • Explore all reviews
  232. javax.servlet
    • Bummer that this can't be handled on the client side, the correct way.
    • The exotic versions of java.io and javax.servlet packages that I use include few methods that make data just pop into memory as Strings, and this forces me to work with streams.
    • The server code is a java servlet, and I believe the easiest way is to use a regex to find the field that potentially could have this issue and replace any quotes inside of it.
    • If there isn't one, how can this problem be solved another way?
    • I generate JSON from a java Servlet, from MySQL, like this ... Prueba.java (Servlet)** CODESNIPPET_JAVA1 .
    • I have struggled to create a regex to find quotes meeting the above requirements.
    • Explore all reviews
  233. commons-lang
    • I was trying to use: commons-lang3-3.1.jar, i switch to commons-lang-2.6.jar and it now works fine.
    • That's a build error preventing the display of your real exception: it says it can't load the class NestableRuntimeException from Apache commons lang.
    • Thank you works fantastically :).
    • That's a build error preventing the display of your real exception: it says it can't load the class NestableRuntimeException from Apache commons lang.
    • Thanks to all, easier than I thought.
    • Unfortunately, there is no escapeJavaScript in StringEscapeUtils, is it the same as escapeECMAScript?
    • Explore all reviews
  234. java.lang
    • No, if you run the program in the debugger and set breakpoints in the java.lang.Integer constructors with int and String there is no hit of the String constructor, only on the int one!.
    • Exception in thread "main" java.lang.ClassCastException: java.lang.Object cannot be cast to heroes.model.Creature at heroes.model.Creature.main(Creature.java:131).
    • Value org.apache.http.message.BasicHttpResponse@4636f428 of type java.lang.String cannot be converted to JSONArray.
    • as you say I made changes, but now i got this exception.. org.json.JSONException: Value !DOCTYPE of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.
    • No problem, glad it worked for you!
    • I think this is a bug with the JSON SerDe I'm using but I'm not sure.
    • Explore all reviews
  235. jinahya
    • I've fixed the factory method for others to see, I hope you don't mind.
    • You can see full mavenized project at URL_http://code.google.com/p/jinahya/sou rce/browse/trunk/com.googlecode.jinahya/stackoverflow/ [ URL_http://code.google.com /p/jinahya/source/browse/trunk/com.googlecode.jinahya/stackoverflow/] JAXB doesn't need the setter if you control to use fields not properties.
    • Explore all reviews
  236. jsonmarshaller
    • If GSON does not fit your needs, I recommend URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] .
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  237. servletapi
    • So the above still works, but you can also (and probably should) do this: CODESNIPPET_JAVA2 .
    • But I got to admit it too : IT'S WEIRD.
    • Explore all reviews
  238. freemarker
    • This is actually what we did, but we put some extra functionality in it which we had use for:<#macro hazStringContent content> <#if content?has_content && content != "">"${content?js_string?replace("\\'", "\'")?replace("\\>",">")}"<#else>null.
    • I am trying to pass a JSON string from my server to the client and I want to manipulate it with Freemarker.
    • Use a URL_http://freemarker.sourceforge.net/docs/ref_directive_macro.html [FreeMarker-macro] to combine all of the answers above, while making the template more readable and maintainable: CODESNIPPET_JAVA1 .
    • EDIT2: In case a single-quote pops up, CODETERM5 will escape it which again leads to invalid JSON.
    • Explore all reviews
  239. javax.crypto
    • Don't bother creating your own "security encryption", just use one of the built in cryptography APIs such as javax.crypto.Cipher.
    • Not only is that a bad idea, but it is also a bad idea to use regexes to modify JSON.
    • Explore all reviews
  240. net.sf.sojo
    • URL_http://sojo.sourceforge.net/guide/user/object-interchange.html [SOJO] works serialization of Java structures pretty well.
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  241. spring-mvc-ajax
    • The only view resolver I have is the following: CODESNIPPET_JAVA3 .
    • I'm not sure, the path of my form submission; and there obviously is no JSP view for it, I'm expecting JSON to be returned actually, but for some reason this isn't working, it's just trying to forward me to some JSP, so I'm guessing that I need to specify how to handle this in my XML... but I've seen about 1000 different ways that people return JSON, and all of them are very confusing to me, I'm just looking for the simplest way, so I can take it from there edit: I added an answer which is a good start, but it allows you to type ".json" after any URL and it will do some really bad things if as the controller I'm not expecting it, so I need to somehow have this view resolver only apply to secured URLs .
    • Explore all reviews
  242. com.foursquare
    • Avoid the use of "good" and "best" in titles if possible.
    • URL_https://github.com/foursquare/foursquare-fhttp [Another-library] I found has the opposite problem - it has no way of doing basicauth and it does not serialize JSONs back into objects for you.
    • Explore all reviews
  243. jsf-component
    • All you basically need to do is to hook on specific requests (ajaxical requests usually have a CODETERM3 header) and have a reference to the associated JSF component tree in the session so that you can do the works on it.
    • Since you're already asking a trivial question like this, I think it's going to be a very long journey.
    • Explore all reviews
  244. woodstox
    • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping.
    • There was mention of this behavior as a bug on a woodstox mailing list somewhere.
    • Explore all reviews
  245. hsqldb
    • If you don't want a full-featured database, use something like HSQLDB or JavaDB.
    • Those changes will allow Maven to find the latest URL_http://in.relation.to/Bloggers/Hibernate361FinalRelease [Hibernate] and URL_http://www.springsource.org/documentation [Spring] libraries which are not always present in the default Maven repositories and also other libraries like the URL_http://hsqldb.org/ [HSQLDB] - an in-memory database used to test this example and JSON Java conversion.
    • Explore all reviews
  246. json-taglib
    • The object has two attributes, one named CODETERM11 with value CODETERM12 , the other named CODETERM13 with value CODETERM14 .
    • @user1727557 I personally use the [json-taglib]( URL_http://json - taglib.sourceforge.net/) which is a set of JSP tags for generating JSON.
    • Assuming you want to generate the JSON from one or more Java objects, the following is a fairly straightforward approach: Set the Java object(s) as attributes in request/session scope Convert the objects to JSON using a tag library such as URL_http://json-taglib.sourceforge.net/index.html [ URL_http://json-taglib.sourceforge.net/index.html ] .
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  247. org.gaelyk
    • (This would probably have to recurse through the response) I am looking for something easy that doesn't include a lot of libraries.
    • To use this in your Gaelyk app, you should just need to URL_http://sourceforge.net/projects/json-lib/files/ [download-json- lib-2.3-jdk15.jar-from-here] and do something similar (without the @Grab then, as you'll have the jar in your CODETERM2 folder.
    • Explore all reviews
  248. org.apache.ibatis
    • This is mapped to person table in mysql database.I am querying the database like: CODESNIPPET_JAVA3 .
    • I am not able to get any result from database.It does not select any row even though value exists.I have checked that none of other validation checks are failing.
    • But this is pretty bad approach and client would not like it.
    • Since I am more familiar with Jackson, here are some aspects where I think Jackson has more complete support than Gson (apologies if I miss a Gson feature): Extensive annotation support; including full inheritance, and advanced "mix-in" annotations (associate annotations with a class for cases where you can not directly add them) Streaming (incremental) reading, writing, for ultra-high performance (or memory-limited) use cases; can mix with data binding (bind sub-trees) -- EDIT latest versions of Gson also include streaming reader Tree model (DOM-like access); can convert between various models (tree <-> java object <-> stream) Can use any constructors (or static factory methods), not just default constructor Field and getter/setter access (earlier gson versions only used fields, this may have changed) Out-of-box JAX-RS support Interoperability: can also use JAXB annotations, has support/work-arounds for common packages (joda, ibatis, cglib), JVM languages (groovy, clojure, scala) Ability to force static (declared) type handling for output Support for deserializing polymorphic types (Jackson 1.5) -- can serialize AND deserialize things like List correctly (with additional type information) Integrated support for binary content (base64 to/from JSON Strings) .
    • Explore all reviews
  249. org.slf4j
    • I want to log to JSON in such a way that my message is not encoded again but printed raw into the logfile: At the moment it looks like this: CODESNIPPET_JAVA1 .
    • Java: How to log raw JSON as JSON and avoid escaping during logging with logback / slf4j.
    • Explore all reviews
  250. async-json-library
    • The closest I've found is this URL_http://code.google.com/p/async-json- library/ [async-json-library] which does _almost_ exactly what I'd like, except it cannot recover objects where actual strings or other data values are split between pieces.
    • I have been working on this app for on and off for three months and have yet to see any memory issues at all.
    • Explore all reviews
  251. org.skyscreamer
    • You say you are using Jersey/JAX-RS, so you URL_https://github.com/skyscreamer/yoga [Yoga] should be of particular interest.
    • Choose which fields you want to see at call-time Navigate entity relationships in a single call for complex views .
    • Explore all reviews
  252. open-esb
    • In my experience, the JSON parser for WSO2 ESB (based on Axis2-json) supports only a subset of JSON: 1.
    • well actually i modified the source for the message builder and it solved the problem atleast for now..
    • This is because JSON is mapped to XML-like datastructure, and XML must have a root, so the first key-value pair is considered as root.
    • If you don't wish to build or manipulate the message within the ESB, you can use message relay message builder/formatter for application/json in place of default axis2 builder/formatter pair.Have a look at [this]( URL_http://docs.wso2.org/display/ESB403/Message+Relay) .
    • This because the converter has to know which XML tag should be used for each value: e.g.
    • so does this mean as of now we dont have any other solution to this problem...?
    • Explore all reviews
  253. org.grails
    • I was really hoping that Grails would have something like this...
    • I haven't used STS a whole lot, but sounds like something's wrong there (a conclusion that you've already come to yourself).
    • On server side you could also use standard Grails JSON converter (but you could use Gson, if you prefer), see URL_http://grails.org/Converters+Reference [ URL_http://grails.org/Converters+Reference ] .
    • Grails - a better way to exclude class name from default json converters in groovy?
    • I have tried that one, Groovy:unable to resolve class grails.converters.JSON.
    • I have been writing custom marshallers in a grails project for the purposes of being able to exclude some fields from the json model such as the class names.
    • Explore all reviews
  254. dom4j
    • + Dom4j has SAX-like API but easier.
    • My votes are for URL_http://dom4j.sourceforge.net/ [dom4j] and URL_http://jackson.codehaus.org/Tutorial [jackson] - if you give your question more context we might be able to help more.
    • Explore all reviews
  255. pentaho
    • Any help will be appreciated.I have tried this code to serialize it, but it does not work.
    • It's very hard to find the source for MarshallableResultSet and the javadoc for it.
    • Explore all reviews
  256. com.android.tools.external.lombok
    • Is there any way to do it dynamically.
    • Sample syntax-check with URL_https://code.google.com/p/google-gson/ [Gson] (using URL_http://projectlombok.org/ [lombok] ): CODESNIPPET_JAVA1 .
    • Explore all reviews
  257. google-sitebricks
    • I need SSL support and I was using Sitebricks already for serving HTML pages and RESTful web services.
    • To minimize duplicate/similar code I would like to configure sitebricks to respond with a consistent Reply object every time the code executed in the REST endpoints throws an exception.
    • CODETERM2 which would do a GET request and deserialize the JSON response into a POJO of type CODETERM3 I did find a library that is pretty close to what I want called URL_http://sitebricks.org/#webclient [sitebricks] but it is severely limited in its scope e.g.
    • Instead of handling the exceptions and creating a custom JSON response in each endpoint I want that sitebricks itself catches the exception and returns something like: CODESNIPPET_JAVA1 .
    • What features are you looking for beyond that that make Jersey/Sitebricks more attractive to you?
    • Exception for Sitebricks: CODESNIPPET_JAVA1 .
    • Explore all reviews
  258. java.util.logging
    • Thanks, -Noah UPDATE - SOLVED Originally my client and client config were being created like so: CODESNIPPET_JAVA7 .
    • If you change the java.util.logging level up to CODETERM2 , you should see a number of extra messages that help diagnose such problems.
    • Explore all reviews
  259. eclipse-tools
    • The net effect is that rather than writing lots of little getJSONObject() calls, you invest in setting up corresponding classes, this should result in nicely structured code, where the processing of the data, that is the real business logic, is separated from the parsing code, which I view as "plumbing".
    • There do appear to be URL_http://sourceforge.net/projects/jaxb-builder/ [Eclipse-tools] that automate this manual drudgery.
    • Explore all reviews
  260. spring-hateoas
    • I've only used flexjson, but the other 2 have very good reps. For HATEOAS, there is spring-hateoas (on github) or Jersey.
    • You'll need to implement your custom Jackson Serializer ( URL_http://jackson.c odehaus.org/1.7.9/javadoc/org/codehaus/jackson/map/JsonSerializer.html [http:/ /jackson.codehaus.org/1.7.9/javadoc/org/codehaus/jackson/map/JsonSerializer.ht ml] ) Take a look at Spring Hateoas project.
    • Explore all reviews
  261. javax.naming
    • So working perfectly.
    • Since your setter method is named CODETERM1 Jackson assumes the variable is named mDReqID because of the Java naming conventions (variables should start with lower case letters).
    • Anyway I usually leave the types in the CODETERM4 objects as simple CODETERM5 and then in the class from where I retrieve the response, I do the correct formatting while creating my objects, for example, when you put the values in your CODETERM6 ... _Note 3_: The use of the annotation CODETERM7 is interesting to separate the name of a field in the JSON response and in your app, in order to follow Java naming conventions, which your attributes are not following... _Note 4_: You shouldn't use CODETERM8 attributes in your classes.
    • From a Java naming perspective that would be blasphemous, though.
    • Explore all reviews
  262. java.util
    • I got the json content as a result from a GET request using google custom search API.. just extra information in case it can help in some ways!
    • I'm sorry but it isn't working I'll get this as error: W/System.err(21478): com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token the file Map.java doesn't exits because it's raw data binding (thanks for the link).
    • It's working just fine.
    • But I can't understand why lost the ordering.
    • JSONObject is a java.util.Map and JSONArray is a java.util.List, so you can access them with standard operations of Map or List .
    • I executed it locally, but within my file is just the javascript piece you posted.
    • Explore all reviews
  263. jacson
    • yes you can use jacson to parse it but there is more easy way to do it its Jsonme lib "import org.json.me" you dont have to add jar file to use it CODESNIPPET_JAVA1 .
    • yes its more easy but if your project is complex i advice you to use jacson lib .
    • Explore all reviews
  264. parboiled
    • But writing parser-generators, even for a simple language like JSON, is a lot- of-work.
    • Parboiled has no such disadvantage!
    • Explore all reviews
  265. java.applet
    • Hi BalusC, This method seemed to work fine.....until I tried using it in a Java Applet and got hit with a reflectpermission.
    • I have the following json string that is returned to my java applet from another source that i need to interact with.
    • Explore all reviews
  266. myfaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • So put simply, doing json seems quite esoteric when using JSF (MyFaces).
    • Explore all reviews
  267. org.json4s
    • It makes the code much easier to understand.
    • You can use a CODETERM3 to make it a little cleaner as regards the generics.
    • Explore all reviews
  268. javax.xml.xpath
    • As many others have pointed out, Java doesn't ship a standard JSON-parsing library as part of the JDK, so if you want to use JDK-bundled tech with absolutely NO dependencies, you have 3 XML parsing choices: URL_http://docs.oracle.com/javase/7/docs/api/javax/xml/xpath/XPathFactory.html [XPathFactory] - XPath-based parsing.
    • This is probably the slowest and most memory intensive, BUT, one of the most convenient ways to query your data.
    • You wouldn't write a stock-trading app using this, but if you just need data from a big config file, it is very handy (although for configs, there are many other specific libs for that which are easier than rolling your own).
    • Reads the entire XML into an in-memory data structure you can query and traverse as needed.
    • Explore all reviews
  269. jbox2d
    • Would be more networking efficient but not as easy to write.
    • Each client has one body (player) that they can control but there can be collision therefore they will need to see everyone else's body to know why some of their movement is restricted.
    • Explore all reviews
  270. org.apache.ivy
    • URL_http://stackoverflow.com/questions/2134507/fast- lightweight-xml-parser [This-answer] provides a simple example of using URL_ht tp://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/parsers/DocumentBuilder.h tml [CODETERM1] to generate a DOM.
    • And with tools like URL_http://maven.apache.org/ [Maven] or URL_http://ant.apache.org/ivy/ [Ivy] to automatically calculate and download dependencies from your project definition, there's really no reason to fear using libraries.
    • Explore all reviews
  271. javajson
    • I've written web pages and servlets before so I'm familiar with GET and POST concepts and it seems the RESTful method of delivering web services will be easier to grasp.
    • You should try JavaJson from source forge... you can parse that this way: CODESNIPPET_JAVA1 .
    • Explore all reviews
  272. net.sf.ehcache
    • In next request to that cached page, filter looks for Ehcache, finds, but without elementx and UPDATES elements!
    • How to renew or invalidate cache using SimpleCachingPageFilter in Ehcache?
    • Explore all reviews
  273. org.jruby
    • The development team are experienced at Java, with some Python, but are smart and can quickly learn other technologies.
    • I have a Java HashMap that I have in JRuby, I am trying to convert it to JSON, but its not converting correctly, I think this example shows the problem: CODESNIPPET_JAVA1 .
    • Feel free to suggest the technology stack of your choice.
    • This is highly subjective and way too broad; You're asking something that a lot of companies are basing their whole business on and have evolved over a decade; mobile didn't happen with iPhone, it just got a lot more complex because of it.
    • Explore all reviews
  274. jena
    • As I've said in another answer, [don't process RDF/XML as XML]( URL_http://stackoverflow.com/a/17052385/1281433 )!
    • I have problems using subf,null,null: The method listStatements(Resource, Property, RDFNode) is ambiguous for the type Model.
    • An alternative using Jena and RDF/JSON I'd point out that Jena can serialize a model in RDF/JSON, and that might be an easier way for you to get JSON if that's what you need.
    • listStatements(subj, null, null) - the use of null acts as a wildcard (the Javadoc tells you this) - URL_http://jena.apache.org/documentation/javadoc/jena/co m/hp/hpl/jena/rdf/model/Model.html#listStatements(com.hp.hpl.jena.rdf.model.Re source,%20com.hp.hpl.jena.rdf.model.Property,%20com.hp.hpl.jena.rdf.model.RDFN ode).
    • What I want is to extract each article and convert it to RDF/JSON (I know how to write a model) using Apache Jena, so I can have a separate document for each article, and later import them all to a index like CouchDB or Elasticsearch to perform searches.
    • I think because there are two definitions of listStatements with 3 exact arguments each, one in Model and another in ModelCon.
    • Explore all reviews
  275. liferay
    • I am able to find the correct CODETERM3 , then the CODETERM4 under that CODETERM5 , but I cannot determine how to actually use that information in any other APIs.
    • Another option would be to use Tags in this as well, but the same problem arises.
    • But the following URL works for liferay.com site: URL_http://www.liferay.com/tunnel-web/jsonws .
    • It is a known fact that Liferay doesn't expose all local services to the JSON api.
    • Explore all reviews
  276. htmlunit
    • HtmlUnit doesn't support it.
    • If you want easier you could use URL_http://htmlunit.sourceforge.net/ [HtmlUnit] which imitates the behaviour of browsers so you could easily get the content (and parse it into Html, javascript and css, you could also execute javascript code on content so you could probably parse JSON files to using JSON.parse or any other equivalent functions) of any page on the web.
    • Explore all reviews
  277. com.liferay.portal
    • But the following URL works for liferay.com site: URL_http://www.liferay.com/tunnel-web/jsonws .
    • Another option would be to use Tags in this as well, but the same problem arises.
    • Explore all reviews
  278. org.boon
    • It compares Boon, Jackson, Smart JSON and GSON.
    • Apologies if I'm being a bother, I've looked around the API and there isn't any reference of LinkedHashMaps, so I don't know why it's popping up here.
    • Explore all reviews
  279. tomcat
    • Clean, simple, useful!
    • Since it's unclear which one you're using, here's just a Tomcat-targeted example: check the CODETERM7 and CODETERM8 attributes of the CODETERM9 element in CODETERM10 : URL_http://tomcat.apache.org/tomcat-6.0-doc/config/http.html [HTTP-connector- reference] .
    • Explore all reviews
  280. net.sf.json-lib
    • JSONObject json JSONSerializer.toJSON(myJsonString); will produce an erroe of Type mismatch the other one works.
    • java heap space error when using large xml file.
    • This is true, but POJO -> XML -> JSON would work with an additional library.
    • When I wanted to use JSONLib; I found out that the jar file that is available in URL_http://json-lib.sourceforge.net has some class dependencies and it needs to be used by some other jar files, that contain that classes.
    • JSONObject json JSONSerializer.toJSON(myJsonString); will produce an erroe of Type mismatch the other one works.
    • You can use the URL_http://json-lib.sourceforge.net/apidocs/jdk15/net/sf/json/ util/JSONUtils.html#mayBeJSON%28java.lang.String%29 [.mayBeJSON(String-str)] available in the URL_http://json- lib.sourceforge.net/apidocs/jdk15/net/sf/json/util/JSONUtils.html [JSONUtils] library for validating JSON in java or else A wild idea for validating JSON, try parsing it and catch the exception: CODESNIPPET_JAVA1 .
    • Explore all reviews
  281. org.apache.struts
    • By far, this is the best answer or suggested solution I found all around so far.
    • Basically in your struts xml you extend from json-default instead of struts-default, then you return a result type of json.
    • i have tried those parametes, and it seems that my JSON still trying to read the properties that missing !!
    • Oh, jeez sorry I remember solving something similar but didn't check the to see if it was the same OP.
    • I picked up "Struts2 in action" book, which is quite all right but enough when the need comes to quickly solve few isues.
    • You'd need to add a new forward for your action in Struts that directs to a JSP to generate the JSON instead of the standard JSP for your webpage.
    • Explore all reviews
  282. org.joda
    • Java's DateFormat and Joda Time's DateTimeFormatter are not the same, so it is pretty normal; doesn't the joda time plugin provide a way to specify a DateTimeFormatter?
    • Instead of complaining, have you actually tried to contact authors of module, offering your help?
    • Java's DateFormat and Joda Time's DateTimeFormatter are not the same, so it is pretty normal; doesn't the joda time plugin provide a way to specify a DateTimeFormatter?
    • when I add that I get the compile error "incompatible types: JodaModule cannot be converted to Module" - the method expects a org.codehaus.jackson.map.Module but JodaModule does not have this in its heirarchy so how could this work?
    • from my point of view, you should be able to configure JodaModule itself and then simply register it as usual, yeh, maybe it's a good thing to work on.
    • So there's a whole separate module devoted to handling Joda objects, but it does the serialization in the most simplistic manner possible, failing to retain crucial information... That's a shame.
    • Explore all reviews
  283. org.apache.accumulo
    • Move to storing the information in a JSON file that gets read in as a special class object which gets passed around to whoever needs to pull some info from it (small drawback is that as is each class creates table references from the table names as needed, where as using a JSON it may make some sense to go ahead and instantiate all table references so that classes can just ask for the reference, but then a few extra references will get created often when not needed.)
    • So I'm building various indexing and ingestion classes in Java for URL_http://accumulo.apache.org [Accumulo] But my problem is not directly related.
    • I've already got a stack of books including Design Patterns just to get my feet wet, but any general programming practice knowledge-bases I'll gladly take suggestions.
    • Go ahead as I am now, which seems bad since if I submit the tokens in the wrong order all kinds of nastiness may occur.
    • I tried to make this generalized so others can benefit but some more details may be needed, let me know.
    • Pass the properties object itself around and let each class handle instantiating its own string objects (could easily become a pain to maintain in the future if tokens are added or removed from the file).
    • Explore all reviews
  284. net.jangaroo
    • This would allow you to save effort of learning new language and API sdk - with the flexibility of consuming RESTful services via javascript framework where JSON support is native.
    • It's not that it's cumbersome, it's just new.
    • This is in my opinion - I am not aware of the context, you would be best judge in selecting the platform.
    • Java isn't new, but it's been a long time.
    • If you find dealing with Android development a bit cumbersome - and if you are comfortable with .NET MVC and ASP.NET, then you should look at frameworks like Sencha Touch - URL_http://www.sencha.com/products/touch/ [Snecha-Touch-URL] Sencha Touch is javascript framework that can be generated via your ASPX pages - the framework generates look and feel that is similar to native look of Android and iPhone.
    • Explore all reviews
  285. lucene
    • Since it is pure text data, you can process them with standard text search tools like URL_http://lucene.apache.org/core/ [Lucene] , and find your entry based on that.
    • but the problem is that the final client that need this solution that I have to sell to later, uses MySQLm.
    • I would recommend to use URL_http://stackoverflow.com/questions/2010663/lucene-with-php [Lucene] for this.
    • Removing one or the other also fixed my problem.
    • solved I used this PHP file to take care of everything, thanks for all the hints, they were very usufull, also I tried using lucene is faster especially for long n data bases, but unfortunately I cannot decide to move to a lucen DB CODESNIPPET_JAVA2 .
    • Explore all reviews
  286. jpachube
    • COSM's API documentation for what the xml request body should look like is as follows: CODESNIPPET_JAVA3 .
    • I'm using jpachube and am running into problems with .POST on creatDatastream.
    • Modified the createDatastream method using input from bjpirt (much thanks).
    • The only difference I found was the version , but I made that switch in the code already and got the same error.
    • day three it was pointed out that there was a problem with the xml (see below).
    • Explore all reviews
  287. log4j
    • I have a simple Hello World example that passes a Map to Camel and displays the values to the console via Log4J.
    • I had this problem when I had a Log4J logger as a class property, such as: CODESNIPPET_JAVA1 .
    • May be it would be nice to see what Log4j is saying.
    • I'm writing the back end of a web application, that uses REST APIs for extracting data that is used for reports in the client side.The framework I'm writing on uses Codehaus jackson for parsing the requests from JSON to data objects (data beans).I have a bunch of APIs of this sort, 10-15.each of them gets a different request object from the client side (though some inheritance do exist).what I want to do is add logging (using log4j) for each of these APIs so that when I enter each of the methods the request data object will be logged.the simple solution would be to implement a toString() method for each of these data objects, but I want to avoid going over all of these data objects and see if there's a solution similiar to the way that jackson parses the JSON into an object.I.e have the object converted back to its textual format in order to put it into the log.
    • No additional erros in log4j :( and I haev the same been configuration... Is there a working sample somewhere I can download and debug the differences?
    • Explore all reviews
  288. commons-collections
    • Thank you works fantastically :).
    • No, this one only contains the source files but not the actually needed .class files.
    • It seems like a lot of libs for just JSON parsing :S.
    • Correct me if I am wrong I have commons-collections-3.2-sources.jar in my class path.This is the correct lib for apache commons?
    • Apache's commons.collections library has a CollectionUtils class that provides easy-to-use methods for Collection manipulation/checking, such as intersection, difference, and union.
    • Explore all reviews
  289. javax.swing
    • I understand list models, but the way I have it setup the JList populates indirectly from the textfile I have created/saved.If I have a Listmodel, I don't see how my current method of reading from the textfile would still continue to work.
    • it doesn't return any true or false.
    • Most of Swing still doesn't know about Collections (only Vectors if that!
    • 1. read Oracle tutorial URL_http://docs.oracle.com/javase/tutorial/uiswing/components/list.html#creating [How-to-use-List---Creating-a-Model] for working code example 2. create CODETERM1 as local variable, then every changes will be made only in the model 3. there is bug, maybe feature, Swing GUI freeze for a few seconds, in the case that is removed more than 999 Items in one moment (already visible JList), can't found answer for this issue 4. all updates to the already visible Swing GUI must be done on EDT, more read in Oracle tutorial URL_http://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html [Concurency-in-Swing---Event-DIspatch-Thread] 5.
    • Clients can use serialization (over a different socket) to send back objects or pass them as parameters to RMI invocation, this should be personal preference Of course I don't know what exactly you want to do but both tools work great and can also be used orthogonally.
    • I'm a bit new to JSON, swing and stack overflow altogether.
    • Explore all reviews
  290. caliper
    • Since caliper also uses Gson, I can in fact use the caliper code for parsing the data all the way into specialized Java classes.
    • The reason is that I'm currently using URL_https://code.google.com/p/caliper/ [caliper] for some (micro-) benchmarks, and while the benchmark is _still running_ (or if I canceled it prematurely), the output file will not be a complete JSON document.
    • I also tried using CODETERM4 , but it would still expect complete documents, and not return a meaningful result at each CODETERM5 .
    • (I don't like the Caliper web interface, because it is slow, does not scale to large experiment sets, and a lot of data fails to submit and is then missing from the run.)
    • Right now, I'm using a nasty hack, that uses the known indentation that caliper currently produces to split the result document at CODETERM3 into chunks, then parse only these until the last one fails.
    • But that is a nasty hack, and not robust towards future changes of caliper output.
    • Explore all reviews
  291. spring
    • It also integrates nicely with Spring if you need that.
    • Hmm, I'm not sure, it looks like it expects to be deployed in a war file, and I would rather avoid a heavyweight servlet container and all of that infrastructure, the API is just a small part of my project, I don't want to stuff the entire thing in a war just so I can support the API :-/.
    • I would advise against Spring MVC for REST because it is not JAX-RS compliant.
    • Explore all reviews
  292. proguard
    • The funny thing is that -overloadaggressively is one of the recommended options in various Proguard examples for setting up GSON.
    • That avoids any name clashes as well.
    • There's probably also a Proguard setting to avoid duplicate names, but I'm not familiar enough to say what it is.
    • Upon starting up my app logs two errors, but only after obfuscation.
    • Unless I'm being misled, the errors are like: class Property declares multiple JSON fields named a and same for class PropertyDefinition.
    • One thing to watch out for: After exporting my app and testing I ran into problems due to Proguard and GSON.
    • Explore all reviews
  293. com.sugarcrm
    • To clarify, this is most likely only useful for SugarCRM 6.5 and earlier.
    • Modified the org.json one, only changing HashMap to LinkedHashMap in the JSONObject.If anybody else stumbles over the same problem, here is the jar and when they fix it in SugarCRM you can just change back to the real org.json library.
    • URL_http://www.sugarcrm.com/support/bugs.html?caseID=34925#issue_34925 [ URL_http://www.sugarcrm.com/support/bugs.html?caseID=34925 issue_34925] For example this does not work: CODESNIPPET_JAVA1 .
    • Ordered JSON library due to SugarCRM bug.
    • This is horrible, but I need a library for java that maintains the order within JSON-objects.
    • So is there any weirdly implemented JSON library out there that does this?
    • Explore all reviews
  294. lombok
    • Is there any way to do it dynamically.
    • Sample syntax-check with URL_https://code.google.com/p/google-gson/ [Gson] (using URL_http://projectlombok.org/ [lombok] ): CODESNIPPET_JAVA1 .
    • Another possibility is to use URL_http://code.google.com/p/google-gson/ [Gson] (Note, I use lombok here to generates getters/setters, toString, etc): CODESNIPPET_JAVA1 .
    • Explore all reviews
  295. org.apache.pdfbox
    • We're using HTTPS for the REST calls, the reason we're encrypting the data is because most of the messages are also spending time in an Amazon Web Services Simple Queueing Service queue, which only accepts strings.
    • Apache pdfbox, but I'm a bit leery to use the encoding - it seems like hardly anybody is using or implementing it, which might just mean that Base64 has more inertia, or which may instead mean that there's some wonky problem with Ascii85.
    • Are there any problems with Ascii85 that mean that I should use Base64 instead?
    • Explore all reviews
  296. jsonassert
    • Whil this solution works for the order of data items within the JSON, it will fail if the order of elements within arrays does not match.
    • So you'd have something like this: JSONAssert.assertEquals(expected, data, JSONCompareMode.NON_EXTENSIBLE); The NON_EXTENSIBLE mode means that any new or missing fields cause failures, but the order doesn't.
    • You could try using json-lib's URL_http://json- lib.sourceforge.net/apidocs/jdk15/net/sf/json/test/JSONAssert.html [JSONAssert] class: CODESNIPPET_JAVA1 .
    • Explore all reviews
  297. org.postgis
    • I thought that adding the _@XmlAccessorType(XmlAccessType.FIELD)_ tag was enough to recognize only the attributes from the class as fields in the json file, but it seems that this does not work for inherited attributes.
    • Also subclassing Point did not bring the answer as the problem lies in the used interface of CoordinateSequence.
    • In addition, I would need Geometry to have a no-arg default constructor...
    • Explore all reviews
  298. pdfbox
    • We're using HTTPS for the REST calls, the reason we're encrypting the data is because most of the messages are also spending time in an Amazon Web Services Simple Queueing Service queue, which only accepts strings.
    • Apache pdfbox, but I'm a bit leery to use the encoding - it seems like hardly anybody is using or implementing it, which might just mean that Base64 has more inertia, or which may instead mean that there's some wonky problem with Ascii85.
    • Are there any problems with Ascii85 that mean that I should use Base64 instead?
    • Explore all reviews
  299. xml-infoset
    • Well, that's it.
    • That means I want proper integers, booleans and nulls and I don't want extra object wrappers or something that tries to capture the entire XML Infoset.
    • I've been saying "MUST" a lot, I realize now :) The library needn't actually provide that, but there must be a way to add the functionality in a clean fashion (= not in a way that would make rewriting everything easier).
    • Additionally, arrays must be serialized using nested elements so it's possible to differentiate between empty arrays and properties which aren't present in a given view: Undefined CODETERM15 property (not present in view): CODESNIPPET_JAVA1 .
    • It shouldn't touch the entities CODETERM17 and/or clear it's CODETERM18 , for example.
    • Deserialize XML and JSON and merge the data into existing entities** Now this is the difficult part.
    • Explore all reviews
  300. surefire
    • provided**This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime.
    • From URL_http://maven.apache.org/guides/introduction /introduction-to-dependency-mechanism.html#Dependency_Scope [ URL_http://maven.apache.org/guides/introduction/introduction-to-dependency - mechanism.html#Dependency_Scope] : compile**This is the default scope, used if none is specified.
    • Furthermore, those dependencies are propagated to dependent projects.
    • Explore all reviews
  301. redmine
    • Use something like [this json validator]( URL_http://jsonlint.com /) to validate your json.
    • I get a CODETERM1 but I'm not sure if it's from failing to get the JSON or modelling it wrong.
    • If it's as simple as the JSON being fetched incorrectly I'll be really annoyed at myself.
    • Explore all reviews
  302. mockito
    • I was thinking of maybe this method should be broken apart to two methods, but I can't see any clean and good solution because this method will be used as an access point from other components in the system, therefore one method should accomplish one thing.
    • Please add some more code so we can understand exact mocking objects.
    • I hope I can get something better, I don't like these argument captors and generally too much code is needed to simply describe this case and there will be many types of the requests.
    • Please add some more code so we can understand exact mocking objects.
    • External dependencies (e.g., JUnit, Mockito, Easy Mock, JayWay, etc.)
    • So basically I would like to build up my unit test for this something like: Mock the CODETERM2 (somehow) to correctly generate JSON results based on the requests.Correct me if I'm wrong but I could marshal back the JSON result if I build up the mocked object hierarchy.My problem here is that I need to create the hierarchy for every single request, but I guess I cannot do anything fancier here.I should assert that the CODETERM3 method invoked with the expected device ID.
    • Explore all reviews
  303. org.springframework.data
    • I wish there was an easy answer to producing XML in Spring Data REST, but I haven't found one yet.
    • The annotation @RestResource(exported false) is not working for a property in an Entity class.
    • This all goes a bit against REST (basically) to do the lookup on the serverside as you should be sending everything needed with the request (Representational State Transfer and Hypermedia as Transfer Engine of All State).
    • There are a couple of problems with XML that we haven't found reasonable answers for: How do I represent an object in XML?
    • Explore all reviews
  304. java.sql
    • Hope this helps URL_https://forums.oracle.com/forums/thread.jspa?threadID=83378 [ URL_https://forums.oracle.com/forums/thread.jspa?threadID=83378 ] Solution is to use java.sql.Time instead of java.sql.Date .
    • I found a very stupid mistake in my app.Instead _java.util.Date_ I used _java.sql.Date_ in my Model class :( Thats why Date field always was null.
    • 1: So to use less memory we must: use server side cursor behind the scene use resultset open as URL_http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html#CONCUR_READ_ONLY [read-only] and, of course, URL_http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html#TYPE_FORWARD_ONLY [forward-only] ; avoid to load all the cursor in a list (or a CODETERM1 ) but write each row directly on an _output line_, where for output line I mean an output stream or a writer or also a json generator that wraps an output stream or a writer.
    • 4: I used arrays to cache thinks and to avoid to call getters each iteration.
    • Explore all reviews
  305. protobuf-java-format
    • Other things you can do is call class in each and get the classloader and fool around with getting the classloaders parents as well to see what the classloader heirarchy looks like.
    • simplify the problem then...take out protobuf-java-format and instead add code like Exception e new InvalidProtocolBufferException() to see if that works first.
    • Another very useful method to play around with when debugging is XXXXX.class.getProtectionDomain().getCodeSource().getLocation() replace XXXXX with a class that exists in protobuf like that Exception class that your class is having no problem loading and protobuf-java-format is having a problem loading and also any class from protobuf-java-format.
    • I have been able to get it to work in dev mode if I put the source code for protobuf-java-format in my app folder.
    • NoClassDefFoundError is thrown when I try to use any static method from protobuf-java-format library.
    • Explore all reviews
  306. java.net
    • If you set the content type of the send to application/x-www-form-urlencoded the REST package will automatically decode it for you.
    • A socket must be used for HTTP and the operation must block in that construct -- taking 200ms to resolve an address and open a connection might not mean a failure.
    • If you can cite sources, so much the better.
    • I want to make sure this doesn't hang if the page at "addr" fails for any reason.
    • Gson provides default serialization and deserialization for Enums, Map, java.net.URL, java.net.URI, java.util.Locale, java.util.Date, java.math.BigDecimal, and java.math.BigInteger classes.
    • Explore all reviews
  307. javassist
    • Please, suggest, how to do it right way.
    • Right Javassist should do mostly what you need, but the declarations need to be on separate lines (if going by declaration, otherwise your code could determine order by getter/setter if that proves to be ambiguous.
    • The first idea is to write several serializers/deserializers and a factory, that would mark the problem fields with required serializer/deserializer annotations using, say, the javassist library, but it seems that it is an overhead.
    • You need to use it _first_, and include the generated code in your project.Another option could be dynamically generate the class using javassist or CGLib, but that class would be useless unless you use reflection to access its members, so even if it _would_ be a class, it will _behave_ like a really annoying Map.
    • It's not so bad I guess, but it makes some of my classes a little bloated with annotations all over the place.
    • This would prevent it from trying to handle the Javassist stuff (and failing).
    • Explore all reviews
  308. spring-data-rest
    • I wish there was an easy answer to producing XML in Spring Data REST, but I haven't found one yet.
    • I'm trying to avoid showing a couple fields in the content of the JSON response using spring-data-rest.
    • The annotation @RestResource(exported false) is not working for a property in an Entity class.
    • The annotation is not working.
    • This all goes a bit against REST (basically) to do the lookup on the serverside as you should be sending everything needed with the request (Representational State Transfer and Hypermedia as Transfer Engine of All State).
    • There are a couple of problems with XML that we haven't found reasonable answers for: How do I represent an object in XML?
    • Explore all reviews
  309. com.rabbitmq
  310. kxml
    • Yes, JSON does have a toXML and you can make JSON.XMLtoJSON, but i need to add extra bits, and change a few bits around to satisfy the dojo requirements.As the quick bursts will be very strict in format, and typically be 3/4 lines line (50 at the most a (a recurring set of 3/4 line elements) holding in memory will not be too much of an issue..Thanks again for the comments so far..
    • From my own experience with kXML 2: I used it to parse XML files larger than 1 GB - Wikipedia dumps and I was very happy with performance / memory consumption etc.
    • @PSpeed: IMHO SAX is not ideal, because event driven approach of SAX is harder to understand and use than pull parsing approach (of kXML parser or similar).
    • Explore all reviews
  311. saxon
    • URL_http://saxon.sourceforge.net/ [Saxon] does, so perhaps you could try it instead?
    • Explore all reviews
  312. org.springframework.retry
    • Those changes will allow Maven to find the latest URL_http://in.relation.to/Bloggers/Hibernate361FinalRelease [Hibernate] and URL_http://www.springsource.org/documentation [Spring] libraries which are not always present in the default Maven repositories and also other libraries like the URL_http://hsqldb.org/ [HSQLDB] - an in-memory database used to test this example and JSON Java conversion.
    • Explore all reviews
  313. apache-configuration
    • URL_http://commons.apache.org/proper/commons-configuration//index.html [Commons-Configuration] has several features which could help you organize Configuration data independent from source (properties file, XML file, database, ...) Hierarchical properties Declaring and creating beans .
    • Explore all reviews
  314. tapestry
    • The actually tapestry component passes the json object into the datatable as an argument, but the problem is the function is being passed in as a string rather than an executable function.
    • Evaluating random strings as Javascript code is probably a bad idea.
    • Both JSONObject and JSONArray take a String as constructor argument, and the api is fully documented in those links.
    • Explore all reviews
  315. cglib
    • It's a pity that I could not achieve the same result in a simpler way, maybe some CGlib magic could do it.
    • Maybe you can use cglib with bytecode manipulations in runtime to avoid creating proxies.
    • You need to use it _first_, and include the generated code in your project.Another option could be dynamically generate the class using javassist or CGLib, but that class would be useless unless you use reflection to access its members, so even if it _would_ be a class, it will _behave_ like a really annoying Map.
    • Explore all reviews
  316. retroweaver
    • An alternative is to use Retroweaver to make the jar compatible with Java 1.4: URL_http://retroweaver.sourceforge.net [ URL_http://retroweaver.sourceforge.net ] .
    • Explore all reviews
  317. spring-security-oauth
    • My personal choice would be: Either of the following:** Spring WebServices (XML) Spring MVC (JSON) Secured with:** Spring Security OAuth provider - (AFAIK, a little complicated compared to Google's provider, but lots of tutorials on integrating with the above two).
    • Explore all reviews
  318. apache-commons-collections
    • No, this one only contains the source files but not the actually needed .class files.
    • Correct me if I am wrong I have commons-collections-3.2-sources.jar in my class path.This is the correct lib for apache commons?
    • Explore all reviews
  319. org.apache.tapestry
    • Both JSONObject and JSONArray take a String as constructor argument, and the api is fully documented in those links.
    • Explore all reviews
  320. net.sourceforge.jexcelapi
    • Otherwise you are most likely to have to roll your own matches using URL_http://poi.apache.org/ [Apache-POI] or URL_http://jexcelapi.sourceforge.net/ [JExcel] .
    • Explore all reviews
  321. net.sourceforge.retroweaver
    • An alternative is to use Retroweaver to make the jar compatible with Java 1.4: URL_http://retroweaver.sourceforge.net [ URL_http://retroweaver.sourceforge.net ] .
    • Explore all reviews
  322. org.apache.pivot
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  323. anathema
    • I would contend that what is sought does not violate the RESTful/stateless nature of the resources.
    • Explore all reviews
  324. sjsxp
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • Explore all reviews
  325. jasperreports
    • If that is the case, why not just use a [JRResu ltSetDataSource]( URL_http://jasperreports.sourceforge.net/api/net/sf/jasperreports /engine/JRResultSetDataSource.html).
    • Explore all reviews
  326. xmlserializer
    • why would you want to override that check (and generate invalid xml)?
    • The XMLSerializer throws the exception while trying to create a XML tag in this name because $ is not allowed in XML tag names.
    • Explore all reviews
  327. net.sourceforge.htmlunit
    • If you want easier you could use URL_http://htmlunit.sourceforge.net/ [HtmlUnit] which imitates the behaviour of browsers so you could easily get the content (and parse it into Html, javascript and css, you could also execute javascript code on content so you could probably parse JSON files to using JSON.parse or any other equivalent functions) of any page on the web.
    • Explore all reviews
  328. spring-ide
    • While I added Spring IDE from eclipse marketplace, I still could not solve my problem.
    • Explore all reviews
  329. javax.activity
  330. org.apache.lucene
  331. org.codehaus.stomp
    • In particular, I can't just iterate through the entries and build an associative array because the array looks completely different if there is a string & int as opposed to two strings.
    • Is there a way to convince Stomp to unserialize it in a reasonable manner or is there some PHP incantation make accessing this array less painful?
    • Explore all reviews
  332. partext
    • Like say at branch Toyota, Gas, Compact the mileage would be avg(Camry, Corolla) the output is a little off, i am looking for something like this.
    • Explore all reviews
  333. net.sf.sprockets
    • If you would like to use a library to handle this parsing for you (or just review the source code to see how it's being done), you can check out [Sprockets]( URL_https://github.com/pushbit/sprockets ) (disclosure: I'm the developer).
    • Explore all reviews
  334. com.tunnelvisionlabs
    • With DMS you can define the JSON syntax, build ASTs, and then write source-to- source tranformatinos to map that to XML representing your schema.
    • Explore all reviews
  335. net.sourceforge.argo
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  336. org.apache.velocity
    • the backslash is for escaping actual references, not things that cause parse errors.
    • Explore all reviews
  337. com.octo.android.robospice
    • I know I could get the data in a different way but I want to still use my listener and be able to make CODETERM6 block that way.
    • Explore all reviews
  338. javax.servlet.http
    • Never mind, that was my own fault, actually.
    • It throws this exception: org.codehaus.jackson.map.JsonMappingException: Can not construct instance of javax.servlet.http.HttpServletRequest, problem: abstract types can only be instantiated with additional type information.
    • Explore all reviews
  339. jsonij
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  340. soapui
    • There is source code for a rest client on this page + some help, (it is for jira but should be usable for android as well) URL_http://www.j-tricks.com/1/post/2012/05/java-rest-client-for-jira-using - jersey.html.
    • Explore all reviews
  341. tomee
    • What we are going for in my company is an Apache TomEE server, using JAX-RS to expose our API as REST services.
    • Explore all reviews
  342. org.apache.poi
    • Otherwise you are most likely to have to roll your own matches using URL_http://poi.apache.org/ [Apache-POI] or URL_http://jexcelapi.sourceforge.net/ [JExcel] .
    • Explore all reviews
  343. com.google.inject
    • You can use Guice's URL_https://code.google.com/p/google-guice/wiki/AOP [AOP- goodness] to bind a method interceptor to catch and serialize exceptions to JSON... CODESNIPPET_JAVA1 .
    • Explore all reviews
  344. bark
    • I can just foresee problems if I (well, not me, I won't be doing the adding) add words a few months from now, and I don't remember already having similar words, or if I forget to update every individual word with the new synonyms.
    • Explore all reviews
  345. javax.xml.stream
    • URL_http://docs.oracle.com/javase/7/docs/api/javax/xml/stream/XMLStreamReader.html [XMLStreamReader] - Fastest parsing method and uses the lowest overhead.
    • Explore all reviews
  346. jjson
    • This is a sampling of the worst JSON-to/from-Java libraries, right?
    • From URL_http://www.json.org [ URL_http://www.json.org ] , under the Java section: URL_http://www.json.org/java/index.html [ URL_http://www.json.org/java/index.html ] URL_http://json-lib.sourceforge.net/ [ URL_http://json-lib.sourceforge.net/ ] URL_http://code.google.com/p/json-simple/ [ URL_http://code.google.com/p/json-simple/ ] URL_http://code.google.com/p/jjson/ [ URL_http://code.google.com/p/jjson/ ] Pick your poison .
    • Explore all reviews
  347. org.khronos
    • @tolgap and Mosquito: Don't catch Exception in general with Exception e. See here: URL_http://source.android.com/source/code-style.html .
    • Explore all reviews
  348. net.sf.jasperreports
    • If that is the case, why not just use a [JRResu ltSetDataSource]( URL_http://jasperreports.sourceforge.net/api/net/sf/jasperreports /engine/JRResultSetDataSource.html).
    • Explore all reviews
  349. net.sf.saxon
    • URL_http://saxon.sourceforge.net/ [Saxon] does, so perhaps you could try it instead?
    • This fails because the Saxon transformer we are using does not support a StAXSource.
    • Explore all reviews
  350. org.apache.wink
    • It looks as on the first time the wrong provider is chosen, the header explicitely states that JSON should be used as response.
    • The HTTP headers sent from client side also implicite state that JSON is expected: Accept text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8 Accept-Encoding gzip, deflate Accept-Language en,de;q=0.5 Content-Type application/json What is causing that problem and how to avoid it?
    • Explore all reviews
  351. com.blitline
    • However I m keep getting an error : IOException: Server returned HTTP response code: 500 for URL: URL_http://api.blitline.com/job [ URL_http://api.blitline.com/job ] In the following link there is an example code but doesnt work in my case.
    • Explore all reviews
  352. java.math
    • Gson provides default serialization and deserialization for Enums, Map, java.net.URL, java.net.URI, java.util.Locale, java.util.Date, java.math.BigDecimal, and java.math.BigInteger classes.
    • Explore all reviews
  353. de.odysseus.staxon
    • Tools that can be used for converting from/to XML/JSON (e.g., URL_http://beckchr.github.com/staxon/ [StaxON] , URL_http://json- lib.sourceforge.net/ [JSON-lib] , URL_http://jettison.codehaus.org [Jettison] , URL_http://xstream.codehaus.org/ [XStream] ) do not seem to do that but only conversion of a known structure.
    • Explore all reviews
  354. java.text
    • Edit:Sorry, just answered your first question, for the second question: Just use the result and place it into a URL_http://docs.oracle.com/javase/7/docs/api/java/util/Date.html [Date] using the URL_http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html [SimpleDateFormat] .
    • Explore all reviews
  355. org.apache.activemq
    • In particular, I can't just iterate through the entries and build an associative array because the array looks completely different if there is a string & int as opposed to two strings.
    • Explore all reviews
  356. com.google.caliper
    • The reason is that I'm currently using URL_https://code.google.com/p/caliper/ [caliper] for some (micro-) benchmarks, and while the benchmark is _still running_ (or if I canceled it prematurely), the output file will not be a complete JSON document.
    • Explore all reviews
  357. jarjar
    • GSON is also good, but unfortunately I noted you're doing Android development, HTC messed that one up for us, so if you do decide to use GSON URL_http://code.google.com/p/google-gson/issues/detail?id=255 [remember-to- jarjar] the library.
    • Explore all reviews
  358. javaee
    • To achieve what you want, you need to set the error code and write the response yourself, e.g.
    • Explore all reviews
  359. dotcms
    • bug) with the URL_http://dotcms.com/docs/latest/j avadocs/com/dotmarketing/util/json/JSONArray.html [API] you are using.
    • And CODETERM3 has an overloaded CODETERM4 method which takes a Collection and wraps it in a CODETERM5 (thus causing the problem).
    • Explore all reviews
  360. org.jboss.arquillian.config
    • As far as I can see in the URL_http://www.jboss.org /file-access/default/members/resteasy/freezone/docs/1.1.GA/userguide/html/Cont ent%5FMarshalling%5FProviders.html#Default%5FProviders%5Fand%5Fdefault%5FJAX- RS%5FContent%5FMarshalling [documentation] JAX-RS can automatically marshal and unmarshal application/json strings back to java classes.
    • Explore all reviews
  361. org.mybatis
    • Unwanted Json result using mybatis result with hashmap.
    • but, json result is looking confused column sort such as, CODESNIPPET_JAVA4 .
    • Explore all reviews
  362. gjson
    • I compare it against JSONObject and gjson, and found Jackson meet my need.
    • Explore all reviews
  363. org.springframework.build.aws
    • Getting this : cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:annotation-driven'.
    • Explore all reviews
  364. jsonmessage
    • JsonReader reader new JsonReader(new InputStreamReader(socket.getInputStream(), "UTF-8")) // it blocks at this call JsonMessage message gson.fromJson(reader,JsonMessage.class); How do I handle this disconnection in my Java application and still be able to read the JSON messages?
    • Explore all reviews
  365. org.hsqldb
    • Those changes will allow Maven to find the latest URL_http://in.relation.to/Bloggers/Hibernate361FinalRelease [Hibernate] and URL_http://www.springsource.org/documentation [Spring] libraries which are not always present in the default Maven repositories and also other libraries like the URL_http://hsqldb.org/ [HSQLDB] - an in-memory database used to test this example and JSON Java conversion.
    • Explore all reviews
  366. java.util.zip
  367. commons-configuration
    • URL_http://commons.apache.org/proper/commons-configuration//index.html [Commons-Configuration] has several features which could help you organize Configuration data independent from source (properties file, XML file, database, ...) Hierarchical properties Declaring and creating beans .
    • Most of our code is Java at the moment, so we've been looking at URL_http://commons.apache.org/configuration/ [Apache-Commons-Config] , but we've found it to be quite verbose.
    • I also feel as though I'm being pushed towards XML as a format, but my clients and colleagues are apprehensive about trying something else.
    • Explore all reviews
  368. jontools
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  369. com.twilio
    • I have included a JSON dependency from this URL_http://www.java2s.com/Code/Jar/j/Downloadjsonjar.htm [json] and this file URL_http://www.java2s.com/Code/JarDownload/json/json.jar.zip [link] but I'm still getting an error.
    • Explore all reviews
  370. google-web-toolkit
    • We fixed it by running a proxy servlet to fake local locations for all of our external sites.
    • You have to use JsoSplittable explicitly, otherwise (using Splittable) GWT cannot know whether it's supposed to be a JsoSplittable or JsonSplittable; and JavaScriptObjects (like JsoSplittable; aka _overlay types_) are really special beasts: URL_http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes .
    • Explore all reviews
  1. gjson
    • I compare it against JSONObject and gjson, and found Jackson meet my need.
    • Explore all reviews
  2. jsonmessage
    • JsonReader reader new JsonReader(new InputStreamReader(socket.getInputStream(), "UTF-8")) // it blocks at this call JsonMessage message gson.fromJson(reader,JsonMessage.class); How do I handle this disconnection in my Java application and still be able to read the JSON messages?
    • Explore all reviews
  3. org.springframework.retry
    • Those changes will allow Maven to find the latest URL_http://in.relation.to/Bloggers/Hibernate361FinalRelease [Hibernate] and URL_http://www.springsource.org/documentation [Spring] libraries which are not always present in the default Maven repositories and also other libraries like the URL_http://hsqldb.org/ [HSQLDB] - an in-memory database used to test this example and JSON Java conversion.
    • Explore all reviews
  4. javax.servlet.http
    • Never mind, that was my own fault, actually.
    • It throws this exception: org.codehaus.jackson.map.JsonMappingException: Can not construct instance of javax.servlet.http.HttpServletRequest, problem: abstract types can only be instantiated with additional type information.
    • Explore all reviews
  5. jsonij
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  6. soapui
    • There is source code for a rest client on this page + some help, (it is for jira but should be usable for android as well) URL_http://www.j-tricks.com/1/post/2012/05/java-rest-client-for-jira-using - jersey.html.
    • Explore all reviews
  7. org.apache.pivot
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  8. bark
    • I can just foresee problems if I (well, not me, I won't be doing the adding) add words a few months from now, and I don't remember already having similar words, or if I forget to update every individual word with the new synonyms.
    • Explore all reviews
  9. net.sourceforge.jexcelapi
    • Otherwise you are most likely to have to roll your own matches using URL_http://poi.apache.org/ [Apache-POI] or URL_http://jexcelapi.sourceforge.net/ [JExcel] .
    • Explore all reviews
  10. javax.xml.stream
    • URL_http://docs.oracle.com/javase/7/docs/api/javax/xml/stream/XMLStreamReader.html [XMLStreamReader] - Fastest parsing method and uses the lowest overhead.
    • Explore all reviews
  11. jjson
    • This is a sampling of the worst JSON-to/from-Java libraries, right?
    • From URL_http://www.json.org [ URL_http://www.json.org ] , under the Java section: URL_http://www.json.org/java/index.html [ URL_http://www.json.org/java/index.html ] URL_http://json-lib.sourceforge.net/ [ URL_http://json-lib.sourceforge.net/ ] URL_http://code.google.com/p/json-simple/ [ URL_http://code.google.com/p/json-simple/ ] URL_http://code.google.com/p/jjson/ [ URL_http://code.google.com/p/jjson/ ] Pick your poison .
    • Explore all reviews
  12. apache-commons-collections
    • No, this one only contains the source files but not the actually needed .class files.
    • Correct me if I am wrong I have commons-collections-3.2-sources.jar in my class path.This is the correct lib for apache commons?
    • Explore all reviews
  13. org.khronos
    • @tolgap and Mosquito: Don't catch Exception in general with Exception e. See here: URL_http://source.android.com/source/code-style.html .
    • Explore all reviews
  14. spring-security-oauth
    • My personal choice would be: Either of the following:** Spring WebServices (XML) Spring MVC (JSON) Secured with:** Spring Security OAuth provider - (AFAIK, a little complicated compared to Google's provider, but lots of tutorials on integrating with the above two).
    • Explore all reviews
  15. cglib
    • It's a pity that I could not achieve the same result in a simpler way, maybe some CGlib magic could do it.
    • Maybe you can use cglib with bytecode manipulations in runtime to avoid creating proxies.
    • You need to use it _first_, and include the generated code in your project.Another option could be dynamically generate the class using javassist or CGLib, but that class would be useless unless you use reflection to access its members, so even if it _would_ be a class, it will _behave_ like a really annoying Map.
    • Explore all reviews
  16. tapestry
    • The actually tapestry component passes the json object into the datatable as an argument, but the problem is the function is being passed in as a string rather than an executable function.
    • Evaluating random strings as Javascript code is probably a bad idea.
    • Both JSONObject and JSONArray take a String as constructor argument, and the api is fully documented in those links.
    • Explore all reviews
  17. apache-configuration
    • URL_http://commons.apache.org/proper/commons-configuration//index.html [Commons-Configuration] has several features which could help you organize Configuration data independent from source (properties file, XML file, database, ...) Hierarchical properties Declaring and creating beans .
    • Explore all reviews
  18. net.sf.jasperreports
    • If that is the case, why not just use a [JRResu ltSetDataSource]( URL_http://jasperreports.sourceforge.net/api/net/sf/jasperreports /engine/JRResultSetDataSource.html).
    • Explore all reviews
  19. net.sf.saxon
    • URL_http://saxon.sourceforge.net/ [Saxon] does, so perhaps you could try it instead?
    • This fails because the Saxon transformer we are using does not support a StAXSource.
    • Explore all reviews
  20. org.apache.wink
    • It looks as on the first time the wrong provider is chosen, the header explicitely states that JSON should be used as response.
    • The HTTP headers sent from client side also implicite state that JSON is expected: Accept text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8 Accept-Encoding gzip, deflate Accept-Language en,de;q=0.5 Content-Type application/json What is causing that problem and how to avoid it?
    • Explore all reviews
  21. tomee
    • What we are going for in my company is an Apache TomEE server, using JAX-RS to expose our API as REST services.
    • Explore all reviews
  22. java.text
    • Edit:Sorry, just answered your first question, for the second question: Just use the result and place it into a URL_http://docs.oracle.com/javase/7/docs/api/java/util/Date.html [Date] using the URL_http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html [SimpleDateFormat] .
    • Explore all reviews
  23. org.apache.tapestry
    • Both JSONObject and JSONArray take a String as constructor argument, and the api is fully documented in those links.
    • Explore all reviews
  24. partext
    • Like say at branch Toyota, Gas, Compact the mileage would be avg(Camry, Corolla) the output is a little off, i am looking for something like this.
    • Explore all reviews
  25. org.apache.activemq
    • In particular, I can't just iterate through the entries and build an associative array because the array looks completely different if there is a string & int as opposed to two strings.
    • Explore all reviews
  26. jarjar
    • GSON is also good, but unfortunately I noted you're doing Android development, HTC messed that one up for us, so if you do decide to use GSON URL_http://code.google.com/p/google-gson/issues/detail?id=255 [remember-to- jarjar] the library.
    • Explore all reviews
  27. javaee
    • To achieve what you want, you need to set the error code and write the response yourself, e.g.
    • Explore all reviews
  28. de.odysseus.staxon
    • Tools that can be used for converting from/to XML/JSON (e.g., URL_http://beckchr.github.com/staxon/ [StaxON] , URL_http://json- lib.sourceforge.net/ [JSON-lib] , URL_http://jettison.codehaus.org [Jettison] , URL_http://xstream.codehaus.org/ [XStream] ) do not seem to do that but only conversion of a known structure.
    • Explore all reviews
  29. dotcms
    • bug) with the URL_http://dotcms.com/docs/latest/j avadocs/com/dotmarketing/util/json/JSONArray.html [API] you are using.
    • And CODETERM3 has an overloaded CODETERM4 method which takes a Collection and wraps it in a CODETERM5 (thus causing the problem).
    • Explore all reviews
  30. spring-ide
    • While I added Spring IDE from eclipse marketplace, I still could not solve my problem.
    • Explore all reviews
  31. org.mybatis
    • Unwanted Json result using mybatis result with hashmap.
    • but, json result is looking confused column sort such as, CODESNIPPET_JAVA4 .
    • Explore all reviews
  32. org.springframework.build.aws
    • Getting this : cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mvc:annotation-driven'.
    • Explore all reviews
  33. saxon
    • URL_http://saxon.sourceforge.net/ [Saxon] does, so perhaps you could try it instead?
    • Explore all reviews
  34. kxml
    • Yes, JSON does have a toXML and you can make JSON.XMLtoJSON, but i need to add extra bits, and change a few bits around to satisfy the dojo requirements.As the quick bursts will be very strict in format, and typically be 3/4 lines line (50 at the most a (a recurring set of 3/4 line elements) holding in memory will not be too much of an issue..Thanks again for the comments so far..
    • From my own experience with kXML 2: I used it to parse XML files larger than 1 GB - Wikipedia dumps and I was very happy with performance / memory consumption etc.
    • @PSpeed: IMHO SAX is not ideal, because event driven approach of SAX is harder to understand and use than pull parsing approach (of kXML parser or similar).
    • Explore all reviews
  35. org.hsqldb
    • Those changes will allow Maven to find the latest URL_http://in.relation.to/Bloggers/Hibernate361FinalRelease [Hibernate] and URL_http://www.springsource.org/documentation [Spring] libraries which are not always present in the default Maven repositories and also other libraries like the URL_http://hsqldb.org/ [HSQLDB] - an in-memory database used to test this example and JSON Java conversion.
    • Explore all reviews
  36. com.rabbitmq
  37. java.util.zip
  38. commons-configuration
    • URL_http://commons.apache.org/proper/commons-configuration//index.html [Commons-Configuration] has several features which could help you organize Configuration data independent from source (properties file, XML file, database, ...) Hierarchical properties Declaring and creating beans .
    • Most of our code is Java at the moment, so we've been looking at URL_http://commons.apache.org/configuration/ [Apache-Commons-Config] , but we've found it to be quite verbose.
    • I also feel as though I'm being pushed towards XML as a format, but my clients and colleagues are apprehensive about trying something else.
    • Explore all reviews
  39. com.twilio
    • I have included a JSON dependency from this URL_http://www.java2s.com/Code/Jar/j/Downloadjsonjar.htm [json] and this file URL_http://www.java2s.com/Code/JarDownload/json/json.jar.zip [link] but I'm still getting an error.
    • Explore all reviews
  40. jontools
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  41. com.google.caliper
    • The reason is that I'm currently using URL_https://code.google.com/p/caliper/ [caliper] for some (micro-) benchmarks, and while the benchmark is _still running_ (or if I canceled it prematurely), the output file will not be a complete JSON document.
    • Explore all reviews
  42. net.sourceforge.htmlunit
    • If you want easier you could use URL_http://htmlunit.sourceforge.net/ [HtmlUnit] which imitates the behaviour of browsers so you could easily get the content (and parse it into Html, javascript and css, you could also execute javascript code on content so you could probably parse JSON files to using JSON.parse or any other equivalent functions) of any page on the web.
    • Explore all reviews
  43. retroweaver
    • An alternative is to use Retroweaver to make the jar compatible with Java 1.4: URL_http://retroweaver.sourceforge.net [ URL_http://retroweaver.sourceforge.net ] .
    • Explore all reviews
  44. com.google.inject
    • You can use Guice's URL_https://code.google.com/p/google-guice/wiki/AOP [AOP- goodness] to bind a method interceptor to catch and serialize exceptions to JSON... CODESNIPPET_JAVA1 .
    • Explore all reviews
  45. google-web-toolkit
    • We fixed it by running a proxy servlet to fake local locations for all of our external sites.
    • You have to use JsoSplittable explicitly, otherwise (using Splittable) GWT cannot know whether it's supposed to be a JsoSplittable or JsonSplittable; and JavaScriptObjects (like JsoSplittable; aka _overlay types_) are really special beasts: URL_http://code.google.com/p/google-web-toolkit/wiki/OverlayTypes .
    • Explore all reviews
  46. com.tunnelvisionlabs
    • With DMS you can define the JSON syntax, build ASTs, and then write source-to- source tranformatinos to map that to XML representing your schema.
    • Explore all reviews
  47. org.jboss.arquillian.config
    • As far as I can see in the URL_http://www.jboss.org /file-access/default/members/resteasy/freezone/docs/1.1.GA/userguide/html/Cont ent%5FMarshalling%5FProviders.html#Default%5FProviders%5Fand%5Fdefault%5FJAX- RS%5FContent%5FMarshalling [documentation] JAX-RS can automatically marshal and unmarshal application/json strings back to java classes.
    • Explore all reviews
  48. org.codehaus.stomp
    • In particular, I can't just iterate through the entries and build an associative array because the array looks completely different if there is a string & int as opposed to two strings.
    • Is there a way to convince Stomp to unserialize it in a reasonable manner or is there some PHP incantation make accessing this array less painful?
    • Explore all reviews
  49. java.math
    • Gson provides default serialization and deserialization for Enums, Map, java.net.URL, java.net.URI, java.util.Locale, java.util.Date, java.math.BigDecimal, and java.math.BigInteger classes.
    • Explore all reviews
  50. com.blitline
    • However I m keep getting an error : IOException: Server returned HTTP response code: 500 for URL: URL_http://api.blitline.com/job [ URL_http://api.blitline.com/job ] In the following link there is an example code but doesnt work in my case.
    • Explore all reviews
  51. org.apache.lucene
  52. org.apache.velocity
    • the backslash is for escaping actual references, not things that cause parse errors.
    • Explore all reviews
  53. net.sf.sprockets
    • If you would like to use a library to handle this parsing for you (or just review the source code to see how it's being done), you can check out [Sprockets]( URL_https://github.com/pushbit/sprockets ) (disclosure: I'm the developer).
    • Explore all reviews
  54. javax.activity
  55. net.sourceforge.argo
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  56. org.apache.poi
    • Otherwise you are most likely to have to roll your own matches using URL_http://poi.apache.org/ [Apache-POI] or URL_http://jexcelapi.sourceforge.net/ [JExcel] .
    • Explore all reviews
  57. net.sourceforge.retroweaver
    • An alternative is to use Retroweaver to make the jar compatible with Java 1.4: URL_http://retroweaver.sourceforge.net [ URL_http://retroweaver.sourceforge.net ] .
    • Explore all reviews
  58. com.octo.android.robospice
    • I know I could get the data in a different way but I want to still use my listener and be able to make CODETERM6 block that way.
    • Explore all reviews
  59. xmlserializer
    • why would you want to override that check (and generate invalid xml)?
    • The XMLSerializer throws the exception while trying to create a XML tag in this name because $ is not allowed in XML tag names.
    • Explore all reviews
  60. jasperreports
    • If that is the case, why not just use a [JRResu ltSetDataSource]( URL_http://jasperreports.sourceforge.net/api/net/sf/jasperreports /engine/JRResultSetDataSource.html).
    • Explore all reviews
  61. sjsxp
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • Explore all reviews
  62. anathema
    • I would contend that what is sought does not violate the RESTful/stateless nature of the resources.
    • Explore all reviews
  63. spring-data-rest
    • I wish there was an easy answer to producing XML in Spring Data REST, but I haven't found one yet.
    • I'm trying to avoid showing a couple fields in the content of the JSON response using spring-data-rest.
    • The annotation @RestResource(exported false) is not working for a property in an Entity class.
    • The annotation is not working.
    • This all goes a bit against REST (basically) to do the lookup on the serverside as you should be sending everything needed with the request (Representational State Transfer and Hypermedia as Transfer Engine of All State).
    • There are a couple of problems with XML that we haven't found reasonable answers for: How do I represent an object in XML?
    • Explore all reviews
  64. javassist
    • Please, suggest, how to do it right way.
    • Right Javassist should do mostly what you need, but the declarations need to be on separate lines (if going by declaration, otherwise your code could determine order by getter/setter if that proves to be ambiguous.
    • The first idea is to write several serializers/deserializers and a factory, that would mark the problem fields with required serializer/deserializer annotations using, say, the javassist library, but it seems that it is an overhead.
    • You need to use it _first_, and include the generated code in your project.Another option could be dynamically generate the class using javassist or CGLib, but that class would be useless unless you use reflection to access its members, so even if it _would_ be a class, it will _behave_ like a really annoying Map.
    • It's not so bad I guess, but it makes some of my classes a little bloated with annotations all over the place.
    • This would prevent it from trying to handle the Javassist stuff (and failing).
    • Explore all reviews
  65. java.net
    • If you set the content type of the send to application/x-www-form-urlencoded the REST package will automatically decode it for you.
    • A socket must be used for HTTP and the operation must block in that construct -- taking 200ms to resolve an address and open a connection might not mean a failure.
    • If you can cite sources, so much the better.
    • I want to make sure this doesn't hang if the page at "addr" fails for any reason.
    • Gson provides default serialization and deserialization for Enums, Map, java.net.URL, java.net.URI, java.util.Locale, java.util.Date, java.math.BigDecimal, and java.math.BigInteger classes.
    • Explore all reviews
  66. protobuf-java-format
    • Other things you can do is call class in each and get the classloader and fool around with getting the classloaders parents as well to see what the classloader heirarchy looks like.
    • simplify the problem then...take out protobuf-java-format and instead add code like Exception e new InvalidProtocolBufferException() to see if that works first.
    • Another very useful method to play around with when debugging is XXXXX.class.getProtectionDomain().getCodeSource().getLocation() replace XXXXX with a class that exists in protobuf like that Exception class that your class is having no problem loading and protobuf-java-format is having a problem loading and also any class from protobuf-java-format.
    • I have been able to get it to work in dev mode if I put the source code for protobuf-java-format in my app folder.
    • NoClassDefFoundError is thrown when I try to use any static method from protobuf-java-format library.
    • Explore all reviews
  67. org.springframework.data
    • I wish there was an easy answer to producing XML in Spring Data REST, but I haven't found one yet.
    • The annotation @RestResource(exported false) is not working for a property in an Entity class.
    • This all goes a bit against REST (basically) to do the lookup on the serverside as you should be sending everything needed with the request (Representational State Transfer and Hypermedia as Transfer Engine of All State).
    • There are a couple of problems with XML that we haven't found reasonable answers for: How do I represent an object in XML?
    • Explore all reviews
  68. java.sql
    • Hope this helps URL_https://forums.oracle.com/forums/thread.jspa?threadID=83378 [ URL_https://forums.oracle.com/forums/thread.jspa?threadID=83378 ] Solution is to use java.sql.Time instead of java.sql.Date .
    • I found a very stupid mistake in my app.Instead _java.util.Date_ I used _java.sql.Date_ in my Model class :( Thats why Date field always was null.
    • 1: So to use less memory we must: use server side cursor behind the scene use resultset open as URL_http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html#CONCUR_READ_ONLY [read-only] and, of course, URL_http://docs.oracle.com/javase/6/docs/api/java/sql/ResultSet.html#TYPE_FORWARD_ONLY [forward-only] ; avoid to load all the cursor in a list (or a CODETERM1 ) but write each row directly on an _output line_, where for output line I mean an output stream or a writer or also a json generator that wraps an output stream or a writer.
    • 4: I used arrays to cache thinks and to avoid to call getters each iteration.
    • Explore all reviews
  69. mockito
    • I was thinking of maybe this method should be broken apart to two methods, but I can't see any clean and good solution because this method will be used as an access point from other components in the system, therefore one method should accomplish one thing.
    • Please add some more code so we can understand exact mocking objects.
    • I hope I can get something better, I don't like these argument captors and generally too much code is needed to simply describe this case and there will be many types of the requests.
    • Please add some more code so we can understand exact mocking objects.
    • External dependencies (e.g., JUnit, Mockito, Easy Mock, JayWay, etc.)
    • So basically I would like to build up my unit test for this something like: Mock the CODETERM2 (somehow) to correctly generate JSON results based on the requests.Correct me if I'm wrong but I could marshal back the JSON result if I build up the mocked object hierarchy.My problem here is that I need to create the hierarchy for every single request, but I guess I cannot do anything fancier here.I should assert that the CODETERM3 method invoked with the expected device ID.
    • Explore all reviews
  70. org.postgis
    • I thought that adding the _@XmlAccessorType(XmlAccessType.FIELD)_ tag was enough to recognize only the attributes from the class as fields in the json file, but it seems that this does not work for inherited attributes.
    • Also subclassing Point did not bring the answer as the problem lies in the used interface of CoordinateSequence.
    • In addition, I would need Geometry to have a no-arg default constructor...
    • Explore all reviews
  71. pdfbox
    • We're using HTTPS for the REST calls, the reason we're encrypting the data is because most of the messages are also spending time in an Amazon Web Services Simple Queueing Service queue, which only accepts strings.
    • Apache pdfbox, but I'm a bit leery to use the encoding - it seems like hardly anybody is using or implementing it, which might just mean that Base64 has more inertia, or which may instead mean that there's some wonky problem with Ascii85.
    • Are there any problems with Ascii85 that mean that I should use Base64 instead?
    • Explore all reviews
  72. xml-infoset
    • Well, that's it.
    • That means I want proper integers, booleans and nulls and I don't want extra object wrappers or something that tries to capture the entire XML Infoset.
    • I've been saying "MUST" a lot, I realize now :) The library needn't actually provide that, but there must be a way to add the functionality in a clean fashion (= not in a way that would make rewriting everything easier).
    • Additionally, arrays must be serialized using nested elements so it's possible to differentiate between empty arrays and properties which aren't present in a given view: Undefined CODETERM15 property (not present in view): CODESNIPPET_JAVA1 .
    • It shouldn't touch the entities CODETERM17 and/or clear it's CODETERM18 , for example.
    • Deserialize XML and JSON and merge the data into existing entities** Now this is the difficult part.
    • Explore all reviews
  73. com.sugarcrm
    • To clarify, this is most likely only useful for SugarCRM 6.5 and earlier.
    • Modified the org.json one, only changing HashMap to LinkedHashMap in the JSONObject.If anybody else stumbles over the same problem, here is the jar and when they fix it in SugarCRM you can just change back to the real org.json library.
    • URL_http://www.sugarcrm.com/support/bugs.html?caseID=34925#issue_34925 [ URL_http://www.sugarcrm.com/support/bugs.html?caseID=34925 issue_34925] For example this does not work: CODESNIPPET_JAVA1 .
    • Ordered JSON library due to SugarCRM bug.
    • This is horrible, but I need a library for java that maintains the order within JSON-objects.
    • So is there any weirdly implemented JSON library out there that does this?
    • Explore all reviews
  74. org.apache.pdfbox
    • We're using HTTPS for the REST calls, the reason we're encrypting the data is because most of the messages are also spending time in an Amazon Web Services Simple Queueing Service queue, which only accepts strings.
    • Apache pdfbox, but I'm a bit leery to use the encoding - it seems like hardly anybody is using or implementing it, which might just mean that Base64 has more inertia, or which may instead mean that there's some wonky problem with Ascii85.
    • Are there any problems with Ascii85 that mean that I should use Base64 instead?
    • Explore all reviews
  75. proguard
    • The funny thing is that -overloadaggressively is one of the recommended options in various Proguard examples for setting up GSON.
    • That avoids any name clashes as well.
    • There's probably also a Proguard setting to avoid duplicate names, but I'm not familiar enough to say what it is.
    • Upon starting up my app logs two errors, but only after obfuscation.
    • Unless I'm being misled, the errors are like: class Property declares multiple JSON fields named a and same for class PropertyDefinition.
    • One thing to watch out for: After exporting my app and testing I ran into problems due to Proguard and GSON.
    • Explore all reviews
  76. lombok
    • Is there any way to do it dynamically.
    • Sample syntax-check with URL_https://code.google.com/p/google-gson/ [Gson] (using URL_http://projectlombok.org/ [lombok] ): CODESNIPPET_JAVA1 .
    • Another possibility is to use URL_http://code.google.com/p/google-gson/ [Gson] (Note, I use lombok here to generates getters/setters, toString, etc): CODESNIPPET_JAVA1 .
    • Explore all reviews
  77. redmine
    • Use something like [this json validator]( URL_http://jsonlint.com /) to validate your json.
    • I get a CODETERM1 but I'm not sure if it's from failing to get the JSON or modelling it wrong.
    • If it's as simple as the JSON being fetched incorrectly I'll be really annoyed at myself.
    • Explore all reviews
  78. surefire
    • provided**This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime.
    • From URL_http://maven.apache.org/guides/introduction /introduction-to-dependency-mechanism.html#Dependency_Scope [ URL_http://maven.apache.org/guides/introduction/introduction-to-dependency - mechanism.html#Dependency_Scope] : compile**This is the default scope, used if none is specified.
    • Furthermore, those dependencies are propagated to dependent projects.
    • Explore all reviews
  79. jsonassert
    • Whil this solution works for the order of data items within the JSON, it will fail if the order of elements within arrays does not match.
    • So you'd have something like this: JSONAssert.assertEquals(expected, data, JSONCompareMode.NON_EXTENSIBLE); The NON_EXTENSIBLE mode means that any new or missing fields cause failures, but the order doesn't.
    • You could try using json-lib's URL_http://json- lib.sourceforge.net/apidocs/jdk15/net/sf/json/test/JSONAssert.html [JSONAssert] class: CODESNIPPET_JAVA1 .
    • Explore all reviews
  80. caliper
    • Since caliper also uses Gson, I can in fact use the caliper code for parsing the data all the way into specialized Java classes.
    • The reason is that I'm currently using URL_https://code.google.com/p/caliper/ [caliper] for some (micro-) benchmarks, and while the benchmark is _still running_ (or if I canceled it prematurely), the output file will not be a complete JSON document.
    • I also tried using CODETERM4 , but it would still expect complete documents, and not return a meaningful result at each CODETERM5 .
    • (I don't like the Caliper web interface, because it is slow, does not scale to large experiment sets, and a lot of data fails to submit and is then missing from the run.)
    • Right now, I'm using a nasty hack, that uses the known indentation that caliper currently produces to split the result document at CODETERM3 into chunks, then parse only these until the last one fails.
    • But that is a nasty hack, and not robust towards future changes of caliper output.
    • Explore all reviews
  81. spring
    • It also integrates nicely with Spring if you need that.
    • Hmm, I'm not sure, it looks like it expects to be deployed in a war file, and I would rather avoid a heavyweight servlet container and all of that infrastructure, the API is just a small part of my project, I don't want to stuff the entire thing in a war just so I can support the API :-/.
    • I would advise against Spring MVC for REST because it is not JAX-RS compliant.
    • Explore all reviews
  82. javax.swing
    • I understand list models, but the way I have it setup the JList populates indirectly from the textfile I have created/saved.If I have a Listmodel, I don't see how my current method of reading from the textfile would still continue to work.
    • it doesn't return any true or false.
    • Most of Swing still doesn't know about Collections (only Vectors if that!
    • 1. read Oracle tutorial URL_http://docs.oracle.com/javase/tutorial/uiswing/components/list.html#creating [How-to-use-List---Creating-a-Model] for working code example 2. create CODETERM1 as local variable, then every changes will be made only in the model 3. there is bug, maybe feature, Swing GUI freeze for a few seconds, in the case that is removed more than 999 Items in one moment (already visible JList), can't found answer for this issue 4. all updates to the already visible Swing GUI must be done on EDT, more read in Oracle tutorial URL_http://docs.oracle.com/javase/tutorial/uiswing/concurrency/dispatch.html [Concurency-in-Swing---Event-DIspatch-Thread] 5.
    • Clients can use serialization (over a different socket) to send back objects or pass them as parameters to RMI invocation, this should be personal preference Of course I don't know what exactly you want to do but both tools work great and can also be used orthogonally.
    • I'm a bit new to JSON, swing and stack overflow altogether.
    • Explore all reviews
  83. lucene
    • Since it is pure text data, you can process them with standard text search tools like URL_http://lucene.apache.org/core/ [Lucene] , and find your entry based on that.
    • but the problem is that the final client that need this solution that I have to sell to later, uses MySQLm.
    • I would recommend to use URL_http://stackoverflow.com/questions/2010663/lucene-with-php [Lucene] for this.
    • Removing one or the other also fixed my problem.
    • solved I used this PHP file to take care of everything, thanks for all the hints, they were very usufull, also I tried using lucene is faster especially for long n data bases, but unfortunately I cannot decide to move to a lucen DB CODESNIPPET_JAVA2 .
    • Explore all reviews
  84. log4j
    • I have a simple Hello World example that passes a Map to Camel and displays the values to the console via Log4J.
    • I had this problem when I had a Log4J logger as a class property, such as: CODESNIPPET_JAVA1 .
    • May be it would be nice to see what Log4j is saying.
    • I'm writing the back end of a web application, that uses REST APIs for extracting data that is used for reports in the client side.The framework I'm writing on uses Codehaus jackson for parsing the requests from JSON to data objects (data beans).I have a bunch of APIs of this sort, 10-15.each of them gets a different request object from the client side (though some inheritance do exist).what I want to do is add logging (using log4j) for each of these APIs so that when I enter each of the methods the request data object will be logged.the simple solution would be to implement a toString() method for each of these data objects, but I want to avoid going over all of these data objects and see if there's a solution similiar to the way that jackson parses the JSON into an object.I.e have the object converted back to its textual format in order to put it into the log.
    • No additional erros in log4j :( and I haev the same been configuration... Is there a working sample somewhere I can download and debug the differences?
    • Explore all reviews
  85. jpachube
    • COSM's API documentation for what the xml request body should look like is as follows: CODESNIPPET_JAVA3 .
    • I'm using jpachube and am running into problems with .POST on creatDatastream.
    • Modified the createDatastream method using input from bjpirt (much thanks).
    • The only difference I found was the version , but I made that switch in the code already and got the same error.
    • day three it was pointed out that there was a problem with the xml (see below).
    • Explore all reviews
  86. net.jangaroo
    • This would allow you to save effort of learning new language and API sdk - with the flexibility of consuming RESTful services via javascript framework where JSON support is native.
    • It's not that it's cumbersome, it's just new.
    • This is in my opinion - I am not aware of the context, you would be best judge in selecting the platform.
    • Java isn't new, but it's been a long time.
    • If you find dealing with Android development a bit cumbersome - and if you are comfortable with .NET MVC and ASP.NET, then you should look at frameworks like Sencha Touch - URL_http://www.sencha.com/products/touch/ [Snecha-Touch-URL] Sencha Touch is javascript framework that can be generated via your ASPX pages - the framework generates look and feel that is similar to native look of Android and iPhone.
    • Explore all reviews
  87. commons-collections
    • Thank you works fantastically :).
    • No, this one only contains the source files but not the actually needed .class files.
    • It seems like a lot of libs for just JSON parsing :S.
    • Correct me if I am wrong I have commons-collections-3.2-sources.jar in my class path.This is the correct lib for apache commons?
    • Apache's commons.collections library has a CollectionUtils class that provides easy-to-use methods for Collection manipulation/checking, such as intersection, difference, and union.
    • Explore all reviews
  88. org.apache.accumulo
    • Move to storing the information in a JSON file that gets read in as a special class object which gets passed around to whoever needs to pull some info from it (small drawback is that as is each class creates table references from the table names as needed, where as using a JSON it may make some sense to go ahead and instantiate all table references so that classes can just ask for the reference, but then a few extra references will get created often when not needed.)
    • So I'm building various indexing and ingestion classes in Java for URL_http://accumulo.apache.org [Accumulo] But my problem is not directly related.
    • I've already got a stack of books including Design Patterns just to get my feet wet, but any general programming practice knowledge-bases I'll gladly take suggestions.
    • Go ahead as I am now, which seems bad since if I submit the tokens in the wrong order all kinds of nastiness may occur.
    • I tried to make this generalized so others can benefit but some more details may be needed, let me know.
    • Pass the properties object itself around and let each class handle instantiating its own string objects (could easily become a pain to maintain in the future if tokens are added or removed from the file).
    • Explore all reviews
  89. org.joda
    • Java's DateFormat and Joda Time's DateTimeFormatter are not the same, so it is pretty normal; doesn't the joda time plugin provide a way to specify a DateTimeFormatter?
    • Instead of complaining, have you actually tried to contact authors of module, offering your help?
    • Java's DateFormat and Joda Time's DateTimeFormatter are not the same, so it is pretty normal; doesn't the joda time plugin provide a way to specify a DateTimeFormatter?
    • when I add that I get the compile error "incompatible types: JodaModule cannot be converted to Module" - the method expects a org.codehaus.jackson.map.Module but JodaModule does not have this in its heirarchy so how could this work?
    • from my point of view, you should be able to configure JodaModule itself and then simply register it as usual, yeh, maybe it's a good thing to work on.
    • So there's a whole separate module devoted to handling Joda objects, but it does the serialization in the most simplistic manner possible, failing to retain crucial information... That's a shame.
    • Explore all reviews
  90. org.apache.struts
    • By far, this is the best answer or suggested solution I found all around so far.
    • Basically in your struts xml you extend from json-default instead of struts-default, then you return a result type of json.
    • i have tried those parametes, and it seems that my JSON still trying to read the properties that missing !!
    • Oh, jeez sorry I remember solving something similar but didn't check the to see if it was the same OP.
    • I picked up "Struts2 in action" book, which is quite all right but enough when the need comes to quickly solve few isues.
    • You'd need to add a new forward for your action in Struts that directs to a JSP to generate the JSON instead of the standard JSP for your webpage.
    • Explore all reviews
  91. net.sf.json-lib
    • JSONObject json JSONSerializer.toJSON(myJsonString); will produce an erroe of Type mismatch the other one works.
    • java heap space error when using large xml file.
    • This is true, but POJO -> XML -> JSON would work with an additional library.
    • When I wanted to use JSONLib; I found out that the jar file that is available in URL_http://json-lib.sourceforge.net has some class dependencies and it needs to be used by some other jar files, that contain that classes.
    • JSONObject json JSONSerializer.toJSON(myJsonString); will produce an erroe of Type mismatch the other one works.
    • You can use the URL_http://json-lib.sourceforge.net/apidocs/jdk15/net/sf/json/ util/JSONUtils.html#mayBeJSON%28java.lang.String%29 [.mayBeJSON(String-str)] available in the URL_http://json- lib.sourceforge.net/apidocs/jdk15/net/sf/json/util/JSONUtils.html [JSONUtils] library for validating JSON in java or else A wild idea for validating JSON, try parsing it and catch the exception: CODESNIPPET_JAVA1 .
    • Explore all reviews
  92. javax.xml.xpath
    • As many others have pointed out, Java doesn't ship a standard JSON-parsing library as part of the JDK, so if you want to use JDK-bundled tech with absolutely NO dependencies, you have 3 XML parsing choices: URL_http://docs.oracle.com/javase/7/docs/api/javax/xml/xpath/XPathFactory.html [XPathFactory] - XPath-based parsing.
    • This is probably the slowest and most memory intensive, BUT, one of the most convenient ways to query your data.
    • You wouldn't write a stock-trading app using this, but if you just need data from a big config file, it is very handy (although for configs, there are many other specific libs for that which are easier than rolling your own).
    • Reads the entire XML into an in-memory data structure you can query and traverse as needed.
    • Explore all reviews
  93. jsonmarshaller
    • If GSON does not fit your needs, I recommend URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] .
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  94. servletapi
    • So the above still works, but you can also (and probably should) do this: CODESNIPPET_JAVA2 .
    • But I got to admit it too : IT'S WEIRD.
    • Explore all reviews
  95. freemarker
    • This is actually what we did, but we put some extra functionality in it which we had use for:<#macro hazStringContent content> <#if content?has_content && content != "">"${content?js_string?replace("\\'", "\'")?replace("\\>",">")}"<#else>null.
    • I am trying to pass a JSON string from my server to the client and I want to manipulate it with Freemarker.
    • Use a URL_http://freemarker.sourceforge.net/docs/ref_directive_macro.html [FreeMarker-macro] to combine all of the answers above, while making the template more readable and maintainable: CODESNIPPET_JAVA1 .
    • EDIT2: In case a single-quote pops up, CODETERM5 will escape it which again leads to invalid JSON.
    • Explore all reviews
  96. javax.crypto
    • Don't bother creating your own "security encryption", just use one of the built in cryptography APIs such as javax.crypto.Cipher.
    • Not only is that a bad idea, but it is also a bad idea to use regexes to modify JSON.
    • Explore all reviews
  97. net.sf.sojo
    • URL_http://sojo.sourceforge.net/guide/user/object-interchange.html [SOJO] works serialization of Java structures pretty well.
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  98. spring-mvc-ajax
    • The only view resolver I have is the following: CODESNIPPET_JAVA3 .
    • I'm not sure, the path of my form submission; and there obviously is no JSP view for it, I'm expecting JSON to be returned actually, but for some reason this isn't working, it's just trying to forward me to some JSP, so I'm guessing that I need to specify how to handle this in my XML... but I've seen about 1000 different ways that people return JSON, and all of them are very confusing to me, I'm just looking for the simplest way, so I can take it from there edit: I added an answer which is a good start, but it allows you to type ".json" after any URL and it will do some really bad things if as the controller I'm not expecting it, so I need to somehow have this view resolver only apply to secured URLs .
    • Explore all reviews
  99. com.foursquare
    • Avoid the use of "good" and "best" in titles if possible.
    • URL_https://github.com/foursquare/foursquare-fhttp [Another-library] I found has the opposite problem - it has no way of doing basicauth and it does not serialize JSONs back into objects for you.
    • Explore all reviews
  100. jsf-component
    • All you basically need to do is to hook on specific requests (ajaxical requests usually have a CODETERM3 header) and have a reference to the associated JSF component tree in the session so that you can do the works on it.
    • Since you're already asking a trivial question like this, I think it's going to be a very long journey.
    • Explore all reviews
  101. woodstox
    • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping.
    • There was mention of this behavior as a bug on a woodstox mailing list somewhere.
    • Explore all reviews
  102. hsqldb
    • If you don't want a full-featured database, use something like HSQLDB or JavaDB.
    • Those changes will allow Maven to find the latest URL_http://in.relation.to/Bloggers/Hibernate361FinalRelease [Hibernate] and URL_http://www.springsource.org/documentation [Spring] libraries which are not always present in the default Maven repositories and also other libraries like the URL_http://hsqldb.org/ [HSQLDB] - an in-memory database used to test this example and JSON Java conversion.
    • Explore all reviews
  103. json-taglib
    • The object has two attributes, one named CODETERM11 with value CODETERM12 , the other named CODETERM13 with value CODETERM14 .
    • @user1727557 I personally use the [json-taglib]( URL_http://json - taglib.sourceforge.net/) which is a set of JSP tags for generating JSON.
    • Assuming you want to generate the JSON from one or more Java objects, the following is a fairly straightforward approach: Set the Java object(s) as attributes in request/session scope Convert the objects to JSON using a tag library such as URL_http://json-taglib.sourceforge.net/index.html [ URL_http://json-taglib.sourceforge.net/index.html ] .
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Explore all reviews
  104. org.gaelyk
    • (This would probably have to recurse through the response) I am looking for something easy that doesn't include a lot of libraries.
    • To use this in your Gaelyk app, you should just need to URL_http://sourceforge.net/projects/json-lib/files/ [download-json- lib-2.3-jdk15.jar-from-here] and do something similar (without the @Grab then, as you'll have the jar in your CODETERM2 folder.
    • Explore all reviews
  105. org.apache.ibatis
    • This is mapped to person table in mysql database.I am querying the database like: CODESNIPPET_JAVA3 .
    • I am not able to get any result from database.It does not select any row even though value exists.I have checked that none of other validation checks are failing.
    • But this is pretty bad approach and client would not like it.
    • Since I am more familiar with Jackson, here are some aspects where I think Jackson has more complete support than Gson (apologies if I miss a Gson feature): Extensive annotation support; including full inheritance, and advanced "mix-in" annotations (associate annotations with a class for cases where you can not directly add them) Streaming (incremental) reading, writing, for ultra-high performance (or memory-limited) use cases; can mix with data binding (bind sub-trees) -- EDIT latest versions of Gson also include streaming reader Tree model (DOM-like access); can convert between various models (tree <-> java object <-> stream) Can use any constructors (or static factory methods), not just default constructor Field and getter/setter access (earlier gson versions only used fields, this may have changed) Out-of-box JAX-RS support Interoperability: can also use JAXB annotations, has support/work-arounds for common packages (joda, ibatis, cglib), JVM languages (groovy, clojure, scala) Ability to force static (declared) type handling for output Support for deserializing polymorphic types (Jackson 1.5) -- can serialize AND deserialize things like List correctly (with additional type information) Integrated support for binary content (base64 to/from JSON Strings) .
    • Explore all reviews
  106. org.slf4j
    • I want to log to JSON in such a way that my message is not encoded again but printed raw into the logfile: At the moment it looks like this: CODESNIPPET_JAVA1 .
    • Java: How to log raw JSON as JSON and avoid escaping during logging with logback / slf4j.
    • Explore all reviews
  107. async-json-library
    • The closest I've found is this URL_http://code.google.com/p/async-json- library/ [async-json-library] which does _almost_ exactly what I'd like, except it cannot recover objects where actual strings or other data values are split between pieces.
    • I have been working on this app for on and off for three months and have yet to see any memory issues at all.
    • Explore all reviews
  108. org.skyscreamer
    • You say you are using Jersey/JAX-RS, so you URL_https://github.com/skyscreamer/yoga [Yoga] should be of particular interest.
    • Choose which fields you want to see at call-time Navigate entity relationships in a single call for complex views .
    • Explore all reviews
  109. open-esb
    • In my experience, the JSON parser for WSO2 ESB (based on Axis2-json) supports only a subset of JSON: 1.
    • well actually i modified the source for the message builder and it solved the problem atleast for now..
    • This is because JSON is mapped to XML-like datastructure, and XML must have a root, so the first key-value pair is considered as root.
    • If you don't wish to build or manipulate the message within the ESB, you can use message relay message builder/formatter for application/json in place of default axis2 builder/formatter pair.Have a look at [this]( URL_http://docs.wso2.org/display/ESB403/Message+Relay) .
    • This because the converter has to know which XML tag should be used for each value: e.g.
    • so does this mean as of now we dont have any other solution to this problem...?
    • Explore all reviews
  110. org.grails
    • I was really hoping that Grails would have something like this...
    • I haven't used STS a whole lot, but sounds like something's wrong there (a conclusion that you've already come to yourself).
    • On server side you could also use standard Grails JSON converter (but you could use Gson, if you prefer), see URL_http://grails.org/Converters+Reference [ URL_http://grails.org/Converters+Reference ] .
    • Grails - a better way to exclude class name from default json converters in groovy?
    • I have tried that one, Groovy:unable to resolve class grails.converters.JSON.
    • I have been writing custom marshallers in a grails project for the purposes of being able to exclude some fields from the json model such as the class names.
    • Explore all reviews
  111. dom4j
    • + Dom4j has SAX-like API but easier.
    • My votes are for URL_http://dom4j.sourceforge.net/ [dom4j] and URL_http://jackson.codehaus.org/Tutorial [jackson] - if you give your question more context we might be able to help more.
    • Explore all reviews
  112. pentaho
    • Any help will be appreciated.I have tried this code to serialize it, but it does not work.
    • It's very hard to find the source for MarshallableResultSet and the javadoc for it.
    • Explore all reviews
  113. com.android.tools.external.lombok
    • Is there any way to do it dynamically.
    • Sample syntax-check with URL_https://code.google.com/p/google-gson/ [Gson] (using URL_http://projectlombok.org/ [lombok] ): CODESNIPPET_JAVA1 .
    • Explore all reviews
  114. google-sitebricks
    • I need SSL support and I was using Sitebricks already for serving HTML pages and RESTful web services.
    • To minimize duplicate/similar code I would like to configure sitebricks to respond with a consistent Reply object every time the code executed in the REST endpoints throws an exception.
    • CODETERM2 which would do a GET request and deserialize the JSON response into a POJO of type CODETERM3 I did find a library that is pretty close to what I want called URL_http://sitebricks.org/#webclient [sitebricks] but it is severely limited in its scope e.g.
    • Instead of handling the exceptions and creating a custom JSON response in each endpoint I want that sitebricks itself catches the exception and returns something like: CODESNIPPET_JAVA1 .
    • What features are you looking for beyond that that make Jersey/Sitebricks more attractive to you?
    • Exception for Sitebricks: CODESNIPPET_JAVA1 .
    • Explore all reviews
  115. java.util.logging
    • Thanks, -Noah UPDATE - SOLVED Originally my client and client config were being created like so: CODESNIPPET_JAVA7 .
    • If you change the java.util.logging level up to CODETERM2 , you should see a number of extra messages that help diagnose such problems.
    • Explore all reviews
  116. eclipse-tools
    • The net effect is that rather than writing lots of little getJSONObject() calls, you invest in setting up corresponding classes, this should result in nicely structured code, where the processing of the data, that is the real business logic, is separated from the parsing code, which I view as "plumbing".
    • There do appear to be URL_http://sourceforge.net/projects/jaxb-builder/ [Eclipse-tools] that automate this manual drudgery.
    • Explore all reviews
  117. spring-hateoas
    • I've only used flexjson, but the other 2 have very good reps. For HATEOAS, there is spring-hateoas (on github) or Jersey.
    • You'll need to implement your custom Jackson Serializer ( URL_http://jackson.c odehaus.org/1.7.9/javadoc/org/codehaus/jackson/map/JsonSerializer.html [http:/ /jackson.codehaus.org/1.7.9/javadoc/org/codehaus/jackson/map/JsonSerializer.ht ml] ) Take a look at Spring Hateoas project.
    • Explore all reviews
  118. javax.naming
    • So working perfectly.
    • Since your setter method is named CODETERM1 Jackson assumes the variable is named mDReqID because of the Java naming conventions (variables should start with lower case letters).
    • Anyway I usually leave the types in the CODETERM4 objects as simple CODETERM5 and then in the class from where I retrieve the response, I do the correct formatting while creating my objects, for example, when you put the values in your CODETERM6 ... _Note 3_: The use of the annotation CODETERM7 is interesting to separate the name of a field in the JSON response and in your app, in order to follow Java naming conventions, which your attributes are not following... _Note 4_: You shouldn't use CODETERM8 attributes in your classes.
    • From a Java naming perspective that would be blasphemous, though.
    • Explore all reviews
  119. java.util
    • I got the json content as a result from a GET request using google custom search API.. just extra information in case it can help in some ways!
    • I'm sorry but it isn't working I'll get this as error: W/System.err(21478): com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of java.util.LinkedHashMap out of START_ARRAY token the file Map.java doesn't exits because it's raw data binding (thanks for the link).
    • It's working just fine.
    • But I can't understand why lost the ordering.
    • JSONObject is a java.util.Map and JSONArray is a java.util.List, so you can access them with standard operations of Map or List .
    • I executed it locally, but within my file is just the javascript piece you posted.
    • Explore all reviews
  120. jacson
    • yes you can use jacson to parse it but there is more easy way to do it its Jsonme lib "import org.json.me" you dont have to add jar file to use it CODESNIPPET_JAVA1 .
    • yes its more easy but if your project is complex i advice you to use jacson lib .
    • Explore all reviews
  121. parboiled
    • But writing parser-generators, even for a simple language like JSON, is a lot- of-work.
    • Parboiled has no such disadvantage!
    • Explore all reviews
  122. java.applet
    • Hi BalusC, This method seemed to work fine.....until I tried using it in a Java Applet and got hit with a reflectpermission.
    • I have the following json string that is returned to my java applet from another source that i need to interact with.
    • Explore all reviews
  123. myfaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • So put simply, doing json seems quite esoteric when using JSF (MyFaces).
    • Explore all reviews
  124. org.json4s
    • It makes the code much easier to understand.
    • You can use a CODETERM3 to make it a little cleaner as regards the generics.
    • Explore all reviews
  125. jinahya
    • I've fixed the factory method for others to see, I hope you don't mind.
    • You can see full mavenized project at URL_http://code.google.com/p/jinahya/sou rce/browse/trunk/com.googlecode.jinahya/stackoverflow/ [ URL_http://code.google.com /p/jinahya/source/browse/trunk/com.googlecode.jinahya/stackoverflow/] JAXB doesn't need the setter if you control to use fields not properties.
    • Explore all reviews
  126. jbox2d
    • Would be more networking efficient but not as easy to write.
    • Each client has one body (player) that they can control but there can be collision therefore they will need to see everyone else's body to know why some of their movement is restricted.
    • Explore all reviews
  127. org.apache.ivy
    • URL_http://stackoverflow.com/questions/2134507/fast- lightweight-xml-parser [This-answer] provides a simple example of using URL_ht tp://docs.oracle.com/javase/1.5.0/docs/api/javax/xml/parsers/DocumentBuilder.h tml [CODETERM1] to generate a DOM.
    • And with tools like URL_http://maven.apache.org/ [Maven] or URL_http://ant.apache.org/ivy/ [Ivy] to automatically calculate and download dependencies from your project definition, there's really no reason to fear using libraries.
    • Explore all reviews
  128. javajson
    • I've written web pages and servlets before so I'm familiar with GET and POST concepts and it seems the RESTful method of delivering web services will be easier to grasp.
    • You should try JavaJson from source forge... you can parse that this way: CODESNIPPET_JAVA1 .
    • Explore all reviews
  129. net.sf.ehcache
    • In next request to that cached page, filter looks for Ehcache, finds, but without elementx and UPDATES elements!
    • How to renew or invalidate cache using SimpleCachingPageFilter in Ehcache?
    • Explore all reviews
  130. org.jruby
    • The development team are experienced at Java, with some Python, but are smart and can quickly learn other technologies.
    • I have a Java HashMap that I have in JRuby, I am trying to convert it to JSON, but its not converting correctly, I think this example shows the problem: CODESNIPPET_JAVA1 .
    • Feel free to suggest the technology stack of your choice.
    • This is highly subjective and way too broad; You're asking something that a lot of companies are basing their whole business on and have evolved over a decade; mobile didn't happen with iPhone, it just got a lot more complex because of it.
    • Explore all reviews
  131. jena
    • As I've said in another answer, [don't process RDF/XML as XML]( URL_http://stackoverflow.com/a/17052385/1281433 )!
    • I have problems using subf,null,null: The method listStatements(Resource, Property, RDFNode) is ambiguous for the type Model.
    • An alternative using Jena and RDF/JSON I'd point out that Jena can serialize a model in RDF/JSON, and that might be an easier way for you to get JSON if that's what you need.
    • listStatements(subj, null, null) - the use of null acts as a wildcard (the Javadoc tells you this) - URL_http://jena.apache.org/documentation/javadoc/jena/co m/hp/hpl/jena/rdf/model/Model.html#listStatements(com.hp.hpl.jena.rdf.model.Re source,%20com.hp.hpl.jena.rdf.model.Property,%20com.hp.hpl.jena.rdf.model.RDFN ode).
    • What I want is to extract each article and convert it to RDF/JSON (I know how to write a model) using Apache Jena, so I can have a separate document for each article, and later import them all to a index like CouchDB or Elasticsearch to perform searches.
    • I think because there are two definitions of listStatements with 3 exact arguments each, one in Model and another in ModelCon.
    • Explore all reviews
  132. liferay
    • I am able to find the correct CODETERM3 , then the CODETERM4 under that CODETERM5 , but I cannot determine how to actually use that information in any other APIs.
    • Another option would be to use Tags in this as well, but the same problem arises.
    • But the following URL works for liferay.com site: URL_http://www.liferay.com/tunnel-web/jsonws .
    • It is a known fact that Liferay doesn't expose all local services to the JSON api.
    • Explore all reviews
  133. htmlunit
    • HtmlUnit doesn't support it.
    • If you want easier you could use URL_http://htmlunit.sourceforge.net/ [HtmlUnit] which imitates the behaviour of browsers so you could easily get the content (and parse it into Html, javascript and css, you could also execute javascript code on content so you could probably parse JSON files to using JSON.parse or any other equivalent functions) of any page on the web.
    • Explore all reviews
  134. com.liferay.portal
    • But the following URL works for liferay.com site: URL_http://www.liferay.com/tunnel-web/jsonws .
    • Another option would be to use Tags in this as well, but the same problem arises.
    • Explore all reviews
  135. org.boon
    • It compares Boon, Jackson, Smart JSON and GSON.
    • Apologies if I'm being a bother, I've looked around the API and there isn't any reference of LinkedHashMaps, so I don't know why it's popping up here.
    • Explore all reviews
  136. tomcat
    • Clean, simple, useful!
    • Since it's unclear which one you're using, here's just a Tomcat-targeted example: check the CODETERM7 and CODETERM8 attributes of the CODETERM9 element in CODETERM10 : URL_http://tomcat.apache.org/tomcat-6.0-doc/config/http.html [HTTP-connector- reference] .
    • Explore all reviews
  137. java.lang
    • No, if you run the program in the debugger and set breakpoints in the java.lang.Integer constructors with int and String there is no hit of the String constructor, only on the int one!.
    • Exception in thread "main" java.lang.ClassCastException: java.lang.Object cannot be cast to heroes.model.Creature at heroes.model.Creature.main(Creature.java:131).
    • Value org.apache.http.message.BasicHttpResponse@4636f428 of type java.lang.String cannot be converted to JSONArray.
    • as you say I made changes, but now i got this exception.. org.json.JSONException: Value !DOCTYPE of type java.lang.String cannot be converted to JSONObject at org.json.JSON.typeMismatch(JSON.java:111) at org.json.JSONObject.
    • No problem, glad it worked for you!
    • I think this is a bug with the JSON SerDe I'm using but I'm not sure.
    • Explore all reviews
  138. commons-lang
    • I was trying to use: commons-lang3-3.1.jar, i switch to commons-lang-2.6.jar and it now works fine.
    • That's a build error preventing the display of your real exception: it says it can't load the class NestableRuntimeException from Apache commons lang.
    • Thank you works fantastically :).
    • That's a build error preventing the display of your real exception: it says it can't load the class NestableRuntimeException from Apache commons lang.
    • Thanks to all, easier than I thought.
    • Unfortunately, there is no escapeJavaScript in StringEscapeUtils, is it the same as escapeECMAScript?
    • Explore all reviews
  139. javax.servlet
    • Bummer that this can't be handled on the client side, the correct way.
    • The exotic versions of java.io and javax.servlet packages that I use include few methods that make data just pop into memory as Strings, and this forces me to work with streams.
    • The server code is a java servlet, and I believe the easiest way is to use a regex to find the field that potentially could have this issue and replace any quotes inside of it.
    • If there isn't one, how can this problem be solved another way?
    • I generate JSON from a java Servlet, from MySQL, like this ... Prueba.java (Servlet)** CODESNIPPET_JAVA1 .
    • I have struggled to create a regex to find quotes meeting the above requirements.
    • Explore all reviews
  140. org.hibernate
    • That Really Cool, but i already have my ready thin client in java SE, i need to move the logic & SQL statement to server side, so the client just have the GUI.
    • It's very strage: I previously set this parameter but I got an "out of memory" error.
    • Means its perfect now when the hibernate executes the query for Project insertion as insert into primavera.project (endDate, projectDesc, projectName, projectTitle, startDate) values (?, ?, ?, ?, ?)
    • Hibernate can spend a lot of time doing dirty checking on flush if your session is huge.
    • I used Collection instead, see my answer but it is nice to know that it is not possible.
    • I have learned that PostgreSQL has a URL_http://www.postgresql.org/docs/9.2/static/datatype-json.html [JSON] data type, so I want to use this datatype instead of string (varchar).
    • Explore all reviews
  141. json-p
    • If so can get a 200 but if not CORS enabled or setup for jsonp will not trigger success.
    • Hi Aymen, if you have a solution that is significantly different than what others provided, it's definitely okay to answer your own question, but you should show code and describe in detail what the solution was so that when other users with the same problem find this question from a google search, they'll actually find an answer that helps them solve their problem too.
    • Edit 1 @Vik Gamov, By interoperability, I mean a way to inject javascript / JSON objects into the script at runtime.
    • Could you elaborate what type of interoperability are you talking about?Currently, API of JSON-P is very low level.
    • I have checked it with Google Chrome's debugger and I do!
    • I am using CODETERM1 but I always get failures (timeouts) since this is a JSON no JSONP.
    • Explore all reviews
  142. ch.qos.logback
    • I'm pretty sure Logback itself doesn't have anything like that, so you'd want to look at wherever you got the Appender from instead if that's your problem.
    • I found a somewhat hacky soluation and added something that should resemble an SSCCE!.
    • It's works now!
    • Logback doesn't do anything unusual with JSON.
    • I want to log to JSON in such a way that my message is not encoded again but printed raw into the logfile: At the moment it looks like this: CODESNIPPET_JAVA1 .
    • Java: How to log raw JSON as JSON and avoid escaping during logging with logback / slf4j.
    • Explore all reviews
  143. google-threadlocal
    • Try using another one by setting the correct JVM OPTS: CODESNIPPET_JAVA4 .
    • As a second guess you may also have a HashTable memory leak that can be caused even in Java when not cleaning up a HashTable of Java objects correctly (somewhere in the web-apps server code).
    • well, but its still just a "guess".
    • So, in my case i solved the problem by designing the database connection in a per thread basis using ThreadLocal generic.
    • Yes, very good detective work.
    • If that problem applies to you an you add a similar fix to the one i mentioned, your problems will dissapear.
    • Explore all reviews
  144. net.sf.spring-json
    • Thanks, right now I saw 4 solutions - spring-json, jackson (delivered with Spring-MVC), FlexJson (delivered with SpringRoo) and gson... After few hours of play with first 3 of them i found that FlexJSON is fastest in setting up, spring-json has best docs and Spring-mvc jackson has working samples on spring svn.
    • The Spring-JSON project is great, but it unfortunately relies on Spring 2.5.
    • I can't say much about Spring-JSON, but I've found Jackson to be an extremely mature and flexible solution.
    • I'm trying to use a Json View for Spring ( URL_http://spring- json.sourceforge.net/ [ URL_http://spring-json.sourceforge.net/ ] ) (org.springframework.web.servlet.view.json.JsonView) but whenever I write a controller class that extends CODETERM1 I get the following Error: java.lang.IllegalStateException: ApplicationObjectSupport instance [org.springframework.web.servlet.view.json.JsonView] does not run in an ApplicationContext The weird thing is, that when I implement the Controller interface directly and do not inherit, _it is fine_.
    • It's reasonably fast, and has good documentation.
    • I'm trying to use a Json View for Spring ( URL_http://spring- json.sourceforge.net/ [ URL_http://spring-json.sourceforge.net/ ] ) (org.springframework.web.servlet.view.json.JsonView) but whenever I write a controller class that extends CODETERM1 I get the following Error: java.lang.IllegalStateException: ApplicationObjectSupport instance [org.springframework.web.servlet.view.json.JsonView] does not run in an ApplicationContext The weird thing is, that when I implement the Controller interface directly and do not inherit, _it is fine_.
    • Explore all reviews
  145. jax-ws
    • It has support for jax-ws annotations, and it's easy to use.
    • I tried servlet but it became complex to use webservice with it.
    • thank you, your solution saved me.In real i wanted to serve some complex data as json which was not easily possible without managedBean.
    • URL_http://reddymails.blogspot.com/2012/05/solving-cross-domain-problem- using.html [ URL_http://reddymails.blogspot.com/2012/05/solving-cross-domain - problem-using.html] .
    • It can be used standalone and is the standard binding layer for JAX-WS (SOAP) and JAX-RS (RESTful) Web Services.
    • But I strongly recommend to look at JAX-RS or JAX-WS instead of abusing JSF as a JSON web service.
    • Explore all reviews
  146. ph.samson
    • Your post helps me a lot and finally I landed it in getting success.
    • Do you need to serve up the resource as a _real_ text/plain to any clients or can you live with telling lies for good reasons?
    • There are pretty much easy to understand tutorials.
    • Both of these libraries solve several problems, so that you do not have to deal with low level implementation.
    • The best library json I've ever found is URL_http://software.dzhuvinov.com /json-rpc-2.0-base.html [that] For making requests you will need URL_http://software.dzhuvinov.com/json- rpc-2.0-base.html [base] part of library.
    • so I need to force my application to respond with _text/plain_ in the header but still projecting my classes to _json_ output.
    • Explore all reviews
  147. org.codehaus.jettison
    • I have edited your questions title and tags to include Jettison to try and attract the answer you are looking for.
    • also I can't see any bug in here.if it has please explain more.
    • @Afrin this one also work for simple query.
    • But I need to implement it using JETTISON :( .Plz guide me to achieve this using JETTISON.
    • I am using Apache CXF which supports JSON through Jettison.
    • "the java.io.IOException: Stream closed" exception that I'm getting happens when I use Jackson instead of Jettison.
    • Explore all reviews
  148. java.io
    • Obviously it depends on the average line size of the output, but that could very well be fewer batches than one per line.
    • The exotic versions of java.io and javax.servlet packages that I use include few methods that make data just pop into memory as Strings, and this forces me to work with streams.
    • Doing this way, I could GZIP the bytes also, it will still binary, is that a good practice?
    • If you have multiple contexts where you use the same field, and you want it serialized in one (JSON, for example), and not serialized in another (java.io, for example) then you should create a custom serializer for the case where you don't want it, rather than abuse the keyword.
    • I chose this _binary_ approach over JSON because even though you _could_ transmit the CODETERM18 with JSON almost as efficiently as in binary, it would defeat the very purpose of JSON: being human-readable.
    • I suspected that too, but the only missing characters are apparently ]}.
    • Explore all reviews
  149. org.glassfish.main.core
    • It works now.
    • The fact that you're using Java and GlassFish are really irrelevant - these two technologies are capable of publishing all kinds of services.
    • The default location of java ee 7 jars of Windows, C:\glassfish4\glassfish\modules, But you should not use jar this way, best way is include server from your IDE.
    • Exposing your core model is known as _spilling your guts_** - if you change this then all subscribers to your service will need to change too.
    • (recommended for mobile).
    • The problem is, I don't really understand the linkage method between the server and the iOS device.
    • Explore all reviews
  150. javax.portlet
    • Now i think its better i create a servlet returning JSONObject string and calling that from the JSP... atleast that works fine :)any suggestions?
    • thanks, i found the jira link for the bug also but i was not sure.
    • I want to make spring MVC 3.0.3 portlet using DispatcherPortlet class With JSON support.
    • portlet**.HandlerAdapter You have to make sure that you use the right one - the servlet and portlet APIs are completely incompatible.
    • text/html Without this, if i use the 'InternalResourceViewResolver' only then it runs fine and i am able to use the portlet.
    • Explore all reviews
  151. org.everit.osgi.bundles
    • and paste all the downloaded codes there, and have fun.
    • it is ok, but it's an ugly hack and I dislike it.
    • I feel this to be the best and the most easiest JSON Decoding.
    • I have seen URL_https://github.com/douglascrockford/JSON-java/issues/5 [this- bug-report] , but I don't see a solution.
    • The reason that I do it this way is an attempt to make it easier to follow whats happening.
    • Explore all reviews
  152. jsonrpc4j
    • It would be better if you post ONLY the relevant portion of code, it's too lengthy to read..!.
    • This is a minimum working example and I can not think of one line to omit in this case - if you could point out any irrelevant portions i am maybe able to improve my question.
    • If you have a complicated API, it can help greatly.
    • I tried to enable default typing and to annotate (with @JsonTypeInfo) the _Object.class_ via mix-in, but both failed (exceptions below).
    • If i call _remoteService.getNut()_ everything works as expected, the log prints: CODESNIPPET_JAVA7 .
    • Explore all reviews
  153. struts1
    • If I use some properties, it works fine.
    • @HiwayChe I add this and keep getting error.
    • I use excludeProperties on result, you can refer to URL_http://struts.apache.org/release/2.2.x/docs/json - plugin.html.
    • Use the Struts URL_http://struts.apache.org/release/2.3.x/docs/json- plugin.html ["JSON-Plugin"] .
    • Declare the field you'd like to return as JSON string like the field of your action, provide the getter and setter.
    • my problem is my data in action is always equal to null.
    • Explore all reviews
  154. dumbledroid
    • I really liked your pretndo library and use it whenever you have to read a JSON or XML.
    • People could use it for bad purposes, and your key can be blocked!
    • So, if you correct these issues, Dumbledroid will work.
    • I've been researching and error must be because the JSON received contains an Object and not an Array, but as the JSON is generated by the Tumblr API, I have no control over it, and do not go out and solve this my problem.
    • : it's good to remove your Tumblr API key from your question.
    • Explore all reviews
  155. java.lang.reflect
    • It's just simple recursion: introspect one type (with super-types etc) for fields, methods (see JDK javadocs for Class); find actual values of fields using java.lang.reflect.Field, rinse repeat.And if you want to get fancy, keep track of already resolved objects to handle cycles (or shared refs).
    • It is not working for me java.lang.reflect.Type listOfTestObject new TypeToken>(){}.getType();String str gson.toJson(commentInfo, listOfTestObject);JsonElement commentObj gson.toJsonTree(str); and myObj.add("commentInfo", commentObj);out.println(myObj.toString()); Is it correct.
    • to use JavaType, you need to construct method by passing java.lang.reflect.Type into TypeFactory (check out JavaDocs for details), respectively: CODESNIPPET_JAVA2 .
    • I think there is no java.lang.reflect package in MIDP 2.0.Will make hard to make a generic parser...
    • If J2ME has java.io.IOException; java.io.Writer; java.lang.reflect.Field; java.lang.reflect.Modifier; java.lang.reflect.Method; java.util.Collection; java.util.HashMap; java.util.Iterator; java.util.Map; java.util.TreeSet;, then you could use the first one, as they are simple java classes.
    • Explore all reviews
  156. alfresco
    • @Gagravarr um, thank you, after i trying to find classes loaded, for some reason , JSONParser class not loaded, alfresco didn't see that.
    • I'd check your classpath, and ensure you only have one copy of each of the jars - my hunch is you may have both old and new copies of at least one and that's confusing it.
    • I will talking throw codes line with a few words, In alfresco I need to create a reports using its Workflows APIs that response as JSON, I found the solution for using JSON as a Data Source in this link (this will be good reference to full understand my issue) : URL_http://www.birt-exchange.org/org/devshare/designing-birt-reports/1053 -scripted-data-source-using-json/ [ URL_http://www.birt-exchange.org/org/devshare /designing-birt-reports/1053-scripted-data-source-using-json/] I downloaded the source and I understand how its works, and finally I was having a problem "authentication issue" and solved it by editing source file 'JSONParser.java', anyway I have another problem now, I have the following code in Java thats working: CODESNIPPET_JAVA1 .
    • @Gagravarr I think all jars is copied, I downloaded "httpcomponents client 4.0" and put all as external jars on eclipse for my project, and copied it to WEB-INF/lib on alfresco (with JSONParser classes as a jar file), I forgot to put them first and I got Class Not Found Exception, but now you see my problem that I got after that ...
    • and fetch rows in data set table like : CODESNIPPET_JAVA4 .
    • To get exception I uploaded it to Alfresco integrated with BIRT, and I got : CODESNIPPET_JAVA5 .
    • Explore all reviews
  157. kryo
    • Well both projects actually are games which is why Kryo appealed to me.
    • Since it sounds like you are using the format to archive data, human- readability and the use of a standard long-lived format is probably more important than efficiency, so I suspect you will want to choose the JSON route.
    • Use it if you need to interoperte with a JSON (human-readable) data format Kryo is for efficient binary serialisation.
    • Human readability can be sacrificed since I don't plan on reading the files only processing them .
    • I figured I would use URL_http://jettison.codehaus.org/ [Jettison] as it seems it would be URL_http://blog.bdoughan.com/2011/04/jaxb-and-json-via-jettison.html [easier- to-implement] since it actually works with JAXB; however, looking at URL_http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking [Older- benchmarks] in which Jettison was not included I have found URL_http://code.google.com/p/kryo/ [Kryo] produces smaller files and Serialized and DeSerialized quicker than some alternatives.
    • Explore all reviews
  158. mongojack
    • This is the easiest (and, I believe, most correct) way to do something like this.
    • Even if I wanted to, writing a custom serializer for OtherClass would be extremely complex because it is an abstract root class.
    • To accomplish this, I created a very simple custom serializer: CODESNIPPET_JAVA2 .
    • This makes me almost sure that the problem lies in my custom serializer, but I am not sure how else I am supposed to write it.
    • However, if you are working exclusively with JSON, you might want to investigate third party libraries like URL_http://mongojack.org/ [MongoJack] - this uses the Java driver under the covers, but translates the results of your query directly into JSON for you.
    • Explore all reviews
  159. voldemort
    • This seems quite straightforward.
    • JSON Serializer for arbitrary HashMaps in Voldemort.
    • While Voldemort does support its "JSON-like" storage (it's not JSON but simple binary dictionaries, as far as I know), there isn't much benefit to using it in my opinion, since you can not query on it or request subsets of document.
    • To indicate that I want to store a HashMap representation of a Java bean, but with constraints on allowed keys (only CODETERM1 , CODETERM2 , CODETERM3 and CODETERM4 ) and their types.
    • I am trying to set up the configuration for Voldemort key-value store.
    • Explore all reviews
  160. restlet
    • here the code to prevent using chunked http request in restlet.ClientResource.setEntityBuffering(true);.
    • It doesn't expose an InputStream so you can't even roll your own event-driven parsing.
    • Is there any config in Restlet that i can set to let StringRepresentation class treat "type" as a common attribute name?
    • I'm using the restlet library and Jackson to send JSON data, and I cannot get the following to return a json object for a List, I get null out of it and no errors: CODESNIPPET_JAVA1 .
    • Indeed, without using varnish and making my app contacting directly my rest server everything works fine.
    • As for your mapping, I would think an exception should be at least thrown, but right off the bat it looks like you are expecting the albums list to map to the "results" JSON node, but there isn't anything to make this association.
    • Explore all reviews
  161. commons-jexl
    • Or recommending the user to either use an existing library such as JEXL, MVEL, or any other from this list: URL_http://java-source.net/open-source/expression- languages [ URL_http://java-source.net/open-source/expression-languages ] But they all seem to rely on a trusted user (ex.
    • And lock up my app, or access unwanted resources.
    • But in my case, I want my expression evaluation to run in a secure sandbox.
    • After doing a little bit of my own research, both JEXL and MVEL seem to be out.
    • So the user cannot do something as simple as: CODESNIPPET_JAVA2 .
    • All the ones I found are very complex, and implement things like loops, import statements etc.
    • Explore all reviews
  162. stax
    • Since it converts StAX events to/from JSON it can be used with an XML binding tool (JAXB is the standard) to produce JSON from objects.
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • The point being: JAXB does not have any concept of JSON, so any support for JSON relies on retrofitting JSON to an XML model of the world (StaX).
    • JAXB (JSR-222) is configuration by exception and only requires annotations where you need to override the default XML representation (Jettison converts XML StAX events to/from JSON).
    • StAXON can convert JSON to XML using either XSLT with default templates or StAX event API URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to- XML [ URL_https://github.com/beckchr/staxon/wiki/Converting-JSON-to-XML ] Here's a simple example: INPUT FILE: CODESNIPPET_JAVA1 .
    • It is similar to STAX, but instead of calling stubbed methods every time it finds something new, it rips across the XML file and notifies the caller of its modified state as it sees new content but does nothing WITH the content until you ask it for it.
    • Explore all reviews
  163. net.sf.flexjson
    • Yep I've been much happier with FlexJSON than GSON in Play too.
    • URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html [ URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html ] I'm unfamiliar with Jackson's methods for doing similar things, but I can say that FlexJSON is very performant, and in general intuitive to use during serialization/deserialziation steps.
    • @SJuan76 well, yes and no.
    • URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html [ URL_http://flexjson.sourceforge.net/javadoc/flexjson/JSONDeserializer.html ] I'm unfamiliar with Jackson's methods for doing similar things, but I can say that FlexJSON is very performant, and in general intuitive to use during serialization/deserialziation steps.
    • I tried this for Map, with and without include("values"), but the json result is the same; I was expecting to see class type data in the json for different Object type in the map when using "values"?
    • I think the reason you are getting a List instead of List is a bug in Flexjson.
    • Explore all reviews
  164. org.apache.cxf
    • For some reason cxf just preferred for me to call .flush() and not .close().
    • Also the conversion from pojo to json and vice-versa is handled itself by the CXF apis.
    • @Prabhathkesav it works with collection and single element: URL_http://pastebin.com/j8RbYkc3 .
    • My main problem was sending multiple parameters to my web service method, expecting the web service to consume them as JSon.
    • I am using Apache CXF which supports JSON through Jettison.
    • The problem I was having was that any exception I threw from within the filtering step was getting turned into a different exception by CXF (the one about the unknown writer for octet-stream).
    • Explore all reviews
  165. com.google.gwt
    • AutoBeans works, but they are some kind of buggy especially if you use Maps or Lists.
    • that could be a problem, I will try and get back in a day .. :).
    • I've pretty much used this method, as mentioned in my own answer.
    • @Christian Kuetbach you can deserializing/serialize with GWT AutoBean framework at client/server side, but i have not tried with complex Java Map.
    • i will do it like u said!.
    • My doubt is I want java class to bind with GWT components(Student).
    • Explore all reviews
  166. eclipselink
    • @BDoughan : Yes I have tried this with eclipseLink and it works well.
    • Thanks for quick response I am facing javax.xml.bind.JAXBException: property "eclipselink.media-type" is not supported exception.
    • Works fine, but I have to do it in this way inside the resource method: JAXBContext context JAXBContextFactory.createContext(new Class[] {ONIXMessage.class}, null); How can I fetch the eclipselink JAXBContext from Jersey?
    • Ah, thankyou sorry I thought you were just reiterating the answer to my other question URL_http://stackoverflow.com/questions/16931910/with-eclipselink-moxy - how-do-i-map-xml-content-to-a-name-different-to-value and because I used the alternative solution you gave I didnt see the need for it.I don't fully understand this but its now working :).
    • This is also one of the good solutions.
    • The exception being thrown is an RI exception (com.sun.xml.internal.bind.v2.runtime package) so EclipseLink MOXy is not being picked up as the JAXB provider.
    • Explore all reviews
  167. sax
    • For this sort of translation from one format to another, SAX is ideal.
    • establishing a context that lets you know when a JSON string has finished syntactically, without loading the whole thing into memory), you could look into event-based parsers (similar to what SAX does with XML).
    • It's like SAX parsing for XML.
    • Yes, JSON does have a toXML and you can make JSON.XMLtoJSON, but i need to add extra bits, and change a few bits around to satisfy the dojo requirements.As the quick bursts will be very strict in format, and typically be 3/4 lines line (50 at the most a (a recurring set of 3/4 line elements) holding in memory will not be too much of an issue..Thanks again for the comments so far..
    • To prevent all the object creation, look at event driven xml and json handling like URL_http://www.saxproject.org/ [SAX] for XML and URL_http://code.google.com/p/json-simple/ [Json-Simple] and/or URL_http://jackson.codehaus.org/ [Jackson] for JSON.
    • If it's the size of the file you're worried about, then you should use the 'SAX' style example.
    • Explore all reviews
  168. org.mvel
    • So the user cannot do something as simple as: CODESNIPPET_JAVA2 .
    • And lock up my app, or access unwanted resources.
    • Or recommending the user to either use an existing library such as JEXL, MVEL, or any other from this list: URL_http://java-source.net/open-source/expression- languages [ URL_http://java-source.net/open-source/expression-languages ] But they all seem to rely on a trusted user (ex.
    • After doing a little bit of my own research, both JEXL and MVEL seem to be out.
    • But in my case, I want my expression evaluation to run in a secure sandbox.
    • All the ones I found are very complex, and implement things like loops, import statements etc.
    • Explore all reviews
  169. com.google.code.gson
    • Ok, figured it out.Gson is causing it...using json.toString() instead doesn't add the key.Thanks for the replies.
    • The problem is not the inizialitation of Map, Gson does this for you!
    • No, I am also planning to use the values in calculations and other stuff...
    • Otherwise it is very difficult to know what to look for.
    • Well first of all your jsonString is not a valid json.
    • The problem I think is that it's not compatible with GAE.
    • Explore all reviews
  170. javax.jms
    • Our system is a large, in-house warehouse management system with a lot of process that commonly have both synchronous and asynchronous flows.
    • As a result, we use JMS to expose endpoints for our services.
    • Since we like JMS, and we like the ability to 'fall back' to HTTP for other clients, we prefer JSON messages as messages payload.
    • No support for example auto-generation, and in fact examples are a pain because they have to be xml encoded in the WADL.
    • This gives a lot of the same benefits of REST services, but provides the reliability of JMS.
    • In our case, I dont want to generate service objects from the WADL file, so using WADL means duplicating my method/parameter names in the WADL after i code them in java, which is harder than using javadoc.
    • Explore all reviews
  171. org.json
    • Ah ok so I could just catch a ClassCastException, thanks!
    • it is incredibly hard to _research_ this.
    • @TEG: I'm using the library from URL_http://www.json.org/java/index.html I'll be looking into removing stuff but I'm working with a ~20K lines text file for very basic extraction and analysis of the parts of the tweets.
    • My bad, I thought that would refer to the "simple" reference implementation of json.org.
    • GSON is a very powerful library for convert JSON-Java Object and viceversa..
    • This doesn't work for me, since a JSONArray is not iterable.
    • Explore all reviews
  172. org.glassfish.jersey
    • I created a new question for this that I'd like you to answer here: URL_http://stackoverflow.com/questions/18646747/how-to-produce-json-output-with - jersey-1-17-1-using-jaxb This can help others.
    • Thanks I had this problem for quite a while, I saw somewhere in the jersey documenation that it would scan the classpath for providers and the JacksonProvider would be automatically discovered but this appears to be incorrect.
    • One of the best ways to use Jersey is using IoC.
    • I kept searching for a much more complex cause.
    • By the way, in my last Jersey project I didn't use @XmlRootElement property, I just had an ordinary JavaBean, and all worked fine (i.e.
    • Don't really know about Jersey, but in RESTEasy exception mappers to classes like Exception and Throwable have, by design, no effect.
    • Explore all reviews
  173. org.springframework
    • Thanks Sean,MediaType is from Spring 3.0,there i will mention application/json.But CharStreams and Closeables api is from google code.IS there any way to write same functionlity with native java code.
    • I'm new to Spring MVC and was having a really hard time figuring out how to return JSON.
    • Thanks the solution works.
    • URL_https://jira.springsource.org/browse/SPR-7543 Automatically expose @PathVariables in the Model causes all methods that have {@PathVariable} parameters to include the {@PathVariable}'s in the model, so the model always contains more than 1 item, so {extractValueFromSingleKeyModel} doesn't work.
    • This is extremely easy with Spring MVC but it all depends on your back end.
    • That last part isn't really clear yet.
    • Explore all reviews
  174. commons-httpclient
    • It worked!
    • As a first debugging step I'd dump out the contents of builder and see exactly what the server is sending you - "< at position 0" could be an XML response instead of JSON or it could be an HTML error page.
    • Corrected it to catch both.
    • As a first debugging step I'd dump out the contents of builder and see exactly what the server is sending you - "< at position 0" could be an XML response instead of JSON or it could be an HTML error page.
    • [With Apache HttpClient]( URL_http://hc.apache.org/httpclient - legacy/performance.html#Request_Response_entity_streaming) it may [not be that simple]( URL_http://stackoverflow.com/questions/10146692/how-do-i-write-to-an - outpustream-using-defaulthttpclient) indeed, but please keep searching.
    • @IanRoberts, I must be more attentive, I made a mistake in URL -> streamS instead of stream :).
    • Explore all reviews
  175. com.fasterxml.jackson
    • Since you are using Jackson I would recommend to store your object as [JsonNode]( URL_http://fasterxml.github.com/jackson - databind/javadoc/2.1.0/com/fasterxml/jackson/databind/JsonNode.html).
    • 2) There's apparently a bug in Jackson 2.2.2 that prevents the null serializer from being called on null nodes using the Tree Model; it only gets called for POJOs.
    • The post part works correctly for other request, and i do imported Jackson.
    • I'll use a CustomDeserializers, it's gonna save me a lot of headaches!I'll also be able to apply my versioning strategies in there with very little modifications.
    • What would you expect Jackson to map the value of b to in both situations?
    • Could you debunk my fear?
    • Explore all reviews
  176. org.msgpack
    • I just went to the following link and thought of stream compression URL_http://tech.3scale.net/2012/07/25/fun-with - redis-replication/.
    • Even if one use MessagePack, should one consider compressing data on Network stream also so as to decrease the latency.
    • You should consider using MessagePack as it is full compatible with Redis and Lua, it is a great compression on JSON: URL_http://msgpack.org/ [ URL_http://msgpack.org/ ] It implies some Lua code to compress and uncompress, but the cost should be small.
    • Explore all reviews
  177. jmeter
    • when I use jmeter try got data is correct,but falue at android (use RestTemplate)please help me how to fix it, thanks!
    • This is my SQL- CODETERM5 But after trying to insert, I am getting this exception- CODESNIPPET_JAVA3 .
    • I am working on the project in which I need to make a connection to database and insert lot of rows in that Database.
    • Explore all reviews
  178. weka
    • Let me warn you that I'm quite new to Weka :) I _havent_ found a way to get direct access to the J48s Root Tree (appears to be private w/in the class)are you aware of a way to get at it?
    • If not, the closest Ive found as a way to get at the data bit hackish: use J48.toString() to dump the tree-as-string, and then convert that back into a Tree Structure and then convert that into a JSON string (YUK).
    • It seems that this use-case is not unusual, so I'm wondering if any of you all have already solved this problem .
    • Explore all reviews
  179. spring-android
    • Spring Android has a RestTemplate that is pretty easy to use.
    • This error happens when the jackson engine tries to parse the json response from the server.I am using Spring Android to serialise/deserialise objects to and from json.This problem seems to be related to the default encoding UTF-8.
    • try out Spring Android - is has very handy class RestTemplate.
    • Explore all reviews
  180. javax.xml.parsers
    • Also handy if you want to read, query, make changes and write the DOM back out as a modified XML file.
    • 2nd slowest and fairly memory-intense, but necessary if you want/need the XML DOM to stick around in memory so you can operate on it.
    • It is basically like a chatty person telling you everything they are doing AS they do it.
    • Explore all reviews
  181. org.simpleframework
    • For xml we use simple ( URL_http://simple.sourceforge.net [simple.sourceforge.net] ) .
    • Why would you want to limit it to a single server, which has obvious problems in terms of outages etc as well as handling that many requests per second.
    • It depends of what you are willing to do with your loaded datas (how you want / need to process them), but if you are willing in the end to load XML elements into java beans, i'm a big fan of URL_http://simple.sourceforge.net [SimpleXML] , way simpler and quicker than anything else (imho).
    • If you work out how to scale out, it'll kill two birds with one stone.
    • The choice of SAX/DOM is really basde on what you're trying to parse, see this for how to decide on which one to use: URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences-between- dom-and.html [ URL_http://geekexplains.blogspot.com/2009/04/sax-vs-dom-differences - between-dom-and.html] Even if you don't use SAX/DOM there are still simple options available to you, take a look at Simple : ) URL_http://simple.sourceforge.net/ [ URL_http://simple.sourceforge.net/ ] You may also want to consider STaX.
    • URL_http://simple.sourceforge.net/ [Simple] apparently can deal with more complex object graphs, but XStream seems more popular, does JSON and will probably suit my needs (I won't be ever having cyclic references).
    • Explore all reviews
  182. org.apache.sling
    • turns out you can do: JSONObject json new JSONObject(slingHttpServletRequest.getParameterMap()); as well - your method does give a bit more control over what is allowed into the json object (such as introducing a white/black list) - which is nice.
    • I would also iterate over the request params but instead of using an arbitrary json library use the JSONObject that is provided by sling.
    • Use the built in pretty printer in Sling's JSONObject: URL_http://sling.apache .org/apidocs/sling5/org/apache/sling/commons/json/JSONObject.html#toString(int [ URL_http://sling.apache.org/apidocs/sling5/org/apache/sling/commons/json/JSONObje ct.html#toString(int] ) public java.lang.String toString(int indentFactor) throws JSONException Make a prettyprinted JSON text of this JSONObject.
    • Ideally I would like to use a URL_http://sling.apache.org/site/index.html [Apache-Sling] library (as they are exposed in my container naturally).
    • I am using the Apache Sling JSONObject to model my JSON Object and turn it into a String, so if the Sling JSONObject can be set to output a tidy string (which i dont think it can) that would work too.
    • i looking also for a good implementation.
    • Explore all reviews
  183. org.mediawiki
    • (MediaWiki recommends adding the &indexpageids parameter to assist with parsing, however I can't see how it would be useful to me.)
    • I tried using the CODETERM3 and CODETERM4 annotations as well but they don't appear to help, throwing the same exception CODETERM5 .
    • Thanks for any and all assistance.
    • Explore all reviews
  184. org.w3c.dom
    • The above example works, so, please, be more precise.
    • (note that keeping a reference to your document builder will speed things up if you need to parse multiple files) Then you use the function in URL_http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Document.html [org.w3c.dom.Document] to read or manipulate the contents.
    • I've used org.w3c.dom.Element maybe using another one may help navigate through the response (if jaxb supports it).
    • Explore all reviews
  185. net.java
    • You're welcome, glad that it worked out for you.
    • This is essential when configuring JerseyTest too, otherwise only the server part of a JerseyTest will work with POJOs and the client in your test class will fail: URL_https://java.net/projects/jersey/lists/users/archive/2011-07/message/43 .
    • Here is the download page for the reference implementation jar of JSR-000353 URL_https://java.net/projects/jsonp/downloads/directory/ri [ URL_https://java.net/projects/jsonp/downloads/directory/ri ] If you are using JSON I recommend the Jackson JSON library.
    • I found where the code is now: URL_http://java.net/projects/meapplicationdevelopers/sources/svn/show .
    • URL_https://java.net/jira/browse/JERSEY-753 [ URL_https://java.net/jira/browse/JERSEY-753 ] This method of producing JSON has some limitations and may not be what your ultimately want.
    • Probably best to do this by filing an issue at URL_http://java.net/jira/browse/JERSEY and attach the file there.
    • Explore all reviews
  186. dozer
    • (If there's a lot to map, you could use a Framework like Dozer to do it for you).
    • I was rather hoping to avoid having to merge beans, past experience of this king was rather bad.
    • The OP also wants a succinct configuration-based transformation facility, and for that you might try Dozer (which also operates on plain Java objects.
    • Explore all reviews
  187. com.dyuproject.protostuff
    • it says: A serialization library with built-in support for forward-backward compatibility (schema evolution) and validation.available formats: protostuff (native), protobuff, json ...
    • @Eric support for generics and circular references is not part of the google spec; protobuf-net and protostuff essentially cheat with extensions (that fit the wire spec); I have no idea if the approaches taken for the two are even remotely similar.
    • protostuff could probably fit with your requirements, see URL_http://code.google.com/p/protostuff/ [ URL_http://code.google.com/p/protostuff/ ] it takes a special language describing the base data structure an produces tidy java classes with annotations.
    • Explore all reviews
  188. zookeeper
    • So the final JSON String will look like this - CODESNIPPET_JAVA4 .
    • You can do it, in limited cases, by doing the obvious string manipulations, but it's far better, in the general case, to deserialize the JSON, modify the resulting Map, and then reserialize the Map.
    • What's the best and efficient way to do this?
    • Explore all reviews
  189. com.google.guava
    • @MattBall Thanks, I was just about to edit and improve that part :).
    • Also, it's currently got a hard dependency on Google Collections which I want to remove and it's probably too heavyweight for your needs, but it allows you to interact with your JSON data in the way you're looking for: CODESNIPPET_JAVA1 .
    • And maybe I'll clean up the code I have and try to create a standard.
    • Explore all reviews
  190. net.sourceforge.jena
    • You might need to have a look at the Turtle spec document to understand how this gets build, it is kind of intuitive anyway.
    • You can use any of the libraries listed URL_http://json.org/java/ [here] to parse your JSON document and URL_http://jena.sourceforge.net/tutorial/RDF_API/ [Jena] to create the RDF triples.
    • Bear in mind that there are several ways to serialize RDF triples, RDF/Turtle is the most readable.
    • Explore all reviews
  191. rhino
    • I could recommend embedding Rhino, enabling the user to write javascript.
    • This is saying roughly the same thing (use JSON2):[Java 6 + JSON2.parse()]( URL_http://stackoverflow.com/questions/2405410/java-6-scriptengine - and-json-parse-problem).
    • You've also got the advantage that if your problem requires it, you may well be able to set it up so that the same expressions will happily run client or server side.
    • Important point here, 100GB won't fit into main memory, so I/O performance might be the bottleneck and should be optimized rather than the processing code.
    • Embedding Rhino and exposing a limited set of objects was a great way to enable all sorts of user scripting in a past project and that was some years ago, Rhino is quite mature now.
    • Important point here, 100GB won't fit into main memory, so I/O performance might be the bottleneck and should be optimized rather than the processing code.
    • Explore all reviews
  192. org.neo4j
    • Can somebody help me to get values inside "data" element: I have json output from neo4j as follows: CODESNIPPET_JAVA2 .
    • Nodes can be unique per-index (meaning, if you index a property, you can enforce only one node existing for that property) - see URL_http://docs.neo4j.org/chunked/stable/rest-api-unique-indexes.html [ URL_http://docs.neo4j.org/chunked/stable/rest-api-unique-indexes.html ] for the documentation to do this via the REST API.
    • Check out URL_http://neo4j.org/ [neo4J] The internal representation of the graph would be then delegated to the database and people have been working on this for years, so I would expect the representation to be efficient and performant.
    • Explore all reviews
  193. org.springframework.build
    • I am trying to parse JSON data being sent from UI in my Controller using Spring build Jackson support and this is my code CODESNIPPET_JAVA1 .
    • i checked the JSON format using some online services and it seems valid, while tryin gto parse JSON data i am getting following exception CODESNIPPET_JAVA3 .
    • my CODETERM1 class contains simple properties for for CODETERM2 , CODETERM3 etc with a no argument constructor .
    • Explore all reviews
  194. org.apache.camel
    • I have a Java project that currently returns a map to Camel without any nested key,value pairs, and the Jackson library marshalls it just fine into JSON using the Jackson library.
    • Unfortunately this didn't helped me :-/ Any other suggestion?
    • How can I get Camel to marshall a Java object with nested key,value pairs?
    • Changed constructor to use Upper case as per 'HourlySalesFigures' in both the argument and constructor body, same thing again.
    • How do I marshall nested key,value pairs into JSON with Camel and Jackson library?
    • I modified my ApplicationContext.xml to add these changes( also updated the xml above), and now I get the following error: Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 30 in XML document from class path resource [applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 30; columnNumber: 25; cvc-complex-type.2.4.a: Invalid content was found starting with element 'camel:dataFormats'.
    • Explore all reviews
  195. org.codehaus.woodstox
    • The main reason I mention it is that the author, Tatu Saloranta, has done some really great stuff (including URL_http://woodstox.codehaus.org/ [Woodstox] , the StAX implementation that I use).
    • For sake of completeness, I will also mention that Woodstox ( URL_http://woodstox.codehaus.org ) is another Stax impl that does work well -- alas, JDK-bundled SJSXP has some issues that XML module can not work around with (esp.
    • I especially like being able to switch back and forth between using a "tree model" (similar to XML DOM) and object mapping.
    • Explore all reviews
  196. org.yaml
    • What you can do is that 1.ask the server side to return a valid json format to you, 2. or you can use YAML library to extract the key- pair value.
    • Besides the consuming side would have to periodically poll the file to look for new input, which means you're already losing time.
    • Writing to a file on the filesystem is almost never going to be as fast as a socket connection.
    • Adding dependencies can be a hassle.
    • wish I could upvote this more.
    • The messiness inside the CODETERM7 method is for making sure you only ever get a Double or an Integer or a Long, and probably could be better, or at least simplified if you're okay with getting BigDecimals, which I believe is the default.
    • Explore all reviews
  197. com.google.protobuf
    • Or [Protocol Buffers]( URL_http://code.google.com/p/protobuf /) since it's supported by almost any language, results in smaller serialized data and you don't even have to write a single line of code to parse / serialize it.
    • simplify the problem then...take out protobuf-java-format and instead add code like Exception e new InvalidProtocolBufferException() to see if that works first.
    • What do you mean "my object writer would pass it"?Also, all you have to do is call build() on the world that you serialize, and then you can do something like "toByteArray()" or something like that, take a look at the protobuf javadoc for the best serialization method.
    • Actually, I disagree on your "scalability" and "maintenace" / "change" points re protobuf: protobuf is specifically designed for scalability, with dense output (smaller than json etc), and cheap processing (especially compared to text protocols).
    • The protobuf objects have serialization methods to bytes, it's very efficient and compresses really well.
    • Another very useful method to play around with when debugging is XXXXX.class.getProtectionDomain().getCodeSource().getLocation() replace XXXXX with a class that exists in protobuf like that Exception class that your class is having no problem loading and protobuf-java-format is having a problem loading and also any class from protobuf-java-format.
    • Explore all reviews
  198. com.extjs
    • Probably in other situation it will not be useful approach but for me works great!
    • Sorry I don't have a work around, but the infinite grid in the latest ExtJS release is really buggy..
    • can you suggest the solution with respect to extjs version i am using.
    • You would need to give more details then, because right now I can't imagine why escaping the slashes would make problems, but escaping the quotes wouldn't.
    • The grid works excellent aside from this one defect.
    • I am wondering if there is a way to work around the exception thrown in ExtJS and whether or not there is something abnormal which I am doing to trigger this behavior.
    • Explore all reviews
  199. jetty
    • Thanks for the answer,Ron, but I am really looking for a Java solution since my code is in Java.
    • You can catch the exception, but not sure if that helps a lot -- parser probably won't read the whole thing.
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • Tangent answer, but I've found python + gunicorn to be really speedy for making quick REST mockups when I'm integrating with a 3rd party service.
    • So I would like to hear what IDE/Plugins + J2EE Technology stack + Server(If that matters) is a good combination for my usecase and why.
    • I get this regardless of what CODETERM1 and CODETERM2 annotations I add to my methods though they should both be CODETERM3 .
    • Explore all reviews
  200. javax.xml
    • I pretty much look for anything you've written when dealing with MOXy or JAXB.
    • I think I ended up tracing through it and found that it was a problem in the json provider.
    • yes I see that before sending the request an OPTIONS call is send It's normal now I decided to make it as simple with text/xml and mapped it to objects with jaxb .thanks anyway.
    • There also must be a way of doing this using PropertyNamingStrategy, the problem I am facing with it is that Spring MVC is handling it somehow differently than serializing something directly with ObjectMapper from JAXB objects.
    • In the past I remember working with XML files, using the JAXB compiler to automatically generate Java classes, and those tags where automatically generated, so I guess some tools to generate code do this, while others do not.
    • My classes have jaxb annotations and the system application provider seems to interfere with the jackson json provider.
    • Explore all reviews
  201. twitter4j
    • This looks like a toString representation of the object, it would be better if you could write it in the format you need as you receive results.
    • Thanks for the reply i am using twitter4j and i am facing the exception java.lang.NoClassDefFoundError: javax/crypto/Mac .I am using maven for building.
    • Works like a charm!
    • It is a twitter4J dump (entities as called in twitter4J - UserJSONImpl ).
    • Thanks heaps, Love your work with Twitter4J, keep it up!
    • the isTruncated=false, so JSON would be isTruncated : false, but you can't simply substitute '=' for ':' , because the equals - sign could be part of a literal text, though I don't understand why Twitter4J doesn't use JSON.
    • Explore all reviews
  202. org.apache.axis2
    • Following this small tutorial: URL_http://code.google.com/p/jsonp-support-for- axis2/wiki/OneStopPage [ URL_http://code.google.com/p/jsonp-support-for - axis2/wiki/OneStopPage] I was able to configure my Axis 2 web service correctly.
    • well actually i modified the source for the message builder and it solved the problem atleast for now..
    • The problem is that the returned JSON, doesn't look like a standard JSON representation (Not even in badgerfish format).
    • If you don't wish to build or manipulate the message within the ESB, you can use message relay message builder/formatter for application/json in place of default axis2 builder/formatter pair.Have a look at [this]( URL_http://docs.wso2.org/display/ESB403/Message+Relay) .
    • This is because JSON is mapped to XML-like datastructure, and XML must have a root, so the first key-value pair is considered as root.
    • Typically this means a RESTful API with JSON.Theres one issue weve come across, where were dealing with an existing Web API which is presenting in JSON.The problem is where arrays are incorrectly serialized in certain cases.
    • Explore all reviews
  203. javax.script
    • I just ran your code and it works fine.
    • I was adding quotes in java script which was causing problem and I didn't even think about to look JS file.
    • use the java script in the client side of your application and pass the selected values to server.
    • I have a large amount of data being sent from server to java script, which is taking quite a long time to load.
    • XSS paradise O_O Load them from server, instead of from client :////.
    • Hi guys I am having problem with my jquery function what I am trying to achieve is to populate data in a listbox The java script funtion CODESNIPPET_JAVA1 .
    • Explore all reviews
  204. jstl
    • If it's valid JSON it should work correctly.
    • I'm trying to load the JSON object when the page loads, but I've been unsuccessful with various different ways... c:set var, body onload, mixing JSTL and JS... Is there a way to load JSON objects as the page loads?
    • Obviously it didn't work, I kind of screwed it up, please help.
    • We are currently using JSP with JSTL for our view, but our designer doesn't know JSP so it's been a real pain to merge his design changes into the source.
    • It worked!
    • If you're using JSTL c:out, ensure that its escapeXml attribute is set to false.
    • Explore all reviews
  205. com.google.appengine
    • Do I have to write from scratch a servlet that manages the jSON handling or there is a library or something like the SOAP support for web services?
    • This is way too vague.
    • However I can parse for Category CODETERM5 Once, I get the Category JSONObject, I can parse for Item like this CODETERM6 fine.
    • I have created a JSONArray of Category object which include Item object List(JSONArray) in google appengine, thus, using CODETERM1 I validate the resulting String here URL_http://jsonformatter.curiousconcept.com/ [ URL_http://jsonformatter.curiousconcept.com/ ] and it fails.
    • App Engine has some very nice tutorials on their website, I'd recommend starting there: URL_https://developers.google.com/appengine/docs/java/gettingstarted/creating [ URL_https://developers.google.com/appengine/docs/java/gettingstarted/creating ] I'd just create a simple form which you would POST to a servlet.
    • my requirements: i want a webform where i can enter student news and events and that should be stored on webservice(json).this webservice must be comapatible with appengine.please help me i strucked with that i con't move work.. sorry for my english.
    • Explore all reviews
  206. com.googlecode.json-simple
    • It should be pretty simple to check if the string begins and ends with [].
    • According to my reading of both the code and comments of the JSONObject class ( URL_https://code.google.com/p/json - simple/source/browse/trunk/src/main/java/org/json/simple/JSONObject.java), it doesn't do anything to preserve the order of the keys.
    • You can use [json-simple]( URL_http://code.google.com/p/json-simple /) which is simple, as the name implies.
    • Thanks :) currently looking at Gson, I'm using this json-simple lib, which I suspect is lacking a few good feature I need.
    • @mabuzer Gave up...just using Gson (for pretty-print) + json-simple for everything else.
    • According to my reading of both the code and comments of the JSONObject class ( URL_https://code.google.com/p/json - simple/source/browse/trunk/src/main/java/org/json/simple/JSONObject.java), it doesn't do anything to preserve the order of the keys.
    • Explore all reviews
  207. junit
    • that's good, sound like you're including the libraries correctly then...maybe it's the arguments that are being passed to assertThat causing the problem then.
    • So basically I would like to build up my unit test for this something like: Mock the CODETERM2 (somehow) to correctly generate JSON results based on the requests.Correct me if I'm wrong but I could marshal back the JSON result if I build up the mocked object hierarchy.My problem here is that I need to create the hierarchy for every single request, but I guess I cannot do anything fancier here.I should assert that the CODETERM3 method invoked with the expected device ID.
    • I was thinking of maybe this method should be broken apart to two methods, but I can't see any clean and good solution because this method will be used as an access point from other components in the system, therefore one method should accomplish one thing.
    • I've been battling this today and your question inspired me to make it bloody work :D The annotations are here: URL_https://github.com/FasterXML/jackson- annotations/wiki/Jackson-Annotations [ URL_https://github.com/FasterXML/jackson - annotations/wiki/Jackson-Annotations] See JUnit test here: URL_https://gist.github.com/TomDemeranville/7009250 [ URL_https://gist.github.com/TomDemeranville/7009250 ] .
    • I hope I can get something better, I don't like these argument captors and generally too much code is needed to simply describe this case and there will be many types of the requests.
    • The solution that I used in the end was to change to sourceforge.net json parser, a couple of code tweaks and my JUnit tests still worked and Tomcat did not complain.
    • Explore all reviews
  208. org.apache.xmlbeans
    • upvoted just for saying that XMLBeans "seems like a lot of faffing around".
    • What formats and libraries are people using in production systems these days, is anyone else trying to avoid the URL_http://www.codinghorror.com/blog/archives/001114.html [angle-bracket-tax] ?
    • We've also looked at URL_http://xmlbeans.apache.org/ [XMLBeans] , but it seems like a lot of faffing around.
    • What formats and libraries are people using in production systems these days, is anyone else trying to avoid the URL_http://www.codinghorror.com/blog/archives/001114.html [angle-bracket-tax] ?
    • _Edit: really needs to be a cross platform solution: Linux, Windows, Solaris etc.
    • We've also looked at URL_http://xmlbeans.apache.org/ [XMLBeans] , but it seems like a lot of faffing around.
    • Explore all reviews
  209. genson
    • This is a good answer, but if you don't want to use other libraries, you could also add a private member to GeneralTemplate which contains the class name as string.
    • @mgibson by the way you should not get source code for libs and package it your self, as the code in the trunk is not matching the released version.
    • Thanks, it works.
    • you can also have a look at genson URL_http://code.google.com/p/genson /, it is easy to use, provides streaming api/databinding, can deserialize even if there is no default ctr and much more.
    • @mgibson great you like it :) yeah sure if you use maven use the dependency from here URL_http://code.google.com/p/genson/wiki/GettingStarted Download, if you just want to dl the jar you can find it here URL_http://mvnrepository.com/artifact/com.owlike/genson/0.94 (you have a download link there).
    • The classes include: URL_https://code.google.com/p/genson/source/browse/src/test/java/com/owlike/ge nson/bean/Feed.java?r=2b80106be551560dd27cef4197de0d0500e93439 [Feed.java] - which has an id field URL_https://code.google.com/p/genson/source/browse/src/t est/java/com/owlike/genson/bean/Link.java?r=2b80106be551560dd27cef4197de0d0500 e93439 [Link.java] - which has a href field Genson will integrate with URL_https://code.google.com/p/genson/wiki/SpringIntegration [Spring-MVC] and URL_https://code.google.com/p/genson/wiki/JerseyIntegration [Jersey-for-JAX- RS] .
    • Explore all reviews
  210. org.antlr
    • Pity that it is not well known enough.
    • ANTLR has the disadvantage that it complicates the build process a lot, though.
    • Examples are JAVACC, CUP and my preferred tool, ANTLR.
    • ANTLR is very powerful but can be difficult to start with.
    • JSON is relatively simple and it would be a useful exercise.
    • With DMS you can define the JSON syntax, build ASTs, and then write source-to- source tranformatinos to map that to XML representing your schema.
    • Explore all reviews
  211. org.jboss
    • Thanks for the post, I've gotten quite a bit further, but still haven't cracked the nut.
    • I had no problem reading the contents of the custom class' instance, nor a problem while returning it to my client.
    • i would like to using only JAXB(native for JBOSS AS 7) for best performance, avoiding others "jar".
    • The following servlet is a demo of how you can use this (I am running it on a JBoss 7.1.1): CODESNIPPET_JAVA1 .
    • i would like to using only JAXB(native for JBOSS AS 7) for best performance, avoiding others "jar".
    • NOTE: If you are deploying this in JBoss 7 do not set the CODETERM4 context parameter as it is enabled by default.
    • Explore all reviews
  212. elasticsearch
    • If this is something you must have you can just convert all the values of this field to string.
    • So when some data have CODETERM12 as CODETERM13 , like CODETERM14 , then it is throwing exception, as the type is mapped to CODETERM15 .
    • You can't have a field that contains different types of values.
    • But it will disable type mapping for all fields.
    • A bit longer - ElasticSearch is not schema-less - it's dynamic.
    • So if there are 20 fields in JSON, I bother for types of 4 fields, for other 16 fields if they are considered as String, I am OK with that.
    • Explore all reviews
  213. org.mongodb
    • And when I say paging is the standard way of doing this, this applies to SQL databases as well as Mongo.
    • That does in fact work, though I wound up with a different solution.
    • @brainOverflow That is what I thought was easy.
    • I mean storing Json as an String field is not very useful, as it does not allow you to query or aggregate your data.
    • Good, hope someone has a solution.
    • /} is not valid JSON, so I doubt you'll find any JSON parser/marshaller that will generate that.
    • Explore all reviews
  214. ognl
    • To make this working you need to add CODETERM3 parameter in the JSON result CODESNIPPET_JAVA1 .
    • It doesn't work because firstly the value CODETERM1 in the list attribute is used to evaluate the OGNL expression, then when failed it's used as a name of JSON array (if a map is used then to the JSON object).
    • The other option is to build an EL bridge between JSONObjects and something like MVEL or OGNL, which would give you the more-familiar dot notation.
    • The json-path project I mentioned earlier uses too many regular expression which makes me a bit skeptical about its performance.
    • Update about Ognl: it works!
    • But then I tried CODETERM4 which works and in the same way CODETERM5 also should work which implements CODETERM6 interface.
    • Explore all reviews
  215. restfb
    • I used Graph API Explorer to see if my search was working and to check if "count" appeared on the results, and it does: CODESNIPPET_JAVA2 .
    • But, it's resulting into the error: CODESNIPPET_JAVA5 .
    • Facebook restfb using jsonObject stopped getting likes count.
    • I can see the problem is occuring due to conversion of CODETERM8 class object to String by CODETERM9 .
    • I am using restfb to get the number of likes in an specific post, and it was working well.
    • Somehow, this morning it stopped working, and I didn't change anything in the code.
    • Explore all reviews
  216. jersey
    • If one existed I'd prefer a HTTP framework that worked with Gson instead of Jersey as I'm more comfortable with it.
    • Yes, I'm very familiar with Gson, and Jersey already uses Jackson, but converting JSON to and from POJOs is only one part of the problem, I'm looking for an alternative to Jersey, which is a framework for building REST-HTTP APIs.
    • I need to build the server side of a JSON-REST API, and I've been playing with Jersey to do it (using it's JSON-POJO mapping feature).
    • The problem is that even testing the simplest possible use-case has required several questions here on SO, and quite a bit of hunting around.
    • Explore all reviews
  217. org.apache.thrift
    • Other libraries like Protocol Buffers: Apache Avro, Apache Thrift.
    • It's hard to say from your text what you really want.
    • This can be useful if you want your service to be consumed by Javascript code, where JSON is often the easiest thing to deal with.
    • Where do things like "Apache Thrift" come in and what are the benefits?
    • Explore all reviews
  218. quick-json
    • yeah but it it's in the correct format from what i can tell so I don't know why it's telling it it's not.
    • The user facing service (using URL_https://code.google.com/p/quick-json/ [quick-json] ) prevents the user from making the backend (using URL_https://code.google.com/p/json-simple/ [json-simple] ) do bad stuff.
    • As you can see, it works as intended: CODESNIPPET_JAVA2 .
    • I figured this one out myself, the documentation for Quick-JSON is a bit rough, but I figured it out.
    • That works as well.
    • I'm trying to parse this stock info at: URL_http://www.google.com/finance/info?client=ig&q=csco [ URL_http://www.google.com/finance/info?client=ig&q=csco ] that's in JSON format to a map, essentially following this tutorial I saw using the quick-json jar but it keeps giving me an exception and I can't figure out why.
    • Explore all reviews
  219. org.springframework.security
    • The flow is that when receive a call to /entry.html, it will check and choose to redirect to CODETERM1 handled by spring security and then redirect to CODETERM2 response JSON resolve to view CODETERM3 , which is a jsp contain only a json string I would like to know if I can use CODETERM4 in CODETERM5 without using an jsp to write just a json value?
    • My personal choice would be: Either of the following:** Spring WebServices (XML) Spring MVC (JSON) Secured with:** Spring Security OAuth provider - (AFAIK, a little complicated compared to Google's provider, but lots of tutorials on integrating with the above two).
    • I am fully willing to abandon the ".json" URL's entirely, and would prefer to have a simple way to specify controller methods that return JSON, than add a security aspect that is necessary because of a small subset of controller methods.
    • If you're using a framework like Spring Security you can control that some URL like .json can only be reached by some users (for instance the administrator, if they're only used in the admin pages).
    • Explore all reviews
  220. regexp
    • I'll accept his solution (since the question has regexp) but use yours, Thank you.
    • The reason why this pattern is safe is that new lines are invalid in String values (they must be escaped using CODETERM2 ) so you can safely remove whitespace around them.
    • I used like this: s.replaceAll("\\s*\\n\\s","") but there was a new line in output.
    • I'm trying to change some back-end code without screwing around much with the front-end... and the front end doesn't seem to like quotation marks.
    • Explore all reviews
  221. jython
    • Jython sounds like a possible solution.
    • Alternately if you just want to remove comments I believe you can do it trivially in Python, which you can just call with Jython.
    • Hey guys, I'm still a noob to Android-related coding and StackOverflow in general, so don't be too harsh on me but I haven't been able to find a question like this asked on here already.
    • Well actually two arrays.
    • Explore all reviews
  222. com.google.code.guice
    • You need to hook it (or a subclass such as CODETERM2 ) in the Jersey- recognized IoC container (its own by default, but I personally prefer Guice), or otherwise get it registered as an CODETERM3 .
    • Now I glossed over getting the Provider and MessageBodyReader registered with your JAX-RS Application configuration, but that could vary greatly depending upon if you're using Jersey's servlet, using a custom Application, using Guice, or any number of other ways of setting up your JAX-RS stack.
    • Remember that erasure is URL_http://www.angelikalanger.com/Gener icsFAQ/FAQSections/TechnicalDetails.html#FAQ101 [replacing-type-parameters-by- their-leftmost-bound] and that a URL_http://gafter.blogspot.com/2006/12/super- type-tokens.html [super-type-token] (which is what that TypeToken is, as used in Guice & Gson and various other places) is basically a trick that lets you get access to the parameterized type information of the superclass via reflection.
    • I was using Jersey and Guice so was a little hard to find out how, but I did it.
    • But I'd like to have my dependencies injected with Guice.
    • So my question is how to resolve this situation and have Jersey, Guice and JSON play nicely together?
    • Explore all reviews
  223. ireport
    • Once your field is defined you can use its computed value in a text field or whatever: Hope that helps some people.
    • below is the json source and jrxml file.
    • They should be the JSON path from the root of the JSON input file using standard dot notation.
    • On _iReport_, values are correctly displayed on both parameter and data fields, but when run thru the codes below only the parameter fields are displayed.
    • Explore all reviews
  224. xstream
    • See JavaDoc - toXML: Serialize an object to a pretty-printed XML String.
    • XStream seems somewhat less flexible, and it's fairly slow.
    • I tried Xstream as well but I was not able to .Btw the name of the xml tag will change Dynamically .
    • I tried to solve your problem using XStream all the ways I could think of and I have failed.
    • I like XStream very much.
    • Since escaping new lines / quotes etc can make this a little tricky, why not just use [XStream]( URL_http://xstream.codehaus.org /) to convert the object to XML and wrap the [HTML in a CDATA section]( URL_http://www.w3schools.com/xml/xml_cdata.asp ) ?
    • Explore all reviews
  225. org.jboss.resteasy
    • Thanks for the post, I've gotten quite a bit further, but still haven't cracked the nut.
    • And now to open a RESTEasy bug.
    • it's better you have a RESTful framework like [Jersey]( URL_https://jersey.java.net /) or [resteasy]( URL_http://www.jboss.org/resteasy) .
    • Yes, my exception mapper works, but not for those...
    • I know that implementation works in Jersey, RestEASY and Spring 3.
    • Don't really know about Jersey, but in RESTEasy exception mappers to classes like Exception and Throwable have, by design, no effect.
    • Explore all reviews
  226. jdbc
    • are you using Hibernet or or simple jdbc or any other orm tool.
    • For a long time you had to specify the charset in the jdbc connection string for MySQL.
    • You don't have to use all of jOOQ's features to take advantage of some useful JDBC extensions.
    • This uses POJOs and annotations to provide a more complex structure to your objects.
    • Maybe you can improve a lot the total processing time by optimizing the query itself but its a different story.
    • For me its usually worth to maintain something between the db and remote client, it just sounds right.
    • Explore all reviews
  227. com.pubnub
    • I've opened a new question which is compliant with SO's requirements here: URL_http://stackoverflow.com/questions/20547815/java-is-there-a-convenient-way-to - extract-data-from-the-mtgox-pubnub-json-api .
    • Trying to extract bits of information directly from a CODETERM2 produces ugly code with lots of calls to CODETERM3 , for which again exceptions might need to be handled.
    • The Concept** For me, the best solution was to convert the CODETERM1 s from the PubNub API to bean classes which I found in the MtGox module of the URL_https://github.com/timmolter/XChange [XChange-library] .
    • This approach has the disadvantage that I have to write my own POJO classes, e.g.
    • Most is standard code for using PubNub.
    • PubNub Java Class for MtGox JSON API It's easy to create a ready made Java Class for ingesting the live feed provided by Mt.Gox This is a work-in-progress post to show you how to access the PubNub Data Feed from Mt.Gox as shown in the Dev Console live feed!
    • Explore all reviews
  228. javax.json
    • It would be fairly easy to wrap URL_http://docs.oracle.com/javaee/7/api/javax/json/JsonObject.html [JsonObject] and URL_http://docs.oracle.com/javaee/7/api/javax/json/JsonArray.html [JsonArray] in a JSObject implementation.
    • Edit 1 As it turns out the URL_http://hg.openjdk.java.net/jdk8/jdk8-gate/nashorn/file /fbd21b00197b/src/jdk/nashorn/api/scripting/ScriptObjectMirror.java [ScriptObjectMirror] class can be used as a go-by or as a default implementation of JSObject itself.
    • Edit 1 @Vik Gamov, By interoperability, I mean a way to inject javascript / JSON objects into the script at runtime.
    • As it turns out, they have also provided a default implementation for URL_http ://hg.openjdk.java.net/jdk8/jdk8-gate/nashorn/file/38378024a332/src/jdk/nashor n/api/scripting/JSObject.java [JSObject] with URL_http://hg.openjdk.java.net/j dk8/jdk8-gate/nashorn/file/fbd21b00197b/src/jdk/nashorn/api/scripting/ScriptOb jectMirror.java [ScriptObjectMirror] .
    • I know Nashorn allows for objects from other JVM languages, like standard Java objects.
    • will Nashorn include native support for javax.json.spi.JsonObject)?
    • Explore all reviews
  229. java.beans
    • @RequestBody is perfectly capable of parsing nested JSON, however you have to adhere to the Java Beans specification.
    • It just converts JSON format to Java beans and vice versa.
    • All you will need is the servlet engine - which provides a way to host threaded Java code over an HTTP interface.
    • Hi,chubbsondubs,I had a similar problem.Does it affect if your getter and setters are private or your constructor is private?
    • By the way, I recommend that you don't expose the Java Beans themselves - in domain driven development terms this is your _core model_.
    • Primitives are now serialized to valid JSON ( CODETERM8 ), but "normal" Java beans are also wrapped which is undesired ( CODETERM9 instead of CODETERM10 ).
    • Explore all reviews
  230. org.apache.avro
    • @chris-gerken and all: this is not asking to recommend a tool.
    • I generate this JSON objects with AVRO ( URL_http://avro.apache.org ) JSon Encoder, they seem to be ok, but apparently other parsers have problems with them.
    • There isn't much for guiding documentation or examples out there, but here are a couple decent looking ones: Here's a tutorial for using the socket server: URL_http://gbif.blogspot.com/2011/06/getting-started-with-avro-rpc.html [ URL_http://gbif.blogspot.com/2011/06/getting-started-with-avro-rpc.html ] Here's an open source project/demo for using Avro over http: URL_http://code.google.com/p/avro-http-example/ [ URL_http://code.google.com/p /avro-http-example/] .
    • Gotchas: It is sometimes challenging to convert Java generics, like TreeMap.
    • Other libraries like Protocol Buffers: Apache Avro, Apache Thrift.
    • This can be useful if you want your service to be consumed by Javascript code, where JSON is often the easiest thing to deal with.
    • Explore all reviews
  231. com.jayway.jsonpath
    • only giving reference of any external link is not taken as a good answer.
    • default type used by jayway jsonpath?
    • Nice.
    • I think you have to add these dependencies to your project: URL_https://code.google.com/p/json-path/downloads/detail?name=json- path-0.8.0-dependencies.zip&can=2&q= [ URL_https://code.google.com/p/json - path/downloads/detail?name=json-path-0.8.0-dependencies.zip&can=2&q=] In particular json-smart-1.1.jar where the missing Exception class is contained.
    • Aha, that was it!
    • This will solve my problem for sure :).
    • Explore all reviews
  232. apache-wink
    • and the server returns only "Hello World!".
    • I encode the whole structure at once (about 10 MB) and I have a problem finding out what leads to this weird exception.
    • Do you know how best to debug this and what might typically lead to it?
    • I use plain java and Apache Wink for JSON.
    • I've been working with Apache Wink and for that I have needed to use a JSON provider, such as Jettison (a colleague has been using Jackson).
    • Explore all reviews
  233. freebase-java-api
    • You're correct, as it currently stands the standard Google Java client library doesn't offer a lot of benefit over just making the Freebase API calls yourself.
    • I had a problem with the input geolocation when I used the latitude and longitude from wikipedia.
    • NB: eventually I would like to query for larger amounts of data; the above query is just a simple example.
    • Question What would a basic example of querying Freebase with MQL from the Java Freebase API (google-api-services-freebase) look like and what is the recommended way for processing the resulting data?
    • Im especially wondering how to correctly use URL_https://developers.google.com/resources/api-libraries/documentation/freeba se/v1/java/latest/com/google/api/services/freebase/Freebase.html [the- CODETERM1-class] .
    • Explore all reviews
  234. stringtree
    • Talking about tools, if you're looking for some tools outside of Java, you can always feel free to try URL_http://jsonlint.com/ [JSONLint] .
    • As of this writing, there are these 20: URL_http://www.JSON.org/java/index.html [org.json] URL_https://github.com/upictec/org.json.me/ [org.json.me] URL_http://jackson.codehaus.org/ [Jackson-JSON-Processor] URL_http://json-lib.sourceforge.net/ [Json-lib] URL_http://developer.berlios.de/projects/jsontools/ [JSON-Tools] URL_http://code.google.com/p/json-simple/ [json-simple] URL_http://www.stringtree.org/stringtree-json.html [Stringtree] URL_http://sojo.sourceforge.net/ [SOJO] URL_http://www.restlet.org/ [Restlet] URL_http://jettison.codehaus.org/ [Jettison] URL_http://json-taglib.sourceforge.net/ [json-taglib] URL_http://xstream.codehaus.org/ [XStream] URL_http://code.google.com/p/jsonmarshaller/ [JsonMarshaller] URL_http://flexjson.sourceforge.net/ [Flexjson] URL_http://sourceforge.net/projects/jontools/ [JON-tools] URL_http://code.google.com/p/google-gson/ [google-gson] URL_http://argo.sourceforge.net/ [Argo] URL_http://pivot.apache.org/ [Pivot] URL_http://jwm.slavitica.net/p/projects/jsonij [jsonij] URL_http://sourceforge.net/projects/fastjson/ [fastjson] ...but of course the list can change.
    • Quicker, simpler and clearer error message but it's a web-based.
    • URL_http://www.stringtree.org/stringtree-json.html [This] is a good library for handling JSON.
    • URL_http://www.JSON.org/java/index.html [org.json] is the canonical one, but I prefer URL_http://www.stringtree.org/stringtree-json.html [Stringtree] personally.
    • Explore all reviews
  235. json-smart
    • If you want to keep JSON, look for other frameworks like "json-smart": URL_http://code.google.com/p/json-smart/ [ URL_http://code.google.com/p/json - smart/] They claim to be 2-3 times faster than Jackson.
    • What's more, you can retrieve a specific object inside a JSON object may it be another object, an array and convert it to a String or manipulate the way you want.
    • @KwintenP Try using the URL_https://code.google.com/p/json-smart/ [json-smart- library] .
    • I did a pretty extensive evaluation of json-java libraries a few months ago, and chose json-smart: URL_http://code.google.com/p/json-smart/ [ URL_http://code.google.com/p/json-smart/ ] Has been working well.
    • URL_http://code.google.com/p/json-smart/ [json-smart] Both of these libraries work as required by your implementation with a String "null" value.
    • Explore all reviews
  236. dropwizard
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • And I know that I could use a real CODETERM4 instead of the annotation and do it by hand, so I'm just asking if there's some elegant shortcut for this problem.
    • I'd like to accept JSON on an REST endpoint and convert it to the correct type for immediate validation.
    • I know I could create different endpoints for all kind of cars, but thats does not seem DRY.
    • But what is usually used is URL_http://docs.oracle.com/javaee/6/tutorial/doc/gircz.html [Bean-Validation- API] implementation.The nice thing about this is decoupling between data format handling, and validation logic.This is what frameworks like DropWizard use; and it's the direction JAX-RS (like Jersey) are taking things for JAX-RS 2.0. .
    • Explore all reviews
  237. mule
    • Using on Mule 3.4.1 and it is working like a charm!.
    • But in one of my JAVA Object , i have a CODETERM8 and since in JSON Object , Integer cannot be keys, CODETERM9 library is giving an Exception : CODESNIPPET_JAVA1 .
    • CODETERM2 can be anything..another CODETERM3 , OR CODETERM4 etc ..Now i have to convert it into CODETERM5 (and removing all those keys that have value as NULL)..
    • When i use a given Mule Transformer , CODETERM6 , it is converting into appropriate JSON..but not able to remove NULL value..And i could not find any properties to set in Custom-transformer that will remove NULL values..!!
    • So then, i wrote a custom transformer**, that uses the CODETERM7 library and i am able to remove NULL values.
    • Explore all reviews
  238. xmlrpc
    • As for a client, well, I am using Apache XMLRPC, so it should be easy to implement.
    • I have found a python example but am struggling to find a java version.
    • Bonus points (not really) but if anyone could provide one where the the transport mechanism is abstracted out so the two are interchangable, I would be eternally in their favour.
    • Hi dfa - it's not an ongoing consultancy - it's just asking for a word from the wise about libraries that are tried and tested, as opposed to me going down a route that ends up with "version x.y of z lib needs version a.b of c lib and they don't work together".
    • Believe me, if someone could give me references to 2 x xmlrpc libs (1 client, 1 server) and 2 x json (ditto) then I'd be a happy man !.
    • Explore all reviews
  239. org.jibx
    • It's pretty awesome!I'm just looking for an equivalent JSON framework that can bind multiple JSON structures into the same class.
    • Most do not extend the flexibility of mapping complex Java hierarchies into any arbitrary chosen JSON object representation.
    • These frameworks include Castor, JiBX and the like.
    • The configuration is usually pretty limited.
    • If my Java domain classes changes in any way, my json responses will change as well, causing any service clients, expecting the old version of json responses, to break.
    • Explore all reviews
  240. robospice
    • I need to send a POST HTTP request** using Robospice for Android that will have data in the following format: Content-Type: application/json {'var1':'var1val','telNumber':'var2val'} There may be other HTTP headers inside but this is the only header required by the server - I've tested it with a simple HelloWorld request that doesn't require any specific objects in the body.
    • I know I could get the data in a different way but I want to still use my listener and be able to make CODETERM6 block that way.
    • Doing it this way, I keep getting CODETERM4 and I am pretty sure it is related to format of the body.
    • Note that I was testing the very same request with both Chrome app for sending REST requests and CODETERM6 (worked fine).
    • With the default caching everything works as expected.
    • Explore all reviews
  241. castor
    • This is true, but POJO -> XML -> JSON would work with an additional library.
    • Most do not extend the flexibility of mapping complex Java hierarchies into any arbitrary chosen JSON object representation.
    • These frameworks include Castor, JiBX and the like.
    • The configuration is usually pretty limited.
    • If my Java domain classes changes in any way, my json responses will change as well, causing any service clients, expecting the old version of json responses, to break.
    • Explore all reviews
  242. morphia
    • The process seems standard to me.
    • But I think that I'am doing something wrong, because this code throws the following exception: CODESNIPPET_JAVA2 .
    • I'm looking for a 'clean' answer to this as well.
    • It seems like that the following line is throwing this exception: CODESNIPPET_JAVA3 .
    • Good, hope someone has a solution.
    • All my MongoDB query's are through Morphia to keep the code clean.
    • Explore all reviews
  243. jsoup
    • In short, it's not a very fluid API in the style of, say, JSoup, it appears to be a tool that comes from the era where everything was XML, and then it was retrofitted for JSON.
    • I don't think Jsoup will execute Javascript.
    • I was not sure if the JSON string will be wrapped in a body tag or if it would be removed to suit a well formed document.
    • Is there JSoup like libraries for JSON ?
    • Thank you very much.I had a doubt about this and I posted the question, your suggest is only way to get json string without to find it in html code.
    • URL_http://jsoup.org [JSoup] may however be URL_http://stackoverflow.com/questions/2835505/how-to-scan-a-website-or-page- for-info-and-bring-it-into-my-program/2835555#2835555 [useful] in this.
    • Explore all reviews
  244. vanilla
    • Everything has worked really well so far with the vanilla setup and the JsonProperty, JsonIgnore, and JsonFilter annotations.I'll check it out though, thanks.
    • vanilla JSON parser supplied with android can parse data, unfortunatelyit builds full JSON model in memory (like DOM parser for XML ) - this works fine forsmall data amounts, but is not practicable for slightly bigger data as it allocates and hogs a lot of memory.
    • It turns out that vanilla Struts2 doesn't accept query strings in the format CODETERM1 (feel free to correct me on this).
    • JSON.stringify(jsonObj) before passing it to the query string, a la CODETERM4 - which in this case, I can't do since Kendo UI grid doesn't seem to have an interceptor-like event to let me change the query parameters.
    • Gson 1.7.1 and 2.0 both respect final field assignments during vanilla deserialization operations, and the initial final field assignments are not altered.
    • Its the same reason you wouldn't forgo classes in a java program in favor of passing around a bunch of HashMaps.
    • Explore all reviews
  245. smartgwt
    • i use smartgwt 2.5. i have a databound treegrid which fetches a json from the database and builds the tree.
    • I'm afraid that UI components in SmartGWT and ExtGWT have very specific JSON format for fetching, updating, filtering, etc, and it would be very painful implement servlet-based service.
    • Thanks, I've just understood that I should remove GWT and left only SmartGWT and ExtGWT in question.
    • But I think that it's not very good idea.
    • I know that client's UI components in SmartGWT and ExtGWT can work with JSON, but have for this quite specific format.
    • I think that there are should be some approaches in ExtGWT / SmartGWT, but I couldn't find them.
    • Explore all reviews
  246. gwt-platform
    • I tried to output a table, that would contain the JSON values, taken with a help of Piriti mappers.
    • Here are the two presenters that are involved in this procedure: The CODETERM1 (that uses CODETERM2 , that is a widget, I'm not sure that widget should be used here, but, according to URL_http://groups.google.com/group/gwt- platform/browse_thread/thread/1bec69f557fda229/57135899295ae4bf [this- conversation] , widget may do the trick): CODESNIPPET_JAVA1 .
    • It's not a real project's code, it's just an attempt to understand GWTP, so this may be not the most beautiful solution (in fact, it's not one for sure).
    • Here is what happens with this code: the first row with CODETERM5 appears, then it changes to the first row that contains CODETERM6 's values, then again it contains CODETERM7 's values, then again CODETERM8 's, after that the second row with CODETERM9 appears, then it changes to the second row that contains CODETERM10 's values, then again it contains CODETERM11 's values, then again CODETERM12 's.
    • So, there are two products and two rows, and in this code the values are changed twice, but in the end the table contains only CODETERM13 's values.
    • But I haven't yet figured out how to make the correct output.
    • Explore all reviews
  247. spring-framework-issues
    • It's fixed in Spring 3.1 - use @RequestMapping(method RequestMethod.GET, value "foo/bar", produces "application/json"), see [SPR-7353]( URL_https://jira.springsource.org/browse/SPR-7353) .
    • URL_https://jira.springsource.org/browse/SPR-7543 Automatically expose @PathVariables in the Model causes all methods that have {@PathVariable} parameters to include the {@PathVariable}'s in the model, so the model always contains more than 1 item, so {extractValueFromSingleKeyModel} doesn't work.
    • Ok, I've opened a Spring Source JIRA request for this one, perhaps it is a much needed improvement: URL_https://jira.springsource.org/browse/SPR-10552 [ URL_https://jira.springsource.org/browse/SPR-10552 ] Or else, it is a case of leveraging the Jackson conversion capabilities in clever ways which sounds like a lot of plumbing.
    • You'll need to change your pom.xml if you're migrating from 1.x (Step 1: Update Maven / JAR dependencies from URL_http://www.cowtowncoder.com/blog/archives/2012/04/entry_469.html is all you need for the builtin support to latch on).
    • Support for Jackson 2 has been added in Spring 3.2, and has also backported to Spring 3.1.2 ( URL_https://jira.springsource.org/browse/SPR-9507 [SPR-9507] ) .
    • See URL_http://blog.springsource.org/2011/02/21/spring-3-1-m1-mvc-namespace- enhancements-and-configuration/ [Spring-3.1-MVC-Namespace-Improvements] See URL_https://jira.springsource.org/browse/SPR-7504?focusedCommentId=62730&p age=com.atlassian.jira.plugin.system.issuetabpanels%3acomment-tabpanel [SPR-7504] Make it easier to add new Message Converters to AnnotationMethodHandlerAdapter Exemple: CODESNIPPET_JAVA1 .
    • Explore all reviews
  248. com.eclipsesource.minimal-json
    • Are you using any kind of JSON library?
    • Problem is, there is absolutely no response after printing the raw JSON output.
    • URL_https://github.com/ralfstx/minimal-json - I cannot seem to find a suitable method!.
    • Generally speaking, you'd parse the JSON into it's "object" representation in your language, then ask for the key of interest.
    • CODETERM2 Well, you get the idea...I just need to extract the key value for "first_aired_iso" for each episode.
    • Not sure what you mean exactly by minimal JSON, personally I find the CODETERM1 package simple and straightforward (i.e.
    • Explore all reviews
  249. simple-http
    • Imagine a servlet that is triggered by a simple HTTP request with the URL /getCustomers.
    • (note - if I exclude the cookies during the POST I do get plain html back from the server w/ a valid "access denied" message) Full code for this solution is below CODESNIPPET_JAVA1 .
    • RequestFactory is very much like that but offers additional facilities.
    • I would like to make a simple HTTP POST using JSON in Java.
    • I don't know exact value to do this but I would give UTF-8 a go first.
    • I'm doing what should be a simple http post that includes a json string as the http body.
    • Explore all reviews
  250. commons-beanutils
    • But a project I'm working on has a really big JSON to manage and its structure changes a lot by time.
    • But in case if you get arbitrary JSON objects and you would like process them in the way you described, I would suggest combine URL_http://jackson.codehaus.org/ [Jackson-JSON-processor] along with Apache's URL_http://commons.apache.org/proper/commons-beanutils/ [Commons-Beanutils] .
    • Thank you works fantastically :).
    • So you may use it something like this: CODESNIPPET_JAVA1 .
    • It seems like a lot of libs for just JSON parsing :S.
    • Use BeanUtils recursively to walk your entire object graph - be careful of cycles - you'll need a Set or something on the side to keep track of what you've already seen XML: Look at XMLEncoder - it works using JavaBean properties to create XML For reading: One approach might be to use existing libs (for JSON or XML) to create objects then deal with merging the properties between objects.
    • Explore all reviews
  251. com.github.fge
    • Curious if anyone has any other suggestions on a good way to accomplish this (from what it seems), simple task that need, or if I perhaps need to stick with the 2nd option from above?
    • Load this as a schema, validate your input against it: if it validates, you know you need to deserialize against your fruit class.
    • Through searching, I have found the following 2 promising libraries for accomplishing this: URL_http://jsontools.berlios.de/ [ URL_http://jsontools.berlios.de/ ] URL_https://github.com/fge/json-schema-validator [ URL_https://github.com/fge/json - schema-validator] However, the first one seems fairly outdated with poor support.
    • Similar story with the 2nd one, which seems to be up-to-date with good test code.
    • Hier is a working parsing method based on the version of fge but improved as 1. it used jode's DateTime with the correct timezone initialized 2. minor change to pattern to accept +0200 too CODESNIPPET_JAVA1 .
    • Very cool additional piece -- thanks for sharing.
    • Explore all reviews
  252. jsonschema2pojo
    • FYI, jsonschema2pojo also supports generating types from an example JSON document (not schema) as of v0.3.3.
    • The jsonschema2pojo tool takes a json schema document and generates DTO-style Java classes (in the form of .java source files).
    • jsonschema2pojo.org was exactly what I was looking for!.
    • A detailed solution would be to use a tool such as jsonschema2pojo to autogenerate the required Domain Classes such as Student from the Schema of the json Response.
    • At the moment the best solution is probably URL_https://code.google.com/p/jsonschema2pojo/ [JsonSchema2Pojo] : It does the job from the seldom used Json Schema but also with plain Json.
    • EDIT:Maybe URL_https://github.com/ko5tik/jsonserializer [ URL_https://github.com/ko5tik/jsonserializer ] would be useful UPDATE:FYI so I looked at jsonschema2pojo but that only creates pojos from a schema, and I didnt actually have a json schema, just the actual json.
    • Explore all reviews
  253. glassfish
    • Oracle has produced a standard JSON API (JSR 353) for Java EE 6 which is available in Maven, and the reference implementation used in Glassfish is also available in Maven.
    • Explore all reviews
  254. thrift-protobuf-compare
    • I figured I would use URL_http://jettison.codehaus.org/ [Jettison] as it seems it would be URL_http://blog.bdoughan.com/2011/04/jaxb-and-json-via-jettison.html [easier- to-implement] since it actually works with JAXB; however, looking at URL_http://code.google.com/p/thrift-protobuf-compare/wiki/Benchmarking [Older- benchmarks] in which Jettison was not included I have found URL_http://code.google.com/p/kryo/ [Kryo] produces smaller files and Serialized and DeSerialized quicker than some alternatives.
    • Explore all reviews
  255. bson4jackson
    • You might be interested in URL_https://github.com/michel-kraemer/bson4jackson [bson4jackson] project, which allows you to use Jackson data binding to work with BSON (create POJOs from BSON, write as BSON) -- especially since Jackson also work with JSON.
    • Explore all reviews
  256. opencsv
    • @user2524908 Before you go and fix how the CSV parsing happens, try to write the String out yourself with proper escaping and checking if that works for you.
    • I like the OpenCSV solution.
    • Explore all reviews
  257. org.scribe
    • Authentication is via Oauth - I recommend using URL_https://github.com/fernandezpablo85/scribe-java [Scribe] .
    • Explore all reviews
  258. org.jvnet.ws.wadl
    • Also there are tools like URL_http://wadl.java.net/wadl2java.html [CODETERM1] .
    • Explore all reviews
  259. org.jdbi
    • Aside from Jersey (and other JAX-RS impls like RESTeasy), which use Jackson, you might also benefit from using something like URL_http://jdbi.org/ [jDBI] for binding relational data in POJOs first.It does many things bigger ORMs (like Hibernate) do, but is simpler to use for most common tasks.
    • Explore all reviews
  260. org.jdom
    • The new JSR-353 (part of JEE 7) could be useful to you , you could try URL_http://www.jdom.org/ [ URL_http://www.jdom.org/ ] just to mention two.
    • Explore all reviews
  261. org.apache.xmlrpc
    • As for a client, well, I am using Apache XMLRPC, so it should be easy to implement.
    • Explore all reviews
  262. jmustache
    • Note that this is a very simple implementation and you may need to extend it to fit your needs: CODESNIPPET_JAVA3 .
    • So the JSON model would look something like this: CODESNIPPET_JAVA2 .
    • Explore all reviews
  263. spring-integration
    • I ended up upgrading to Jackson 2, which required me to upgrade another tool (Spring Integration) to an unofficial release - but all works.
    • To be complete honest, I don't find the Spring integration all that compelling, which isn't really a big deal.Much like Spring MVC versus Struts, I'm not really expecting a lot of change with the Spring Rest JSON functionality, I'm just trying to figure out if it actually exists so I can try it out.
    • Explore all reviews
  264. io.netty
    • I have worked with a netty server with a lesser hardware configuration than yours and supported many thousands msgs/sec.
    • Explore all reviews
  265. beanfactory
    • It's fairly easy to annotate controllers with some annotation, and then hook up the BeanFactory bootstrap process to register the controllers within some handler mapping process.
    • Explore all reviews
  266. ektorp
  267. symmetricds
    • For an example, can use URL_http://www.symmetricds.org/ [SymmetricDS] (Open source available) to replicate data between client and server database.
    • Explore all reviews
  268. hessian
    • There are even simpler packages; Hessian for example has rather simple reflection-based serializer/deserializer.
    • And then accessing fields/methods dynamically.
    • Explore all reviews
  269. cassandra
    • Thank you so much man you are always so thorough in your answers and explanations.
    • My use cases : I use jackson as serialization when I need to save blobs to storage systems (Redis, Cassandra, Mongo, ... sometime mysql too).
    • In Cassandra, writes are much more efficient than reads so it is beneficial to avoid reads before writes if possible.
    • In conclusion, there could be significant performance advantages to using separate columns if you have to update your data or if you only want to read parts at once.
    • I am actually tempted to do this to all of my data.
    • Cassandra is adding support for JSON-like maps, lists, and sets in 1.2: URL_https://issues.apache.org/jira/browse/CASSANDRA-3647 [ URL_https://issues.apache.org/jira/browse/CASSANDRA-3647 ] .
    • Explore all reviews
  270. commons-exec
    • I need to communicate with MongoDB shell via Java To explain in short, I am using something like Runtime.exec (commons exec specifically) to call URL_http://www.mongodb.org/display/DOCS/Scripting+the+shell [MongoDB-shell-in eval-mode] Using this approach, I am able to successfully invoke MongoDB commands, retrieve the output into a stream (and print to stdout for example) All is well till this point.
    • Explore all reviews
  271. jdbchelper
    • Since you are not creating the query dynamically, you don't need to use StringBuffer/StringBuilder.
    • Explore all reviews
  272. org.apache.solr
    • Then you would have a POJO like this CODESNIPPET_JAVA2 .
    • 2. fetch search result from Solr in form of POJO's described in my project** I know that point CODETERM5 can be done by CODETERM6 , but i don't want to write separate logic to index, I am using Solrj in my project to extract information, so I want to know can solrj use my POJO definition to parse the search results** also any possible workflow for above working scenario, and tools required (I am new to solrj).
    • In particular, Im interested in putting a nice, clean API over a SOLR server, which serves up json data.
    • Explore all reviews
  273. org.directwebremoting
    • The latest version of DWR has json support, you need to enable in your web.xml by passing init-param for the DWR Servlet, more information can be found URL_http://directwebremoting.org/dwr/introduction/remoting_options.html [at] , also for DWR there is a nice Book named 'DWR Java AJAX Applications'.
    • For some of your requirements other libraries may be suitable, but DWR is useful if you have a Java backend.
    • Explore all reviews
  274. apache-commons-jxpath
    • I kind of remember there is such a component in A URL_http://commons.apache.org/ [pache-Commons] , but can't remember its name.
    • Explore all reviews
  275. apache-io
    • I was just hoping for some other solution as doing something like this kinda defeats the performance benefits of using the streaming parser.
    • Explore all reviews
  276. commons-codec
    • No need to use Commons Codec; DatatypeConverter is part of the standard (JAXB).
    • 1. you could add the required characters in code (padding, etc) 2. you can use commons-codec 1.5 ( new Base64(true)), where they added support for this encoding.
    • Explore all reviews
  277. jflex
    • MUCH easier to use than antlr, jflex or others since you write your grammars in pure Java.
    • Explore all reviews
  278. ezmorph
    • Thank you works fantastically :).
    • It seems like a lot of libs for just JSON parsing :S.
    • Explore all reviews
  279. anjsonserializer
    • Some pull parser like GSON oder jackson would suit your task better (jackson claims to be faster, but also heavier jars and more dependencies - I prefer GSON) You may also consider simple databinding library: URL_https://github.com/ko5tik/jsonserializer [ URL_https://github.com/ko5tik/jsonserializer ] ( jars available from maven central ) With it parsing of JSON becomes looks this way: URL_https://github.com/ko5tik/accmeter/blob/master/src/main/java/de/pribluda/a ndroid/accmeter/file/SampleReader.java [ URL_https://github.com/ko5tik/accmeter/blo b/master/src/main/java/de/pribluda/android/accmeter/file/SampleReader.java] ( just provide java.io.Reader and class to fill fields in ) .
    • EDIT:Maybe URL_https://github.com/ko5tik/jsonserializer [ URL_https://github.com/ko5tik/jsonserializer ] would be useful UPDATE:FYI so I looked at jsonschema2pojo but that only creates pojos from a schema, and I didnt actually have a json schema, just the actual json.
    • So I then tried following the example and created a POJO based on the json data I had and it was quite easy, then I then tried full data binding using this and it worked first time.
    • Explore all reviews
  280. com.jgeppert.struts2.jquery
    • By far, this is the best answer or suggested solution I found all around so far.
    • Not necessary, If you are using Struts 2 why not to use URL_http://code.google.com/p/struts2-jquery/ [struts2-jquery-plugin] and make grids more easier like described URL_http://code.google.com/p/struts2-jquery/wiki/GridTag [here] .
    • Explore all reviews
  281. org.springframework.ws
  282. simpleconverter
    • Create a system property - i.e System.setProperty("jettison.mapped.typeconverter.class", "org.codehaus.jettison.mapped.SimpleConverter"); So jettison uses simple converter and output values as string.
    • Explore all reviews
  283. com.google.code
    • It is easy to make it work with URL_http://www.mongodb.org/display/DOCS/Java+Tutorial [java] and it has a nice mapper from java objects to mongo called URL_http://code.google.com/p/morphia/ [morphia] .
    • Explore all reviews
  284. com.restfb
    • You may want to look at URL_http://restfb.com/ [RestFB] as a good choice for a library to use.
    • Explore all reviews
  285. com.sun.grizzly
    • here is my problem:i have jquery that creates json that needs to be posted in jersey, a server running by grizzly that has a REST webservice gets incoming json object which need to be outputed.Im giving a try but not sure how to implement this correctly, please check and correct me, thanks!
    • Explore all reviews
  286. org.atmosphere.plugins
    • try URL_https://github.com/Atmosphere/atmosphere- extensions/blob/master/spring/samples/spring- websocket/src/main/java/org/atmosphere/samples/pubsub/dto/BaseCommand.java [this] it works CODESNIPPET_JAVA1 .
    • After that, it worked!
    • Explore all reviews
  287. openfaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  288. colander
    • You said "what it would look like".
    • Did you verify that it does look like that?
    • Explore all reviews
  289. hamcrest-matchers
    • URL_http://baddotrobot.com/blog/2012/09/14/diff-excel-with-java-and-hamcrest/ [simple-excel] offers verification of generated excel files and brings it's own Hamcrest matchers for this.
    • Explore all reviews
  290. batch-import
    • I think the most effective format is something like a node- and edgelist, see URL_https://github.com/jexp/batch-import [ URL_https://github.com/jexp/batch - import] for a CSV version, D3 does something similar in Javascript, see the D3 examples that read in JSON.
    • Explore all reviews
  291. petr
    • I will add one more tip for excelent JSON<->JAVA binding lib PoJSON, it is written specifically for the URL_http://netbeans.org [NetBeans-IDE] (by Petr Hrebejk) and thus it is used in production on large project.
    • Explore all reviews
  292. com.intellij
    • The Community Edition of URL_http://www.jetbrains.com/idea/ [IntelliJ-IDEA] and URL_http://eclipse.org/ [Eclipse] are both popular and free IDEs.
    • Explore all reviews
  293. com.sun.tools.jxc.maven2
    • URL_https://jaxb.dev.java.net/guide/Mapping_your_favorite_class.html#HashMap ["JAXB-spec-defines-a-special-handling-for-Map-when-it's-used-as-a-property- of-a-bean."]
    • Explore all reviews
  294. hamcrest-json
    • ), it is useful that CODETERM6 supports JSON text (as CODETERM7 ), as well as natively supporting objects from Douglas Crockford's JSON library CODETERM8 .
    • Explore all reviews
  295. boon
    • It also has the fastest JSON to JavaBean mode too.
    • It is new, but if speed and simple API is what you are looking for, I don't think there is a faster or more minimalist API.
    • Explore all reviews
  296. com.jayway.restassured
    • I found the answer :) Use URL_http://code.google.com/p/rest- assured/wiki/Usage#JSON_%28using_JsonPath_%29 [JsonPath] or URL_http://code.google.com/p/rest-assured/wiki/Usage#XML_%28using_XmlPath_%29 [XmlPath] (in case you have XML) to get data from the response body.
    • Explore all reviews
  297. vertx-junit-annotations
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • Explore all reviews
  298. org.eclipse.jdt
    • The Community Edition of URL_http://www.jetbrains.com/idea/ [IntelliJ-IDEA] and URL_http://eclipse.org/ [Eclipse] are both popular and free IDEs.
    • Explore all reviews
  299. com.fasterxml.staxmate
    • But if not, perhaps you should build a DOM tree from Stax, using URL_http://staxmate.codehaus.org [link-text] , like URL_http://www.cowtowncoder.com/blog/archives/2009/06/entry%5F270.html [this- article] explains?
    • Explore all reviews
  300. ormlite
    • With the default caching everything works as expected.
    • But OrmLite doesn't seem to like the array of objects.
    • The ORMLite annotations and the Jackson annotations should be able to play well together.
    • To be concrete I need to deserialize CODETERM3 from ORMLite, so I should be able to programatically create CODETERM4 and add values into it.
    • I also want to do opposite - get data from server in JSON and convert it to Java class and save this class to SQLite using ORMLite.
    • Explore all reviews
  301. acris
    • So if you are using it to transfer data between your rest service and GWT front-end then its fine.To save Student JSON notation you can convert it to POJO using many available library like URL_http://jersey.java.net/nonav/documentation/latest/json.html [jersey] or URL_http://code.google.com/p/acris/wiki/GWTJsonizer [GWTJsonizer] and can store easily that to DB.
    • Explore all reviews
  302. net.logstash.logback
    • But I guess it's not the best way to do it (serialize, deserialize the JSON...) .
    • Explore all reviews
  303. jcouchdb
    • I have some JSon documents that I'd like to parse into Java classes - with Svenson, used in jcouchdb, and then put those parsed objects into DB.
    • Explore all reviews
  304. serialized-php-parser
    • I would like to thank URL_http://stackoverflow.com/users/1953082/loris [Loris] , for giving me the idea of an PHP serialize() result, and URL_http://stackoverflow.com/users/887590/matt-taylor [Matt-Taylor] for trying to help me solve this problem.
    • Found a nice solution using the URL_http://code.google.com/p/serialized-php- parser/ [serialized-php-parser] lib: CODESNIPPET_JAVA1 .
    • Explore all reviews
  305. net.databinder
  306. org.primefaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  307. com.sun.xml.bind
  308. richfaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  309. org.drools
    • My preference is to stick with Java (or maybe Scala or Groovy) since I'm using tools like Drools for rules and Shiro for security.
    • If you are building ajax/json/nosql solutions, I'd like to hear details about what tools you are using and any pros/cons you've found to using them.
    • Explore all reviews
  310. io.restx
  311. resteasy
    • I have used both Jackson and Gson for the JSON support with RESTEasy and it is quite simple.
    • Another really great part of RESTEasy is the good support for multipart form data.
    • Explore all reviews
  312. jooq
    • You don't have to use all of jOOQ's features to take advantage of some useful JDBC extensions.
    • Explore all reviews
  313. org.apache.cxf.dosgi
    • URL_http://cxf.apache.org/ [An-Open-Source-Services-Framework-From-Apache] -**CXF** has been designed to provide a pluggable architecture that supports not only XML but also non-XML type bindings, such as JSON and CORBA, in combination with any type of transport.
    • I have not used it, but according to URL_http://cxf.apache.org CXF supports both SOAP and REST/HTTP bindings and XML, JSON and FastInforset message formats.
    • If you want the ability to support a SOAP service as well as a RESTful one, check out URL_http://cxf.apache.org/ [Apache-CXF] .
    • Explore all reviews
  314. shiro
    • My preference is to stick with Java (or maybe Scala or Groovy) since I'm using tools like Drools for rules and Shiro for security.
    • If you are building ajax/json/nosql solutions, I'd like to hear details about what tools you are using and any pros/cons you've found to using them.
    • Explore all reviews
  315. spring-social
    • If your problem is just with Twitter, you can look for dedicated APIs like Twiiter4J or Spring Social, that should provides ready java beans for tweets.
    • Explore all reviews
  316. spring-data-mongodb
    • The most clean solution I found so far: use the build-in MappingMongoConverter of spring-data-mongodb.
    • Explore all reviews
  317. javacsv
    • I used the JSON.simple library from here URL_https://code.google.com/p/json- simple/ [ URL_https://code.google.com/p/json-simple/ ] to read the JSON string to keep the order of keys and use JavaCSV library from here URL_http://sourceforge.net/projects/javacsv/ [ URL_http://sourceforge.net/projects/javacsv/ ] to convert to CSV format.
    • Explore all reviews
  318. xalan
  319. ksoap2
  320. simple-excel
    • URL_http://baddotrobot.com/blog/2012/09/14/diff-excel-with-java-and-hamcrest/ [simple-excel] offers verification of generated excel files and brings it's own Hamcrest matchers for this.
    • Explore all reviews
  321. name.pehl
    • Also if i had a string "2011-12-08" can i not specify a formatter that will return a date such as what piriti allows you to do this using @Mapping(value "date", format "dd.MM.yyyy"), as shown here URL_http://code.google.com/p/piriti/wiki/ExternalMappings [ URL_http://code.google.com/p/piriti/wiki/ExternalMappings ] .
    • Explore all reviews
  322. jvm-serializers
    • But from running this locally, I don't think it supports statements of being super fast.
    • Explore all reviews
  323. org.jglue.fluent-json
    • Lastly there is mapping support in the API which allows you to map your domain objects to JSON.
    • I recently created a library for creating Gson objects fluently: URL_http://jglue.org/fluent-json/ [ URL_http://jglue.org/fluent-json/ ] It works like this: CODESNIPPET_JAVA1 .
    • The goal being when Java8 is released you'll be able to do something like this: CODESNIPPET_JAVA3 .
    • Explore all reviews
  324. spring-mvc-rest
  325. org.apache.maven
    • This worked for me and I'm using: Apache Maven 3.0.4 (r1232337; 2012-01-17 01:44:56-0700) org.springframework version 3.1.2.RELEASE spring-security version 3.1.0.RELEASE.
    • Explore all reviews
  326. jaxb
    • Actually, any XML package that can use Stax API can use Jettison -- JAXB does, so there's no extra work involved (same is mostly true for XStream too, although it may have some additional support).
    • JAXB 2.0 also has support for JSON serialization using Jettison.
    • Explore all reviews
  327. nate
  328. hamcrest
    • You need to split this problem into two: reading the name/value pairs from Excel into a map, and then building a matcher from this map.
    • ), it is useful that CODETERM6 supports JSON text (as CODETERM7 ), as well as natively supporting objects from Douglas Crockford's JSON library CODETERM8 .
    • It is well documented, tested, and supported.
    • Finally, if you are not using JUnit, you can use Hamcrest directly for assertions.
    • AFAIK there is no Excel integration included in Hamcrest.
    • URL_http://baddotrobot.com/blog/2012/09/14/diff-excel-with-java-and-hamcrest/ [simple-excel] offers verification of generated excel files and brings it's own Hamcrest matchers for this.
    • Explore all reviews
  329. tjws
    • That is, it includes the parent fields, as well as the fields in ExtendsContentProviderBean.
    • Explore all reviews
  330. com.facebook.api
    • Alright, So I make an Graph API Call and parse the JSON request.Using a link like this I make a HttpGet request: URL_http://graph.facebook.com/me/feed?=access_token= [ URL_http://graph.facebook.com/me/feed?=access_token= ] "MYACCESSTOKEN" This works fine, but the problem arises maintaining the same access token throughout.
    • Explore all reviews
  331. json-antlr
    • If your main reason for writing a parser is learning how to do it, this is probably a good starting point.
    • Explore all reviews
  332. jboss-logmanager
    • ... because if I am writing affiliate.setEmployees(null), it is working fine.
    • Explore all reviews
  333. javadb
    • If you don't want a full-featured database, use something like HSQLDB or JavaDB.
    • Explore all reviews
  334. as-code-completion
    • It's still in draft (not finalised) but it's close to completion and is now a viable tool specifying your structural rules I've recently started a new open source project specifically intended to solve your problem: URL_http://code.google.com/p/jsonschema2pojo/ [jsonschema2pojo] .
    • The project is not yet mature but already provides coverage of the most useful parts of json schema.
    • Explore all reviews
  335. org.codehaus.castor
    • This is true, but POJO -> XML -> JSON would work with an additional library.
    • Explore all reviews
  336. jets3t
    • However, you saying this made me look at something else I just did using a JetS3t utility, and I fixed it, thanks.
    • Explore all reviews
  337. neo4j-graphdb
    • Check out URL_http://neo4j.org/ [neo4J] The internal representation of the graph would be then delegated to the database and people have been working on this for years, so I would expect the representation to be efficient and performant.
    • Explore all reviews
  338. spring-finance-manager
    • Check this one out URL_http://stsmedia.net/spring-finance-part-7-adding-support-for-json-and-xml- views/ [Adding-support-for-JSON-and-XML-views] URL_http://code.google.com/p/spring-finance-manager/ [Source-code-for-Spring- Finance-Manager] .
    • Explore all reviews
  339. de.l3s.boilerpipe
    • I am using URL_http://code.google.com/p/boilerpipe/ [boilerpipe] and it seems great, but I want to output JSON.
    • Explore all reviews
  340. org.icefaces
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  341. jxls
    • the result will be list, and you just write the property that you want to display in excel format that will be read by jxls.
    • if you need helper to convert into xls, you can use jxls, it can convert java bean (or list) into excel with expression language.
    • Explore all reviews
  342. codegist-crest
    • Update After 1.5 years, I still think it's really good solution.
    • If you don't mind, that's cool.
    • Explore all reviews
  343. httpzoid
    • Too much code for this task, checkout this library URL_https://github.com/kodart/Httpzoid [ URL_https://github.com/kodart/Httpzoid ] It uses GSON internally and provides API that works with objects.
    • Explore all reviews
  344. com.sdicons.jsontools
    • Curious if anyone has any other suggestions on a good way to accomplish this (from what it seems), simple task that need, or if I perhaps need to stick with the 2nd option from above?
    • Through searching, I have found the following 2 promising libraries for accomplishing this: URL_http://jsontools.berlios.de/ [ URL_http://jsontools.berlios.de/ ] URL_https://github.com/fge/json-schema-validator [ URL_https://github.com/fge/json - schema-validator] However, the first one seems fairly outdated with poor support.
    • Similar story with the 2nd one, which seems to be up-to-date with good test code.
    • Here you can find a URL_http://jsontools.berlios.de/ [tool] that can validate a JSON file, or you could just deserialize your JSON file with any JSON library and if the operation is successful then it should be valid ( URL_http ://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/index.html [google- json] for example that will throw an exception if the input it is parsing is not valid JSON).
    • I've used URL_http://jsontools.berlios.de/ [JSON-Tools-library] and it works well.
    • Explore all reviews
  345. apacheyay
    • Of course, one of the advantages of using POST data is that there is typically no limit on the size of the arguments you can send.
    • Explore all reviews
  346. javax.persistence
    • (also I can't read those hieroglyphics that you posted above; I see no Java persistence code there either, like pm.makePersistent).
    • Then you can use standard Java persistence tools and libraries to save it out to/read it in from your database, and it will handle all your escaping automatically.
    • Explore all reviews
  347. aalto-xml
    • ); but for async nothing yet that I am aware of.The lib you refer to seems badly named; it does not seem to do real asynchronous processing, but merely allow one to parse sequence of JSON documents (which multiple other libs allow doing as well) If there were people who really wanted this, writing one is not impossible -- for XML there is URL_http://wiki.fasterxml.com/AaltoHome [Aalto] , and handling JSON is quite a bit simpler than XML.For what it is worth, there is actually URL_http://jira.codehaus.org/browse/JACKSON-39 [this-feature-request] to add non-blocking parsing mode for URL_http://jackson.codehaus.org [Jackson] ; but very few users have expressed interest in getting that done (via voting for the feature request).
    • Explore all reviews
  348. io.spray
    • I would look into any of the following frameworks or libraries to create REST APIs with java and/or scala: URL_http://www.playframework.com/ [Play-Framework] URL_http://vertx.io/ [Vert.x] URL_http://spray.io/ [Spray] URL_http://dropwizard.codahale.com/ [Dropwizard] (which uses Jetty, Jersey, and Jackson) .
    • Explore all reviews
  349. google-api-translate-java
    • There is a URL_http://code.google.com/p/google-api-translate-java [library] which retains the encoding of the http response (Czech expressions) with JSon message like this : CODESNIPPET_JAVA1 .
    • Explore all reviews
  350. jms-ws-transport
    • WADL doesnt appear to support my unique use of the JMS transport either, though i don't see why the wadl:resource and wadl:path would not work with jms endpoints.
    • Explore all reviews
  351. commons-logging
  352. org.squeryl
    • One version supports Jerkson and the other Squeryl (or any other usage).
    • My models are also used as db schema (squeryl), and the fields must be "Date" to map correctly.
    • Squeryl supports "@Transient", which does the same for persistance.
    • Explore all reviews
  353. com.squareup.retrofit
    • And yes, we are exposing a lot details of the implementation here, it means every change you have to change tests as well I would probably also convert requests to url and bodies.
    • Explore all reviews
  354. org.apache.myfaces.trinidad
    • I would then strongly recommend to just grab an existing component lirbary which enables using ajaxcal magics in JSF, like URL_http://primefaces.org [PrimeFaces] , URL_http://www.jboss.org/richfaces [RichFaces] , URL_http://openfaces.org [OpenFaces] , URL_http://icefaces.org [IceFaces] , URL_http://myfaces.apache.org/trinidad/ [Trinidad] , etc.
    • Explore all reviews
  355. spring-roo
    • Tools used: Spring-Roo: for rapid prototyping ( URL_http://projects.spring.io/spring-roo/ [ URL_http://projects.spring.io/spring-roo/ ] ) Spring Tool Suite Spring Maven Tomcat SqlServer Hibernate All of these tools work really well together to develop a web service.
    • Explore all reviews
  356. org.glassfish
    • JsonObject and JsonReader API can be used in two different ways: Use a Java EE 7 compliant application server, such as URL_http://glassfish.org [GlassFish-4] .
    • You can use NetBeans, Eclipse or IntelliJ and if the server runtime is configured properly then it just works.
    • A good set of samples for using this API are available at URL_https://github.com/arun-gupta/javaee7-samples/tree/master/json [ URL_https://github.com/arun-gupta/javaee7-samples/tree/master/json ] .
    • I believe the best practice should be to go through the official java JSON API: URL_http://json-processing-spec.java.net/ [ URL_http://json-processing - spec.java.net/] which are still work in progress.
    • Explore all reviews
  357. com.nebhale.jsonpath
    • A Java implementation: URL_https://github.com/nebhale/JsonPath [ URL_https://github.com/nebhale/JsonPath ] It seems well maintained and works fine.
    • Explore all reviews
  358. uk.co.datumedge
    • ), it is useful that CODETERM6 supports JSON text (as CODETERM7 ), as well as natively supporting objects from Douglas Crockford's JSON library CODETERM8 .
    • Explore all reviews
  359. org.glassfish.webservices
    • WebServices and their security), so any newbie-tweaks to my question are very welcome._ .
    • Explore all reviews
  360. spring-ws
    • Obviously, in a web project, like a Spring web services project, it is important to have POJO's, but just for unit tests couldn't you just use a generic Jackson JsonNode object?
    • Explore all reviews
  361. com.google.code.svenson
    • which could be parsed again with code like this CODESNIPPET_JAVA3 .
    • I realize this is off-topic, but I'd like to present a solution in URL_http://code.google.com/p/svenson/ [svenson-JSON] .
    • Apart from having to use properties, svenson can handle cases like this with a more simple JSON output with a discriminator property CODESNIPPET_JAVA1 .
    • would output JSON like CODESNIPPET_JAVA2 .
    • I wrote a JSON library to do just that.. URL_http://code.google.com/p/svenson/ [ URL_http://code.google.com/p/svenson/ ] With svenson you would do something like: CODESNIPPET_JAVA1 .
    • That sounds like an interesting approach, the only improvements I'd want is a way to not have to manually map classes to string field names when parsing it back (is there any support to infer class names, maybe output could be more verbose and contain the fulle package and class name).The public fields were just an example (although with serialization your private data is your public interface).
    • Explore all reviews
  362. io.gatling
    • It can parse JSON to Maps and Lists faster than any other lib can parse to a JSON DOM and that is without Index Overlay mode.
    • It also has a very fast JSON lax mode and a PLIST parser mode.
    • :) But gatling is not, and the results are the same.
    • Explore all reviews
  363. hibernate
    • FlexJSON shines with its deepSerialize method that can properly handle serializing all get methods presented in a bean obtained from Hibernate (lazy loaded).
    • Might be worth checking out, especially if you use an ORM solution.
    • Explore all reviews
  364. com.google.gdata
    • It's probably can't be fully explained in the answer, so a link (or a few) would be appreciated.
    • Explore all reviews
  365. java.rmi
    • Look into Java RMI if it makes sense to have the same object definition on both ends, and in case you're interested in invoking methods on the remote object.
    • Explore all reviews
  366. sonar
    • I tried it but when I execute I get this error "java.lang.NoClassDefFoundError: org/json/simple/JSONValue".
    • If this JSON is the result of a call from a Sonar Web Service, then you do not need to parse it: just use the Sonar Java Web Service Client component, this will do all that for you and you won't need to care about JSON at all URL_http://docs.codehaus.org/display/SONAR/Using+the+Web+Service+Java+client [ URL_http://docs.codehaus.org/display/SONAR/Using+the+Web+Service+Java+client ] .
    • Explore all reviews
  367. org.jboss.jbossas
  368. javafx
  369. org.apache.jena
    • What I want is to extract each article and convert it to RDF/JSON (I know how to write a model) using Apache Jena, so I can have a separate document for each article, and later import them all to a index like CouchDB or Elasticsearch to perform searches.
    • Explore all reviews
  370. odata4j
    • If you are looking to consume a ado.net data service(now renamed WCF Data Service) from android client, I would recommend you to have a look at the URL_http://code.google.com/p/odata4j/ [OData4j] library.
    • Explore all reviews