I am new to ADF. Please help. Pasting a snippet of my code:-
I am unable to print a new line message with \n.
<af:message id="errMessage" message="#{backingBeanScope.ta_del_entUiBean.errorMessage}" messageType="error"
visible="#{backingBeanScope.ta_del_entUiBean.error}"/>
public String getErrorMessage()
{
return message;
}
message contains a String this way, say : The following error have occurred. \n 1. Null ponter exception. \n 2. ODBC Exception \n. 3. JDBC Exception
The output is .
The following error have occurred. 1. Null ponter exception. 2. ODBC Exception . 3. JDBC Exception
How do I make it appear as
The following error have occurred.
1. Null ponter exception.
2. ODBC Exception
3. JDBC Exception
Thanks a lot for the help. The Java Platform version is 1.7.0_51 and the `Jdev` version is 12.1.3.0
I had the same issue. But our client was using IE browser. It works well in IE browser.
The problem with the af:message or af:messages components is that they firstly get rendered on the page, and after that, the content will be attached. That's why when you insert a text containing special characters like "\n" or "\r" they will be printed as they are (actually, they are know only to the compiler who knows how to parse them, but remember, you are using an ADF faces component, not the standard output like in the case of System.out.println() ).
With this in mind, it should be clear that you have to instruct the browser how to print the content. How? Easy, just by inserting HTML tags inside your message body. In your case, the message String should be:
<html><body>
The following error have occurred.<br/>
1. Null ponter exception.<br/>
2. ODBC Exception<br/>
3. JDBC Exception<br/>
</body></html>
Or you can enclose the lines within a paragraph tag instead ( < p > ).
Related
I have socket listen on Dart, that receives messages from server (written on C).
Client (Dart):
(Uint8List data) async {
Future.delayed(const Duration(seconds: 1));
String serverResponse = String.fromCharCodes(data);
globals.progressEvent = double.parse(serverResponse));
}
Server(C):
send(client_fd, "90", BUFFER_LENGTH, 0);
When run it, I see an exception "Unhandled Exception: FormatException: Invalid double"
it fails on line "double.parse(serverResponse))"
What can be the reason?
Check String parser
As the commenter suggested, I'd recommend checking whether the String you get in Dart corresponds to what the server sends. Have you tried printing it to take a look?
Additionally, I'd generally advise you to use double.tryparse, which will not throw an exception, but instead return null when parsing fails. You can then see if it's null, and if so print some debugging information.
Encoding
I'm not too familiar with how Dart handles binary data, but to me it looks like you use 1 byte for each character (UTF-8), whereas Dart's fromCharCodes seems to conventionally use the UTF-16 format, with 2 bytes per character. When trying to parse your 9 and 0 together, I guess it gets a non-numeric value, causing the parser to faill. https://api.flutter.dev/flutter/dart-core/String/String.fromCharCodes.html
I have noticed that when I pass a (valid) CREATE FUNCTION statement to TSqlParser my listener receives a call to EnterCreate_or_alter_procedure()
I am using the latest versions of TSqlLexer.g4 & TSqlParser.g4.
My output also shows
Exception thrown: 'Antlr4.Runtime.InputMismatchException' in Antlr4.Runtime.dll
line 1:7 mismatched input 'FUNCTION' expecting {'OR', 'PROC', 'PROCEDURE'}
What could be causing this?
I found the issue.
It was a copy-paste error from a previous project in which I was only interested in Stored Procedures, hence, I was passing a StoredProcedure context to the walker, not batch().
I'm following the following kdb+tick demo: DEMO
There does not seem to be any error when I launch run.bat but all the q instances in the different cmd windows seem to be stuck.
Namely, the q) command does not show up, so after the process has displayed the q.q message, the cursor is blinking on an empty line. Therefore, I am unable to execute any queries.
The only window that does show something is ticker.bat which shows (after q.q message):
k){ON!x y}
'<
#
"q"
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://ww..
q))
Why can't I use the other processes? How do I resolve this?
That error in ticker.bat is the process attempting to execute an html file as code. Check what arguments are in ticker.bat then check that source file. I think you'll find you've download html instead of the raw text version.
Somewhere in my code, I have this line:
return _store.OpenFile(path, fileMode);
With fileMode being sometimes FileMode.Create and sometimes FileMode.Open.
Everything works well, I always get a valid stream and if necessary, the file is correctly created.
But, I've just discovered in my VS output that I have the following message every time I call the method where the above line is:
A first chance exception of type 'System.IO.FileNotFoundException'
occurred in mscorlib.dll
I get this error when the file is created and I also get this error when the file is overwritten (and obviously exists).
I'm just curious about these errors since everything works perfectly.
Thanks,
EDIT: Same thing with new IsolatedStorageFileStream(...). Everything works fine but I still get the "first chance exception" message.
var isf = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream isfs;
if (!isf.FileExists(_filename))
isfs = new IsolatedStorageFileStream(_filename, System.IO.FileMode.Create, isf);
else
isfs = new IsolatedStorageFileStream(_filename, System.IO.FileMode.Open, isf);
var writer = XmlWriter.Create(isfs);
xml.Save(writer);
writer.Close();
isfs.Close();
isfs.Dispose();
isf.Dispose();
Found the answer.
It's just how VS debugger works: for every exception caught by a {{catch}} block, a "first chance exception" message appears in the VS output.
So here, we can guess that, internally, the {{OpenFile}} method uses a try/catch block to check if the file exists.
I have an application developed using visual studio 2010 under C.
When I run my application,everything appears fine until it arrives to :
while ((row = mysql_fetch_row(result))) {
t[k] = atof(row[num_fields - 1]);
k++;
}
The select query doesn't have any problem. An exception message appears:
An unhandled win32 exception has occurred in ...
I read some articles which tell that this is a problem of deallocating the memory.
I have added:
mysql_free_result(result);
free(t);
But nothing changed. Please help.
Thank you.
First of all, better you can do is running with a debugger.
Once that was said, I can see some things which can produce an exception:
What happens if num_fields==0? You'd get an exception in row array
Check that row is correctly set by mysql_fetch_row before executing atof. For example, I would separate the same code in several rows with some checks.