users@jersey.java.net

Re: [Jersey] Sudden wierdness

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 20 Feb 2009 19:12:35 +0100

On Feb 20, 2009, at 6:28 PM, Marsh Eric wrote:

> Hi Folks,
>
> I'm suddenly seeing some very strange behavior from jersey.
> Something, I don't know what, is happening somewhere between the web
> connection and the persistence layer, but I'm not really sure
> exactly why I'm seeing it now but not previously. I did recently
> upgrade to the latest version so perhaps that's got something to do
> with it.
>

When you say latest version do you mean 1.0.2 or 1.0.3-SNAPSHOT?


> Essentially Jersey doesn't seem to be setting some passed numeric
> values and so those values are defaulting to zeros.

Can you provide an example of your resource classes showing how the
numeric values are being extracted? and the client requests you make
to those resources. Or even better a simple project that reproduces
the issue?

Has your client changed?


> Also, a passed string is giving me a truncation error if there are
> any spaces embedded (see my passed values below and the error
> message from the persistence layer).
>
> I don't expect you guys to solve my problems, but if anyone else has
> mentioned anything like this happening before that might be helpful.
> Also is there any documentation explaining how to set Jersey up for
> debugging?

No docs. The source jars is available on the maven repo in the same
location as the code and JavaDoc jars . So you should be able to use
that source to debug your project using say NetBeans.


> Seems that there's a lot of mysterious things happening in there
> that I don't understand.
>


> One last thing - since a lot of information is passed on the command
> line what can be done to secure it? Just encrypt the parameters?
>

I don't understand the question, can you provide an example of what
you mean?

Paul.

> Thanks,
>
> ERic
>
> {"accuracy":"17",
> "mykey":{"@uri":"http://192.168.0.3:8080/hereiam/ws/members/?userid=emarsh&code=dW1hYjAwbg==
> "},
> "@uri":"http://192.168.0.3:8080/hereiam/ws/mylocations/",
> "longitude":"-98.288691",
> "timestamp":"2009-02-19T08:35:51-06:00",
> "imat":"vallero distribution center",
> "latitude":"29.604120",
> "peopleCollection":{"people":[
> {"@uri":"http://192.168.0.3:8080/hereiam/ws/peoples/2/"},
> {"@uri":"http://192.168.0.3:8080/hereiam/ws/peoples/7/"}],
> "uri":"http://192.168.0.3:8080/hereiam/ws/members/"}}
>
> results in
>
> Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build
> b04-fcs (04/11/2008))):
> oracle.toplink.essentials.exceptions.DatabaseException
> Internal Exception: com.mysql.jdbc.MysqlDataTruncation: Data
> truncation: Data too long for column 'imat' at row 1
> Error Code: 0
> Call: INSERT INTO mylocation (latitude, longitude, width, timestamp,
> imat, photo, height, accuracy, mykey) VALUES
> (?, ?, ?, ?, ?, ?, ?, ?, ?)
> bind => [0.0, 0.0, 0, 2009-02-19 08:35:51.0, vallero
> distribution center, null, 0, 0, 1]
> Query: InsertObjectQuery(hereiamdb.Mylocation[pk=null])
> at
> oracle
> .toplink
> .essentials
> .exceptions.DatabaseException.sqlException(DatabaseException.java:311)