Problem with REST

Posted on 2011-04-24
Last Modified: 2012-05-11
Hello ,
i tire to write a REST web - service with java ( netbean , glassfish and jersey)

i write a very simple code and it work . But when i tried to make something like this :

package service;

import java.util.logging.Level;
import java.util.logging.Logger;
import converter.FlyedpConverter;
import entities.FlysCombination;

public class FlyedpResource {

    public Response get(@PathParam("date") String date) throws IOException


        FlysCombination comb =new  FlysCombination();
	      FlysCombination x = FlysCombination.instance();

            comb = x.getcomb(date);


        if(comb == null)
            return Response.status(Response.Status.NOT_FOUND).build();
        return Response.ok(comb).build();

Open in new window

 * To change this template, choose Tools | Templates
 * and open the template in the editor.

package entities;

import converter.FlyedpConverter;
import java.util.ArrayList;

 * @author mehdi
public class FlysCombination {

    public FlysCombination ()


    public static FlysCombination flycomb=null;

     public static FlysCombination instance()
        if(flycomb == null)
            flycomb=new FlysCombination();
        return flycomb;

	private  String session;
	private   ArrayList combinations = new ArrayList();

	public FlysCombination(String session,ArrayList combinations)



        	public ArrayList getcombinations() {
		return combinations;
	public void setcombinations(ArrayList goingthere) {
		this.combinations = goingthere;

public String getsession() {
		return session;

public void setsession(String session) {
		this.session = session;

public FlysCombination getcomb(String a)
     FlyedpConverter fly = new FlyedpConverter (a);
     FlysCombination flycomb =new FlysCombination (session,combinations);




Open in new window

package converter;

public class FlyedpConverter


private String keydate;

public FlyedpConverter(String keydate)

public String getkeydate() {
	return keydate;
public void setkeydate(String keydate) {
	this.keydate = keydate;


Open in new window

i have this error :

Status: 500 (Internal Server Error) at com.sun.jersey.spi.container.ContainerResponse.write( at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest( at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest( at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest( at com.sun.jersey.spi.container.servlet.WebComponent.service( at com.sun.jersey.spi.container.servlet.ServletContainer.service( at com.sun.jersey.spi.container.servlet.ServletContainer.service( at javax.servlet.http.HttpServlet.service( at org.apache.catalina.core.StandardWrapper.service( at org.apache.catalina.core.StandardWrapperValve.invoke( at org.apache.catalina.core.StandardContextValve.invoke( at org.apache.catalina.core.StandardPipeline.invoke( at com.sun.enterprise.web.WebPipeline.invoke( at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke( at org.apache.catalina.core.StandardHostValve.invoke( at org.apache.catalina.connector.CoyoteAdapter.doService( at org.apache.catalina.connector.CoyoteAdapter.service( at at com.sun.grizzly.http.ProcessorTask.invokeAdapter( at com.sun.grizzly.http.ProcessorTask.doProcess( at com.sun.grizzly.http.ProcessorTask.process( at com.sun.grizzly.http.DefaultProtocolFilter.execute( at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter( at com.sun.grizzly.DefaultProtocolChain.execute( at com.sun.grizzly.DefaultProtocolChain.execute( at com.sun.grizzly.http.HttpProtocolChain.execute( at com.sun.grizzly.ProtocolChainContextTask.doCall( at at at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork( at com.sun.grizzly.util.AbstractThreadPool$ at

i think that the problem is in the @XmlRootElement , i dont found where write it ... Help me please
Question by:keviin555
    1 Comment
    LVL 92

    Accepted Solution

    check your server log for the underlying cause of the problem

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    scoresAverage challenge 8 58
    changeXy challenge 13 40
    Spring Controller - inheritance in request parameter 3 30
    countAbc challenge 9 35
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now