Search Results

Search found 17 results on 1 pages for 'resteasy'.

Page 1/1 | 1 

  • Installing RestEasy documentation is not clear--does maven install resteasy?

    - by user798719
    3.1. Standalone Resteasy If you are using resteasy outside of JBoss AS 6, you will need to do a few manual steps to install and configure resteasy. RESTeasy is deployed as a WAR archive and thus depends on a Servlet container. We strongly suggest that you use Maven to build your WAR files as RESTEasy is split into a bunch of different modules. You can see an example Maven project in one of the examples in the examples/ directory Also, when you download RESTeasy and unzip it you will see a lib/ directory that contains the libraries needed by resteasy. Copy these into your /WEB-INF/lib directory. Place your JAX-RS annotated class resources and providers within one or more jars within /WEB-INF/lib or your raw class files within /WEB-INF/classes. Hi, is my confusion justified? I am using JBoss 5 unfortunately. Do I need to download RESTeasy and unzip it IF I am using Maven, as the documentation recommends? Maven grabs all the dependencies that are needed to build a project, including the RESTEasy fraemwork, right? So why the contradiction here? Wish that the documentation would anticipate common questions and be written more clearly.

    Read the article

  • RESTEasy - access to web folder for geting image

    - by Trick
    I would like to allow users to access images saved in web folder. For example - I have an image in web root folder "blank.png". But the link http://localhost:8080/myapp/blank.png returns 404 (not found). Adding type to resteasy.media.type.mappings does not work. I am a bit of a newbie in RESTEasy...

    Read the article

  • Mocking digest authentication in RestEasy

    - by Ralph
    I am using RestEasy to develop a REST server and using the mock dispatcher (org.jboss.resteasy.mockMockDispatcherFactory) for testing the service in my unit tests. My service requires digest authentication and I would to make that part of my testing. Each of my services accepts a @Context SecurityContext securityContext parameter. Is there any way is inject a fake SecurityContext in the dispatcher so that I can test that my security methods function properly?

    Read the article

  • jboss Resteasy for java 5

    - by Anand
    Is there a resteasy version that runs on jdk 5 enviroment? I tried to compile my code in java 5 but it didnot work saying version problem. Is there a solution here? type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Error instantiating servlet class org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Thread.java:595) root cause java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class javax.ws.rs.core.UriInfo) org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1964) org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:933) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1405) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1284) java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) java.lang.Class.getDeclaredConstructors0(Native Method) java.lang.Class.privateGetDeclaredConstructors(Class.java:2357) java.lang.Class.getConstructor0(Class.java:2671) java.lang.Class.newInstance0(Class.java:321) java.lang.Class.newInstance(Class.java:303) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879) org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) java.lang.Thread.run(Thread.java:595) note The full stack trace of the root cause is available in the Apache Tomcat/5.5.31 logs.

    Read the article

  • RESTEasy - simple string array/collection marshalling

    - by peperg
    Is there a simple way for marshalling and unmarshalling String[] or List in RESTEasy? My code sample : @GET @Path("/getSomething") @Produces(MediaType.APPLICATION_JSON) public List<String> getSomeData() { return Arrays.asList("a","b","c","d"); } Above gives me an Exception : Could not find MessageBodyWriter for response object of type: java.util.Arrays$ArrayList of media type: application/json

    Read the article

  • Using an EJB inside a JAX-RS resource class in RestEasy?

    - by Laird Nelson
    I would like to have the following kind of resource class work when deployed under RestEasy in JBoss 6: @Path("Something") public class Foo { @EJB private SomeService service @GET public Object frobnicate() { assert service != null; // JBoss blows up here return result; } } Two questions: It is a limitation of RestEasy, not of the Java EE specification, right, that RestEasy can't inject anything annotated with @EJB? What have people done to work around this limitation? My developers are about to surge forward with hard-coded JNDI lookups (e.g. context.lookup(someHardCodedNameHere)) because no one can find a workaround to this specification violation at the present time. I really want to avoid this. Lastly, I've looked at using CDI, but the story here isn't much better as RestEasy and CDI still aren't talking to each other. Thanks in advance for any pointers.

    Read the article

  • Why are error pages ignored in RESTEasy web service running on Tomcat?

    - by Chandru
    I'm developing a REST-ful web service using RESTEasy deployed on Tomcat. I've configured an error page which takes the exception's message and generates an XML based on it when any exception occurs during the request. This works fine for any application generated exceptions. However, if client sends an invalid XML which cannot be unmarshalled correctly, an javax.xml.bind.UnmarshalException is thrown and Tomcat's default error page is used instead of mine. I have configured my error page to the error-code 500 in web.xml. Is using error pages the correct way to handle errors when using RESTEasy or is there an alternative way?

    Read the article

  • Injection of an EJB into a web java class under JBoss 7.1.1

    - by Dobbo
    I am trying to build a website using JBoss 7.1.1 and RESTeasy. I have managed to constructed and deploy and EAR with a both a WAR and an EJB-JAR contained within: voyager-app.ear META-INF/MANIFEST.MF META-INF/application.xml META-INF/jboss-app.xml lib/voyager-lib.jar voyager-adm.war voyager-ejb.jar voyager-web.war So far things are very simple. voyager-adm.war & voyager-lib.jar are empty (just the manifest file) but I know that I'm going to have code for them shortly. There is just one Stateful EJB - HarbourMasterBean (with just a local interface) and a few Database Entity Beans in the EJB jar file: voyager-ejb.jar META-INF/MANIFEST.MF META-INF/persistence.xml com/nutrastat/voyager/db/HarbourMasterBean.class com/nutrastat/voyager/db/HarbourMasterLocal.class com/nutrastat/voyager/db/PortEntity.class com/nutrastat/voyager/db/ShipEntity.class As far as I can tell the EJBs deploy correctly because the database units are created and the log shows that the publication of some HarbourMaster references: java:global/voyager-app/voyager-ejb/harbour-master!com.nutrastat.voyager.db.HarbourMasterLocal java:app/voyager-ejb/harbour-master!com.nutrastat.voyager.db.HarbourMasterLocal java:module/harbour-master!com.nutrastat.voyager.db.HarbourMasterLocal java:global/voyager-app/voyager-ejb/harbour-master java:app/voyager-ejb/harbour-master java:module/harbour-master The problem lies in getting the HarbourMaster EJB injected into my web bean. The reference to it is alway NULL no matter what I try. voyager-web.war META-INF/MANIFEST.MF WEB-INF/web.xml WEB-INF/classes/com/nutrastat/voyager/web/ WEB-INF/classes/com/nutrastat/voyager/web/Ships.class WEB-INF/classes/com/nutrastat/voyager/web/VoyagerApplication.class Ships.java: @Path("fleet") public class Ships { protected transient final Logger log; @EJB private HarbourMasterLocal harbourMaster; public Ships() { log = LoggerFactory.getLogger(getClass()); } @GET @Path("ships") @Produces({"text/plain"}) public String listShips() { if (log.isDebugEnabled()) log.debug("Harbour master value: " + harbourMaster); return "Harbour Master: " + harbourMaster; } } &lt;web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0" &gt; <display-name>Voyager Web Application</display-name> <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> <init-param> <param-name> javax.ws.rs.Application </param-name> <param-value> com.nutrastat.voyager.web.VoyagerApplication </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>Resteasy</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> &lt;/web-app&gt; I have been searching the web for an answer and read a number of places, both on StackOverflow and elsewhere that suggests is can be done, and that the problems lies with configuration. But they post only snippets and I'm never sure if I'm doing things correctly. Many thanks for any help you can provide. Dobbo

    Read the article

  • JAX-RS implementation of link/element expansion?

    - by Jimmy
    While reading documentation of Google Data API and Atlassian REST API, I found interesting functionality - link (or title, element expansion) - http://bit.ly/i3rKMw. I would like to implement this functionality in my Java project of web service server for our IS, but I can't find any proper solution or advices for implementation. My project is quite big with many services so I need some robust and most automated solution. I was thinking about how to implement it like an extension for RESTEasy and JAXB, but it seems to be very complicated. Do you know some opensource projects which implements this functionality or any advices which could help me?

    Read the article

  • Calling ASP.NET Web API using JQuery ajax - cross site scripting issue

    - by SimonF
    I have a Web API which I am calling using the JQuery ajax function. When I test the service directly (using the Chrome RESTEasy extension) it works fine, however when I call it using the JQuery ajax function I get an error. I'm calling it on port 81: $.ajax({ url: "http://127.0.0.1:81/api/people", data: JSON.stringify(personToCreate), type: "POST", contentType: "application/json;charset=utf-8", statusCode: { 201: function (newPerson) { callback(newPerson); } }, success: function (newPerson) { alert("New person created with an Id of " + newPerson.Id); }, error: function (jqXHR, textStatus, errorThrown) { alert('Error. '+textStatus+'. '+errorThrown); } }); ...but when I trace it using FireBug Lite the response comes from port 82: {"Message":"No HTTP resource was found that matches the request URI 'http://127.0.0.1:82/api/people'.","MessageDetail":"No action was found on the controller 'People' that matches the request."} I think the error is, effectively, due to cross-site scripting being blocked, but I'm not actually cross-site scripting, if you see what I mean. Has anyone else come across this and been able to fix it? Edit: Routing config (global.asax.vb) is: RouteTable.Routes.MapHttpRoute(name:="DefaultApi", routeTemplate:="api/{controller}/{id}", defaults:=New With {Key .id = System.Web.Http.RouteParameter.Optional}) Controller: Public Function PostValue(ByVal departmentid As Integer, ByVal emailaddress As String, ByVal firstname As String, ByVal lastname As String) As Guid Dim context As New WSMModelDataContext Dim bllPeople As New PeopleBLL(context) Return bllPeople.Create(firstname, lastname, emailaddress, departmentid) End Function When I debug it, it doesn't get as far as running the controller, although when calling it through RESTEasy it routes correctly and the controller executes successfully. The only difference seemes to be that wen called through RESTEasy it is (correctly) using http://127.0.0.1:81 but for some reason when called via JQuery/ajax it seems to be using http://127.0.0.1:82.

    Read the article

  • Selecting a JAX-RS implementation for a new project

    - by Fernando Correia
    I'm starting a new Java project which will require a RESTful API. It will be a SaaS business application serving mobile clients. I have developed one project with Java EE 6, but I'm not very familiar with the ecosystem, since most of my experience is on the Microsoft platform. Which would be a sensible choice for a JAX-RS implementation for a new project such as described? Judging by Wikipedia's list, main contenders seem to be Jersey, Apache CXF, RESTeasy and Restlet. But the Comparison of JAX-RS Implementations cited on Wikipedia is from 2008. My first impressings from their respective homepages is that: CXF aims to be a very comprehensive solution (reminds me of WCF in the Microsoft space), which makes me think it can be more complex to understand, setup and debug than what I need; Jersey is the reference implementation and might be a good choice, but it's legacy from Sun and I'm not sure how Oracle is treating it (announcements page doesn't work and last commit notice is from 4 months ago); RESTeasy is from JBoss and probably a solid option, though I'm not sure about learning curve; Restlet seems to be popular but has a lot of history, I'm not sure how up-to-date it is in the Java EE 6 world or if it carries a heavy J2EE mindset (like lots of XML configuration). What would be the merits of each of these alternatives? What about learning curve? Feature support? Tooling (e.g. NetBeans or Eclipse wizards)? What about ease of debugging and also deployment? Is any of these project more up-to-date than the others? How stable are them?

    Read the article

  • How to move to Java enterprise development after Python and Ruby?

    - by rdasxy
    I used to develop in Django/Python and Rails/Ruby (and before that C/C++ and C#), and I'm now at a job where we do enterprise Java development (Spring, Hibernate, RESTEasy, Maven, etc.) for web applications and web services. Coming from the Convention over Configuration world, what's the best way to get up to speed doing enterprise Java web services development? I know Java (the language) well, and I've written GUIs in Swing and basic JSP before, but nothing of the kind I'm doing now. Are there any recommended tutorials to get up to speed on popular Java enterprise development tutorials?

    Read the article

  • Annotations (@EJB, @Resource, ...) within a RESTful Service

    - by Dominik
    Hi! I'm trying to inject a EJB within my RESTful Service (RESTEasy) via Annotations. public class MyServelet implements MyServeletInterface { ... @EJB MyBean mybean; ... } Unfortunately there is no compilation or AS error, the variable "mybean" is just null and I get a NullPointerException when I try to use it. What I'm doing wrong? Here are some side-informations about my architecture: JBoss 4.2.2.GA Java version: 1.5.0_17 local MDB-Project remote EJB-Project WAR Project with the RESTful Service which uses the remote EJB and sends messages to the local MDB-Project Thanks in advance! br Dominik p.s: everything is working fine when I use normal context lookup.

    Read the article

  • how to send JSON data with server error response code 500

    - by kapil.israni
    I wanted to know if theres a way to send a JSON data along with HTTP response code 500. Basically I want my rest client to know that there is some error on the backend and along with it send a JSON error data structure like this. {"error" : [ {"code": "1001", "desc": "Some error description"}, {"code": "1002", "desc": "Some other error description"} ] } This is using the following java stack = Java 6/JAX-RS/Jersey/Tomcat If not, then is there a way to send a custom response code along with JSON data. Basically looking from JAX-RS API it looks that you can only send JSON data along with 200 OK?? Any thoughts?? I am guessing RESTEasy would be the same, right??

    Read the article

  • unable to find a MessageBodyReader

    - by Cristian Boariu
    Hi guys, I have this interface: @Path("inbox") public interface InboxQueryResourceTest { @POST @Path("{membershipExternalId}/query") @Consumes(MediaType.APPLICATION_XML) @Produces("multipart/mixed") public MultipartOutput query(@PathParam("membershipExternalId") final String membershipExternalId, @QueryParam("page") @DefaultValue("0") final int page, @QueryParam("pageSize") @DefaultValue("10") final int pageSize, @QueryParam("sortProperty") final List<String> sortPropertyList, @QueryParam("sortReversed") final List<Boolean> sortReversed, @QueryParam("sortType") final List<String> sortTypeString, final InstanceQuery instanceQuery) throws IOException; } I have implemented the method to return a MultipartOutput. I am posting an xml query from Fiddler and i receive the result without any problem. BUT i have done an integration test for the same interface, i send the same objects and i put the response like: final MultipartOutput multiPartOutput = getClient().query(getUserRestAuth(), 0, 25, null, null, null, instanceQuery); But here, so from integration tests, i receive a strange error: Unable to find a MessageBodyReader of content-type multipart/mixed;boundary="74c5b6b4-e820-452d-abea-4c56ffb514bb" and type class org.jboss.resteasy.plugins.providers.multipart.MultipartOutput Anyone has any ideea why only in integration tests i receive this error? PS: Some of you will say that i do not send application/xml as ContentType but multipart, which of course is false because the objects are annotated with the required @XmlRootElement etc, otherways neither the POST from Fiddler would work.

    Read the article

  • Tapestry + JaxB conflict

    - by alex
    Hi all ! I need your help to resolve a conflict between Tapestry and JaxB. The error is : com.sun.xml.stream.ZephyrParserFactory cannot be cast to org.codehaus.stax2.XMLInputFactory2 I find a way to resolve it, but it is for jetty : http://tynamo.org/tapestry-resteasy+guide The solution seems to be to add a system properties to declare : javax.xml.stream.XMLInputFactory = com.ctc.wstx.stax.WstxInputFactory But i don't know how to do this for Tomcat. I try to do it int he web.xml like : <env-entry> <env-entry-name> javax.xml.stream.XMLInputFactory </env-entry-name> <env-entry-value> com.ctc.wstx.stax.WstxInputFactory </env-entry-value> <env-entry-type> com.ctc.wstx.stax.WstxInputFactory </env-entry-type> </env-entry> without success... I am also aware for another solution :) thx for helping me.

    Read the article

1