Kevin Thorne

Greenhorn
+ Follow
since Nov 01, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kevin Thorne

Started on Stack Overflow, but I figured getting more eyes on this topic would be beneficial.

How would I go about having the user select an event from their Calendar app? (or the calendar database in general I suppose)

As you can read in the Stack Overflow post, the Android Calendar app doesn't have support for an ACTION_PICK intent.

I guess I have to dump user's calendars into my app; this sounds extremely messy. What's the best way to do it?

Thanks!
Kevin

7 years ago
Can someone do my a favor and mark this UNRESOLVED? I'm still running into this issue. The Jackson Provider is the one returning a LinkedHashMap while the Proxy class attempts to cast it to the object I specified (UserGroup.class)
7 years ago
The Solution

A simple lesson in RESTful services altogether. A PUT method should not (and won't) return anything other than Response object. Making my insert method a POST HTTP method fixed it.
7 years ago
I have got, I think personally, the oddest bug. Even if my JSON specifies a type, Jackson's deserializer still deserializes it into LinkedHashMap

I'm using RESTEasy (JAX-RS JBoss impl) on both the server and client I'm developing, transferring everything in JSON (using Jackson JAX-RS provider). The server and client share common interfaces (as expected).

The cool thing I tried to do with my REST services was to wrap whatever Entity into its interfaces, making CRUD operations transparent and written in a common abstract implementation.

In simpler words, and using code, I've done the following:


is the central interface for any other REST service that will be needing CRUD operations on Entities (User, UserGroup, etc).


Now, for my UserGroup entity class, another interface is made to extend the central interface to specify CRUD ops, plus some helper methods:


On the server side, the UserGroup Server REST service is implemented like this:


Notice the ServerService<ENTITY, EJBSERVICE> extension. This covers the previously stated central MyRestService<ENTITY> interface, since all my EJB stateless beans follow a similar CRUD framework (central interface with CRUD, subinterface with procedural helper methods):



"Alright, I've been reading this for five minutes, what the issue?"

The client takes advantage of RESTEasy proxy interfaces, where you can jam in a properly annotated JAX-RS interface and you'll make calls to the server by just calling the method.

I do similar implementations of the interfaces on the client side so I can cache and all sorts of things.

The Problem

At some point in the client, I call:
Client Log:



Why on earth is LinkedHashMap being generated from that JSON I received in the response? I used @JsonTypeInfo to add in the type into the serialized object. I still have quite the investigation to do, I'll be attempting to navigate RESTEasy proxy interfaces to hopefully get down to the Jackson provider.

Any idea what's going on here? I just feel like the type info shouldn't have been ignored.

Totally willing to clarify and edit, I know this was quite the explosion on my keyboard and here on the forums. I'm hoping to tap into the knowledge of those who know Jackson and Java Generics better than I do.
7 years ago
Overlooked the interface and accidentally implemented ContainerRequestFilter instead of ClientRequestFilter, looking to using requestContext.setUri(); and rebuilding it.
I simply need to attach query parameters (not headers) onto a outgoing request. (Java EE 7.0, JAX-RS 2.0)

In specifics, I currently using the RESTeasy Client ver 3.0.14, so I make my calls using the fancy interface-proxy system. I was attempting to produce something like this:



with:



I made sure I was registering it with as well. Feel free to ask questions. Thanks!
Had to come over to the friendlier side of the Internet since my question was downvoted immediately after posting in SO. :c

How would I go about grabbing the live image of an application in Windows via Windows API in JNA? I'm able to utilize a java.awt.robot object to grab screenshots of windows using its position and size supplied through JNA. However, what if a window is minimized?

I know Windows does this internally with its taskbar hover and Google+ Hangouts is able to screen-share minimized or covered windows.

The use of JNA is still kind of foreign to me, as much explanation as you could spare would be awesome!

Thanks!
echospot
8 years ago