This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Restful WebService without annatations in eclipse using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Restful WebService without annatations in eclipse using java" Watch "Restful WebService without annatations in eclipse using java" New topic
Author

Restful WebService without annatations in eclipse using java

badri raj
Greenhorn

Joined: Jun 30, 2011
Posts: 4
We are creating an application in android which will invoke Restful webservices.But here the problem is the web services should of without annatations as we are going to deploy them in RAD(Rational Application Developer),which is not going to recognise the annatations as it is IBM specific.So We need Restful web services without annatations. Any example source code will be very thankful

Regards, badri
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
The basics of a RESTful service are generally so simple that you do not need annotations or any particular toolkit.

The standard Java library for HTTP connections and the servlet API is all you really need.

How many functions will your Android client be using?

Bill

Java Resources at www.wbrogden.com
badri raj
Greenhorn

Joined: Jun 30, 2011
Posts: 4
thank you William for your reply.We are using 6 to 7 functions where they will invoke web services.Can you give the example for what you have suggested


Regards,
badri
badri raj
Greenhorn

Joined: Jun 30, 2011
Posts: 4
And one more request is can you give the source code of web service where it won't use the annotations and returns a JSON object.This is the actual requirement for our application where the web service won't use annatations and returns a JSON object.Any source code example is very thankful
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39544
    
  27
I don't understand what you mean by "which is not going to recognise the annatations as it is IBM specific" - a library like Jersey can be used in any servlet container; it comes with all jar files necessary to develop with it and deploy it. There's nothing IBM-specific about JAX-RS annotations.


Ping & DNS - updated with new look and Ping home screen widget
badri raj
Greenhorn

Joined: Jun 30, 2011
Posts: 4
Hi Dittmer,

we are getting the below mentioned exception when we are using Jersey(jars) implementation to create web services in RAD7.5(6.1 test server)


com.ibm.ws.jsp.taglib.TldParser endElement JSPG0235E: The JSP container failed to load the TagExtraInfo class [com.ibm.wps.engine.tags.PortletTitleTag$TEI]
[5/9/11 14:47:17:118 IST] 00000015 jsp W com.ibm.ws.jsp.taglib.TldParser endElement JSPG0235E: The JSP container failed to load the TagExtraInfo class [org.apache.jetspeed.portletcontainer.tags.InitTag$TEI]
[5/9/11 14:47:17:290 IST] 00000015 PackagesResou I Scanning for root resource and provider classes in the packages:
com.nytimes.atw.admagmt.android.service
[5/9/11 14:47:17:368 IST] 00000015 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl initialize FFDC0009I: FFDC opened incident stream file D:\Program Files\IBM\SDP\runtimes\base_v61\profiles\AppSrv04\logs\ffdc\server1_00000015_11.05.09_14.47.17_0.txt
[5/9/11 14:47:17:431 IST] 00000015 ServiceLogger I com.ibm.ws.ffdc.IncidentStreamImpl resetIncidentStream FFDC0010I: FFDC closed incident stream file D:\Program Files\IBM\SDP\runtimes\base_v61\profiles\AppSrv04\logs\ffdc\server1_00000015_11.05.09_14.47.17_0.txt
[5/9/11 14:47:17:477 IST] 00000015 ServletWrappe E SRVE0100E: Did not realize init() exception thrown by servlet Jersey REST Service: java.lang.TypeNotPresentException: Type javax.ws.rs.Path not present
at com.ibm.oti.reflect.AnnotationHelper.getAnnotation(AnnotationHelper.java:38)
at com.ibm.oti.reflect.AnnotationHelper.getDeclaredAnnotations(AnnotationHelper.java:50)
at java.lang.Class.getDeclaredAnnotations(Class.java:1648)
at java.lang.Class.getAnnotations(Class.java:1609)
at java.lang.Class.getAnnotation(Class.java:1589)
at java.lang.Class.isAnnotationPresent(Class.java:1676)
at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:122)
at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:78)
at com.sun.jersey.api.core.PackagesResourceConfig.<init>(PackagesResourceConfig.java:89)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:516)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:164)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:197)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:218)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:319)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1250)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:152)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:882)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:804)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:522)
at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:359)
at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:292)
at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:92)
at com.ibm.ws............................................................................................................
................................................................................



regards,
badri
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
If this was my problem I would first try to get Jersey working in your environment - the problem may be as simple as putting JAR files in the right place. The Jersey users mailing list might be a help here.

If you want to start from scratch, the javax.servlet.http.HttpServletRequest interface has methods for dissecting the parts of a request as used by a RESTful service to locate a resource, extract parameters, etc.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Restful WebService without annatations in eclipse using java
 
Similar Threads
storing multiple attributes for one entity
next thing to learn after Servlets/JSPs
JAX-WS - WSDLS - Where are they?
Spring in Action - web services
JAX-WS or JAX-RS for RESTful??