[Resteasy-users] 答复: Changing Default JSON Time Format with RESTEasy 3.x

2013-10-07 Thread
Why not add an extra field which hold  value of timezone?

 

发件人: Ian Anderson [mailto:insanes...@gmail.com] 
发送时间: 2013年10月8日 2:42
收件人: resteasy-users@lists.sourceforge.net
主题: [Resteasy-users] Changing Default JSON Time Format with RESTEasy 3.x

 

I am using RESTEasy to implement a REST Service using JSON serialization.
Currently, Dates are getting serialized to milliseconds since 1970.  To
improve compatibility, I would like to get my dates into one of two formats;
milliseconds + timezone offset or ISO 8061.

It seems that RESTEasy used to use Jettison for JSON serialization, but from
what I've been reading they've switch to Jackson ... all of this has made
googling for help pretty hit or miss.

>From what I can tell, I need to implement a ContextResolver
along the lines of:

public class JacksonConfig impelments ContextResolver
{
private final OBjectMapper objectMapper;

public JacksonConfig() throws Exception
{
objectMapper = new ObjectMapper.configure(
 
SerializationFeature.WRITE_DATE_AS_TIMESTAMPS, false);
}

@Override
public ObjectMapper getContext(Class arg0)
{
return objectMapper;
}
 }

The thing I haven't been able to find, is what do I do with this?  Where do
I put it?

So the larger questions are, am I heading in the right direction and are my
assumptions correct?


Thanks!


-- 
Ian

--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] Error in case resteasy integrated with spring

2013-08-23 Thread
Hi,all.

 I got stuck when integrate resteasy with spring.

I got error messages:

1355 [http-bio-8080-exec-1] ERROR org.jboss.resteasy.core.ExceptionHandler -
failed to execute

javax.ws.rs.NotFoundException: Could not find resource for full path:
http://localhost:8080/VICAdmin/rest/opLog/create/world

at org.jboss.resteasy.core.registry.ClassNode.match(ClassNode.java:72)

at
org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48)

at
org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMe
thodRegistry.java:444)

at
org.jboss.resteasy.core.SynchronousDispatcher.getInvoker(SynchronousDispatch
er.java:234)

at
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.j
ava:171)

 

