sentence
stringlengths 1
1.38k
| label
stringclasses 3
values |
---|---|
It doesn't take long to code, and is quite efficient, in my opinion.
|
n
|
In my opinion this is the worst way to do REST.
|
n
|
Manually handling serialization in Java is a waste of time when you have so many options like JAXB and Jackson.
|
o
|
Even loading the whole document and using XPath is marginally slower than SAX and nothing compared to getting the XML (network speed).
|
n
|
i could say, "i agree".
|
o
|
I agree too, and I wrote the original comment.
|
o
|
Back then I had a desire for control of the deserialisation, but nowadays I would use Jackson and decently annotated model classes.
|
o
|
I'd like to point out 2 more options:
URL_http://restfulie.caelum.com.br/ [Restfulie] , based on the VRaptor web framework, has both server and client side implementations with very good Hypermedia support.
|
p
|
URL_http://www.jboss.org/resteasy [RESTEasy] has a URL_http://docs.jboss.org/resteasy/docs/2.3.0.GA/userguide/html/RESTEasy_Client_Framework.html [JAX-RS-proxy-based-client] implementation.
|
o
|
You can do it in a very simple way with resteasy (by Jboss).
|
p
|
I wrote a blog post about URL_http://guidogarcia.net/blog/2012/03/02/how-to-develop-java- rest-client/ [how-to-develop-a-Java-REST-client] if you want a getting started guide.
|
o
|
Anyway, there are hundreds of alternatives in Java.
|
o
|
Check out URL_http://code.google.com/p/resting [Resting] .
|
o
|
It promises to invoke REST services and create list of objects from XML/JSON/YAML response in one step.
|
p
|
Resting has issues with POST requests.
|
o
|
Just found URL_http://wiki.apache.org/incubator/WinkProposal [Apache-Wink] in the Apache Incubator.
|
o
|
Could be a interesting project for creating REST servers and clients.
|
p
|
Try URL_http://www.rexsl.com/rexsl- test/apidocs-0.10/com/rexsl/test/request/JdkRequest.html [JdkRequest] from URL_http://www.rexsl.com/rexsl-test/ [rexsl-test] (I'm a developer).
|
o
|
This is how it works: CODESNIPPET_JAVA1 .
|
p
|
Though its simple to create a HTTP client and make a reuest.
|
p
|
But if you want to make use of some auto generated clients, You can make use of WADL to describe and generate code.
|
o
|
You can use URL_http://tomayac.de/rest-describe/latest/RestDescribe.html [RestDescribe] to generate and compile WSDL, you can generate clients in php, ruby, python, java and C# using this.
|
o
|
It generates clean code and there is a good change that you have to tweak it a bit after code generation, you can find good documentation and underlying thoughts behind the tool URL_https://do cs.google.com/document/edit?id=1uydmzsDFIiw8OsoMdk5v_s1VW7wrujUmGdUU2zge0fs [here] .
|
p
|
There are few interesting and useful URL_http://wintermuteblog.blogspot.com/2010/01/wadl-toolbox.html [WADL-tools] mentioned on wintermute.
|
p
|
If you are interesting in Eclipse plugin to generate a java client class from WADL, you can see at link URL_http://stackoverflow.com/questions/9159881 /restful-client-from-wadl/16709008#16709008 [Restful-Client-from-WADL] .
|
p
|
Memory leak in JBoss.
|
n
|
I am having a very strange behavior in JBoss, and I'd like avail myself of the Collective Wisdom of the SO Crowd.
|
p
|
We're using JBoss (4.0.4 I think) to serve SOAP calls.
|
o
|
In fact, it's used as glorified RPC server, no more.
|
p
|
We're running out of memory when we have 20+ clients sending their requests at the same time.
|
n
|
The requests consist of the incoming rather small request (proper SOAP) and the returning result packet that is essentially one long SOAP string (and the contents of the string are XML).
|
n
|
Yes I realize this is suboptimal.
|
n
|
Don't ask.
|
o
|
I've traced the leak to an instance of org.jboss.axis.message.SAX2EventRecorder that hold 4 million objects (strings and Integers).
|
o
|
Now, even the longest response does not carry 4MB of data.
|
n
|
The requests are all smaller than 40K.
|
o
|
Something is fishy there, but I can't find any documentation on the Web.
|
o
|
Can someone tell me what the recorder is used for?
|
o
|
And how do I get rid of it?
|
o
|
Or may be configure it to be less memory-hungry?
|
o
|
Any help is appreciated.
|
p
|
Update: To clarify - I did do memory dump, and the dump shows an array or 4,000,000+ objects, Strings and Integers.
|
n
|
The array is owned by a org.jboss.axis.message.SAX2EventRecorder which is in turn held by these guys: org.jboss.axis.message.SOAPEnvelopeAxisImpl@0x19c31fd8 (141 bytes) : field recorderorg.jboss.axis.message.RPCParamElementImpl@0x19c32260 (123 bytes) : field recorderorg.jboss.axis.message.SOAPBodyAxisImpl@0x19c32160 (121 bytes) : field recorderorg.jboss.axis.message.RPCElement@0x19c321e0 (124 bytes) : field recorderorg.jboss.axis.encoding.DeserializationContextImpl@0x19c332f0 (67 bytes) : field recorderorg.jboss.axis.message.SAX2EventRecorder$objArrayVector@0x19c33398 (24 bytes) : field this$0 The data structures of our own app are quete bloated, but not to this degree.
|
n
|
Another update: powers that be have found a "powers-that-be-solution": we're switching to 64-bit memory.
|
n
|
Hurray.
|
o
|
@Arkadiy: Don't assume there's a bug in JBoss; assume the bug is in your code.
|
n
|
You've already identified one 'sub optimal' condition of your software.
|
p
|
Why can't there be more?
|
o
|
My question is: what are you doing running such an old version of JBoss?
|
o
|
It's 2.5 years old.
|
o
|
You'll often find people a hesitance or even reluctance from people to help with outdated software.
|
n
|
@Gortok - I did assume our own fault, but that damned array is responsible for half the meory in use, and it has noting to do with us.
|
n
|
And, the way it's held (see update), it may be allocated for each request in progress-that explains why we fail only when certain number of requests are in progress.
|
o
|
@cletus: - "Enterprise" environment - three dev teams on 3 continent and no one ready to take responsibility.
|
o
|
Ive just been running a case with bea support on some thing of the same sort.
|
o
|
The info needed for them to do anything was: JRA recordings, MissionControl MemLeak screenshots, garbage collection logs and any dump files from the jvm.
|
n
|
Run with the JVM arg -XX:-HeapDumpOnOutOfMemoryError.
|
n
|
This will give you heap dumps when you run out of memory.
|
n
|
You can then analyze the heap dump with the _jhat_ tool (it comes with your JDK).
|
n
|
Alternatively, you can use the _jconsole_ tool (which also comes with your JDK) to request a heap dump at any time using the memory management MBeans.
|
n
|
It will tell you what those 4 million objects actually contain which might give you insight into why the software isn't releasing that memory.
|
n
|
EDIT: It seems you're not the only one with this issue.
|
o
|
There are 2 bug reports filed with Axis URL_https://issues.apache.org/jira/browse/AXIS-2698 [AXIS-2698] URL_https://issues.apache.org/jira/browse/AXIS-2749 [AXIS-2749] See also URL_https://issues.apache.org/jira/browse/AXIS-1771 [AXIS-1771] , it has some interesting information regarding deserialization and ways to mediate its impact.
|
n
|
Which version of Axis are you using?
|
o
|
How do you think I've established that SAX2EventRecorder is the culprit?
|
o
|
Damn, people around here are getting used to newbie questions and don't expect any better.
|
n
|
Voting back up: Arkadiy, it may have been unhelpful for you, but the way you phrased the question made it come across as 'newbie', especially since the title is 'Memory Leak in JBoss'.
|
n
|
The first rule of using a commercial tool is to assume the bug is in your code; not the commercial tool.
|
n
|
I can only work with the information you give me.
|
o
|
Perhaps you should be more specific next time.
|
o
|
Anyway, what is the content of the objects in the SAX2EventRecorder?
|
o
|
Yeah, gotta admit: even though the answer may have covered what you've done, downvoting it and then lambasting the poster leaves me thinking "you're on your own buddy".
|
n
|
@kevin: to quote the question: SAX2EventRecorder that hold 4 million objects (strings and Integers).
|
o
|
That's what the contents is.
|
o
|
@Arkadiy, what are those Strings?
|
o
|
Are they snippets of your (de)serialized xml or are they something completely different?
|
o
|
Are they mostly the same bits and pieces or random?
|
o
|
Way to jump on the people trying to help you, dude.
|
o
|
Your initial question should have stated the exact troubleshooting steps you took - if you ran jconsole, HeapDumpOnOutOfMemoryError, etc.
|
n
|
People posting answers shouldn't assume you took any steps you didn't mention.
|
o
|
@Kevin - Yes, the strings are snippets of HTML.
|
o
|
Thanks for pointing out the bugs - I saw the first two, but not the last one.
|
n
|
It would be nice to know what "settings and things" in the last comment.
|
p
|
It certainly helps to know about 1.4.
|
o
|
We do have 1.4 in our codebase - do we use it?
|
o
|
Will find out.
|
o
|
If you can, run the application under Java 6.
|
o
|
The latest version includes URL_https://visualvm.dev.java.net/ [VisualVM] for profiling.
|
o
|
It should be able to show the growth of memory.
|
n
|
You can attach to a Java 5 VM, but it doesn't show as much.
|
o
|
JBoss and different versions of Hibernate.
|
o
|
We are using JBoss 4.2.3 which in turn comes with version 3.2.1.ga of Hibernate.
|
o
|
I would like to use Hibernate 3.5.1-FINAL which supports JPA 2.0.
|
o
|
I've been trying to make this work by putting my own hibernate jars in my WEB- INF/lib folder and creating my own classloader for my WAR in jboss-web.xml CODESNIPPET_JAVA1 .
|
o
|
I've also tried: CODESNIPPET_JAVA2 .
|
o
|
But I get loads of various issues and this is the exception I'm currently stuck on: CODESNIPPET_JAVA3 .
|
n
|
Since the deadline is looming I thought I'd better ask if it is even possible?
|
o
|
:) .
|
o
|
Perhaps you're better off just upgrading to JBoss AS 5?
|
o
|
Is that not an option?
|
o
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.