Home » Developer & Programmer » JDeveloper, Java & XML » ORA-29542: class AccidentReport already defined by source AccidentReport (Oracle Database 11g Release 11.2.0.3.0)
ORA-29542: class AccidentReport already defined by source AccidentReport [message #635356] Fri, 27 March 2015 10:45 Go to next message
wtolentino
Messages: 309
Registered: March 2005
Senior Member
i am new to java and i inherited an application that is build in oracle forms and reports. when i attempt to recompile thru the PL/SQL Developer the java source named accidentreport i am getting the "ORA-29542: class AccidentReport already defined by source AccidentReport". there is no code change i just tried to recompile it. please advise. thanks -warren.

A lot of code here



[EDITED by LF: added [spoiler] tags]

[Updated on: Sat, 28 March 2015 15:00] by Moderator

Report message to a moderator

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635358 is a reply to message #635356] Fri, 27 March 2015 11:13 Go to previous messageGo to next message
Michel Cadot
Messages: 67290
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

First you should not name a variable with the same name than the class.
Try this and come back.

public class AccidentReport
Clob accidentReport = ((OracleResultSet)rset).getClob(2);

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635359 is a reply to message #635358] Fri, 27 March 2015 11:32 Go to previous messageGo to next message
wtolentino
Messages: 309
Registered: March 2005
Senior Member
thanks michel. it looks like all of the java sources codes that we have has the same variable and class. they works and not sure how it got successfully compiled previously.

e.g.
create or replace and compile java source named caserecord as
import java.util.*;

  public class CaseRecord
  {
     int     casePk;
     String  numPersonsTrans;
     String  numQualVehTires;
 ...


create or replace and compile java source named individualrecord as
//
// Modified  11/09/2004 LTS Added driverCondition
// Modified  06/14/2005 LTS Added ticketNumbers
//                          Added ticketViolations
//                          getName changed to Lastname, Firstname
//
import java.util.*;

public class IndividualRecord
{
 ...
Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635360 is a reply to message #635359] Fri, 27 March 2015 11:36 Go to previous messageGo to next message
Michel Cadot
Messages: 67290
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Just try it.

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635361 is a reply to message #635360] Fri, 27 March 2015 12:00 Go to previous messageGo to next message
wtolentino
Messages: 309
Registered: March 2005
Senior Member
i renamed it to AccidentReport2 and got this error cannot find symbol on this line 488.

Base64 myImage = new Base64();
Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635362 is a reply to message #635361] Fri, 27 March 2015 12:04 Go to previous messageGo to next message
Michel Cadot
Messages: 67290
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Please Use SQL*Plus and copy and paste your session.

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635363 is a reply to message #635362] Fri, 27 March 2015 12:12 Go to previous messageGo to next message
wtolentino
Messages: 309
Registered: March 2005
Senior Member

i tried using SQL*Plus it is giving me this error:

ORA-29536: badly formed source: Encountered "inVehRecord" at line 624, column 42.
Was expecting one of:
    "instanceof" ...
    ")" ...
    "<" ...
    "?" ...
    "==" ...
    "<=" ...
    ">=" ...
    "!=" ...
    "||" ...
    "&&" ...
    "++" ...
    "--" ...
    "+" ...
    "-" ...
    "*" ...
    "/" ...
    "&" ...
    "|" ...
    "^" ...
    "%" ...
    ">" ...
    "=" ...
    "*=" ...
    "/=" ...
    "%=" ...
    "+=" ...
    "-=" ...
    "<<=" ...
    ">>=" ...
    ">>>=" ...
    "&=" ...
    "^=" ...
    "|=" ...
    "<<" ...
    "." ...
    "[" ...
    "(" ...

SQL> 
Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635364 is a reply to message #635363] Fri, 27 March 2015 12:25 Go to previous messageGo to next message
Michel Cadot
Messages: 67290
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Michel Cadot wrote on Fri, 27 March 2015 18:04

Please Use SQL*Plus and copy and paste your session.

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635444 is a reply to message #635364] Mon, 30 March 2015 08:45 Go to previous messageGo to next message
wtolentino
Messages: 309
Registered: March 2005
Senior Member
our dba had tried to recompile using OEM tools and he can recompile.

i tried using SQL*Plus the code is too long and i can't paste the whole text. only this partial will let me see it from the screen.
Partial SQL*Plus output

thanks


[EDITED by LF: applied [spoiler] tags]

[Updated on: Mon, 30 March 2015 13:30] by Moderator

Report message to a moderator

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635466 is a reply to message #635444] Mon, 30 March 2015 13:29 Go to previous messageGo to next message
Littlefoot
Messages: 21579
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I can't help - hopefully, excerpt of the SQL*Plus session will be enough for someone else (Michel?) to assist. However, note that you could have spooled the whole SQL*Plus session into a TXT file so that you could post everything it contains.
Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635468 is a reply to message #635466] Mon, 30 March 2015 13:55 Go to previous messageGo to next message
Michel Cadot
Messages: 67290
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The partial output can't help.
Please attached 2 files:
- the script to create the procedure so we can test by ourselves.
- the complete spool file of your SQL*Plus session so we can see what you get. Before executing your script, please execute the following statement:
set linesize 250 trimout on trimspool on define off

The latter (define off) because I think you error comes from the "&&" which is interpreted by SQL*Plus.

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635470 is a reply to message #635468] Mon, 30 March 2015 14:55 Go to previous messageGo to next message
wtolentino
Messages: 309
Registered: March 2005
Senior Member
thank you all. the set define off appears to solve the problem. it compiled with this error:

SQL> show errors;
Errors for JAVA SOURCE "ACCIDENTREPORT2":

LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      ACCIDENTREPORT2:487: cannot find symbol
0/0      symbol  : class Base64
0/0      location: class accidentreport2
0/0      Base64 myImage = new Base64();
0/0      ^
0/0      ACCIDENTREPORT2:487: cannot find symbol
0/0      2 errors
0/0      location: class accidentreport2
0/0      Base64 myImage = new Base64();
0/0      ^
0/0      Note: ACCIDENTREPORT2 uses or overrides a deprecated API.

LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      Note: Recompile with -Xlint:deprecation for details.

[Updated on: Mon, 30 March 2015 14:58]

Report message to a moderator

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635511 is a reply to message #635470] Tue, 31 March 2015 05:40 Go to previous messageGo to next message
Michel Cadot
Messages: 67290
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

From your script, your java source is named "AccidentReport2" and your class is named "accidentreport2".
In Java character case matters.

Please, try to compile your code using Java compiler, outside Oracle.
Once you can do it outside Oracle then try to create the procedure in the database.
For the moment, the errors come from Java itself and not Oracle rdbms.

Re: ORA-29542: class AccidentReport already defined by source AccidentReport [message #635528 is a reply to message #635511] Tue, 31 March 2015 08:40 Go to previous message
wtolentino
Messages: 309
Registered: March 2005
Senior Member
it looks like when I enclosed the name in double quotes e.g. sms."AccidentReport2" that works with the case. i can see it as AccidentReport2 as it is. however the same errors "cannot find symbol" and "deprecated API" is still there. now that it is in the database when dba recompiled it thru the OEM there was no errors.
Previous Topic: VehicleRecord2:428: cannot find symbol
Next Topic: Getting error while using ExtractValue function.
Goto Forum:
  


Current Time: Sat Aug 08 10:49:50 CDT 2020