tag:blogger.com,1999:blog-743578218566083321.post983218863341494309..comments2024-03-04T02:21:22.021-08:00Comments on Technology highlights: RESTeasy JAX-RS embeddable server and SpringBeanProcessorfandryhttp://www.blogger.com/profile/01990790629557446302noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-743578218566083321.post-64485850920365719982014-06-19T06:41:12.086-07:002014-06-19T06:41:12.086-07:00Hi
I'm a web developer, know some MVC framewor...Hi<br />I'm a web developer, know some MVC frameworks, and some servers like Jboss, Weblogic but new to Jetty and JAX-RS. I finished the book RESTful Java with JAX-RS from Bill Burke. The book is not difficult to understand. But by the end, Bill Burke using Jetty to deploy it into the application and having a JUnit test will be called from Maven. Following the instruction, I run Maven and see the BUIL SUCCESSFUL, exactly as book said. But what is Jetty and how can I see it in term of URI like : http://localhost:9095/customers<br /><br /> I have some questions:<br /> - if embedded, jetty must running somewhere in my machine after run maven?<br /> - If it run somewhere then I can see it using http://? right?<br />Thanks a lot<br /><br />Anonymoushttps://www.blogger.com/profile/17913510832412931334noreply@blogger.comtag:blogger.com,1999:blog-743578218566083321.post-5720101983630286592011-10-18T13:32:28.608-07:002011-10-18T13:32:28.608-07:00I started to play around with the 2.2.2.GA release...I started to play around with the 2.2.2.GA release and wasn’t be able to use the Embedded Container. I also try it with the version 2.2.1 and 2.0.0.GA and I still have the same Exception.<br /><br />The resource class looks like this<br /><br />@Path(“/personliste”)<br />public class RestEasyPersonResouce {<br /><br />@GET<br />@Path(“/hello/{name:.*}”)<br />public String sayHello(@PathParam(“name”) String name){<br />return “Hello ” + name;<br />}<br />}<br /><br />The starter class looks like this<br /><br />public class RestEasyStarter {<br /><br />private TJWSEmbeddedJaxrsServer server;<br /><br />public static void main( String[] args ) throws Exception<br />{<br />RestEasyStarter starter = new RestEasyStarter(“/resteasy”, 9005, RestEasyPersonResouce.class);<br />starter.startServer();<br />}<br />/**<br />* @param rootResourcePath<br />* @param port<br />* @param classes<br />*/<br />public RestEasyStarter(String rootResourcePath, int port, Class … classes) {<br />server = new TJWSEmbeddedJaxrsServer();<br />server.setPort(port);<br />server.setRootResourcePath(rootResourcePath);<br />server.getDeployment().getActualResourceClasses().addAll(Arrays.asList(classes));<br />}<br /><br />public void startServer(){<br />server.start();<br />}<br /><br />}<br /><br />When i start the RestEasyStarter-class i get this Exception<br /><br />Exception in thread “main” java.lang.NoSuchMethodError: org.jboss.resteasy.plugins.server.tjws.TJWSServletServer$FileMappingServe.runInBackground()V<br />at org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.start(TJWSServletServer.java:152)<br />at org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer.start(TJWSEmbeddedJaxrsServer.java:44)<br />at de.gilles.projects.resteasy.service.RestEasyStarter.startServer(RestEasyStarter.java:29)<br />at de.gilles.projects.resteasy.service.RestEasyStarter.main(RestEasyStarter.java:18)<br /><br />May be i am missing something. I really need help to make it run. I couldn’t be able to start a discussion on Jboss Community, threrefore i make it in the blogAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-743578218566083321.post-17675990639055122232011-10-18T13:29:33.748-07:002011-10-18T13:29:33.748-07:00I started to play around with the 2.2.2.GA release...I started to play around with the 2.2.2.GA release and wasn’t be able to use the Embedded Container. I also try it with the version 2.2.1 and 2.0.0.GA and I still have the same Exception.<br /><br />The resource class looks like this<br /><br />@Path(“/personliste”)<br />public class RestEasyPersonResouce {<br /><br />@GET<br />@Path(“/hello/{name:.*}”)<br />public String sayHello(@PathParam(“name”) String name){<br />return “Hello ” + name;<br />}<br />}<br /><br />The starter class looks like this<br /><br /><br />public class RestEasyStarter {<br /><br />private TJWSEmbeddedJaxrsServer server;<br /><br />public static void main( String[] args ) throws Exception<br />{<br />RestEasyStarter starter = new RestEasyStarter(“/resteasy”, 9005, RestEasyPersonResouce.class);<br />starter.startServer();<br />}<br />/**<br />* @param rootResourcePath<br />* @param port<br />* @param classes<br />*/<br />public RestEasyStarter(String rootResourcePath, int port, Class … classes) {<br />server = new TJWSEmbeddedJaxrsServer();<br />server.setPort(port);<br />server.setRootResourcePath(rootResourcePath);<br />server.getDeployment().getActualResourceClasses().addAll(Arrays.asList(classes));<br />}<br /><br />public void startServer(){<br />server.start();<br />}<br /><br />}<br /><br /><br />When i start the RestEasyStarter-class i get this Exception<br /><br />Exception in thread “main” java.lang.NoSuchMethodError: org.jboss.resteasy.plugins.server.tjws.TJWSServletServer$FileMappingServe.runInBackground()V<br />at org.jboss.resteasy.plugins.server.tjws.TJWSServletServer.start(TJWSServletServer.java:152)<br />at org.jboss.resteasy.plugins.server.tjws.TJWSEmbeddedJaxrsServer.start(TJWSEmbeddedJaxrsServer.java:44)<br />at de.gilles.projects.resteasy.service.RestEasyStarter.startServer(RestEasyStarter.java:29)<br />at de.gilles.projects.resteasy.service.RestEasyStarter.main(RestEasyStarter.java:18)<br /><br />May be i am missing something. I really need help to make it run. I couldn’t be able to start a discussion on Jboss Community, threrefore i make it in this blogAnonymousnoreply@blogger.com