473,499 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
10 4495
"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
"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
"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
"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
"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
"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
"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
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2764
by: Yasutaka Ito | last post by:
Hi folks! I have a BaseForm class that inherits System.Windows.Forms.Form. It has a property, whose value I need supplied by the class that inherits it. The BaseForm usees the value supplied...
9
4614
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
3
1162
by: sank | last post by:
hello all, i am a c++ programmar. i want to know other methodes of making abstract other than pure virtual class. thank u all.
16
3501
by: Merlin | last post by:
Hi Been reading the GOF book and started to make the distinction between Class and Interface inheritance. One question though: Do pure abstract classes have representations? (data members?)...
4
2279
by: Tony Johansson | last post by:
Hello! Assume you have an abstract class called Body and a derived class called cylinder. When you have an abstract class you can't instansiate an object. As you can see in the abstract class...
1
12358
by: Tony Johansson | last post by:
Hello!! Assume you have two classes one class called Base which is an abstract class and one derived class called Derived. You are not allowed to create an object of class Base like new...
5
1721
by: Tony Johansson | last post by:
Hello!! Is it possible to have abstract destructor. //Tony
8
21704
by: Dev | last post by:
Hello, Why an Abstract Base Class cannot be instantiated ? Does anybody know of the object construction internals ? What is the missing information that prevents the construction ? TIA....
12
3064
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7012
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4920
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.