Here is my web.xml:

  

 
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap<
/listener-class>  

   

   

 

 
org.jboss.resteasy.plugins.spring.SpringContextLoaderListene
r  



  

   

  Resteasy

 
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatch
er

   

 

 

  Resteasy  

  /rest/*  

   

 



 resteasy.servlet.mapping.prefix

 /rest

   

 

vicadmin

   



contextConfigLocation

classpath:services.xml



 

 Here is my services.xml:



http://www.springframework.org/schema/beans";

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

   xsi:schemaLocation="http://www.springframework.org/schema/beans

   http://www.springframework.org/schema/beans/spring-beans.xsd";>

   

  





 

Within my java file:

package com.linxun.vicadmin.rest;

 

import javax.ws.rs.GET;

import javax.ws.rs.Path;

import javax.ws.rs.PathParam;

 

@Path("/opLog")  

public class OpLogServicePoint {

 

   @GET  

   @Path( "/create/{message}")  

   public String getMessage(@PathParam("message")  String
message)  

 {  

 

  System.out.println( "hello,"+message);

 return "hello,"+message;  

 }  

}

 

What`s wrong with them?

Thanks for your kindly reply.

 

Best Regards 

 

Rixin liu

 

 

 

--
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] 答复: java.lang.NoSuchMethodError: javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration

2013-08-13 Thread
Sorry for my bothers , all.

 

I has fixed this error , which was not a prolem with resteasy.

 

Thanks.

 

Rixin liu

 

发件人: [地址未验证]-liuri...@linxun.com [mailto:-liuri...@linxun.com] 
发送时间: 2013年8月13日 15:26
收件人: resteasy-users@lists.sourceforge.net
主题: [Resteasy-users] java.lang.NoSuchMethodError:
javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/
BootstrapConfiguration

 

HI, all.

 

This is a NOSuchMethodError occurred with resteasy 3.0.2, 3.0.5, my local
web server was tomcat 7.9, jdk: oracle jdk 7.

 

The scraps of web.xml:



Resteasy



org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher









Resteasy

/rest/*



 



resteasy.servlet.mapping.prefix

/rest





resteasy.scan.resources

true



 

The detail of exception stack was:

 

SEVERE: Exception starting filter org.jboss.resteasy.plugins.server.servlet.
Filter30Dispatcher

java.lang.NoSuchMethodError:
javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/
BootstrapConfiguration;

at
org.jboss.resteasy.plugins.validation.ValidatorContextResolver.getContext(Va
lidatorContextResolver.java:73)

at
org.jboss.resteasy.plugins.validation.ValidatorContextResolver.getContext(Va
lidatorContextResolver.java:30)

at
org.jboss.resteasy.spi.ResteasyProviderFactory$1.getContext(ResteasyProvider
Factory.java:2154)

at
org.jboss.resteasy.core.ResourceMethodInvoker.(ResourceMethodInvoker.j
ava:115)

at
org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodR
egistry.java:280)

at
org.jboss.resteasy.core.ResourceMethodRegistry.register(ResourceMethodRegist
ry.java:251)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:221)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:193)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:179)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:156)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(Resourc
eMethodRegistry.java:75)

at
org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.ja
va:400)

at
org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:241)

at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.
init(ServletContainerDispatcher.java:112)

at
org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.init(FilterDispat
cher.java:42)

at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilte
rConfig.java:281)

at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilter
Config.java:262)

at
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterCon
fig.java:107)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.
java:4746)

at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5399)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.
java:1559)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.
java:1549)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
15)

at java.lang.Thread.run(Thread.java:722)

 

八月 13, 2013 3:24:04 下午 org.apache.catalina.core.StandardContext
startInternal

SEVERE: Error filterStart

 

 

Who could help me ? any advice will be appropriated.

 

Best Regards.

 

Rixin Liu

 

 

 

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users


[Resteasy-users] java.lang.NoSuchMethodError: javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/BootstrapConfiguration

2013-08-13 Thread
HI, all.

 

This is a NOSuchMethodError occurred with resteasy 3.0.2, 3.0.5, my local
web server was tomcat 7.9, jdk: oracle jdk 7.

 

The scraps of web.xml:



Resteasy



org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher









Resteasy

/rest/*



 



resteasy.servlet.mapping.prefix

/rest





resteasy.scan.resources

true



 

The detail of exception stack was:

 

SEVERE: Exception starting filter org.jboss.resteasy.plugins.server.servlet.
Filter30Dispatcher

java.lang.NoSuchMethodError:
javax.validation.Configuration.getBootstrapConfiguration()Ljavax/validation/
BootstrapConfiguration;

at
org.jboss.resteasy.plugins.validation.ValidatorContextResolver.getContext(Va
lidatorContextResolver.java:73)

at
org.jboss.resteasy.plugins.validation.ValidatorContextResolver.getContext(Va
lidatorContextResolver.java:30)

at
org.jboss.resteasy.spi.ResteasyProviderFactory$1.getContext(ResteasyProvider
Factory.java:2154)

at
org.jboss.resteasy.core.ResourceMethodInvoker.(ResourceMethodInvoker.j
ava:115)

at
org.jboss.resteasy.core.ResourceMethodRegistry.processMethod(ResourceMethodR
egistry.java:280)

at
org.jboss.resteasy.core.ResourceMethodRegistry.register(ResourceMethodRegist
ry.java:251)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:221)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:193)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:179)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMe
thodRegistry.java:156)

at
org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(Resourc
eMethodRegistry.java:75)

at
org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.ja
va:400)

at
org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:241)

at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.
init(ServletContainerDispatcher.java:112)

at
org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.init(FilterDispat
cher.java:42)

at
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilte
rConfig.java:281)

at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilter
Config.java:262)

at
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterCon
fig.java:107)

at org.apache.catalina.core.StandardContext.filterStart(StandardContext.
java:4746)

at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:
5399)

at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.
java:1559)

at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.
java:1549)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1145)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
15)

at java.lang.Thread.run(Thread.java:722)

 

八月 13, 2013 3:24:04 下午 org.apache.catalina.core.StandardContext
startInternal

SEVERE: Error filterStart

 

 

Who could help me ? any advice will be appropriated.

 

Best Regards.

 

Rixin Liu

 

 

 

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
Resteasy-users mailing list
Resteasy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/resteasy-users