I am trying to re-compile one of the .Java file in Oracle 11g and I am getting the below error:
$ . /dboracle/orabase/product/11.2.0.BTSP8/bin/loadjava -verbose -resolve -synonym -user nm/nm -grant PUBLIC DeviceAttribParserConstants.java
arguments: '-user' 'nm/***' '-verbose' '-resolve' '-synonym' '-grant' 'PUBLIC' ' DeviceAttribParserConstants.java'
creating : source com/bt/nmsloader/model/DeviceAttribParserConstants
loading : source com/bt/nmsloader/model/DeviceAttribParserConstants
Error while creating source com/bt/nmsloader/model/DeviceAttribParserConstants
ORA-29542: class com/bt/nmsloader/model/DeviceAttribParserConstants already defined by source DeviceAttribParserConstants/java
ORA-06512: at line 1
The following operations failed
source com/bt/nmsloader/model/DeviceAttribParserConstants: creation (createFailed)
exiting : Failures occurred during processing
When I have looked in the ALL_Objects meta-dictionary I did not found JAVA SOURCE but can only see JAVA CLASS for DeviceAttribParserConstants.
Now when I am trying to recompile then I am getting above error and if I am dropping the same JAVA class file then I am getting error as below:
ORA-29537: class or resource cannot be created or dropped directly.
ORA-06512: at line1
* Cause: An attempt was made to create or drop JAVA class or resources that is a known result from compilation of an existing JAVA Source object.
I am stuck. Can someone help me in resolving this error.
Many thanks in advance.
Regards,
Himmy Chauhan
Can we delete records from Meta Dictionary
You shouldn't as it is likely to corrupt your database.
Now when I am trying to recompile then I am getting above error and if I am dropping the same JAVA class file then I am getting error as below:
ORA-29537: class or resource cannot be created or dropped directly.
ORA-06512: at line1
* Cause: An attempt was made to create or drop JAVA class or resources that is a known result from compilation of an existing JAVA Source object.
The loadjava utility has a force option:
-force Forces files to be loaded, even if they match digest table entries.
So you can try:
loadjava -verbose -force -resolve -synonym -user nm/nm -grant PUBLIC DeviceAttribParserConstants.java
You can also try to drop the existing java object:
SELECT OWNER, OBJECT_NAME
FROM ALL_OBJECTS
WHERE OWNER = 'NM'
AND OBJECT_NAME LIKE '%DeviceAttribParserConstants';
DROP JAVA CLASS NM.<insert_object_name>
and then try using loadjava without the force option.
(You may want to try backing up the existing class file before you drop/overwrite it just in case you need to revert to the prior version.)
Related
I have 2 JAR files coming from an SDK that I have to use.
Generation problem
I succeeded in generating the first .pas file, but Java2OP fails to generate the second .pas I need, with the message
Access violation at address 0042AF4A dans the 'Java2OP.exe' module. Read at address 09D00000
Would this come from a common issue? There's no other hints about what causes the problem in the SDK .jar.
I'm using Java2OP located in C:\Program Files (x86)\Embarcadero\Studio\18.0\bin\converters\java2op, but I had to first use the solutions in Delphi 10.1 Berlin - Java2OP: class or interface expected before generating the 1st file.
Compilation problem
Anyway, I tried to generate a .hpp file from the generated .pas.
I don't know much about Delphi. Does the problem come from the SDK itself, or the generation of the .pas file?
1st issue solved
Java2OP included Androidapi.JNI.Java.Util
and not Androidapi.JNI.JavaUtil. I had to import Androidapi.JNI.JavaUtil myself, though it is present in the /Program Files(x86)/Embarcadero/... folders.
2nd issue
The same 4 compilation errors happen multiple times across the .pas file on parts using the word this.
Do I have to replace every use of this with self?
Errors
E2023 The function require a type of result : Line 4
E2147 The property 'this' doesn't exist in the base class : Line 5
E2029 ',' or ':' awaited but found 'read' identificator : Line 5
E2029 ',' or ':' awaited but found number : Line 5
[JavaSignature('com/hsm/barcode/DecoderConfigValues$SymbologyFlags')]
JDecoderConfigValues_SymbologyFlags = interface(JObject)
['{BCF30FD2-B650-433C-8A4E-8B638A508487}']
function _Getthis$0: JDecoderConfigValues; cdecl;
property this$0: JDecoderConfigValues read _Getthis$0;
end;
[JavaSignature('com/hsm/barcode/ExposureValues$ExposureSettingsMinMax')]
JExposureValues_ExposureSettingsMinMax = interface(JObject)
['{A576F85F-A021-475C-9741-06D92DBC205F}']
function _Getthis$0: JExposureValues; cdecl;
property this$0: JExposureValues read _Getthis$0;
end;
I have created Java.sqlj program and done with creating packages and jar, when attempting to call the procedure, facing the error like
ATTEMPTING TO LOAD JAVA CLASS s1.S1Sal FROM JAR COEDB.S1SAL
Here s1.S1Sal - Where s1 is the package name and S1Sal is class name and it's defined in the java program.
Error
Run: SYSPROC.S1NUM(DECIMAL(4, 0))
{call SYSPROC.S1NUM(?)}
USER-DEFINED ROUTINE SYSPROC.S1NUM ENCOUNTERED AN EXCEPTION ATTEMPTING TO LOAD JAVA CLASS s1.S1Sal FROM JAR COEDB.S1SAL. ORIGINAL EXCEPTION: (none). SQLCODE=-20212, SQLSTATE=46103, DRIVER=4.22.29
Run of routine failed.
- Roll back completed successfully.
I'm using the following code in post-build step of my Jenkins job:
evaluate(new File("Set-BuildBadge.groovy"));
So it runs a script successfully if it does not contain functions.
If inside the script I define a function for example:
def addSummaryWithText(Icon, Text) {
manager.createSummary(Icon).appendText(Text, false)
}
...
addSummaryWithText("installer.gif", "Project: " + ProjectName)
then I get the following error:
FATAL: Illegal class name "Set-BuildBadge$addSummaryWithText" in class
file Set-BuildBadge$addSummaryWithText java.lang.ClassFormatError:
Illegal class name "Set-BuildBadge$addSummaryWithText" in class file
Set-BuildBadge$addSummaryWithText at
java.lang.ClassLoader.defineClass1(Native Method) ...
I'm not getting how GroovyShell.evaluate works.
Can anyone help me?
Looks like the JVM doesn't like class names with a hyphen in them.
By calling your script Set-BuildBadge.groovy internally it is compiled into a class that isn't allowed when you add a function to the script.
Changing the name of the script to SetBuildBadge.groovy will fix it :-)
I am getting an error for below batch file.
cls
set classpath=C:\Program^ Files\salesforce.com\Data^ Loader\dataloader-29.0.0-uber.jar
set mainclass=com.salesforce.dataloader.process.ProcessRunner
set confdir=C:\Program^ Files\salesforce.com\Data^ Loader\Bkp\
if [%1]==[] goto error
call java -cp %classpath% -Dsalesforce.config.dir=%confdir% %mainclass% process.name=Product_vod__c sfdc.extractionSOQL="SELECT
Id,name FROM Product_vod__c where Id in %1"
goto end
:error
echo Error: missing date argument (must be in 'yyyy-mm-ddThh:mm:ssZ' format)
:end
Error
Could not find or load main class Files\salesforce.com\Data
Can someone please let me know the issue?
Thanks
You've got an unescaped Program Files somewhere in your classpath and its space breaks the classpath argument : the classpath stops at Program and java parses the following Files\salesforce.com\Data as the class it should execute.
You should enclose classpath fragments containing spaces with double-quotes.
I want to use synonyms () described in 'Intro to the tm package' for R. It uses the wordnet package. The wordnet package downloaded from CRAN does not have Dict (dictionary) in its directory. I downloaded it from the Princeton site and copied it over to the directory. After using sys.setenv() and setDict() for setting paths, I still get this error:
Error in sort(unique(unlist(lapply(synsets, getWord))))
error in evaluating the argument 'x' in selecting a method for function 'sort': Error in unique(unlist(lapply(synsets, getWord))) :
error in evaluating the argument 'x' in selecting a method for function 'unique': Error in .jcall(synset, "Ljava/util/List;", "getWord") :
java.lang.NumberFormatException: For input string: "t"
when I try synonyms("company", pos = "NOUN") or another English word in place of 'company'. The problem is in getSynonyms() called from synonyms(). Any idea on how to fix this problem?
Different combinations lead to different input string NumberFormatException. My Java is version 1.8. I tried all the online resources. I added two paths to PATH for R's bin and RJava's jri. Discussion on the exception indicates it is a string to numeric conversion issue. I have made sure that Java to R linkage (via rJava) works (URL: https://www.rforge.net/rJava/ ).