What does Oracle-apex SyntaxError : unexpected token means? - sql

So I'm using the Apex office print (AOP) plugin for printing the reports from Oracle Apex. After I created a process which prints the document by clicking the button, there is an error:
"Error: SyntaxError: Unexpected token % in JSON at position 0".
Does anybody know what is the problem?

It's usually a hint that some JSON is malformed
You should consider the information presented by the AOP team on this particular error, and compare that with your situation.
https://www.apexofficeprint.com/docs/index.html#1012-syntaxerror-unexpected-token-p-in-json-at-position-0

If you are using APEX 5.1 or above, the Dynamic Action plug-in will always work, whereas the Process plug-in might give this JSON error.
The AOP process in the Processing part will only work if the “Reload on Submit” attribute (of the page) is set to “Always”. Since APEX 5.1 and above that attribute is set to “Only for Success” and then the process plug-in is not working.
Alternative you can put the AOP Process to be After Header, and make it conditional than it will work regardless of the setting of "Reload on Submit".
We recommend using the AOP dynamic action.

Related

Salesforce Soap API on VB .NET: Attribute cannot be applied multiple times

I'm using Visual Studio 2019 to make a VB .NET to make a WPF application for windows. I'm trying to use the Salesforce SOAP api to grab data from it. In the solution explorer I right click on my project -> Add -> Service Reference -> advanced -> add web reference. I put in the link to the enterprise WSDL file I downloaded from Salesforce. In my project I have a simple test button setup that runs this to try and login:
Dim SFService = New SFAPI.SforceService
Dim loginResult = New SFAPI.LoginResult
loginResult = SFService.login(userID, userPass)
My issue is that I get some errors stating that the autogenerated References.vb has errors and they are as follows:
Error BC30663 Attribute 'GeneratedCodeAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'SerializableAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'DebuggerStepThroughAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'DesignerCategoryAttribute' cannot be applied multiple times.
Error BC30663 Attribute 'XmlTypeAttribute' cannot be applied multiple times.
Warning Custom tool warning: Schema could not be validated. Class generation may fail or may produce incorrect results
Warning Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.
Warning Custom tool warning: Schema validation error: Schema item 'simpleType' named 'FaultCode' from namespace 'urn:fault.enterprise.soap.sforce.com' is invalid. The Enumeration constraining facet is invalid - 'fns' is an undeclared prefix.
Any help would be greatly appreciated. Thank you!!
In cases where you get errors related to an attribute being applied twice, this usually means that there is a duplicate vb file somewhere. Best thing to do is to hit the icon in your solution explorer to show all files: . There's probably a file being hidden/causing a duplicate here.
Ultimately, there's duplicate attributes being seen by the compiler, which is a failure, unless you specifically allow duplicate attributes.

How can I display exception messages from custom functoid errors in the BizTalk Administration Console?

My goal is to influence the error descriptions that appear in BizTalk Administration Console in the Error Information tab of suspended instance windows, after errors occur in my custom functoids. If possible, I would also like the ErrorReport.Description promoted property to display this error description on the failed message.
I've read everything I can find about custom functoid development, but I can't find much about error handling within them. In particular, whenever my functoids throw exceptions, I see the boilerplate "Exception has been thrown at the target of an invocation" message that occurs whenever exceptions occur through reflection, rather than the message on the exception itself.
I had hoped to find something within the BaseFunctoid class framework that would allow me to submit an error string, so as to traverse the reflection boundary. Is there some way to pass error information from within a custom functoid, such that the BizTalk Administration Console will display it?
If I emulate the approach taken by DatabaseLookupFunctoid and DatabaseErrorExtractFunctoid, is there some way I can fail the map with the extracted error, rather than mapping it to a field on the destination schema as is shown in its examples?
The simplest way to do this is using custom C#, writing something like this in your code:
System.Diagnostics.EventLog.WriteEntry("EVENT_LOG_SOURCE", "Error message...", System.Diagnostics.EventLogEntryType.Error);
As Johns-305 mentions, you need to make sure your event source is registered (e.g. System.Diagnostics.EventLog.CreateEventSource("EVENT_LOG_SOURCE", "Application") - but this should really be done as part of your installation steps with an EventLogInstaller or some kind of script to set up the environment). It's certainly true that error handling in BizTalk is just .NET error handling, but one thing to keep in mind is that maps are actually executing as XSLT, and the context in which their executing can have a major impact on how exceptions and errors will be handled, particularly unhandled exceptions.
Orchestrations
If you're executing a transform in an orchestration that has exception handling in it, the exception thrown will be handled and may even fall into additional logging you have in the orchestration - in other words, executing a throw from a C# functiod will work the way you'd think it would work elsewhere in C#. However, I try to avoid this since you never know if a map will at some point be used else where and because exception handling in XSLT doesn't always work the way you'd think (see below).
Send/Receive Ports
Unfortunately, if you're executing a map on a send or receive port and throw an exception within it, you will almost definitely get very unhelpful error message in the event log and a suspended instance in the group hub. There is no easy, straightforward way to simple "cancel" a transform - XSLT 1.0 doesn't have any specified way of doing that (see for example Throwing an exception from XSLT). That leaves you with outputting an error string to a particular node in the output (and/or to the EventLog), or writing lots of completely custom XSLT to try to validate input, or designing your schemas properly and using a validating component where necessary. For example, if you have a node that must match a particular regex, or should never be empty, or should never repeat more than X times, make sure you set those restrictions on the schema and then make sure you pass it through the XmlValidator or similar before attempting to map.
The simplest answer is, you just do.
Keep in mind, there is nothing special at all about error handling in BizTalk apps, it's just regular plain old .Net error handling.
So, what you do is catch the error in you code, write the details to the Windows Event Log (be sure to create a custom Event Source) and...that's it. That is all I do. I don't worry about what appear in BT Admin specifically.strong text

