Error in declaration
Hi when i declare as below:
DATA: ws_grid_100 TYPE REF TO cl_gui_alv_grid,
ws_grid2_100 TYPE REF TO cl_gui_alv_grid,
ws_cont1_100 TYPE REF TO cl_gui_docking_container,
ws_cont2_100 TYPE REF TO cl_gui_docking_container.
and execute the program i get the error "*** illegal reference ***"
can any one help me understand y this is coming?
Hi Neha,
It would have be better if you would have attached the short dump. In absense of that, prima facie, it appears as if you are using the variables prior to instantiating them. Make sure you have following coded after the declaration and before the call to any instance method of ws_grid_100 or ws_grid2_100 -
CREATE OBJECT ws_cont1_100
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT ws_cont2_100
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT ws_grid_100
EXPORTING
i_parent = ws_cont1_100
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CREATE OBJECT ws_grid2_100
EXPORTING
i_parent = ws_cont2_100
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
In case problem still persists, please attach the dump (and list the code, if possible) to enable pinpointing the erroneous code.
-Abhijeet.
Similar Messages
-
Error:xml declaration may only begin enttties
my problem is that the code by the name DomEcho01.java in this tutorial
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
compiles fine but at run time it gives me an error saying
"error:xml declaration may only begin enttties "
can ne1 tell me y is this happenin
thanx
sam<?xml version='1.0' encoding='utf-8'?>
<!-- A SAMPLE set of slides -->
<slideshow
title="Sample Slide Show"
date="Date of publication"
author="Yours Truly"
>
<!-- TITLE SLIDE -->
<slide type="all">
<title>Wake up to WonderWidgets!</title>
</slide>
<!-- OVERVIEW -->
<slide type="all">
<title>Overview</title>
<item>Why <em>WonderWidgets</em> are great</item>
<item/>
<item>Who <em>buys</em> WonderWidgets</item>
</slide>
</slideshow>i am using the same xml file that is given in the tutorial -
Error when declaring IDOC segments in program
I am getting error when declaring IDOC segments in my program.
Below is how I declared.
data: wa_e1vfkonk like e1vfkonk.
For the same syntax few segments are showing as properly declared and few are showing error that 'eqvfkonk' does not exist.
How ever this structure does exist when i check it.
Help appreciated.Hi Prasad,
I think the segment that you are declaring in the program doesn't exist in SAP system as standard.
Maybe you mean E1VFKONX, finishing with "X" instead "K"?
Reward points if useful.
Roger -
Error: Multiple declaration
Hi all,
We have an issue occuring only in solaris-sparc platform(not on gcc/linux).
In a source file(.cpp) we have many variables declared and defined, when try complile all of these variables give the following error:
Error: Multiple declaration <variable>
The compilation unit(headers and file) contains templates(function and class),specialization.
When these variable declaration is moved to header, then it works also when variables are put into include once using (#ifdefs like header file) it works
Is there any technique/processing compiler does and goes thru the cpp file twice? Anything specific to solaris? Any pointers would be of great help!
I am using Sunstudio 11
Thanks in advance for all your help!
Thanks,
QrioYou are probably running into a program organization issue regarding placement of template declarations and definitions. Different compilers have different rules.
The topic is discussed in detail in Chapter 5, Program Organization, of the C++ Users Guide:
[http://docs.sun.com/app/docs/doc/819-5267/bkaep?a=view]
(This pointer is for Sun Studio 12, but this property of Sun C++ has not changed.)
Briefly: If a header file foo.h contains template declarations, the compiler will look for foo.cc (or foo.C, foo.cpp, foo.c, etc) expecting to find template definitions, and include foo.cc automatically. Consequently, if foo.h contains template declarations, foo.cc must contain only definitions for templates declared in foo.h. It can also contain declarations needed for those definitions that are not available when foo.h is included, but no other definitions. -
Forte C++ error: Multiple declaration for std::tm
I am trying to compile a program (in standard mode) a program that used
to compile OK in SC4.2 and still compiles OK in compat (but I need
to compile it standard mode). Forte C++ 6.0 gives me the error:
CC -c -O -mt -KPIC -D_REENTRANT ... file.c
"/usr/include/time.h", line 30: Error: Multiple declaration for std::tm.
"/usr/include/wchar.h", line 21: Error: Multiple declaration for std::tm.
2 Error(s) detected.
I include time.h, but wchar.h is included from the chain:
/opt/SUNWspro/WS6/include/CC/iostream.h
/opt/SUNWspro/WS6/include/CC/Cstd/./istream
/opt/SUNWspro/WS6/include/CC/Cstd/./ios
/opt/SUNWspro/WS6/include/CC/Cstd/rw/rwlocale
/opt/SUNWspro/WS6/include/CC/Cstd/./string
/opt/SUNWspro/WS6/include/CC/std/wchar.h
So can't I include iostream.h and time.h together?Why are you using major include files with dot-h extentions in Standard Mode? Don't you mean to use #include <ctime> and #include <iostream>?
-
Eclipse error : The declared package does not match the expected package
I'm trying to setup an Eclipse project on some existing code but I can't get past this error. The source files are in the following directories:
d:\mycompany\coolstuff
d:\mycompany\neatstuff
The source files in the coolstuff directory have a package statement:
package mycompay.coolstuff
The source files in the neatstuff directory have a package statement:
package mycompany.neatstuff
I create a new Eclipse Java project, specify the existing directoy of d:\mycompany. When Eclipse tries to build, it gives the following error:
The declared package "mycompany.coolstuff" does not match the expected package "coolstuff"
I've tried everything I can think of short of modifying every package statement since they seem correct based on the Java documentation. What am I missing?All the source builds just fine using a command
nd line and a classpath=.\That's meaningless, since classpath=.\ is just setting the classpath to the current directory.
d:\mycompany\coolstuff
d:\mycompany\neatstuff
The source files in the coolstuff directory have a
package statement:
package mycompay.coolstuff
The source files in the neatstuff directory have a
package statement:
package mycompany.neatstuff
I create a new Eclipse Java project, specify the
existing directoy of d:\mycompany.When you use the package statement "package mycompay.coolstuff" Eclipse looks in the directory above mycompany for mycompay\coolstuff\<classname>, and that directory is d:\, not d:\mycompany.
When Eclipse
tries to build, it gives the following error:
The declared package "mycompany.coolstuff" does not
match the expected package "coolstuff" -
Error: "div" declaration conflicts with "std::div(long, long)"
I am using the STLport downloaded from http://www.stlport.com/ on a Solaris 9 machine having sun_studio 11. I am getting the following compilation errors related to STL. The same code used to compile with the sun_studio 9 compiler.
/builds/isv/solaris/STLport/4.5/stlport/cstdlib", line 92
: Error: "div" declaration conflicts with "std::div(long, long)" introduced by using declaration.
"/builds/aseries/isv/athabasca/isv/solaris/STLport/4.5/stlport/cstdlib", line 92: Error: std::div(long, long) already had a body defined.
2 Error(s) detected.
What can be the possible solution to this problem? As of now I want to continue using this STL library rather than that which comes along with the compiler.
Thanks.The issue is whether the standard headers associated with the compiler have the overloads required by the standard. If the required overloads are present, the original call of std::pow is ambiguous, and the compiler will report it.
If you have a recent version of Visual C++, I'd be very surprised if the function overloads were not available. Possibly you are using a compiler option, perhaps a default option, that hides the overloaded declarations. In that case, some C++ code that conforms to the standard would not behave correctly when used with the compiler in that mode.
The correct approach is to use the compiler in standard-conforming mode so that code you write will be accepted by other standard-conforming compilers. That is, after all, the purpose of the standard. -
Hi all,when i am trying to declare a cursor in a procedure i am getting errors.Kindly correct me where i am going wrong
1 CREATE OR REPLACE PROCEDURE xxc_lc_rcv_interface_prc IS
2 v_a NUMBER;
3 v_b NUMBER;
4 v_c NUMBER;
5 v_d NUMBER;
6 v_e NUMBER;
7 v_f NUMBER;
8 v_g NUMBER;
9 CURSOR rcv_interface_cur
10 IS
11 SELECT shipment_header_id INTO v_c
12 FROM RCV_SHIPMENT_HEADERS
13 WHERE SHIPMENT_NUM = 'NOV1124';
14 SELECT shipment_line_id INTO v_d
15 FROM RCV_SHIPMENT_LINES
16 WHERE SHIPMENT_HEADER_ID = v_c;
17 BEGIN
18 SELECT rcv_headers_interface_s.nextval INTO v_a FROM dual ;
19 SELECT rcv_interface_group_s.nextval INTO v_b FROM dual;
20 SELECT rcv_headers_interface_s.currval INTO v_e FROM dual ;
21 SELECT rcv_interface_groups_s.currval INTO v_f FROM dual;
22 SELECT rcv_transactions_interface_s.nextval INTO v_g FROM dual;
23 BEGIN
24 INSERT INTO rcv_headers_interface
25 (
26 HEADER_INTERFACE_ID,
27 GROUP_ID,
28 PROCESSING_STATUS_CODE,
29 RECEIPT_SOURCE_CODE,
30 TRANSACTION_TYPE,
31 AUTO_TRANSACT_CODE,
32 LAST_UPDATE_DATE,
33 LAST_UPDATE_LOGIN,
34 LAST_UPDATED_BY,
35 CREATION_DATE,
36 CREATED_BY,
37 VALIDATION_FLAG,
38 COMMENTS,
39 SHIPMENT_NUM,
40 FROM_ORGANIZATION_ID,
41 SHIP_TO_ORGANIZATION_ID,
42 EXPECTED_RECEIPT_DATE
43 --RECEIPT_HEADER_ID
44 )
45 VALUES
46 (v_a, --Header Interface ID
47 v_b, --Group ID
48 'PENDING', --Processing Status Code
49 'INVENTORY', --Receipt source Code
50 'RECEIVE', --Transaction Type
51 'DELIVER' , --AUT Transact Code
52 sysdate, --last update date
53 1053, --last updated by
54 1053, --Last Update Login
55 sysdate, --creation date
56 1053, --created by
57 'Y', --Validation Flag
58 'Receiving Through Interface', --Comments
59 'NOV1124' , --Shipment Number
60 81, --From Org
61 82, --To org
62 sysdate --Expected Receipt Date
63 );
64 END;
65 BEGIN
66 FOR crec IN rcv_interface_cur loop
67 INSERT INTO rcv_transactions_interface
68 (
69 HEADER_INTERFACE_ID,
70 GROUP_ID,
71 INTERFACE_TRANSACTION_ID,
72 TRANSACTION_TYPE,
73 TRANSACTION_DATE,
74 PROCESSING_STATUS_CODE,
75 PROCESSING_MODE_CODE,
76 TRANSACTION_STATUS_CODE,
77 CATEGORY_ID,
78 QUANTITY,
79 LAST_UPDATE_DATE,
80 LAST_UPDATED_BY,
81 CREATION_DATE,
82 CREATED_BY,
83 RECEIPT_SOURCE_CODE,
84 DESTINATION_TYPE_CODE,
85 AUTO_TRANSACT_CODE,
86 SOURCE_DOCUMENT_CODE,
87 UNIT_OF_MEASURE,
88 INTERFACE_SOURCE_CODE,
89 ITEM_ID,
90 --ITEM_DESCRIPTION,
91 UOM_CODE,
92 EMPLOYEE_ID,
93 SHIPMENT_HEADER_ID,
94 TO_ORGANIZATION_ID,
95 SUBINVENTORY,
96 FROM_ORGANIZATION_ID,
97 FROM_SUBINVENTORY,
98 EXPECTED_RECEIPT_DATE,
99 SHIPPED_DATE,
100 VALIDATION_FLAG
101 )
102 VALUES
103 (v_e, --Header Interface ID
104 v_f, --Group ID
105 v_g, --Interface_transaction_id
106 'RECEIVE', --Transaction Type
107 sysdate, --Transaction Date
108 'PENDING', --Processing Status Code
109 'BATCH', --Processing Mode Code
110 'PENDING', --Transaction Status Code
111 120, --Category ID
112 2, --Quantity
113 sysdate, --last update date
114 1053, --last updated by
115 sysdate, --creation date
116 1053, --created by
117 'INVENTORY', --Receipt source Code
118 'INVENTORY', --Destination Type Code
119 'DELIVER' , --AUTO Transact Code
120 'INVENTORY', --Source Document Code
121 'Each', --Unit Of Measure
122 'RCV', --Interface Source Code
123 2492, --Item ID
124 --'ABBY KITCHEN CURTAIN SET BEIGE/BURGUNDY', --Item Description
125 'EA', --UOM COde
126 1053, --User
127 v_c, --Shipment Header ID
128 v_d, --SHipment Line ID
129 82, --To Organization ID
130 'Brooklyn', --Sub Inventory ID
131 81, --From Organization
132 'Vessel', --From Subinventory
133 sysdate, --Expected Receipt Date
134 sysdate, --Shipped Date
135 'Y' --Validation Flag
136 );
137 --END IF;
138 END LOOP;
139 END;
140* END xxc_lc_rcv_interface_prc;
SQL> /
Warning: Procedure created with compilation errors.
SQL> sho err
Errors for PROCEDURE XXC_LC_RCV_INTERFACE_PRC:
LINE/COL ERROR
14/2 PLS-00103: Encountered the symbol "SELECT" when expecting one of
the following:
begin function pragma procedure subtype type <an identifier>
<a double-quoted delimited-identifier> current cursor delete
exists prior
The symbol "begin" was substituted for "SELECT" to continue.
141/0 PLS-00103: Encountered the symbol "end-of-file" when expecting
one of the following:
( begin case declare end exception exit for goto if loop mod
null pragma raise return select update while with
<an identifier> <a double-quoted delimited-identifier>
<a bind variable> << continue close current delete fetch lock
insert open rollback savepoint set sql execute commit forall
merge pipe purgehi,
I have corrected your code
CREATE OR REPLACE PROCEDURE xxc_lc_rcv_interface_prc
IS
v_a NUMBER;
v_b NUMBER;
v_c NUMBER;
v_d NUMBER;
v_e NUMBER;
v_f NUMBER;
v_g NUMBER;
CURSOR rcv_interface_cur
IS
SELECT shipment_header_id
INTO v_c
FROM rcv_shipment_headers
WHERE shipment_num = 'NOV';
BEGIN
SELECT shipment_line_id
INTO v_d
FROM rcv_shipment_lines
WHERE shipment_header_id = v_c;
SELECT rcv_headers_interface_s.NEXTVAL
INTO v_a
FROM DUAL;
SELECT rcv_interface_group_s.NEXTVAL
INTO v_b
FROM DUAL;
SELECT rcv_headers_interface_s.CURRVAL
INTO v_e
FROM DUAL;
SELECT rcv_interface_groups_s.CURRVAL
INTO v_f
FROM DUAL;
SELECT rcv_transactions_interface_s.NEXTVAL
INTO v_g
FROM DUAL;
BEGIN
INSERT INTO rcv_headers_interface
(header_interface_id, GROUP_ID, processing_status_code,
receipt_source_code, transaction_type,
auto_transact_code, last_update_date, last_update_login,
last_updated_by, creation_date, created_by,
validation_flag, comments, shipment_num, from_organization_id, ship_to_organization_id, expected_receipt_date
--RECEIPT_HEADER_ID
VALUES (v_a, --Header Interface ID
v_b, --Group ID
'PENDING', --Processing Status Code
'INVENTORY', --Receipt source Code
'RECEIVE', --Transaction Type
'DELIVER', --AUT Transact Code
SYSDATE, --last update date
--, --last updated by
--, --Last Update Login
SYSDATE, --creation date
-- , --created by
'Y', --Validation Flag
'Receiving Through Interface', --Comments
'NOV', --Shipment Number
-- , --From Org
-- , --To org
SYSDATE --Expected Receipt Date
END;
BEGIN
FOR crec IN rcv_interface_cur
LOOP
INSERT INTO rcv_transactions_interface
(header_interface_id, GROUP_ID,
interface_transaction_id, transaction_type,
transaction_date, processing_status_code,
processing_mode_code, transaction_status_code,
category_id, quantity, last_update_date,
last_updated_by, creation_date, created_by,
receipt_source_code, destination_type_code,
auto_transact_code, source_document_code,
unit_of_measure, interface_source_code, item_id,
--ITEM_DESCRIPTION,
uom_code, employee_id, shipment_header_id, to_organization_id, subinventory, from_organization_id, from_subinventory, expected_receipt_date, shipped_date, validation_flag
VALUES (v_e, --Header Interface ID
v_f, --Group ID
v_g, --Interface_transaction_id
'RECEIVE', --Transaction Type
SYSDATE, --Transaction Date
'PENDING', --Processing Status Code
'BATCH', --Processing Mode Code
'PENDING', --Transaction Status Code
-- , --Category ID
-- , --Quantity
SYSDATE, --last update date
-- , --last updated by
SYSDATE, --creation date
-- , --created by
'INVENTORY', --Receipt source Code
'INVENTORY', --Destination Type Code
'DELIVER', --AUTO Transact Code
'INVENTORY',
--Source Document Code
'Each', --Unit Of Measure
'RCV', --Interface Source Code
-- , --Item ID
--'ABBY KITCHEN CURTAIN SET BEIGE/BURGUNDY', --Item Description
'EA', --UOM COde
-- , --User
v_c, --Shipment Header ID
v_d, --SHipment Line ID
-- , --To Organization ID
'Brooklyn', --Sub Inventory ID
-- , --From Organization
'Vessel', --From Subinventory
SYSDATE, --Expected Receipt Date
SYSDATE, --Shipped Date
'Y' --Validation Flag
--END IF;
END LOOP;
END;
END xxc_lc_rcv_interface_prc;
there are many syntax errors i have corrected .
Note : code is not compiled or tested .Thanks,
P Prakash
Edited by: prakash on Nov 21, 2011 4:00 AM -
In ECC 6 , I AM GETTING ERROR WHILE DECLARING DATA TYPE OF BAPI
HI,
IN ECC 6 , i AM GETTING ERROR" NO READ ACESS RETURN"
EVENTHOUGH I DECLARED DATA TYPE FOR EXAMPLE
DATA: RETURN TYPE BAPIRET2.AND USING IN RFC.
HOW TO CORRECT THE ERROR.
pLZ HELP ME.
REGARDS,
RANIHi Rani,
Could you please post the piece of coding where the error comes from? Maybe we can help you then.
Regards,
John. -
Error while declaring the internal table
Hi all,
I am trying to declare as following and I am getting the error
data: begin of test,
w_text(1000),
end of test.
data: i_test type standard table of test.Hello
types: begin of test,
w_text(1000),
end of test.
data: i_test type standard table of test. -
Error with declaring a method with array variable
Hi,
I had implemented this:
import java.awt.*;
import javax.swing.*;
public class Oefening1
public static void main(String args[])
int array[]= new int[10];
int getal;
JTextArea outputArea = new JTextArea();
Container container = getContentPane();
container.add(outputArea);
public void invoerRij(int array[10])
output +=" ";
for(int counter = 0; counter <10;counter++){
output +="Geef een getal in"+"\n"+array[counter]+"\n";
outputArea.setText(output);
I had comilated this code while the compiler gave errors like these:
A:\Oefening1.java:15: illegal start of expression
public void invoerRij(int array[10])
^
A:\Oefening1.java:24: ';' expected
^
A:\Oefening1.java:12: cannot resolve symbol
symbol : method getContentPane ()
location: class Oefening1
Container container = getContentPane();
^
3 errors
Tool completed with exit code 1
Now i have read my book and finded out that the declaration of a method always starts with public.
Can anyone halp me solving these probs? Thanks
Crazydj1The problem is that you didn't close the previous method definition.
Compiler error messages (in any language) often mistakenly report false errors on perfectly valid code immediately following the actual error.
When you post code on these forums, please wrap in in [code][/code] tags. -
Error must declare the scalar variable
por que me marca ese error una consulta?
DECLARE @feci AS datetime
DECLARE @fecf AS datetime
SET @FECI=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%0]')
SET @FECF=(SELECT DISTINCT(T0.DOCDATE) FROM ORTT T0 WHERE T0.DOCDATE='[%1]')
EXEC DBO.COMPARATIVO @FECI,@FECF
Edited by: mary merecias on Nov 17, 2011 3:15 PMel codigo no, son las variables. si pongo este código me marca que no tiene un select MUST SPECIFY TABLE TO SELECT FROM
Declare @fec1 as datetime
Declare @fec2 as datetime
SET @fec1=[%0]
SET @fec2=[%1]
SELECT DISTINCT(T0.itemcode),T0.itemname,T0.onhand,
(SELECT SUM(PCH1.linetotal) AS TOTAL
FROM OPCH
INNER JOIN pch1 on OPCH.docentry=PCH1.docentry
INNER JOIN OITM ON OITM.ITEMCODE=PCH1.ITEMCODE
WHERE pch1.targettype<>'19' and OITM.itemcode=T0.ITEMCODE AND OPCH.DOCDATE>=@FEC1 AND OPCH.DOCDATE<=@fec2)AS 'TOTAL COMPRAS',
(SELECT SUM(PCH1.QUANTITY) AS TOTAL
FROM OPCH
INNER JOIN pch1 on OPCH.docentry=PCH1.docentry
INNER JOIN OITM ON OITM.ITEMCODE=PCH1.ITEMCODE
WHERE pch1.targettype<>'19' and OITM.itemcode=T0.ITEMCODE AND OPCH.DOCDATE>=@fec1 AND OPCH.DOCDATE<=@fec2 ) AS 'PIEZAS COMPRADAS',
(SELECT SUM(INV1.linetotal) AS TOTAL
FROM OINV
INNER JOIN INV1 on OINV.docentry=INV1.docentry
INNER JOIN OITM ON OITM.ITEMCODE=INV1.ITEMCODE
WHERE INV1.targettype<>'14' and OITM.itemcode=T0.ITEMCODE AND OINV.DOCDATE>=@fec1 AND OINV.DOCDATE<=@fec2)AS 'TOTAL VENTAS',
(SELECT SUM(INV1.QUANTITY) AS TOTAL
FROM OINV
INNER JOIN INV1 on OINV.docentry=INV1.docentry
INNER JOIN OITM ON OITM.ITEMCODE=INV1.ITEMCODE
WHERE INV1.targettype<>'14' and OITM.itemcode=T0.ITEMCODE AND OINV.DOCDATE>=@fec1 AND OINV.DOCDATE<=@fec2 ) AS 'PIEZAS VENDIDAS'
FROM OITM T0
GROUP BY T0.itemcode,T0.itemname,T0.onhand
en SQL SERVER si funciona bien
Edited by: mary merecias on Nov 17, 2011 4:50 PM
Edited by: mary merecias on Nov 17, 2011 4:51 PM
Edited by: mary merecias on Nov 17, 2011 4:53 PM -
Error while declaring RT_PERSON using pnpce ldb
when am declaring
data : RT_PERSON like line of PC2RT_PERSON.
am getting an error msg that
"FIELD 'PC2RT_PERSON' is unknown .it is neither in the specified tables, nor in the DATA statement".
whatz the error .what should i do.
points will be rewarded.
thanks in advance.declare as :
data : RT_PERSON like PC2RT_PERSON. -
Static context error, nothing declared static, new instance isn't working
I'm trying to get the IP address of a user using my applet. Nothing in my code is declared static.
InetAddress IP = InetAddress.getAddress();I get non-static method getAddress cannot be referenced from a static context.
I just read on another post with someone having a similar but not identical problem and someone replied saying you need to create a new instance. So I tried this:
InetAddress IP = new InetAddress();
//IP.getAddress();With this, I get the error: InetAddress(); is not public in java.net.InetAddress; cannot be accessed from an outside package
What can I do? It's probably something simple.
If you need code just ask, there's just alot of code and it might take awhile to recreate it.I'm trying to get the IP address of a user using my
applet. Nothing in my code is declared static.
InetAddress IP = InetAddress.getAddress();I get non-static method getAddress cannot be
referenced from a static context.
I just read on another post with someone having a
similar but not identical problem and someone replied
saying you need to create a new instance. So I tried
this:
InetAddress IP = new InetAddress();
//IP.getAddress();With this, I get the error: InetAddress(); is not
public in java.net.InetAddress; cannot be accessed
from an outside package
What can I do? It's probably something simple.
If you need code just ask, there's just alot of code
and it might take awhile to recreate it.In your first try the method you attempted to use can only be used in an instant of an InetAddress ie. ip.getAddress(). Therefore the compiler thought you were trying to call a static method that was really an instance method. On your second try you used the contructor of InetAddress which isn't public, so you can't use it. To make an InetAddress use any of the static methods of the InetAddress, which can be found at http://java.sun.com/j2se/1.4.1/docs/api/java/net/InetAddress.html -
Forte C++:error: Multiple Declaration for std::exception
Hi,
I am trying to compile code written in C++ 4.2/solrais 2.6 with Forte 6 C++ compiler on Solaris 7. Getting the following error.
/opt/SUNWspro/WS6/include/CC/exception.h Line 17: Multiple Declaration for std::exception.
Tried running only the preprocessor using -E option and noticed from the output that both "exception" and "exception.h" contents included.
Any help!I got this same error and was able to fix it by eliminating
#include <math.h> in my code.
As it turned out this #include was not needed.
It then compiled in standard mode.
Hope this helps.
Maybe you are looking for
-
How can I transmit and receive messages using Vector CANTech CancardXL with LabVIEW?
I'm a new LabVIEW user and I need transmit and receive CAN messages using a CancardXL from Vector CANTech with LabVIEW. Could somebody have any vi or suggestion?
-
TS1591 iphoto recognises my iPhone but iTunes and finder don't see the device?
Folks, Iphoto autmatically detectgs my iphone 5s when i connect it to my imac. Howver, both finder and itunes don't see it as a device. If i sign into itunes store the device sees the apps currently on my phone but i can't access my songs to play. Am
-
Can't download anything bigger than 20MB on iPad2 3G.
How can you access apps, podcasts, iview etc if you can't download anything bigger than 20MB? It doesn't make sense!
-
Hi Gurus, Im getting the following message on the status bar while I load the data from the ODS to cube "No corresponding requests were found for request REQU_482YYA0AQ1PAHB4N1TA35H3UJ in the ODS/Cube" Please let me know the problem behind it. Thanks
-
I keep getting the "invalid sim" message on my phone. I did everything I could find online and finally reset my phone. Now I can't get my phone reset till I get it to recognize my sim. any advice?