|
From: Josiah H. <jha...@el...> - 2013-01-10 03:24:53
|
Hi everyone,
I've been Googling around for this, and none of the solutions I've found have worked for me. I'm trying to build a RESTEasy-enabled application on Jboss 7.1.1 with Gradle. I have the relevant configuration detailed towards the bottom of the message, but I see that the application is being deployed in the logs when I visit that URL:
19:43:46,458 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /impl
19:43:46,474 INFO [org.jboss.as.server] (HttpManagementService-threads - 4) JBAS018559: Deployed "impl.war"
19:43:53,533 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.0.0.1-8080-1) Found BeanManager at java:comp/BeanManager
19:43:53,542 INFO [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.0.0.1-8080-1) Deploying javax.ws.rs.core.Application: class example.JaxRsActivator$Proxy$_$$_WeldClientProxy
But I receive the following error when I deploy the WAR and visit http://localhost:8080/impl/rest/user/list:
HTTP Status 404 - Could not find resource for relative : /user/list of full path: http://127.0.0.1:8080/impl/rest/user/list
What am I doing wrong?
Thanks!
Joe
Configuration:
src/main/webapp/WEB-INF/web.xml (empty except for the opening/closing tags)
example.JaxRsActivator:
@ApplicationPath("/rest")
public class JaxRsActivator extends Application
{
}
example.UserEndpoint:
@Path("user")
public class UserEndpoint
{
@Inject
UserService userService;
@GET
@Path("list")
List<User> list() {
User user = new User();
user.setFirstName("Test");
user.setLastName("User");
return new ArrayList<User>(Arrays.asList(user));
}
}
|
|
From: Weinan Li <we...@re...> - 2013-01-10 07:53:43
|
Hi Josiah, Your 'list()' method is not 'public', as required by JAX-RS spec, you should use 'public' method as your restful api. -- Weinan Li On Thursday, January 10, 2013 at 11:00 AM, Josiah Haswell wrote: > Hi everyone, > > I've been Googling around for this, and none of the solutions I've found have worked for me. I'm trying to build a RESTEasy-enabled application on Jboss 7.1.1 with Gradle. I have the relevant configuration detailed towards the bottom of the message, but I see that the application is being deployed in the logs when I visit that URL: > > 19:43:46,458 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /impl > 19:43:46,474 INFO [org.jboss.as.server] (HttpManagementService-threads - 4) JBAS018559: Deployed "impl.war" > 19:43:53,533 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.0.0.1-8080-1) Found BeanManager at java:comp/BeanManager > 19:43:53,542 INFO [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.0.0.1-8080-1) Deploying javax.ws.rs.core.Application: class example.JaxRsActivator$Proxy$_$$_WeldClientProxy > > > But I receive the following error when I deploy the WAR and visit http://localhost:8080/impl/rest/user/list: > HTTP Status 404 - Could not find resource for relative : /user/list of full path: http://127.0.0.1:8080/impl/rest/user/list > > > What am I doing wrong? > > Thanks! > > Joe > > Configuration: > > src/main/webapp/WEB-INF/web.xml (http://web.xml) (empty except for the opening/closing tags) > > > example.JaxRsActivator: > > @ApplicationPath("/rest") > public class JaxRsActivator extends Application > { > } > > > example.UserEndpoint: > > @Path("user") > public class UserEndpoint > { > > @Inject > UserService userService; > > @GET > @Path("list") > List<User> list() { > User user = new User(); > user.setFirstName("Test"); > user.setLastName("User"); > return new ArrayList<User>(Arrays.asList(user)); > } > > } > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122712 > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... (mailto:Res...@li...) > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |
|
From: Weinan Li <we...@re...> - 2013-01-10 12:22:56
|
btw, you can refer to RESTEasy's example to build up your own project. In RESTEasy source base it has plenty of examples you can check. Please check the 'examples' directory, there is an 'ejb-integration' example you could refer to. -- Weinan Li On Thursday, January 10, 2013 at 3:53 PM, Weinan Li wrote: > Hi Josiah, > > Your 'list()' method is not 'public', as required by JAX-RS spec, you should use 'public' method as your restful api. > > -- > Weinan Li > > > On Thursday, January 10, 2013 at 11:00 AM, Josiah Haswell wrote: > > > Hi everyone, > > > > I've been Googling around for this, and none of the solutions I've found have worked for me. I'm trying to build a RESTEasy-enabled application on Jboss 7.1.1 with Gradle. I have the relevant configuration detailed towards the bottom of the message, but I see that the application is being deployed in the logs when I visit that URL: > > > > 19:43:46,458 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /impl > > 19:43:46,474 INFO [org.jboss.as.server] (HttpManagementService-threads - 4) JBAS018559: Deployed "impl.war" > > 19:43:53,533 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.0.0.1-8080-1) Found BeanManager at java:comp/BeanManager > > 19:43:53,542 INFO [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.0.0.1-8080-1) Deploying javax.ws.rs.core.Application: class example.JaxRsActivator$Proxy$_$$_WeldClientProxy > > > > > > But I receive the following error when I deploy the WAR and visit http://localhost:8080/impl/rest/user/list: > > HTTP Status 404 - Could not find resource for relative : /user/list of full path: http://127.0.0.1:8080/impl/rest/user/list > > > > > > What am I doing wrong? > > > > Thanks! > > > > Joe > > > > Configuration: > > > > src/main/webapp/WEB-INF/web.xml (http://web.xml) (empty except for the opening/closing tags) > > > > > > example.JaxRsActivator: > > > > @ApplicationPath("/rest") > > public class JaxRsActivator extends Application > > { > > } > > > > > > example.UserEndpoint: > > > > @Path("user") > > public class UserEndpoint > > { > > > > @Inject > > UserService userService; > > > > @GET > > @Path("list") > > List<User> list() { > > User user = new User(); > > user.setFirstName("Test"); > > user.setLastName("User"); > > return new ArrayList<User>(Arrays.asList(user)); > > } > > > > } > > > > > > ------------------------------------------------------------------------------ > > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > > MVPs and experts. ON SALE this month only -- learn more at: > > http://p.sf.net/sfu/learnmore_122712 > > > > _______________________________________________ > > Resteasy-developers mailing list > > Res...@li... (mailto:Res...@li...) > > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122712 > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... (mailto:Res...@li...) > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > |
|
From: Xavier C. <xc...@re...> - 2013-01-22 09:23:59
|
Hi Josiah,
If you're an Eclipse user, you could give a try to the JAX-RS tooling that comes with JBoss Tools and JBoss Developer Studio, as it can detect this kind of problem (amongst others). I'll add more validation rules according to the spec for the next release, too.
I'm also interested in users' feedback, so feel free to react if you find bugs or missing features ;-)
Best regards,
Xavier
> Hi Josiah,
>
> Your 'list()' method is not 'public', as required by JAX-RS spec, you should use 'public' method as your restful api.
>
> --
> Weinan Li
>
> On Thursday, January 10, 2013 at 11:00 AM, Josiah Haswell wrote:
>
>> Hi everyone,
>>
>> I've been Googling around for this, and none of the solutions I've found have worked for me. I'm trying to build a RESTEasy-enabled application on Jboss 7.1.1 with Gradle. I have the relevant configuration detailed towards the bottom of the message, but I see that the application is being deployed in the logs when I visit that URL:
>>
>> 19:43:46,458 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /impl
>> 19:43:46,474 INFO [org.jboss.as.server] (HttpManagementService-threads - 4) JBAS018559: Deployed "impl.war"
>> 19:43:53,533 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.0.0.1-8080-1) Found BeanManager at java:comp/BeanManager
>> 19:43:53,542 INFO [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.0.0.1-8080-1) Deploying javax.ws.rs.core.Application: class example.JaxRsActivator$Proxy$_$$_WeldClientProxy
>>
>> But I receive the following error when I deploy the WAR and visit http://localhost:8080/impl/rest/user/list:
>> HTTP Status 404 - Could not find resource for relative : /user/list of full path: http://127.0.0.1:8080/impl/rest/user/list
>>
>>
>> What am I doing wrong?
>>
>> Thanks!
>>
>> Joe
>>
>> Configuration:
>>
>> src/main/webapp/WEB-INF/web.xml (empty except for the opening/closing tags)
>>
>>
>> example.JaxRsActivator:
>>
>> @ApplicationPath("/rest")
>> public class JaxRsActivator extends Application
>> {
>> }
>>
>> example.UserEndpoint:
>>
>> @Path("user")
>> public class UserEndpoint
>> {
>>
>> @Inject
>> UserService userService;
>>
>> @GET
>> @Path("list")
>> List<User> list() {
>> User user = new User();
>> user.setFirstName("Test");
>> user.setLastName("User");
>> return new ArrayList<User>(Arrays.asList(user));
>> }
>>
>> }
>>
>>
>> ------------------------------------------------------------------------------
>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
>> MVPs and experts. ON SALE this month only -- learn more at:
>> http://p.sf.net/sfu/learnmore_122712
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
> ------------------------------------------------------------------------------
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122712
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
|
|
From: Josiah H. <jha...@el...> - 2013-01-22 17:48:59
|
Hi Xavier, Thanks for the response! Glassfish notified me of the issue when I deployed it, but the JAX-RS tooling support from Eclipse is very helpful. Thanks! Josiah From: Xavier Coulon <xc...@re...<mailto:xc...@re...>> Date: Tue, 22 Jan 2013 09:23:47 +0000 To: "res...@li...<mailto:res...@li...>" <res...@li...<mailto:res...@li...>> Subject: Re: [Resteasy-developers] HTTP Status 404 - Could not find resource for elative Hi Josiah, If you're an Eclipse user, you could give a try to the JAX-RS tooling that comes with JBoss Tools and JBoss Developer Studio, as it can detect this kind of problem (amongst others). I'll add more validation rules according to the spec for the next release, too. I'm also interested in users' feedback, so feel free to react if you find bugs or missing features ;-) Best regards, Xavier Hi Josiah, Your 'list()' method is not 'public', as required by JAX-RS spec, you should use 'public' method as your restful api. -- Weinan Li On Thursday, January 10, 2013 at 11:00 AM, Josiah Haswell wrote: Hi everyone, I've been Googling around for this, and none of the solutions I've found have worked for me. I'm trying to build a RESTEasy-enabled application on Jboss 7.1.1 with Gradle. I have the relevant configuration detailed towards the bottom of the message, but I see that the application is being deployed in the logs when I visit that URL: 19:43:46,458 INFO [org.jboss.web] (MSC service thread 1-1) JBAS018210: Registering web context: /impl 19:43:46,474 INFO [org.jboss.as.server] (HttpManagementService-threads - 4) JBAS018559: Deployed "impl.war" 19:43:53,533 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] (http--127.0.0.1-8080-1) Found BeanManager at java:comp/BeanManager 19:43:53,542 INFO [org.jboss.resteasy.spi.ResteasyDeployment] (http--127.0.0.1-8080-1) Deploying javax.ws.rs.core.Application: class example.JaxRsActivator$Proxy$_$$_WeldClientProxy But I receive the following error when I deploy the WAR and visit http://localhost:8080/impl/rest/user/list: HTTP Status 404 - Could not find resource for relative : /user/list of full path: http://127.0.0.1:8080/impl/rest/user/list What am I doing wrong? Thanks! Joe Configuration: src/main/webapp/WEB-INF/web.xml<http://web.xml/> (empty except for the opening/closing tags) example.JaxRsActivator: @ApplicationPath("/rest") public class JaxRsActivator extends Application { } example.UserEndpoint: @Path("user") public class UserEndpoint { @Inject UserService userService; @GET @Path("list") List<User> list() { User user = new User(); user.setFirstName("Test"); user.setLastName("User"); return new ArrayList<User>(Arrays.asList(user)); } } ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET<http://ASP.NET/>, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 _______________________________________________ Resteasy-developers mailing list Res...@li...<mailto:Res...@li...> https://lists.sourceforge.net/lists/listinfo/resteasy-developers ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET<http://ASP.NET/>, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. ON SALE this month only -- learn more at: http://p.sf.net/sfu/learnmore_122712 _______________________________________________ Resteasy-developers mailing list Res...@li...<mailto:Res...@li...> https://lists.sourceforge.net/lists/listinfo/resteasy-developers |
|
From: Bill B. <bb...@re...> - 2013-01-22 19:24:42
|
Good stuff Xavier! On 1/22/2013 12:48 PM, Josiah Haswell wrote: > Hi Xavier, > > Thanks for the response! Glassfish notified me of the issue when I > deployed it, but the JAX-RS tooling support from Eclipse is very > helpful. Thanks! > > Josiah > > From: Xavier Coulon <xc...@re... <mailto:xc...@re...>> > Date: Tue, 22 Jan 2013 09:23:47 +0000 > To: "res...@li... > <mailto:res...@li...>" > <res...@li... > <mailto:res...@li...>> > Subject: Re: [Resteasy-developers] HTTP Status 404 - Could not find > resource for elative > > Hi Josiah, > > If you're an Eclipse user, you could give a try to the JAX-RS tooling > that comes with JBoss Tools and JBoss Developer Studio, as it can detect > this kind of problem (amongst others). I'll add more validation rules > according to the spec for the next release, too. > > I'm also interested in users' feedback, so feel free to react if you > find bugs or missing features ;-) > > Best regards, > Xavier > >> Hi Josiah, >> >> Your 'list()' method is not 'public', as required by JAX-RS spec, you >> should use 'public' method as your restful api. >> >> -- >> Weinan Li >> >> On Thursday, January 10, 2013 at 11:00 AM, Josiah Haswell wrote: >> >>> Hi everyone, >>> >>> I've been Googling around for this, and none of the solutions I've >>> found have worked for me. I'm trying to build a RESTEasy-enabled >>> application on Jboss 7.1.1 with Gradle. I have the relevant >>> configuration detailed towards the bottom of the message, but I >>> *see* that the application is being deployed in the logs when I visit >>> that URL: >>> >>> 19:43:46,458 INFO [org.jboss.web] (MSC service thread 1-1) >>> JBAS018210: Registering web context: /impl >>> 19:43:46,474 INFO [org.jboss.as.server] >>> (HttpManagementService-threads - 4) JBAS018559: Deployed "impl.war" >>> 19:43:53,533 INFO [org.jboss.resteasy.cdi.CdiInjectorFactory] >>> (http--127.0.0.1-8080-1) Found BeanManager at java:comp/BeanManager >>> 19:43:53,542 INFO [org.jboss.resteasy.spi.ResteasyDeployment] >>> (http--127.0.0.1-8080-1) Deploying javax.ws.rs.core.Application: >>> class example.JaxRsActivator$Proxy$_$$_WeldClientProxy >>> >>> But I receive the following error when I deploy the WAR and visit >>> http://localhost:8080/impl/rest/user/list: >>> >>> >>> HTTP Status 404 - Could not find resource for relative : /user/list >>> of full path: http://127.0.0.1:8080/impl/rest/user/list >>> >>> >>> What am I doing wrong? >>> >>> Thanks! >>> >>> Joe >>> >>> *Configuration:* >>> >>> src/main/webapp/WEB-INF/web.xml <http://web.xml/> (empty except for >>> the opening/closing tags) >>> >>> >>> example.JaxRsActivator: >>> >>> @ApplicationPath("/rest") >>> public class JaxRsActivator extends Application >>> { >>> } >>> >>> example.UserEndpoint: >>> >>> @Path("user") >>> public class UserEndpoint >>> { >>> >>> @Inject >>> UserService userService; >>> >>> @GET >>> @Path("list") >>> List<User> list() { >>> User user = new User(); >>> user.setFirstName("Test"); >>> user.setLastName("User"); >>> return new ArrayList<User>(Arrays.asList(user)); >>> } >>> >>> } >>> >>> >>> ------------------------------------------------------------------------------ >>> Master Visual Studio, SharePoint, SQL, ASP.NET <http://ASP.NET/>, C# >>> 2012, HTML5, CSS, >>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>> MVPs and experts. ON SALE this month only -- learn more at: >>> http://p.sf.net/sfu/learnmore_122712 >>> _______________________________________________ >>> Resteasy-developers mailing list >>> Res...@li... >>> <mailto:Res...@li...> >>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers >> >> ------------------------------------------------------------------------------ >> Master Visual Studio, SharePoint, SQL, ASP.NET <http://ASP.NET/>, C# >> 2012, HTML5, CSS, >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >> MVPs and experts. ON SALE this month only -- learn more at: >> http://p.sf.net/sfu/learnmore_122712 >> _______________________________________________ >> Resteasy-developers mailing list >> Res...@li... >> <mailto:Res...@li...> >> https://lists.sourceforge.net/lists/listinfo/resteasy-developers > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > > > > _______________________________________________ > Resteasy-developers mailing list > Res...@li... > https://lists.sourceforge.net/lists/listinfo/resteasy-developers > -- Bill Burke JBoss, a division of Red Hat http://bill.burkecentral.com |