A.G Rajkotia

Greenhorn
+ Follow
since Aug 11, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by A.G Rajkotia

A.G Rajkotia wrote:

William Brogden wrote:What part of this message is not clear to you?



What provision have you made in your client code to handle that content-type?

How do I solve this exception

10 years ago

William Brogden wrote:What part of this message is not clear to you?



What provision have you made in your client code to handle that content-type?

Bill



This is my client code

10 years ago
The following exception is thrown on trying to receive response containing large xml from resteasy client



Unable to find a MessageBodyReader of content-type application/xml and type class org.glassfish.jersey.client.ChunkedInput
at org.jboss.resteasy.core.interception.ClientReaderInterceptorContext.throwReaderNotFound(ClientReaderInterceptorContext.java:39)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.getReader(AbstractReaderInterceptorContext.java:73)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:50)
at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
at org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(DigitalVerificationInterceptor.java:32)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readFrom(ClientResponse.java:244)
at org.jboss.resteasy.client.jaxrs.internal.ClientResponse.readEntity(ClientResponse.java:178)
at org.jboss.resteasy.specimpl.BuiltResponse.readEntity(BuiltResponse.java:223)


10 years ago
I am developing REST web service on netbeans with glassfish 4.0. However trying to import org.glassfish.server shows package unavailable.

Any help is appreciated.
10 years ago

William Brogden wrote:The socket close by the server suggests to me that the client is choking and unable to continue reading the response stream.

Just throwing out ideas here:

Does the client have enough memory to build a DOM that big? Recall that a parsed XML document as a DOM uses a LOT more memory than the size of the document suggests.

Bill




Maybe that's the problem, but how do we increase client's memory.
10 years ago
I would like to mention this again... The app runs perfectly when rows in table is less than 67. This only happens when rows exceed 67 rows
10 years ago

Ulf Dittmer wrote:OK, so the actual code is different in several respects than what you posted; in the future, please post exactly what you're using to AvoidRedHerrings.

Have you tried both readEntity and getEntity separately? Trying them both in the same request (as the code you posted does) is not a good idea, especially as you're disregarding the result of the readEntity call.



Yes I have. Each of the separately and even together. Nothing works. After waiting for a few mins the application throws the following error (I've just discovered it)

Exception
org.jboss.resteasy.plugins.providers.jaxb.JAXBUnmarshalException: javax.xml.bind.UnmarshalException
- with linked exception:
[java.net.SocketException: Connection reset]
at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom(AbstractJAXBProvider.java:105)
at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom(AbstractJAXBProvider.java:105)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.readFrom(AbstractReaderInterceptorContext.java:59)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:51)
at org.jboss.resteasy.plugins.interceptors.encoding.GZIPDecodingInterceptor.aroundReadFrom(GZIPDecodingInterceptor.java:59)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
at org.jboss.resteasy.security.doseta.DigitalVerificationInterceptor.aroundReadFrom(DigitalVerificationInterceptor.java:32)
at org.jboss.resteasy.core.interception.AbstractReaderInterceptorContext.proceed(AbstractReaderInterceptorContext.java:53)
at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:433)
at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:385)
at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:358)
at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:352)
at thebigapplication.StartBox.get(StartBox.java:144)
at thebigapplication.ProductItem.ProductItemDatabase.getAllItems(ProductItemDatabase.java:165)
at thebigapplication.MainGui.initializeApplication(MainGui.java:101)
at thebigapplication.MainGui.createAndShowGui(MainGui.java:42)
at thebigapplication.TheBigApplication.main(TheBigApplication.java:30)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[java.net.SocketException: Connection reset]
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:261)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:229)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:125)
at org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.readFrom(AbstractJAXBProvider.java:101)
... 15 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:189)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:166)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:90)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:281)
at org.apache.http.impl.io.ChunkedInputStream.getChunkSize(ChunkedInputStream.java:251)
at org.apache.http.impl.io.ChunkedInputStream.nextChunk(ChunkedInputStream.java:209)
at org.apache.http.impl.io.ChunkedInputStream.read(ChunkedInputStream.java:171)
at org.apache.http.conn.EofSensorInputStream.read(EofSensorInputStream.java:138)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at org.jboss.resteasy.client.core.SelfExpandingBufferredInputStream.read(SelfExpandingBufferredInputStream.java:57)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(XMLEntityManager.java:2844)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:302)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1753)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.peekChar(XMLEntityScanner.java:497)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2649)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:258)
... 19 more
10 years ago

Ulf Dittmer wrote:What does "freeze" mean? Surely the app does not stop running...? Have you debugged the server side to see what's going on, meaning, how far it gets, and which methods are or are not being executed?

By the way, wherever there's I/O involved you should never write an empty catch handler. At least print the error message to where you will see it, so that you know if something goes wrong.




The server returns the response successfully. I even get the response with response code 200. After that the application get stuck on readEntity line and does not proceed to the next line. No exception is thrown (app freezes)

The real application does not have empty catch handler.

10 years ago
The following is my table

table: Product
id code itemName price description reportGroup inventory

I use restful web services to get this entity


I consume restful web services from java application using resteasy



Everything works fine when my product table has less than 67 rows

When table rows increase above 67 my application consuming does not get any response and freezes..
10 years ago

Yasin Kothia wrote:did you generate a _Skel class?



i used rmic but that created only _stub class
12 years ago
Can we use windows TAPI with Java SE.
12 years ago
Thankx Anayonkar, it helped me a lot

Guys anything on Rmi Security (link, article, blog) will be really helpful. I know Its not required for OCJD, but still I need it.
12 years ago

Roel De Nijs wrote:As per instructions no need to implement any security at all.



Hi Roel, Thanks for the reply

Can you still tell me the security measures that can be applied, I need them
Any book, links, tutorials will be very helpful.

I'm currently using the following code both in my server and client class which i got from rmi tutorials at oracle website

if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
}


Is this sufficient or do we need more.
12 years ago
Hello,

In the OCJD assignment we often use RMI. While the program communicates with the server through the Internet are there any security threats concern with this. Are we required to implement such security code in our assignment. This is because I don't have any knowledge on security.

Thank you
12 years ago