Hi Alejandro!

Thanks for your kind response.
I've done the change that you indicated and worked very well!

I've created an issue in Jira (issue 6562 
[http://jira.opennms.org/browse/NMS-6562]), where your solution is attached, in 
order to facilitate the resolution.

Thanks again!
Vítor Rui Moreira

On 19/05/2014, 21:01, Alejandro Galue wrote:
Hello Vítor,

On May 14, 2014, at 11:07 AM, Vítor Rui Moreira 
<mkw_vmore...@brisa.pt<mailto:mkw_vmore...@brisa.pt>> wrote:

I don't know if it's the correct mailing list to ask this but it's code
related.

I've got several issues in "Notice List" in webapp: the notifications
are displayed incorrectly (my notifications are HTML-based). After
seeing the database and logs from "notifd.log", I saw quote a
difference: in DB, the text was truncated at 4000 chars but in the log,
the text wasn't truncated. The DB, in table "notifications", column
"textmsg" is "text", with size 2147483647.

So, I thought the problem was when writing the notification to the DB.
After inspecting class "OnmsNotification", the "getTextMsg()" method is
annotated with "@Column(length=4000)".

I'm using ONMS 1.8.17 in production, 1.12.5 in development. In both
versions, the annotation exists.

Finally, the question: is there a reason to add this constraint
"@Column(length=4000)" to the method?

Sorry about my english... :-)

The length of @Column annotation is used by Hibernate to create the schema, it 
is not used to limit the content of a specific column. For that purpose there 
is another annotation called @Limit.

The thing is that the code that create the notifications doesn't use 
NotificationsDao because that is one of the oldest part of the code, and it is 
pure JDBC.

The problem is related with the method: 
org.opennms.netmgt.config.NotificationManager.insertNotice(int, Map<String, 
String>, String, Notification):

https://github.com/OpenNMS/opennms/blob/1.12/opennms-config/src/main/java/org/opennms/netmgt/config/NotificationManager.java

Inside its implementation(around line 778) you can see the 4000 characters 
limitation, so you've found a bug:

It should not be difficult to fix, but I suggest to at least open a Jira issue for 
this on jira.opennms.org<http://jira.opennms.org>

Alejandro.



------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs



________________________________

Declaração:
A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e 
confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o 
destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a 
mesma por engano, fica notificado que é estritamente proibido reproduzir, 
guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos. 
Por favor reencaminhe a mensagem para o responsável pelo seu envio ou 
contacte-nos por telefone e elimine a mensagem e ficheiros anexos do seu 
computador, sem os reproduzir.

Disclaimer:
The information contained in this message, and any files attached, is 
privileged and confidential, and intended exclusively for the included 
addresses. If you are not the intended recipient (or the person responsible for 
delivering to the intended recipient) and received this message by mistake, be 
aware that copy, storage, distribution or any other use of all or part of this 
message and the files attached is strictly prohibited. Please notify the sender 
by reply e-mail or contact us by telephone and delete this message and the 
files attached, without retaining a copy.
________________________________

_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to