By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,968 Members | 1,843 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,968 IT Pros & Developers. It's quick & easy.

.ChartRequest is an abstract class. It can't be instantiated.

P: n/a
When I compile my class I get this strange message.
The message is strange as that class is not abstract !!!!
Please help!
Gianni
Jul 17 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
When I compile my class I get this strange message.
The message is strange as that class is not abstract !!!!
Please help!
Gianni


Prove it. Post code.
Jul 17 '05 #2

P: n/a
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
When I compile my class I get this strange message.
The message is strange as that class is not abstract !!!!
Please help!
Gianni


Prove it. Post code.
Jul 17 '05 #3

P: n/a
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<0t********************@texas.net>...
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
When I compile my class I get this strange message.
The message is strange as that class is not abstract !!!!
Please help!
Gianni


Prove it. Post code.


// Decompiled by Jad v1.5.7. Copyright 1997-99 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconVall.../8617/jad.html
// Decompiler options: packimports(3) fullnames fieldsfirst
// Source File Name: ChartServlet.java

import java.io.*;
import java.util.*;
import java.text.*;
import java.awt.*;
import java.awt.image.*;
import javax.servlet.*;
import javax.servlet.http.*;

import it.finsiel.tea.nhcnwi.datimeteo.ejb.*;
import it.finsiel.tea.nhcnwi.datimeteo.util.*;
import it.finsiel.tea.nhxnwi.util.*;

import javachart.utility.ChartRequest;
import javachart.contrib.*;
import javachart.servlet.*;

// Referenced classes of package javachart.servlet:
// Bean, CacheManager, barApp

