You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2010 |
Jan
(1) |
Feb
(2) |
Mar
(6) |
Apr
(5) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(8) |
Sep
(4) |
Oct
(2) |
Nov
(6) |
Dec
(4) |
| 2011 |
Jan
(4) |
Feb
(18) |
Mar
(9) |
Apr
(7) |
May
(6) |
Jun
(13) |
Jul
(11) |
Aug
(7) |
Sep
(12) |
Oct
(28) |
Nov
(12) |
Dec
(11) |
| 2012 |
Jan
(20) |
Feb
(21) |
Mar
(19) |
Apr
(12) |
May
(44) |
Jun
(23) |
Jul
(14) |
Aug
(26) |
Sep
(23) |
Oct
(7) |
Nov
(42) |
Dec
(15) |
| 2013 |
Jan
(62) |
Feb
(20) |
Mar
(14) |
Apr
(52) |
May
(29) |
Jun
(46) |
Jul
(20) |
Aug
(55) |
Sep
(27) |
Oct
(53) |
Nov
(29) |
Dec
(21) |
| 2014 |
Jan
(35) |
Feb
(44) |
Mar
(12) |
Apr
(37) |
May
(24) |
Jun
(17) |
Jul
(13) |
Aug
(1) |
Sep
(4) |
Oct
(13) |
Nov
(1) |
Dec
(1) |
| 2015 |
Jan
(11) |
Feb
(8) |
Mar
(10) |
Apr
(7) |
May
(17) |
Jun
(11) |
Jul
(13) |
Aug
(14) |
Sep
(6) |
Oct
(3) |
Nov
(7) |
Dec
(3) |
| 2016 |
Jan
(1) |
Feb
(4) |
Mar
(8) |
Apr
(2) |
May
(2) |
Jun
(10) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
|
Dec
|
|
From: f c. <fil...@gm...> - 2011-02-15 22:23:06
|
Hi !
i´m using resteasy to generate json to integrate the backend with the ui;
now my problem is that one of the objects has a list; and when the list is
empty the json data is not generated for that data;
example:
@XmlRootElement(name = "CWebAssetsFilters")
@XmlAccessorType(XmlAccessType.FIELD)
@NoJackson
public class CWebAssetsFilterList {
private List<TWebassetsfilter> cWebAssetsFilters = new
ArrayList<TWebassetsfilter>();
private long totalrecord;
getter,,,,setter...
generator
@GET
@Path("/cWebAssetsFilters/readAssetFilters")
@Produces("application/json")
public CWebAssetsFilterList readAssetsFilter(@QueryParam("start") int
start,@QueryParam("limit") int limit){
return new CWebAssetsFilterList();
}
this will return only the totalcount attribute on json;
no cWebAssetsFilters attribute is generated;
do i have an annotation to tell that is madattory to generate all attributes
?
best
Filipe
|
|
From: awaterma <awa...@me...> - 2011-02-11 19:02:04
|
Thanks for your help Michael. This looks to be a maven dependency configuration issue. I narrowed it down to what looks like a classpath conflict between TJWS and Jetty (another test in the project I've been working on uses Jetty). Once that is removed, TJWS tests can run. Also TJWS looks to need a declared version of the Servlet API to work properly. I'm still seeing the following issue, when I scope a versioned Servlet API to "provided", although the tests now run and pass: > java.lang.IllegalStateException: Can not send an error, headers have been already written > at Acme.Serve.Serve$ServeConnection.realSendError(Serve.java:4205) > at Acme.Serve.Serve$ServeConnection.sendError(Serve.java:4183) > at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:71) > at org.jboss.resteasy.core.SynchronousDispatcher.handleFailure(SynchronousDispatcher.java:246) > at org.jboss.resteasy.core.SynchronousDispatcher.handleWriterException(SynchronousDispatcher.java:363) > at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:202) > at org.jboss.resteasy.core.SynchronousDispatcher.handleWriteResponseException(SynchronousDispatcher.java:187) > at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:488) > at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) > at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:207) > at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) > at org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40) > at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) > at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2324) > at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2278) > at Acme.Serve.Serve$ServeConnection.run(Serve.java:2052) > at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402) > at java.lang.Thread.run(Thread.java:680) Are these known issues, I wonder? best wishes, Andrew On Feb 10, 2011, at 11:28 AM, awaterma wrote: > Hello Everybody, > > I'm sorry to trouble the list with this question, but I haven't been able to find an answer via google or the archives, so I thought I'd email you guys. Basically, I'm trying to use the Embedded server for jUnit tests on my RESTEasy implementation. I was having trouble just getting a simple example to work, so I searched Google and came across the following post from Rob Williams: "http://www.jroller.com/robwilliams/entry/resteasy_oobe_a_10". In the comments section, Solomon Duskis makes a suggestion: > >> RESTEasy ClientRequest and EmbeddedServer make this kind of testing even easier. Unfortunately, they're not documented yet... the docs are in progress. >> >> An example can be found at: http://resteasy.svn.sourceforge.net/viewvc/resteasy/trunk/jaxrs/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/finegrain/client/ClientResponseTest.java?view=markup >> Posted by Solomon Duskis on April 27, 2009 at 07:21 AM PDT # >> > > So I followed his suggested approach. My unit tests run perfectly in my IDE (IntelliJ 10) with no apparent issues. However, when I evoke my test as part of a general maven 3 build, I run into the following problem: > >> Caused by: java.lang.NullPointerException >> at javax.servlet.GenericServlet.log(GenericServlet.java:300) >> at javax.servlet.GenericServlet.init(GenericServlet.java:257) >> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:33) >> at Acme.Serve.Serve.addServlet(Serve.java:509) >> at Acme.Serve.Serve.addServlet(Serve.java:493) >> at org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.addServlet(TJWSServletServer.java:57) >> at org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer.start(TJWSEmbeddedJaxrsServer.java:42) >> at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:50) >> at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:40) >> at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:22) > > > As I mentioned, it's not possible to debug this, as when I step through the downloaded source (man, I love maven), I see no NPE from the IDE perspective. Any ideas as to what could be going on? Am I missing some logging configuration data that IntelliJ somehow magically passes on? > > I should also mention, that I although my Unit Tests in IntelliJ all run, and come up green, I do see the following logged errors in the output stream: > >> [Thu Feb 10 11:19:40 CST 2011] MIME map can't be loaded:java.lang.NullPointerException >> [Thu Feb 10 11:19:40 CST 2011] Servlet for path '/' already defined and no default will be used. >> [Thu Feb 10 11:19:40 CST 2011] TJWS httpd 0.0.0.0 - SimpleAcceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8081] is listening. >> [Thu Feb 10 11:19:47 CST 2011] IO error: java.net.SocketException: Broken pipe in processing a request from /127.0.0.1:8081 / java.net.Socket >> [Thu Feb 10 11:19:47 CST 2011] Unexpected problem running servlet >> java.lang.IllegalStateException: Can not send an error, headers have been already written >> at Acme.Serve.Serve$ServeConnection.realSendError(Serve.java:4205) >> at Acme.Serve.Serve$ServeConnection.sendError(Serve.java:4183) >> at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:71) >> at org.jboss.resteasy.core.SynchronousDispatcher.handleFailure(SynchronousDispatcher.java:246) >> at org.jboss.resteasy.core.SynchronousDispatcher.handleWriterException(SynchronousDispatcher.java:363) >> at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:202) >> at org.jboss.resteasy.core.SynchronousDispatcher.handleWriteResponseException(SynchronousDispatcher.java:187) >> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:488) >> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) >> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:207) >> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) >> at org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40) >> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) >> at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2324) >> at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2278) >> at Acme.Serve.Serve$ServeConnection.run(Serve.java:2052) >> at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402) >> at java.lang.Thread.run(Thread.java:680) > > > I wonder if the null mime map is the issue I'm seeing in Maven? Should I do more to initialize TJWS then: > >> ResteasyDeployment deployment = EmbeddedContainer.start(); >> dispatcher = deployment.getDispatcher(); >> dispatcher.getRegistry().addPerRequestResource(PackageService.class); > > > Here's my client connection code: > >> URL url = new URL(generateBaseUrl() + "/packages"); >> connection = (HttpURLConnection)url.openConnection(); > > > Really looking forward to your ideas and suggestions. > > best wishes, > > Andrew Waterman > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb_______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
|
From: awaterma <awa...@me...> - 2011-02-10 23:00:41
|
Thanks so much for the reply Michael.
I've made the changes you suggested and I get similar results, with Maven. In the IDE, however, I get a connection refused error and the tests now fail. At least with the previous implementation the tests can run in the IDE -- although that's hardly enough! :(
Anyway, the Maven3 problem is the same as what I reported earlier:
> org.drools.guvnor.server.rest.PackageServiceTest Time elapsed: 0 sec <<< ERROR!
> java.lang.NullPointerException
> at javax.servlet.GenericServlet.log(GenericServlet.java:300)
> at javax.servlet.GenericServlet.init(GenericServlet.java:257)
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:33)
> at Acme.Serve.Serve.addServlet(Serve.java:509)
> at Acme.Serve.Serve.addServlet(Serve.java:493)
> at org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.addServlet(TJWSServletServer.java:57)
> at org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer.start(TJWSEmbeddedJaxrsServer.java:42)
> at org.drools.guvnor.server.rest.RestTestingBase.initialize(RestTestingBase.j
Serve.java:509 is:
> servlet.init(new ServeConfig((ServletContext) this, initParams, urlPat));
When I run this through the IDE Debugger, it's trying to cast the FileMappingServlet (this) to a ServletContext. Could it be possible that the default Servlet is somehow null?
This feels like a configuration issue since it's so cryptic.
Any other ideas? :)
best wishes,
Andrew
On Feb 10, 2011, at 12:19 PM, Michael Musgrove wrote:
> I do not know the cause of your issue but for what its worth here is some code that I have used in my surefire maven plugin without issues:
>
> protected static void startRestEasy(Class<?> ... classes) throws Exception
> {
> server = new TJWSEmbeddedJaxrsServer();
> server.setPort(PORT);
> server.start();
> Registry registry = server.getDeployment().getRegistry();
> ResteasyProviderFactory factory = server.getDeployment().getDispatcher().getProviderFactory();
>
> if (classes != null)
> for (Class<?> clazz : classes)
> registry.addPerRequestResource(clazz);
>
> factory.addExceptionMapper(...);
> }
>
> @BeforeClass
> public static void beforeClass() throws Exception {startRestEasy(...);}
>
> Mike
>
>> Hello Everybody,
>>
>> I'm sorry to trouble the list with this question, but I haven't been able to find an answer via google or the archives, so I thought I'd email you guys. Basically, I'm trying to use the Embedded server for jUnit tests on my RESTEasy implementation. I was having trouble just getting a simple example to work, so I searched Google and came across the following post from Rob Williams: "http://www.jroller.com/robwilliams/entry/resteasy_oobe_a_10". In the comments section, Solomon Duskis makes a suggestion:
>>
>>> RESTEasy ClientRequest and EmbeddedServer make this kind of testing even easier. Unfortunately, they're not documented yet... the docs are in progress.
>>>
>>> An example can be found at: http://resteasy.svn.sourceforge.net/viewvc/resteasy/trunk/jaxrs/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/finegrain/client/ClientResponseTest.java?view=markup
>>> Posted by Solomon Duskis on April 27, 2009 at 07:21 AM PDT #
>>>
>>
>> So I followed his suggested approach. My unit tests run perfectly in my IDE (IntelliJ 10) with no apparent issues. However, when I evoke my test as part of a general maven 3 build, I run into the following problem:
>>
>>> Caused by: java.lang.NullPointerException
>>> at javax.servlet.GenericServlet.log(GenericServlet.java:300)
>>> at javax.servlet.GenericServlet.init(GenericServlet.java:257)
>>> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:33)
>>> at Acme.Serve.Serve.addServlet(Serve.java:509)
>>> at Acme.Serve.Serve.addServlet(Serve.java:493)
>>> at org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.addServlet(TJWSServletServer.java:57)
>>> at org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer.start(TJWSEmbeddedJaxrsServer.java:42)
>>> at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:50)
>>> at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:40)
>>> at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:22)
>>
>>
>> As I mentioned, it's not possible to debug this, as when I step through the downloaded source (man, I love maven), I see no NPE from the IDE perspective. Any ideas as to what could be going on? Am I missing some logging configuration data that IntelliJ somehow magically passes on?
>>
>> I should also mention, that I although my Unit Tests in IntelliJ all run, and come up green, I do see the following logged errors in the output stream:
>>
>>> [Thu Feb 10 11:19:40 CST 2011] MIME map can't be loaded:java.lang.NullPointerException
>>> [Thu Feb 10 11:19:40 CST 2011] Servlet for path '/' already defined and no default will be used.
>>> [Thu Feb 10 11:19:40 CST 2011] TJWS httpd 0.0.0.0 - SimpleAcceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8081] is listening.
>>> [ Thu Feb 10 11:19:47 CST 2011] IO error: java.net.SocketException: Broken pipe in processing a request from /127.0.0.1:8081 / java.net.Socket
>>> [Thu Feb 10 11:19:47 CST 2011] Unexpected problem running servlet
>>> java.lang.IllegalStateException: Can not send an error, headers have been already written
>>> at Acme.Serve.Serve$ServeConnection.realSendError(Serve.java:4205)
>>> at Acme.Serve.Serve$ServeConnection.sendError(Serve.java:4183)
>>> at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:71)
>>> at org.jboss.resteasy.core.SynchronousDispatcher.handleFailure(SynchronousDispatcher.java:246)
>>> at org.jboss.resteasy.core.SynchronousDispatcher.handleWriterException(SynchronousDispatcher.java:363)
>>> at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:202)
>>> at org.jboss.resteasy.core.SynchronousDispatcher.handleWriteResponseException(SynchronousDispatcher.java:187)
>>> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:488)
>>> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
>>> at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:207)
>>> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
>>> at org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40)
>>> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>>> at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2324)
>>> at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2278)
>>> at Acme.Serve.Serve$ServeConnection.run(Serve.java:2052)
>>> at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402)
>>> at java.lang.Thread.run(Thread.java:680)
>>
>>
>> I wonder if the null mime map is the issue I'm seeing in Maven? Should I do more to initialize TJWS then:
>>
>>> ResteasyDeployment deployment = EmbeddedContainer.start();
>>> dispatcher = deployment.getDispatcher();
>>> dispatcher.getRegistry().addPerRequestResource(PackageService.class);
>>
>>
>> Here's my client connection code:
>>
>>> URL url = new URL(generateBaseUrl() + "/packages");
>>> connection = (HttpURLConnection)url.openConnection();
>>
>>
>> Really looking forward to your ideas and suggestions.
>>
>> best wishes,
>>
>> Andrew Waterman
>>
>> ------------------------------------------------------------------------------
>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
>> Pinpoint memory and threading errors before they happen.
>> Find and fix more than 250 security defects in the development cycle.
>> Locate bottlenecks in serial and parallel code that limit performance.
>> http://p.sf.net/sfu/intel-dev2devfeb
>>
>> _______________________________________________
>> Resteasy-users mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb_______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|
|
From: Michael M. <mmu...@re...> - 2011-02-10 18:17:42
|
I do not know the cause of your issue but for what its worth here is
some code that I have used in my surefire maven plugin without issues:
protected static void startRestEasy(Class<?> ... classes) throws
Exception
{
server = new TJWSEmbeddedJaxrsServer();
server.setPort(PORT);
server.start();
Registry registry = server.getDeployment().getRegistry();
ResteasyProviderFactory factory =
server.getDeployment().getDispatcher().getProviderFactory();
if (classes != null)
for (Class<?> clazz : classes)
registry.addPerRequestResource(clazz);
factory.addExceptionMapper(...);
}
@BeforeClass
public static void beforeClass() throws Exception {startRestEasy(...);}
Mike
> Hello Everybody,
>
> I'm sorry to trouble the list with this question, but I haven't been
> able to find an answer via google or the archives, so I thought I'd
> email you guys. Basically, I'm trying to use the Embedded server for
> jUnit tests on my RESTEasy implementation. I was having trouble just
> getting a simple example to work, so I searched Google and came across
> the following post from Rob Williams:
> "http://www.jroller.com/robwilliams/entry/resteasy_oobe_a_10". In
> the comments section, Solomon Duskis makes a suggestion:
>
>> RESTEasy ClientRequest and EmbeddedServer make this kind of testing
>> even easier. Unfortunately, they're not documented yet... the docs
>> are in progress.
>>
>> An example can be found at:
>> http://resteasy.svn.sourceforge.net/viewvc/resteasy/trunk/jaxrs/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/finegrain/client/ClientResponseTest.java?view=markup
>>
>>
>> Posted by *Solomon Duskis* <http://jroller.com/Solomon> on April 27,
>> 2009 at 07:21 AM PDT #
>> <http://www.jroller.com/robwilliams/entry/resteasy_oobe_a_10#comment-1240842101000>
>>
> So I followed his suggested approach. My unit tests run perfectly in
> my IDE (IntelliJ 10) with no apparent issues. However, when I evoke my
> test as part of a general maven 3 build, I run into the following problem:
>
>> Caused by: java.lang.NullPointerException
>> at javax.servlet.GenericServlet.log(GenericServlet.java:300)
>> at javax.servlet.GenericServlet.init(GenericServlet.java:257)
>> at
>> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:33)
>>
>> at Acme.Serve.Serve.addServlet(Serve.java:509)
>> at Acme.Serve.Serve.addServlet(Serve.java:493)
>> at
>> org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.addServlet(TJWSServletServer.java:57)
>>
>> at
>> org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer.start(TJWSEmbeddedJaxrsServer.java:42)
>>
>> at
>> org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:50)
>>
>> at
>> org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:40)
>>
>> at
>> org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:22)
>>
>
> As I mentioned, it's not possible to debug this, as when I step
> through the downloaded source (man, I love maven), I see no NPE from
> the IDE perspective. Any ideas as to what could be going on? Am I
> missing some logging configuration data that IntelliJ somehow
> magically passes on?
>
> I should also mention, that I although my Unit Tests in IntelliJ all
> run, and come up green, I do see the following logged errors in the
> output stream:
>
>> [Thu Feb 10 11:19:40 CST 2011] MIME map can't be
>> loaded:java.lang.NullPointerException
>> [Thu Feb 10 11:19:40 CST 2011] Servlet for path '/' already defined
>> and no default will be used.
>> [Thu Feb 10 11:19:40 CST 2011] TJWS httpd 0.0.0.0 - SimpleAcceptor
>> ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8081] is listening.
>> [ Thu Feb 10 11:19:47 CST 2011] IO error: java.net.SocketException:
>> Broken pipe in processing a request from /127.0.0.1:8081 /
>> java.net.Socket
>> [Thu Feb 10 11:19:47 CST 2011] Unexpected problem running servlet
>> java.lang.IllegalStateException: Can not send an error, headers have
>> been already written
>> at Acme.Serve.Serve$ServeConnection.realSendError(Serve.java:4205)
>> at Acme.Serve.Serve$ServeConnection.sendError(Serve.java:4183)
>> at
>> org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:71)
>>
>> at
>> org.jboss.resteasy.core.SynchronousDispatcher.handleFailure(SynchronousDispatcher.java:246)
>>
>> at
>> org.jboss.resteasy.core.SynchronousDispatcher.handleWriterException(SynchronousDispatcher.java:363)
>>
>> at
>> org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:202)
>>
>> at
>> org.jboss.resteasy.core.SynchronousDispatcher.handleWriteResponseException(SynchronousDispatcher.java:187)
>>
>> at
>> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:488)
>>
>> at
>> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
>>
>> at
>> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:207)
>>
>> at
>> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
>>
>> at
>> org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40)
>>
>> at
>> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2324)
>> at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2278)
>> at Acme.Serve.Serve$ServeConnection.run(Serve.java:2052)
>> at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402)
>> at java.lang.Thread.run(Thread.java:680)
>
> I wonder if the null mime map is the issue I'm seeing in Maven?
> Should I do more to initialize TJWS then:
>
>> ResteasyDeployment deployment = EmbeddedContainer.start();
>> dispatcher = deployment.getDispatcher();
>> dispatcher.getRegistry().addPerRequestResource(PackageService.class);
>
> Here's my client connection code:
>
>> URL url = new URL(generateBaseUrl() + "/packages");
>> connection = (HttpURLConnection)url.openConnection();
>
> Really looking forward to your ideas and suggestions.
>
> best wishes,
>
> Andrew Waterman
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
>
>
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|
|
From: awaterma <awa...@me...> - 2011-02-10 17:34:09
|
Hello Everybody, I'm sorry to trouble the list with this question, but I haven't been able to find an answer via google or the archives, so I thought I'd email you guys. Basically, I'm trying to use the Embedded server for jUnit tests on my RESTEasy implementation. I was having trouble just getting a simple example to work, so I searched Google and came across the following post from Rob Williams: "http://www.jroller.com/robwilliams/entry/resteasy_oobe_a_10". In the comments section, Solomon Duskis makes a suggestion: > RESTEasy ClientRequest and EmbeddedServer make this kind of testing even easier. Unfortunately, they're not documented yet... the docs are in progress. > > An example can be found at: http://resteasy.svn.sourceforge.net/viewvc/resteasy/trunk/jaxrs/resteasy-jaxrs/src/test/java/org/jboss/resteasy/test/finegrain/client/ClientResponseTest.java?view=markup > Posted by Solomon Duskis on April 27, 2009 at 07:21 AM PDT # > So I followed his suggested approach. My unit tests run perfectly in my IDE (IntelliJ 10) with no apparent issues. However, when I evoke my test as part of a general maven 3 build, I run into the following problem: > Caused by: java.lang.NullPointerException > at javax.servlet.GenericServlet.log(GenericServlet.java:300) > at javax.servlet.GenericServlet.init(GenericServlet.java:257) > at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:33) > at Acme.Serve.Serve.addServlet(Serve.java:509) > at Acme.Serve.Serve.addServlet(Serve.java:493) > at org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.addServlet(TJWSServletServer.java:57) > at org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer.start(TJWSEmbeddedJaxrsServer.java:42) > at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:50) > at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:40) > at org.jboss.resteasy.test.TJWSServletContainer.start(TJWSServletContainer.java:22) As I mentioned, it's not possible to debug this, as when I step through the downloaded source (man, I love maven), I see no NPE from the IDE perspective. Any ideas as to what could be going on? Am I missing some logging configuration data that IntelliJ somehow magically passes on? I should also mention, that I although my Unit Tests in IntelliJ all run, and come up green, I do see the following logged errors in the output stream: > [Thu Feb 10 11:19:40 CST 2011] MIME map can't be loaded:java.lang.NullPointerException > [Thu Feb 10 11:19:40 CST 2011] Servlet for path '/' already defined and no default will be used. > [Thu Feb 10 11:19:40 CST 2011] TJWS httpd 0.0.0.0 - SimpleAcceptor ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=8081] is listening. > [Thu Feb 10 11:19:47 CST 2011] IO error: java.net.SocketException: Broken pipe in processing a request from /127.0.0.1:8081 / java.net.Socket > [Thu Feb 10 11:19:47 CST 2011] Unexpected problem running servlet > java.lang.IllegalStateException: Can not send an error, headers have been already written > at Acme.Serve.Serve$ServeConnection.realSendError(Serve.java:4205) > at Acme.Serve.Serve$ServeConnection.sendError(Serve.java:4183) > at org.jboss.resteasy.plugins.server.servlet.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:71) > at org.jboss.resteasy.core.SynchronousDispatcher.handleFailure(SynchronousDispatcher.java:246) > at org.jboss.resteasy.core.SynchronousDispatcher.handleWriterException(SynchronousDispatcher.java:363) > at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:202) > at org.jboss.resteasy.core.SynchronousDispatcher.handleWriteResponseException(SynchronousDispatcher.java:187) > at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:488) > at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) > at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:207) > at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) > at org.jboss.resteasy.plugins.server.tjws.TJWSServletDispatcher.service(TJWSServletDispatcher.java:40) > at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at Acme.Serve.Serve$ServeConnection.runServlet(Serve.java:2324) > at Acme.Serve.Serve$ServeConnection.parseRequest(Serve.java:2278) > at Acme.Serve.Serve$ServeConnection.run(Serve.java:2052) > at Acme.Utils$ThreadPool$PooledThread.run(Utils.java:1402) > at java.lang.Thread.run(Thread.java:680) I wonder if the null mime map is the issue I'm seeing in Maven? Should I do more to initialize TJWS then: > ResteasyDeployment deployment = EmbeddedContainer.start(); > dispatcher = deployment.getDispatcher(); > dispatcher.getRegistry().addPerRequestResource(PackageService.class); Here's my client connection code: > URL url = new URL(generateBaseUrl() + "/packages"); > connection = (HttpURLConnection)url.openConnection(); Really looking forward to your ideas and suggestions. best wishes, Andrew Waterman |
|
From: Michael M. <mmu...@re...> - 2011-02-09 16:00:18
|
Your application will extend javax.ws.rs.core.Application (defines your
root resources and providers). The classes you return in your
implementation of the
public abstract Set<Class<?>> getClasses();
method defines the classes used for per request method dispatching.
Your singletons are specified by what you return in the getSingletons()
method.
I believe the spec says that the default model is Singleton.
Perhaps some other list member knows the root cause of the error "Class
is not a root resource" even though the class is annotated with the
@Path annotation.
Mike
> Hey ...
>
> Can you please explain how did you do that? Cant find anything on this
> issue.
> I finally got one test application working .. with making a maven
> project .. but when I copy all that into a real project I still get
> the following exception ...
>
> java.lang.RuntimeException: Class is not a root resource. It, or
> one of its interfaces must be annotated with @Path:
> com.dropchop.jop.rest.TestResource implements:
>
>
> which is bizzare ... cause I have annotated class and I can deploy in
> other maven project ..
>
> getting totally lost here :(
>
> Regards
>
> Armando
>
>
> On Wed, Feb 9, 2011 at 3:33 PM, Michael Musgrove <mmu...@re...
> <mailto:mmu...@re...>> wrote:
>
> Which threading model are you using. I got the error you are
> seeing once with the Singleton model but when I moved to the per
> request model for my resources the error went away. I'm afraid
> that I was unable to track down why the Singleton model wasn't
> working.
>
> Mike
>
>> Hi
>>
>> I still can't create a restful service with resteasy. And I don't
>> understand what's wrong.
>>
>> When I created a simple web application from scratch and created
>> and deployed .WAR I get this exception
>>
>> When starting an application I get this exception !!!
>>
>> java.lang.NullPointerException
>> org.scannotation.WarUrlFinder.findWebInfLibClasspaths(WarUrlFinder.java:27)
>> org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.getScanningUrls(ListenerBootstrap.java:33)
>> org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap.createDeployment(ConfigurationBootstrap.java:163)
>> org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.createDeployment(ListenerBootstrap.java:26)
>> org.jboss.resteasy.plugins.server.servlet.ServletBootstrap.createDeployment(ServletBootstrap.java:25)
>> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:66)
>> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
>> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)
>> org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)
>> org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)
>> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
>> org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
>> org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
>> java.lang.Thread.run(Thread.java:662)
>> Web.xml
>>
>> <?xml version="1.0" encoding="UTF-8"?> <web-app
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns="http://java.sun.com/xml/ns/javaee"
>> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>> id="WebApp_ID" version="2.5">
>> <display-name>test-resteasy</display-name> <context-param>
>> <param-name>resteasy.scan</param-name>
>> <param-value>true</param-value> </context-param>
>>
>> <listener>
>>
>> <listener-class>
>> org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
>> </listener-class>
>> </listener>
>>
>> <servlet> <servlet-name>Resteasy</servlet-name>
>> <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
>> </servlet> <servlet-mapping>
>> <servlet-name>Resteasy</servlet-name>
>> <url-pattern>/rest/*</url-pattern> </servlet-mapping>
>> <welcome-file-list> <welcome-file>/index.html</welcome-file>
>> </welcome-file-list> </web-app>
>>
>> my resource test class ...
>>
>> @Path("test") public class TestResource { @GET @Path("hello")
>> public String HelloWorld() { return "Hello restfull
>> world!!!"; } }
>>
>> When I create a maven project and deploy application with same
>> web.xml and same resource class I get
>>
>> StandardWrapper.Throwable: java.lang.RuntimeException: Class
>> is not a root resource. It, or one of its interfaces must be
>> annotated with @Path: com.dropchop.rest.TestResource implements:
>> at
>> org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104)
>> [:6.0.0.Final]
>> at
>> org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83)
>> [:6.0.0.Final]
>> at
>> org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72)
>> [:6.0.0.Final]
>> ....
>>
>> I'm using clean install of JBoss AS 6, the version of RESTeasy
>> that came with it is 2.1.0.GA <http://2.1.0.GA>
>> Any Help would be greatly appreciated.
>> KInd regards
>> Armando
>>
>>
>> ------------------------------------------------------------------------------
>> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
>> Pinpoint memory and threading errors before they happen.
>> Find and fix more than 250 security defects in the development cycle.
>> Locate bottlenecks in serial and parallel code that limit performance.
>> http://p.sf.net/sfu/intel-dev2devfeb
>>
>> _______________________________________________
>> Resteasy-users mailing list
>> Res...@li... <mailto:Res...@li...>
>> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel
> Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> <mailto:Res...@li...>
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
>
>
|
|
From: Michael M. <mmu...@re...> - 2011-02-09 14:31:09
|
Which threading model are you using. I got the error you are seeing once with the Singleton model but when I moved to the per request model for my resources the error went away. I'm afraid that I was unable to track down why the Singleton model wasn't working. Mike > Hi > > I still can't create a restful service with resteasy. And I don't > understand what's wrong. > > When I created a simple web application from scratch and created and > deployed .WAR I get this exception > > When starting an application I get this exception !!! > > java.lang.NullPointerException > org.scannotation.WarUrlFinder.findWebInfLibClasspaths(WarUrlFinder.java:27) > org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.getScanningUrls(ListenerBootstrap.java:33) > org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap.createDeployment(ConfigurationBootstrap.java:163) > org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.createDeployment(ListenerBootstrap.java:26) > org.jboss.resteasy.plugins.server.servlet.ServletBootstrap.createDeployment(ServletBootstrap.java:25) > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:66) > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) > org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) > org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) > org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) > org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) > org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) > org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) > java.lang.Thread.run(Thread.java:662) > Web.xml > > <?xml version="1.0" encoding="UTF-8"?> <web-app > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns="http://java.sun.com/xml/ns/javaee" > xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee > http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" > version="2.5"> <display-name>test-resteasy</display-name> > <context-param> <param-name>resteasy.scan</param-name> > <param-value>true</param-value> </context-param> > > <listener> > > <listener-class> > org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap > </listener-class> > </listener> > > <servlet> <servlet-name>Resteasy</servlet-name> > <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> > </servlet> <servlet-mapping> <servlet-name>Resteasy</servlet-name> > <url-pattern>/rest/*</url-pattern> </servlet-mapping> > <welcome-file-list> <welcome-file>/index.html</welcome-file> > </welcome-file-list> </web-app> > > my resource test class ... > > @Path("test") public class TestResource { @GET @Path("hello") > public String HelloWorld() { return "Hello restfull world!!!"; } } > > When I create a maven project and deploy application with same web.xml > and same resource class I get > > StandardWrapper.Throwable: java.lang.RuntimeException: Class is > not a root resource. It, or one of its interfaces must be > annotated with @Path: com.dropchop.rest.TestResource implements: > at > org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104) > [:6.0.0.Final] > at > org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83) > [:6.0.0.Final] > at > org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72) > [:6.0.0.Final] > .... > > I'm using clean install of JBoss AS 6, the version of RESTeasy that > came with it is 2.1.0.GA <http://2.1.0.GA> > Any Help would be greatly appreciated. > KInd regards > Armando > > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
|
From: Michael M. <mmu...@re...> - 2011-02-09 14:22:46
|
You need the QueryParam annotation as in:
public Response foo(@QueryParam("name")String name,
@QueryParam("num")String num) {...}
Mike
> Hello!
> I've been testing the JBoss JAX-RS implementation Resteasy.
> First I began with the last version userguide (
> http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html_single/index.html
> <http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html_single/index.html>
> ), but I don't know how to use it or if I don't understand the docs.
> Section number 6, speaking about the** *@QueryParam* anotation, tolds
> literal:
>
> /Currently since Resteasy is built on top of a Servlet, it does not
> distinguish between URI query strings or url form encoded paramters. /
>
> As I understand, it's telling that it can read those parameters
> included in the URI ( *http://example.com/test?name=Foo&num=4*
> <http://example.com/test?name=Foo&num=4> ) and those that come in the
> content of a request POST method (
> *Content-Type=application/x-www-form-urlencoded* , and the content
> *name=Foo&num=4* )
>
> Following the example in the userguide, I can't get the parameters if
> the request is a POST method with the content.
>
> Moreover, in the API definition of the *@QueryParam* doesn't speaks
> about the url form encoded params, and in fact there is another
> annotation called *@FormParam* .
>
> So, the question: is there anyway of getting the params coming from
> URI query or form encoded?
> Thanks!
>
> --
> Lucas
>
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
>
>
> _______________________________________________
> Resteasy-users mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-users
|
|
From: Armando O. <arm...@dr...> - 2011-02-09 13:38:07
|
Hi I still can't create a restful service with resteasy. And I don't understand what's wrong. When I created a simple web application from scratch and created and deployed .WAR I get this exception When starting an application I get this exception !!! java.lang.NullPointerException > org.scannotation.WarUrlFinder.findWebInfLibClasspaths(WarUrlFinder.java:27) > org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.getScanningUrls(ListenerBootstrap.java:33) > org.jboss.resteasy.plugins.server.servlet.ConfigurationBootstrap.createDeployment(ConfigurationBootstrap.java:163) > org.jboss.resteasy.plugins.server.servlet.ListenerBootstrap.createDeployment(ListenerBootstrap.java:26) > org.jboss.resteasy.plugins.server.servlet.ServletBootstrap.createDeployment(ServletBootstrap.java:25) > org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:66) > org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) > org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) > org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) > org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) > org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) > org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) > org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) > org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) > java.lang.Thread.run(Thread.java:662) Web.xml <?xml version="1.0" encoding="UTF-8"?> > <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> > <display-name>test-resteasy</display-name> > > <context-param> > <param-name>resteasy.scan</param-name> > <param-value>true</param-value> > </context-param> > > <listener> > > <listener-class> > org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap > </listener-class> > </listener> > > <servlet> > <servlet-name>Resteasy</servlet-name> > > <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> > </servlet> > <servlet-mapping> > <servlet-name>Resteasy</servlet-name> > <url-pattern>/rest/*</url-pattern> > </servlet-mapping> > > <welcome-file-list> > <welcome-file>/index.html</welcome-file> > </welcome-file-list> > </web-app> > > >> my resource test class ... @Path("test") > public class TestResource { > > > @GET > @Path("hello") > public String HelloWorld() { > return "Hello restfull world!!!"; > } > > } When I create a maven project and deploy application with same web.xml and same resource class I get StandardWrapper.Throwable: java.lang.RuntimeException: Class is not a root > resource. It, or one of its interfaces must be annotated with @Path: > com.dropchop.rest.TestResource implements: > at > org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:104) > [:6.0.0.Final] > at > org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:83) > [:6.0.0.Final] > at > org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:72) > [:6.0.0.Final] > .... > I'm using clean install of JBoss AS 6, the version of RESTeasy that came with it is 2.1.0.GA Any Help would be greatly appreciated. KInd regards Armando |
|
From: <luc...@sa...> - 2011-02-09 13:24:04
|
Hello! I've been testing the JBoss JAX-RS implementation Resteasy. First I began with the last version userguide ( http://docs.jboss.org/resteasy/docs/2.0.0.GA/userguide/html_single/index.html ), but I don't know how to use it or if I don't understand the docs. Section number 6, speaking about the @QueryParam anotation, tolds literal: Currently since Resteasy is built on top of a Servlet, it does not distinguish between URI query strings or url form encoded paramters. As I understand, it's telling that it can read those parameters included in the URI (http://example.com/test?name=Foo&num=4) and those that come in the content of a request POST method ( Content-Type=application/x-www-form-urlencoded, and the content name=Foo&num=4) Following the example in the userguide, I can't get the parameters if the request is a POST method with the content. Moreover, in the API definition of the @QueryParam doesn't speaks about the url form encoded params, and in fact there is another annotation called @FormParam. So, the question: is there anyway of getting the params coming from URI query or form encoded? Thanks! -- Lucas |
|
From: Erik H. <eho...@xe...> - 2011-02-08 23:58:44
|
I have bee trying the get a put method working with httpunit but not really
sure what I'm doing wrong. Currently my code
looks like:
Servlet
@PUT
@Path("/users/{userId}.json")
@Consumes({"application/x-www-form-urlencoded", "multipart/form-data"})
public void updateUser(@PathParam("userId")String userId,
@FormParam("jsonAccount")String jsonAccount) {
log.info("in put");
}
and the testing code:
@Test
public void updateUserTest() {
System.out.println("\n" + new
Exception().getStackTrace()[0].getMethodName());
String uri = "http://localhost:8088/restApi/test/users/1.json";
String newAccount = "{\"_id\":\"1\",\"username\":\"bobby\"}";
String encoded = URLEncoder.encode(newAccount);
InputStream source = null;
try {
source = new ByteArrayInputStream(encoded.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String contentType = "application/x-www-form-urlencoded";
WebRequest req = new PutMethodWebRequest(uri, source, contentType);
try {
req.setParameter("jsonAccount", encoded );
WebResponse resp = wc.getResource(req);
System.out.println("resp " + resp.getText());
} catch (Exception e) {
fail(ERR_MSG + e);
}
}
Any help appreciated.
Thanks!
Erik
|
|
From: Joe L. <joe...@gm...> - 2011-02-02 13:19:54
|
Looks like it's there to me: http://repository.jboss.org/maven2/org/jboss/resteasy/ However I notice that the latest version shown via the above URL is 2.0-beta-2 (no sign of 2.0.1.GA or 2.1.0.GA). If I hit the jboss repo via nexus, I do see all versions: https://repository.jboss.org/nexus/content/groups/public-jboss/org/jboss/resteasy Either these are different repositories, or an index needs rebuilding somewhere. On 2 February 2011 11:10, Buggy <bug...@gm...> wrote: > Hi All, > > Looking at the docs I see references to resteasy being available on > > http://repository.jboss.org/maven2 > > but it does not seem to be there any more. > > Best, Giles. > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users > |
|
From: Buggy <bug...@gm...> - 2011-02-02 11:10:43
|
Hi All, Looking at the docs I see references to resteasy being available on http://repository.jboss.org/maven2 but it does not seem to be there any more. Best, Giles. |
|
From: Rolando S. <ser...@gu...> - 2011-02-01 10:32:06
|
Hello, I found a problem with RESTEasy OAuth signatures when the server is behind a reverse proxy. The client correctly calculates the signature considering also the called URL (e.g. http://mydomain.com/oauth/oauth/requestToken), but the server receives the request from the reverse proxy (e.g. http://server_ip/oauth/oauth/requestToken), so the recalculated signature does not match the received one, leading to an error. The problem does not occur using PLAINTEXT signature method, since in this case the signature is the simple [consumerKey]&[tokenSecret] string, not related to the URL, but this is not acceptable without a secure connection. Since the client cannot know the IP of the "real" server that will process its request, the problem should be solved server side. A solution could be having a method in OAuthProvider class to set the public URL to be used for signature check. Other suggestions are welcome! Thank you, Sergio |
|
From: Grzegorz S. <gsz...@gm...> - 2011-01-26 13:46:08
|
1. http://www.jboss.org/resteasy Community->Mailing Lists links only to Resteasy-developers (no info about Resteasy-users) 2. http://sourceforge.net/projects/resteasy/ Big green download button links to some HornetQ stuff. I think it should be RestEASY 2.1.0.GA (or maybe RESTEasy is abandoned, but I think it's not ;)) Grzegorz Szpetkowski |
|
From: Grzegorz S. <gsz...@gm...> - 2011-01-26 13:26:25
|
Hi, I found that Dowload link (from http://jboss.org/resteasy) points to http://sourceforge.net/projects/resteasy/files/Resteasy%20JAX-RS/Beta1/ website, but I think it should be http://sourceforge.net/projects/resteasy/files/Resteasy%20JAX-RS/ (with all versions of RESTEasy). |
|
From: Dmitry <red...@li...> - 2011-01-19 11:34:05
|
Hello!
It seem that RestEASY has no standard Entity Provider for the Source
interface (neither SAXSource, nor JAXBSource).
Here is an example:
@Path("/GetWSDLInfo")
public class GetWSDLInfo
{
@GET
@Produces(MediaType.TEXT_XML)
public Source parse()
{
...
JAXBContext ctx = ...
Marshaller marshaller = ctx.createMarshaller();
return new JAXBSource(marshaller, bean); // bean is a JAXB
annotated Java Bean
}
}
The code works with Tomcat 7 + Jersey
Cheers,
Dmitry
|
|
From: Brock L. <b....@sb...> - 2011-01-14 03:18:13
|
> > I have been using Rest-Easy for about 6 months -- it is a very nice tool. > > I just did hit a snag however. > > I am using the RestEasy Standard Atom provider, but it produces feeds that can not be consumed by standard readers like FeedReader and FeedBurner. > > Basically the problem I believe is that RestEasy uses tags like <atom:id> which have the atom namespace defined in the standard XML format -- but the readers aren't that smart and they are expecting tags like <id>. (see examples below) > > Thanks for any suggestions -- and thanks again for RestEasy! > > Brock. > > Here is part of my POM for RestEasy > > <dependency> > <groupId>org.jboss.resteasy</groupId> > <artifactId>resteasy-jaxrs</artifactId> > <version>1.2.1.GA</version> > </dependency> > <dependency> > <groupId>org.jboss.resteasy</groupId> > <artifactId>resteasy-jaxb-provider</artifactId> > <version>1.2.1.GA</version> > </dependency> > <dependency> > <groupId>org.jboss.resteasy</groupId> > <artifactId>resteasy-atom-provider</artifactId> > <version>1.2.1.GA</version> > </dependency> > <dependency> > <groupId>org.jboss.resteasy</groupId> > <artifactId>resteasy-jettison-provider</artifactId> > <version>1.2.1.GA</version> > </dependency> > <dependency> > <groupId>org.jboss.resteasy</groupId> > <artifactId>resteasy-multipart-provider</artifactId> > <version>1.2.1.GA</version> > </dependency> > > Here is an example of what RestEasy would produce for an Atom feed > > <atom:feed xmlns:atom="http://www.w3.org/2005/Atom"> > > <atom:title>Example Feed</atom:title> > <atom:link href="http://example.org/"/> > <atom:updated>2003-12-13T18:30:02Z</atom:updated> > <atom:author> > <atom:name>John Doe</atom:name> > </atom:author> > <atom:id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</atom:id> > > <atom:entry> > <atom:title>Atom-Powered Robots Run Amok</atom:title> > <atom:link href="http://example.org/2003/12/13/atom03"/> > <atom:id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</atom:id> > <atom:updated>2003-12-13T18:30:02Z</atom:updated> > <atom:summary>Some text.</atom:summary> > </atom:entry> > > </atom:feed> > > Here is an example of what the standard atom readers want: > > <?xml version="1.0" encoding="utf-8"?> > <feed xmlns="http://www.w3.org/2005/Atom"> > > <title>Example Feed</title> > <link href="http://example.org/"/> > <updated>2003-12-13T18:30:02Z</updated> > <author> > <name>John Doe</name> > </author> > <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> > > <entry> > <title>Atom-Powered Robots Run Amok</title> > <link href="http://example.org/2003/12/13/atom03"/> > <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> > <updated>2003-12-13T18:30:02Z</updated> > <summary>Some text.</summary> > </entry> > > </feed> > |
|
From: Jozef H. <joz...@gm...> - 2010-12-20 13:43:25
|
Try providing your own Application subclass listing all the providers and resources used in your application. And set the init parameter accordingly. (I'm not 100% sure that scannotation won't get invoked but it should not.) On 12/20/2010 02:39 PM, Tonique Claque wrote: > Hello, > For some reason I would like to use the RestEasy on Jetty but without > making use of Scannotation and Javassist. I would just like to exclude > it from the WAR I am building. What should I do not for the Scannotation > to get ever invoked? > Thanks, > Ton > > > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > > > > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users -- Jozef Hartinger joz...@gm... |
|
From: Tonique C. <ton...@gm...> - 2010-12-20 13:39:38
|
Hello, For some reason I would like to use the RestEasy on Jetty but without making use of Scannotation and Javassist. I would just like to exclude it from the WAR I am building. What should I do not for the Scannotation to get ever invoked? Thanks, Ton |
|
From: Charles <cpr...@go...> - 2010-12-15 08:56:05
|
Hi! First of all let me show the strange warnings I get when I access my API. 2010-11-18 11:39:26,574 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@c851c3 2010-11-18 11:39:33,466 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@1289d03 2010-11-18 11:39:47,005 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@1631f82 2010-11-18 11:39:49,785 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@dd8d64 2010-11-18 11:39:51,341 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@abbebb 2010-11-18 11:39:52,428 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@14419ee 2010-11-18 11:39:53,296 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@339c2f 2010-11-18 11:39:54,074 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@477d3a 2010-11-18 11:39:54,745 WARN [arjLoggerI18N ] (http-0.0.0.0-80-1) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@4bbc8b I get a warning for each http call to my service. Each get, post, put, causes a warning. It seems like some sort of jboss transaction problems. Now to my environment. I use RESTeasy 2.0.0GA, JBoss AS 5.1GA. My application is an ear, containing two wars and one ejb jar. one of the wars is the entry point for my resteasy services. My resources are modelled as stateless session beans. In the methods of my service, I make according calls to methods of my DAO layers. My DAOs are also stateless session beans. Does anyone have a clue what is going on here? Best regards. btw RESTeasy is awesome! |
|
From: Charles <cpr...@go...> - 2010-12-15 08:55:18
|
Hi, I have created a client proxy using resteasy much like that described in the api-clients example in the resteasy package. I am using my client proxy to call the flickr api for some recent photos uploaded over there. However, for some reason, the flickr api always sends back charset="utf-8" in the content-type which screws with resteasy's ability to pick an appropriate message body reader. I get the following stacktrace javax.faces.el.EvaluationException: org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type text/xml;charset="utf-8" and type class com.dibadepremium.ejb.rest.flickr.beans.FlickrResponse at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) at org.primefaces.application.CleanupActionListener.processAction(CleanupActionListener.java:42) at javax.faces.component.UICommand.broadcast(UICommand.java:387) at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55) at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329) at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304) at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261) at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265) at com.dibadepremium.ejb.util.CustomFacesServlet.service(CustomFacesServlet.java:55) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.jboss.seam.web.RewriteFilter.process(RewriteFilter.java:98) at org.jboss.seam.web.RewriteFilter.doFilter(RewriteFilter.java:57) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at com.dibadepremium.ejb.util.UTF8Filter.doFilter(UTF8Filter.java:28) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at com.dibadepremium.ejb.util.CharsetFilter.doFilter(CharsetFilter.java:46) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) Caused by: org.jboss.resteasy.client.ClientResponseFailure: Unable to find a MessageBodyReader of content-type text/xml;charset="utf-8" and type class com.dibadepremium.ejb.rest.flickr.beans.FlickrResponse at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:351) at org.jboss.resteasy.client.core.BaseClientResponse.createResponseFailure(BaseClientResponse.java:342) at org.jboss.resteasy.client.core.BaseClientResponse$1.createReaderNotFound(BaseClientResponse.java:286) at org.jboss.resteasy.core.messagebody.ReaderUtility.doRead(ReaderUtility.java:106) at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:291) at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:255) at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:228) at org.jboss.resteasy.client.core.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:56) at org.jboss.resteasy.client.core.ClientInvoker.invoke(ClientInvoker.java:102) at org.jboss.resteasy.client.core.ClientProxy.invoke(ClientProxy.java:59) at $Proxy943.getPhotosByTags(Unknown Source) at com.dibadepremium.ejb.flickr.FlickrManager.getSuggestions(FlickrManager.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) at com.dibadepremium.ejb.flickr.FlickrManager_$$_javassist_seam_6.getSuggestions(FlickrManager_$$_javassist_seam_6.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335) at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348) at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88) My question is this. What can I do to remove those unwarranted charset= directives from the content-type header to ensure that content negotiation works properly? I am thinking about all sorts of things such as filters which manipulate the client proxy response headers before the message reaches the messagebodyreader. Or perhaps there is a simpler solution? Please let me know. Thanks. |
|
From: ramu b <bra...@gm...> - 2010-11-30 07:36:22
|
Hi I think this is not the right place to post about resteasy.but i couldn't found any space related to it. I have a web project with rest services.when i deploy that individually the ResteasyIntegrationDeployer working fine.I can able to see the follwoing line in console and rest services working fine. [org.jboss.resteasy.integration.deployers.ResteasyIntegrationDeployer] *** Adding JAX-RS resource classes: but when i add this web project to EAR(enterprise application) and deploying the EAR file ResteasyIntegrationDeployer is not working.i cant see any thing like *[org.jboss.resteasy.integration.deployers.ResteasyIntegrationDeployer] *** Adding JAX-RS resource classes *and rest services are not registering with application.My rest services are not wotking. anybody have similar problem and have any solution? btw i am using jboss 6 CR1 and resteasy 2.0.1... Thanks & Regards Ram |
|
From: Michael M. <mmu...@re...> - 2010-11-24 18:58:48
|
The problem with request such as fooweb.com/web/admin/viewThing.jsf?id=1234 is that you have to track that 1234 corresponds to the URL. Now if the URL moves to a new location you are stuck whereas if you had used the URL as the identifier then you would know it had moved since you would get back a status code such as 301 (moved) or if it gets deleted then a 410 (gone) status code etc. But you can still use the URL in the above query. You would use: fooweb.com/web/admin/viewThing.jsf?id=<url> where of course you would need to escape the <url> As an aside my 2p worth on the use of custom headers is that it builds a coupling between the client and server - it a piece of private information that is shared by clients that are "in the know". Clients that don't know about the header would incur the overhead of having to parse it. Mike > Yes, the URL is unique. However, consider this scenario: > > In the RESTful world (API integration world): > > api.foo.com/things/1234 > > That's the RESTful representation of Thing 1234. Cool. Now, in a web > app that is "downstream" from there, we have a UI and set of forms and > whatnot that create Things. There are many other clients too, but it's > the web UI that I'm thinking of in this message. That Web UI has > something like this: > > fooweb.com/web/admin/things/1234 > or maybe > fooweb.com/web/admin/viewThing.jsf?id=1234 > > In that case, the whole URI of that Thing is not meaningful. While it > does identify the Thing, it does not give me the pure entity ID that's > useful in the web app. > > So I must parse. Or I need to provide that ID somehow, hence my initial > proposal. Of course it's possible that I'm thinking about this wrong in > which case I'm happy to be educated... > > -CB > > On 11/24/2010 10:58 AM, Michael Musgrove wrote: >> The url in location header is already unique so why do you need to >> refer to it by another id. >> >> Some rest folk say that urls should be opaque so they would advise >> against parsing it for meaningful information. >> >> Mike >> >> >>> Hi List, >>> >>> I have many typical entity resources to which a POST will create a new >>> instance and return the resource URL as a Location header. However, I >>> find myself parsing this header in my application clients frequently to >>> strip out the ID of the newly-created entity. >>> >>> While the logic is trivial, I feel like it's silly to do this when I >>> control the server logic as well. I'm thinking about adding and >>> Entity-Id header to store the uniqe ID of whatever entities are created >>> at the various resources. Is there any reason why this is bad practice, >>> RESTfully speaking? I would of course leave the standard Location >>> header(s) there. >>> >>> Thanks, >>> >>> Chris >>> >>> ------------------------------------------------------------------------------ >>> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! >>> Tap into the largest installed PC base& get more eyes on your game by >>> optimizing for Intel(R) Graphics Technology. Get started today with the >>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >>> http://p.sf.net/sfu/intelisp-dev2dev >>> _______________________________________________ >>> Resteasy-users mailing list >>> Res...@li... >>> https://lists.sourceforge.net/lists/listinfo/resteasy-users >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! >> Tap into the largest installed PC base& get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Resteasy-users mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-users > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! > Tap into the largest installed PC base& get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |
|
From: Chris B. <cbr...@re...> - 2010-11-24 18:18:03
|
Yes, the URL is unique. However, consider this scenario: In the RESTful world (API integration world): api.foo.com/things/1234 That's the RESTful representation of Thing 1234. Cool. Now, in a web app that is "downstream" from there, we have a UI and set of forms and whatnot that create Things. There are many other clients too, but it's the web UI that I'm thinking of in this message. That Web UI has something like this: fooweb.com/web/admin/things/1234 or maybe fooweb.com/web/admin/viewThing.jsf?id=1234 In that case, the whole URI of that Thing is not meaningful. While it does identify the Thing, it does not give me the pure entity ID that's useful in the web app. So I must parse. Or I need to provide that ID somehow, hence my initial proposal. Of course it's possible that I'm thinking about this wrong in which case I'm happy to be educated... -CB On 11/24/2010 10:58 AM, Michael Musgrove wrote: > The url in location header is already unique so why do you need to > refer to it by another id. > > Some rest folk say that urls should be opaque so they would advise > against parsing it for meaningful information. > > Mike > > >> Hi List, >> >> I have many typical entity resources to which a POST will create a new >> instance and return the resource URL as a Location header. However, I >> find myself parsing this header in my application clients frequently to >> strip out the ID of the newly-created entity. >> >> While the logic is trivial, I feel like it's silly to do this when I >> control the server logic as well. I'm thinking about adding and >> Entity-Id header to store the uniqe ID of whatever entities are created >> at the various resources. Is there any reason why this is bad practice, >> RESTfully speaking? I would of course leave the standard Location >> header(s) there. >> >> Thanks, >> >> Chris >> >> ------------------------------------------------------------------------------ >> Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! >> Tap into the largest installed PC base& get more eyes on your game by >> optimizing for Intel(R) Graphics Technology. Get started today with the >> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. >> http://p.sf.net/sfu/intelisp-dev2dev >> _______________________________________________ >> Resteasy-users mailing list >> Res...@li... >> https://lists.sourceforge.net/lists/listinfo/resteasy-users > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App& Earn a Chance To Win $500! > Tap into the largest installed PC base& get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Resteasy-users mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-users |