Error R6025 on add Line on Invoice Document - SAP DiApi - java

While integrating invoices into SAP in my Java application on Windows, I am having the following error "R6025 - Pure virtual function call".
However, my application runs on multiple clients in a single version and I have no problems with any of the clients, just this specific one!
During testing with the application in the client environment, I noticed that the error always happens when using the "add" to add the first line in the invoice.
invoiceV1.getLines().add(); // The error happens here!
System.out.println("THIS LINE NOT APPEARS ON CMD");
invoiceV1.getLines().setCurrentLine(lineNum);
............ SETTING LINE VALUES ..........
lineNum++;

As far as i know, you don't need to set the .add() on the first line. Try to put an if just to check if it is the first line or not.
If that doesn't work, you could consider an enviroment error? Or some instalattion problem?

Related

ESAPI not passing file validation

I am working with ESAPI to try and validate windows directory paths. For some reason, the part of my directory path named \14\ is getting converted into a CRLF. The error I am receiving is below, what am I not understanding correctly? I feel like my regex should be working.
WARN IntrusionDetector [SECURITY FAILURE Anonymous:null#unknown -> /project-test/IntrusionDetector] Invalid input: context=directoryPath, type(DirectoryName)=^[a-zA-Z0-9:/\\!##$%^&{}\[\]()_+\-=,.~'` ]{1,255}$, input=C:\UsersTESTUS~1AppDataLocalTempTestCase8002TempWorkSpace, orig=C:\Users\TESTUS~1\AppData\Local\Temp\14\TestCase8002TempWorkSpace
As you can see, I am using the regex:
^[a-zA-Z0-9:/\!##$%^&{}[]()_+-=,.~'` ]$
My input is:
C:\Users\TESTUS~1\AppData\Local\Temp\14\TestCase8002TempWorkSpace
Ouput, after ESAPI does canonicalization and validation:
C:\UsersTESTUS~1AppDataLocalTempTestCase8002TempWorkSpace
Here is the line of code that causes me to receive the error;
String validatedSourcePath = ESAPI.validator().getValidInput("directoryUnzip", directory, "DirectoryName", 255, false);
File validFile = new File(validatedSourcePath);
#C.Williams: I was about 30 minutes into writing up a detailed reply in an editor and accidentally excited my editor window. I'm too ticked off at my stupidity of not saving it to write it again, especially since I was only about 75% done.
However, if you want to email me I can arrange to talk to you via Google Hangouts or Signal to tell you want your problem is and how you can fix it. But it's long and complicated and partially related to a bug the ESAPI team just fixed but is not in any official release yet. But I am not going to take another 45 minutes or more trying to reply with any written text. My email address should be easy enough to find. Just google for my name and ESAPI. I am one of the project co-leaders on ESAPI.
-kevin wall

Deploying component using Services on OCM10gr3

I am trying to deploy the component on OCM 10gr3 using RIDC and the services i am using are
GET_COMPONENT_INSTALL_FORM
GET_MANIFEST_INFO
Following is the code that I am working with
idcClient = manager.createClient("http://localhost/idc/idcplg");
idcClient.getConfig().setProperty("http.library","apache4");
userPasswordContext = new IdcContext("username","password");
DataBinder dataBinder = idcClient.createBinder ();
dataBinder.putLocal("IdcService", "GET_COMPONENT_INSTALL_FORM");
dataBinder.putLocal("IDC_Id","idc");
dataBinder.putLocal("UserTempAuth","d://TestComponent.zip");
dataBinder.putLocal("File","ComponentZipFile");
dataBinder.putLocal("Submit"," Install ");
dataBinder.putLocal("IdcService","GET_MANIFEST_INFO");
dataBinder.putLocal("ComponentName","TestComponent");
dataBinder.putLocal("location","TestComponent/TestComponent.hda");
ServiceResponse response = idcClient.sendRequest (userPasswordContext, dataBinder);
DataBinder binderResult = response.getResponseAsBinder();
But i am still facing problems in deploying the component using this code, while debugging too, i did not faced any exception or errors.
So Can anyone guide me regarding what i should do next.
There are several problems in your code.
The first problem is that you trying to run two services in one call.
The second problem is that you aren't running the correct services. This last statement is hard for me to verify, since you are using a version that has been replaced a long time ago, but judging from the current version, your first service seems to be right. The name of the second service is UPLOAD_NEW_COMPONENT in 12c. The output from the first service call takes a few parameters from the first response - this might be irrelevant in your case though.

Amazon aws sdk AmazonEC2clientBuilder error

i am trying to develop an amazon EC2 Client using java in Eclipse. While reading the official documentation for setting up the region for my client(to launch instances programatically later) it is mentioned to use AmazonEC2ClientBuilder, but I am having difficulty in understanding its usage. Can anybody help me?
Source Code:
AmazonEC2 client=AmazonEC2ClientBuilder.standard().withCredentials(credentials).build();
client.AmazonEC2ClientBuilder.standard().setRegion("US-WEST2");
The first 2 Lines works Fine but Last one Doesn't. When I try to use set region function of AmazonEC2 ,there is a prompt that it is deprecated.
SDK:http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/ec2/AmazonEC2Client.html#builder--
Look at this first line of code:
client = AmazonEC2ClientBuilder.standard().withCredentials(credentials).build();
The variable client is an AmazonEC2Client object (you should have declared it as such higher up in your code). On the second line you are trying to call a method on the AmazonEC2Client object. You aren't using the AmazonEC2ClientBuilder anymore. You've already built your client object in the first line of code, and now you want to call a method on that object in the next line, like so:
client.setRegion("US-WEST2");
However that method is deprecated and it is recommended you call the setRegion method on the AmazonEC2ClientBuilder instead. So you would remove the second line entirely, and change the first line to this:
client = AmazonEC2ClientBuilder.standard()
.withCredentials(credentials)
.withRegion(Regions.US_WEST_2)
.build();

Java exception error during RJDBC::dbConnect: how to silently ignore?

I am trying to connect to a SAS-driven remote database from within R, using RJDBC. The first time I do a dbConnect, I get an error:
Error in .jcall(drv#jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],
: java.lang.NoClassDefFoundError: com/sas/net/crypto/CryptoException
When I do the dbConnect a second time after the first call, it connects fine, and I get back an object of class JDBCConnection.
I looked in the sas.core.jar file (from the latest 94M2 SAS JDBC drivers), and can see CryptoException listed in there. However, I am also curious why it was trying to throw a CryptoException.
Question 1: How can I silently ignore the error on the first dbConnect call?
Question 2: Why was it trying to throw a CryptoException? What can I do to prevent this? (This may cancel question 1.)
This is the same question as shared on the SAS Support Communities page:
https://communities.sas.com/thread/80620
There you shared the code you are using
https://github.com/wthielen/wrds/blob/7edfbfe89ddc329618be72e591cc0bd50e294ea4/R/wrds.R#L47
In this code, the problem appears to be that you are trying to set the classpath before initializing the JVM. Using .jinit() before the call to .jaddClassPath should correct the issue. In the doc for .jinit and since you are developing a package, you may want to use .jpackage instead of .jinit
https://www.rforge.net/doc/packages/rJava/jpackage.html
I was having the same problems and tried the above solutions with no change.
The solution on my computer was modifying the .Renviron file which holds the classpath to the java drivers. Replacing "JDBC_Drivers" with "WRDS_Drivers" was all that was needed:
CLASSPATH="C:/Users/nicol/Documents/WRDS_Drivers/sas.core.jar;C:/Users/nicol/Documents/WRDS_Drivers/sas.intrnet.javatools.jar"

ProgramCallDocument connecting to AS400 from Groovy Hangs

This question is specifically related to the JT400 class ProgramCallDocument, with it's method callProgram(String ProgramName)
I've tried wapping the call in a try/catch - but it's not throwing an exception, the debugger goes into the callProgram method, and just sits there indefinitely.
A small amount of specific information about the API is available here:
http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.toolbox.doc/rzahhxpcmlusing.htm
Here's the code that I'm running:
AS400 as400System = AS400Factory.getAS400System()
ProgramCallDocument programCallDocument = new ProgramCallDocument(as400System, "com.sample.xpcml.Sample.xpcml")
programCallDocument.setStringValue("sampleProgramName.value", sampleValue)
Boolean didProgramCallDocumentRunSuccessfullyOnTheAS400 = programCallDocument.callProgram("sampleProgramName")
The last line of that snippet is the one that just sits there. I left out the try/catch for brevity.
The XPCML file that the ProgramCallDocument constructor uses is just a proprietary XML format that IBM uses for specifying the parameter lengths and types for a program call. I can come back and add it in if it would be helpful, but the ProgramCallDocument constructor runs validation on the XML, and it didn't come up with any validation errors. I'm not familiar with JT400, or how it does Program Calls, so any assistance would be wonderful.
As a further note, doing some more digging on a related issue today I also found this SO post:
Monitor and handle MSGW messages on a job on an IBM i-series (AS/400) from Java
I think it's relevant to this question, because it's about ways to trap MSGW status on the Java/Groovy side.
It's very likely the called program went into a MSGW status (error).
Check WRKACTJOB JOB(QZRCSRVS) to find the program call job and see the status as well as review the job log.
It may be easier to call a native program using the CommandCall class or as a JDBC stored procedure.
Here's an example of the CommandCall usage in Groovy:
sys = AS400Factory.AS400System
cmd = new CommandCall(sys)
if (!cmd.run "CALL MYLIB.MYPGM PARM('${sampleValue}')") {
println cmd.messageList
}

Categories

Resources