public class ChartServlet extends HttpServlet
{
protected RicercaDatimeteoValue rdm = new RicercaDatimeteoValue();
protected HttpSession session;
protected String writeDirectory = "";
protected String imageWidth = "";
private SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHH");

// Initializes this servlet
public void init(ServletConfig config) throws ServletException {

super.init(config);

writeDirectory = config.getInitParameter("kawachartWriteDirectory") ;
imageWidth = config.getInitParameter("imageWidth");
.................................................. .....................................and
so on
Jul 17 '05 #4

P: n/a
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<0t********************@texas.net>...
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
When I compile my class I get this strange message.
The message is strange as that class is not abstract !!!!
Please help!
Gianni


Prove it. Post code.

Is is possible it give me that error as I don't define all the methods
of the interface HttpServletRequest ??
thanks
Jul 17 '05 #5

P: n/a
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<0t********************@texas.net>...
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
When I compile my class I get this strange message.
The message is strange as that class is not abstract !!!!
Please help!
Gianni


Prove it. Post code.


Im sorry that is the class which the compiler consider abstract ...
but can't read abstract nowhere .... Thanks for the help
// Decompiled by DJ v3.5.5.77 Copyright 2003 Atanas Neshkov Date:
11/11/2003 16.52.59
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check
often for new version!
// Decompiler options: packimports(3)
// Source File Name: ChartRequest.java

package javachart.utility;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import javax.servlet.http.*;

public class ChartRequest
implements HttpServletRequest
{

public ChartRequest(HttpServletRequest httpservletrequest)
{
table = new Hashtable();
r = httpservletrequest;
}

public void clearTable()
{
table = new Hashtable();
}

public Object getAttribute(String s)
{
return r.getAttribute(s);
}

public String getAuthType()
{
return r.getAuthType();
}

public String getCharacterEncoding()
{
return r.getCharacterEncoding();
}

public int getContentLength()
{
return r.getContentLength();
}

public String getContentType()
{
return r.getContentType();
}

public Cookie[] getCookies()
{
return r.getCookies();
}

public long getDateHeader(String s)
{
return r.getDateHeader(s);
}

public String getHeader(String s)
{
return r.getHeader(s);
}

public Enumeration getHeaderNames()
{
return r.getHeaderNames();
}

public ServletInputStream getInputStream()
throws IOException
{
return r.getInputStream();
}

public int getIntHeader(String s)
{
return r.getIntHeader(s);
}

public String getMethod()
{
return r.getMethod();
}

public String getParameter(String s)
{
return (String)table.get(s);
}

public Enumeration getParameterNames()
{
return table.elements();
}

public String[] getParameterValues(String s)
{
return r.getParameterValues(s);
}

public String getPathInfo()
{
return r.getPathInfo();
}

public String getPathTranslated()
{
return r.getPathTranslated();
}

public String getProtocol()
{
return r.getProtocol();
}

public String getQueryString()
{
return r.getQueryString();
}

public BufferedReader getReader()
throws IOException
{
return r.getReader();
}

public String getRealPath(String s)
{
return r.getRealPath(s);
}

public String getRemoteAddr()
{
return r.getRemoteAddr();
}

public String getRemoteHost()
{
return r.getRemoteHost();
}

public String getRemoteUser()
{
return r.getRemoteUser();
}

public String getRequestedSessionId()
{
return r.getRequestedSessionId();
}

public String getRequestURI()
{
return r.getRequestURI();
}

public String getScheme()
{
return r.getScheme();
}

public String getServerName()
{
return r.getServerName();
}

public int getServerPort()
{
return r.getServerPort();
}

public String getServletPath()
{
return r.getServletPath();
}

public HttpSession getSession(boolean flag)
{
return r.getSession(flag);
}

public boolean isRequestedSessionIdFromCookie()
{
return r.isRequestedSessionIdFromCookie();
}

public boolean isRequestedSessionIdFromUrl()
{
return r.isRequestedSessionIdFromUrl();
}

public boolean isRequestedSessionIdValid()
{
return r.isRequestedSessionIdValid();
}

public void setParameter(String s, String s1)
{
table.put(s, s1);
}

HttpServletRequest r;
Hashtable table;
}
Jul 17 '05 #6

P: n/a
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message

news:<0t********************@texas.net>...
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
When I compile my class I get this strange message.
The message is strange as that class is not abstract !!!!
Please help!
Gianni


Prove it. Post code.


Im sorry that is the class which the compiler consider abstract ...
but can't read abstract nowhere .... Thanks for the help
// Decompiled by DJ v3.5.5.77 Copyright 2003 Atanas Neshkov Date:
11/11/2003 16.52.59
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check
often for new version!
// Decompiler options: packimports(3)
// Source File Name: ChartRequest.java

package javachart.utility;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import javax.servlet.http.*;

public class ChartRequest
implements HttpServletRequest
{

public ChartRequest(HttpServletRequest httpservletrequest)
{
table = new Hashtable();
r = httpservletrequest;
}

public void clearTable()
{
table = new Hashtable();
}

public Object getAttribute(String s)
{
return r.getAttribute(s);
}

public String getAuthType()
{
return r.getAuthType();
}

public String getCharacterEncoding()
{
return r.getCharacterEncoding();
}

public int getContentLength()
{
return r.getContentLength();
}

public String getContentType()
{
return r.getContentType();
}

public Cookie[] getCookies()
{
return r.getCookies();
}

public long getDateHeader(String s)
{
return r.getDateHeader(s);
}

public String getHeader(String s)
{
return r.getHeader(s);
}

public Enumeration getHeaderNames()
{
return r.getHeaderNames();
}

public ServletInputStream getInputStream()
throws IOException
{
return r.getInputStream();
}

public int getIntHeader(String s)
{
return r.getIntHeader(s);
}

public String getMethod()
{
return r.getMethod();
}

public String getParameter(String s)
{
return (String)table.get(s);
}

public Enumeration getParameterNames()
{
return table.elements();
}

public String[] getParameterValues(String s)
{
return r.getParameterValues(s);
}

public String getPathInfo()
{
return r.getPathInfo();
}

public String getPathTranslated()
{
return r.getPathTranslated();
}

public String getProtocol()
{
return r.getProtocol();
}

public String getQueryString()
{
return r.getQueryString();
}

public BufferedReader getReader()
throws IOException
{
return r.getReader();
}

public String getRealPath(String s)
{
return r.getRealPath(s);
}

public String getRemoteAddr()
{
return r.getRemoteAddr();
}

public String getRemoteHost()
{
return r.getRemoteHost();
}

public String getRemoteUser()
{
return r.getRemoteUser();
}

public String getRequestedSessionId()
{
return r.getRequestedSessionId();
}

public String getRequestURI()
{
return r.getRequestURI();
}

public String getScheme()
{
return r.getScheme();
}

public String getServerName()
{
return r.getServerName();
}

public int getServerPort()
{
return r.getServerPort();
}

public String getServletPath()
{
return r.getServletPath();
}

public HttpSession getSession(boolean flag)
{
return r.getSession(flag);
}

public boolean isRequestedSessionIdFromCookie()
{
return r.isRequestedSessionIdFromCookie();
}

public boolean isRequestedSessionIdFromUrl()
{
return r.isRequestedSessionIdFromUrl();
}

public boolean isRequestedSessionIdValid()
{
return r.isRequestedSessionIdValid();
}

public void setParameter(String s, String s1)
{
table.put(s, s1);
}

HttpServletRequest r;
Hashtable table;
}


By my count, this class is missing 16 methods specified in
HttpServletRequest or ServletRequest. That will most definitely keep you
from instantiating it.
Jul 17 '05 #7

P: n/a
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message news:<W8********************@texas.net>...
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message

news:<0t********************@texas.net>...
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
> When I compile my class I get this strange message.
> The message is strange as that class is not abstract !!!!
> Please help!
> Gianni

Prove it. Post code.


Im sorry that is the class which the compiler consider abstract ...
but can't read abstract nowhere .... Thanks for the help
// Decompiled by DJ v3.5.5.77 Copyright 2003 Atanas Neshkov Date:
11/11/2003 16.52.59
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check
often for new version!
// Decompiler options: packimports(3)
// Source File Name: ChartRequest.java

package javachart.utility;

import java.io.BufferedReader;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import javax.servlet.http.*;

public class ChartRequest
implements HttpServletRequest
{

public ChartRequest(HttpServletRequest httpservletrequest)
{
table = new Hashtable();
r = httpservletrequest;
}

public void clearTable()
{
table = new Hashtable();
}

public Object getAttribute(String s)
{
return r.getAttribute(s);
}

public String getAuthType()
{
return r.getAuthType();
}

public String getCharacterEncoding()
{
return r.getCharacterEncoding();
}

public int getContentLength()
{
return r.getContentLength();
}

public String getContentType()
{
return r.getContentType();
}

public Cookie[] getCookies()
{
return r.getCookies();
}

public long getDateHeader(String s)
{
return r.getDateHeader(s);
}

public String getHeader(String s)
{
return r.getHeader(s);
}

public Enumeration getHeaderNames()
{
return r.getHeaderNames();
}

public ServletInputStream getInputStream()
throws IOException
{
return r.getInputStream();
}

public int getIntHeader(String s)
{
return r.getIntHeader(s);
}

public String getMethod()
{
return r.getMethod();
}

public String getParameter(String s)
{
return (String)table.get(s);
}

public Enumeration getParameterNames()
{
return table.elements();
}

public String[] getParameterValues(String s)
{
return r.getParameterValues(s);
}

public String getPathInfo()
{
return r.getPathInfo();
}

public String getPathTranslated()
{
return r.getPathTranslated();
}

public String getProtocol()
{
return r.getProtocol();
}

public String getQueryString()
{
return r.getQueryString();
}

public BufferedReader getReader()
throws IOException
{
return r.getReader();
}

public String getRealPath(String s)
{
return r.getRealPath(s);
}

public String getRemoteAddr()
{
return r.getRemoteAddr();
}

public String getRemoteHost()
{
return r.getRemoteHost();
}

public String getRemoteUser()
{
return r.getRemoteUser();
}

public String getRequestedSessionId()
{
return r.getRequestedSessionId();
}

public String getRequestURI()
{
return r.getRequestURI();
}

public String getScheme()
{
return r.getScheme();
}

public String getServerName()
{
return r.getServerName();
}

public int getServerPort()
{
return r.getServerPort();
}

public String getServletPath()
{
return r.getServletPath();
}

public HttpSession getSession(boolean flag)
{
return r.getSession(flag);
}

public boolean isRequestedSessionIdFromCookie()
{
return r.isRequestedSessionIdFromCookie();
}

public boolean isRequestedSessionIdFromUrl()
{
return r.isRequestedSessionIdFromUrl();
}

public boolean isRequestedSessionIdValid()
{
return r.isRequestedSessionIdValid();
}

public void setParameter(String s, String s1)
{
table.put(s, s1);
}

HttpServletRequest r;
Hashtable table;
}


By my count, this class is missing 16 methods specified in
HttpServletRequest or ServletRequest. That will most definitely keep you
from instantiating it.

Forgive my complete ignorance!
If it s possible to instantiate a:
public Object getAttribute(String s)
{
return r.getAttribute(s);
}
or a String

public String getAuthType()
{
return r.getAuthType();
}

How can you implement
an
public abstract Principal getUserPrincipal();

thanks for your help
Jul 17 '05 #8

P: n/a
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c*************************@posting.google.co m...
"Ryan Stewart" <zz********@gSPAMo.com> wrote in message

news:<W8********************@texas.net>...
By my count, this class is missing 16 methods specified in
HttpServletRequest or ServletRequest. That will most definitely keep you
from instantiating it.

Forgive my complete ignorance!
If it s possible to instantiate a:
public Object getAttribute(String s)
{
return r.getAttribute(s);
}
or a String

public String getAuthType()
{
return r.getAuthType();
}

How can you implement
an
public abstract Principal getUserPrincipal();

thanks for your help


Well, if you have an HttpServletRequest object stored in your class that
you're using for everything else, why not use it for this? What's wrong
with:
public Principal getUserPrincipal() {
return r.getUserPrincipal()
}

Apart from that, why exactly are you writing this huge class when all you're
doing is passing method calls through to the request object? Wouldn't
something like this suit your needs and be a much nicer design?
public class ChartRequest {
private HashTable t = new HashTable();
private HttpServletRequest r;

public ChartRequest(HttpServletRequest httpservletrequest) {
r = httpservletrequest;
}

public HttpServletRequest getRequest() {
return r;
}

// Your table-related methods here
}

That way, if you want to use the request object, just grab it and use it
like you normally would. Then you can concentrate on creating the
functionality for your table instead of rewriting a bunch of code that
already exists.
Jul 17 '05 #9

P: n/a
I implemented all the methods of HttpServletRequest as that class is
an interface but still have this problem . Do I have to implement all
the methotd of HttpServletRequest's superclass ?? Thanks

I compile-web:
[javac] Compiling 27 source files to C:\siasprod\sias-web
[javac] C:\siasprod\src\sias-web\ChartRequest.java:18: class
javachart.util
ty.ChartRequest must be declared abstract. It does not define
javax.servlet.htt
..HttpSession getSession() from interface
javax.servlet.http.HttpServletRequest.
[javac] public class ChartRequest
Jul 17 '05 #10

P: n/a
"Gianni" <pi***********@yahoo.it> wrote in message
news:3c**************************@posting.google.c om...
I implemented all the methods of HttpServletRequest as that class is
an interface but still have this problem . Do I have to implement all
the methotd of HttpServletRequest's superclass ?? Thanks

I compile-web:
[javac] Compiling 27 source files to C:\siasprod\sias-web
[javac] C:\siasprod\src\sias-web\ChartRequest.java:18: class
javachart.util
ty.ChartRequest must be declared abstract. It does not define
javax.servlet.htt
.HttpSession getSession() from interface
javax.servlet.http.HttpServletRequest.
[javac] public class ChartRequest


First of all, an interface is not a class, nor does it have a superclass. It
has a superinterface if anything. And yes you must implement all the methods
of the interface and all its superinterfaces. You apparently don't
understand the concept of interfaces. Try a good, basic Java book. Also see
my other recent post in this thread. You're not really creating your own
type of Request, so there's no reason to implement HttpServletRequest.
Jul 17 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.