Running Jasper report in Jdeveloper ORA-00904 is thrown

I have an issue that is quite simply driving me nuts...
I am running JDeveloper 11.1.2.1.0, I am also running Jasper Reports 4.5. I have a class that contains several methods. Each of which runs a seprate Jasper report made with iReport.
I am also testing this in the Intergrated WLS.
When a user click a button it runs said report, works great if only calling one report. As soon as I try and call 2 or more reports the first report will work but all other throw this error:
java.sql.SQLSyntaxErrorException ORA-00904: "ID" : invalid identifer
Example
public String button () thorws ClassNotFoundException, Exception
{
Reports runReport = new Reports ();
runReport.FirstReport;
runReport.SecondReport;
...
...
}
Not sure where to trace this error to, as each method in class Reports runs fine when only ran by itself.
Well, Your code sample do not show what you do. It's not even correct java syntax.
The stack trace you get should have more information (e.g. the while query) which you should sahre.
Google for the error message and you find hints like this:
Intermittent ORA-00904: : invalid identifier
that point to possible RDBMS issues. Looking up thebugs mentioned in the thread it seems databases versions earlier than 10.2 are impacted if you reconnect to different schemas with similar objects. Not sure this is your case due to a lack of information in your question.
Frank

Java Server Side Error message validation without actually submitting an application

I am trying to create a testing application to validate server side error messages. Right now our framework is such that each time a incorrect value is entered in a field and the submit button is clicked and on submission, the error message displayed on the page is captured.
Is there anyway I can bypass this technique, such that the validation happens only in the server side and is passed back to the client side, without having to reload the page each time.
Any other ideas would be much appreciated. Please try to ignore the lameness of the question :( I'm just starting off and wanted to try something new to reduce the time taken to capture the error messages.
Thanks a lot..!!
Use AJAX, Luke!
There are a lot of options to do this. You may use jQuery.ajax for sending your form data to some validation servlet. Or you may use JSF for it. It largely depends on your framework and/or architecture of your application.

Proper way to check system requirements for a WordPress plugin

I am curious about the proper way to stop a user from activating my plugin if their system does not meet certain requirements. Doing the checks is easy and I don't need any help with that, I am more curious how to tell WordPress to exit and display an error message.
Currently I have tried both exit($error_message) and die($error_message) in the activation hook method. While my message is displayed and the plugin is not activated, a message saying Fatal Error is also displayed (see image below).
Does anyone know of a better way, that would display my message in a proper error box without displaying Fatal error, it just looks really bad for new users to see that.
Thanks for any help in advance.
This is a little undocumented, as you might have noticed. Instead of die(), do it like this:
$plugin = dirname(__FILE__) . '/functions.php';
deactivate_plugins($plugin);
wp_die('<p>The <strong>X</strong> plugin requires version WordPress 2.8 or greater.</p>','Plugin Activation Error',array('response'=>200,'back_link'=>TRUE));
The lines above wp_die() are to deactivate this plugin. Note that we use functions.php in this case because that's where I have my Plugin Name meta data comment declaration -- and if you use a different file, then change the code above. Note that the path is very specific for a match. So, if you want to see what your path would normally be, use print_r(get_option('active_plugins'));die(); to dump that out so that you know what path you need. Since I had a plugin_code.php where the rest of my plugin code was, and since it was in the same directory as functions.php, I merely had to do dirname(__FILE__) for the proper path.
Note that the end of the wp_die() statement is important because it provides a backlink and prevents an error 500 (which is the default Apache code for wp_die()).
It is only a idea though. Try checking the wordpress version and compare then use php to through custom exception/error. PHP 5.0 try catch can be a good way to do it. Here is some resources.
http://www.w3schools.com/php/php_exception.asp
http://php.net/manual/en/internals2.opcodes.throw.php
You can try the first link. It is pretty basic. Thanks! hope the information will be helpful.