Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

vamshi reddy

Greenhorn
+ Follow
since Aug 21, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by vamshi reddy

I am working on Enunciate REST service, I hav a situtation to include my JSP files in generated war file..

below if my build.xml


<?xml version="1.0" ?>
<project default="declare" name="enunciat" basedir=".">
<target name="init" >
<taskdef name="enunciate" classname="org.codehaus.enunciate.main.EnunciateTask">
<classpath refid="enunciate.classpath"/>
</taskdef>
</target>
<property name="enunciate.home" value="C:/WrkSpace/TestEnunciate/RestPresentation"/>
<property name="java.home" value="C:/Program Files/Java/jdk1.6.0_23"/>
<path id="enunciate.classpath">

<fileset dir="${enunciate.home}/lib">
<include name="*.jar"/>
</fileset>
</path>

<target name="declare" depends="init">
<mkdir dir="dist"/>
<enunciate basedir="C:/WrkSpace/TestEnunciate/RestPresentation/src">
<include name="**/*.java"/>
<include name="**/*.jsp">

<classpath refid="enunciate.classpath"/>
<export artifactId="war.file" destination="dist/J2eewe.war"/>
</enunciate>
</target>

</project>

with out include jsp I can able to generate my war file, while including JSP's I am getting fallowing error..


Buildfile: C:\WrkSpace\TestEnunciate\RestPresentation\build.xml
init:
declare:

BUILD FAILED
C:\WrkSpace\TestEnunciate\RestPresentation\build.xml:31: java.lang.IllegalArgumentException: Illegal name of java source file: C:\WrkSpace\TestEnunciate\RestPresentation\src\com\locations\presentation\Welcome.jsp. (Must end with ".java")

Total time: 325 milliseconds


can any one please help me to resolve this issue, thanks in advance..

8 years ago
can resolve the issue with tomcat server .. but getting error while executing on web sphere server.

please let me know if any one of you has any idea on that ..
8 years ago
I am trying to access request and response of my web service though context and trying to parse jsp through request dispatcher ..

My code looks like

@Path("/debugLocation")
public class locationImplll implements LocationsService{

@Context HttpServletRequest servletRequest;
@Context HttpServletResponse servletResponse;

@Override
public SearchLocationInfo getLocation() {

String filePath = "/Welcome.jsp";
RequestDispatcher req3 = servletRequest.getRequestDispatcher(filePath);
try {
req3.include(servletRequest, servletResponse);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}

giving stack trace at include as:-
ContainerResp E The RuntimeException could not be mapped to a response, re-throwing to the HTTP container
java.lang.RuntimeException: SRV.8.2: RequestWrapper objects must extend ServletRequestWrapper or HttpServletRequestWrapper
at com.ibm.wsspi.webcontainer.util.ServletUtil.unwrapRequest(ServletUtil.java:79)
at com.ibm.wsspi.webcontainer.util.ServletUtil.unwrapRequest(ServletUtil.java:57)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:561)
at com.location.impl.locationImplll.getLocation(locationImplll.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$TypeOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:167)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:70)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:279)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:86)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:136)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:74)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1347)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1279)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1229)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1219)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:419)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:537)
at org.codehaus.enunciate.modules.jersey.EnunciateJerseyServletContainer.service(EnunciateJerseyServletContainer.java:239)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1657)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1597)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at org.codehaus.enunciate.webapp.HTTPRequestContextFilter.doFilter(HTTPRequestContextFilter.java:36)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:934)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:502)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:179)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3826)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:931)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:445)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:504)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:301)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:275)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1563)

tried to add request wrapper as :


@Path("/debugLocation")
public class locationImplll implements LocationsService{

@Context HttpServletRequest servletRequest;
@Context HttpServletResponse servletResponse;

@Override
public SearchLocationInfo getLocation() {

String filePath = "/Welcome.jsp";
HttpServletRequest request;
request = new HttpServletRequestWrapper(servletRequest);
HttpServletResponse response;
response = new HttpServletResponseWrapper(servletResponse);
/* System.out.println(request);
System.out.println(response);*/
RequestDispatcher req3 = request.getRequestDispatcher(filePath);

try {
req3.include(request, response);
} catch (ServletException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}

also giving same erro.. I want to read the content in JSP.. please help me to resolve this as where did I made mistake..

thanks a lot in advance ..
8 years ago
Hi Ivan,


thanks for your help, i tried with WADL2JAVA and created stubs for my WADL file through ant script.

thank you..
8 years ago
I used Enuncaite to create my web service ..
please help me how to generate web service client with WADL..

thanks for your help in advance..
8 years ago
I am trying to call DELETE method for my REST web service which I created using enuncaite.

when I try to access get it's working fine .. but unable to access DELETE and POST methods..

please fine my service class below

@Path("add/{id}")
@GET
public Persona readPersona(@PathParam ("id") String personaId);

@Path("store")
@POST
public void storePersona(Persona persona);

@Path("delete/{id}")
@DELETE
public Persona deletePersona(@PathParam("id") String personaId);

on making some research I got a solution to add an handler .. of which code looks like

if(request.getMethod()!=null && request.getMethod().equalsIgnoreCase("GET")
&&request.getPath().contains("/delete"))
{
request.setMethod("DELETE");
}
My website has around 500 url's which I need to delvelop .. and it;s looks really odd for me to do if else condition for each url,

please help me to get better solution than this or please teach me how this is best way for REST web service
8 years ago
JMS
I got Exception while I retriveing the messages by topic,

Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource JMS$SimpleTCF, throwing ResourceAllocationException. Original exception: javax.resource.spi.ResourceAdapterInternalException: JMSException in createConnection

Please try to help me,
11 years ago