CMDBuild Forum

Re: Bug: Attribute-Reference selection

Hello,

 

we found a serious bug in the selection of a reference attribute.

I give you an example setup to reconstruct the error.

 

The Setup:

- create two new classes -> A and B.

- create a relation between this two classes 1:N (A1 : BN)

- in the B class add an attribute, lets call it REL for the relationship to the A class

 

The Error:

- create a new object in the A class

- fill in code

---heres the first failure---

- fill in description and add a Pagebreak to it for example:

--EXAMPLE-DESCRIPTION--

This is

A

 

Test

--EXAMPLE-DESCRIPTION--

- now switch to the B class and create a new object while adding the created object in A to the REL Attribute in B

 

If you've follwed the orders correctly you get an exception like this

 

---Exception---

Call: services/json/management/modcard/updatecard
--------------------------------------------------
Error: java.lang.NumberFormatException: For input string: "This isA Test"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Long.parseLong(Long.java:438)
	at java.lang.Long.parseLong(Long.java:478)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractReferenceAttributeType.convertNotNullValue(AbstractReferenceAttributeType.java:20)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractReferenceAttributeType.convertNotNullValue(AbstractReferenceAttributeType.java:6)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractAttributeType.convertValue(AbstractAttributeType.java:17)
	at org.cmdbuild.dao.entry.DBEntry.toNative(DBEntry.java:124)
	at org.cmdbuild.dao.entry.DBEntry.setOnly(DBEntry.java:119)
	at org.cmdbuild.dao.entry.DBCard.set(DBCard.java:17)
	at org.cmdbuild.dao.entry.DBCard.set(DBCard.java:7)
	at org.cmdbuild.data.store.DataViewStore.fillCard(DataViewStore.java:297)
	at org.cmdbuild.data.store.DataViewStore.update(DataViewStore.java:237)
	at org.cmdbuild.logic.data.access.DefaultDataAccessLogic.updateCard(DefaultDataAccessLogic.java:528)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
	at sun.proxy.$Proxy170.updateCard(Unknown Source)
	at org.cmdbuild.servlets.json.management.ModCard.updateCard(ModCard.java:299)
	at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:94)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:54)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:142)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:33)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:39)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:679)

---Exception---

 

The Bug:

If you select the object A for the attribute REL of class B cmdbuild removes the pagebreaks of the description.

If you click save cmdbuild sends the string of the searchfield instead of the real objectid to the server.

It seems like cmdbuild "forget" to save the id while selecting the object in the menu.

 

Same error happens if you write something fictional like "gasdfsags" into the searchfield and press save!

 

Why do you use the description field to search for the object id instead of saving the objectid while selecting it?

Is this a known bug and will it be fixed soon?

 

thanks in advance

cg_admin

Thank you for your submission. We've verified that it's a bug related to the combobox component's management. We'll fix it as soon as possible.
 
Best regards.
 
-- Davide Pavan
 
Previously cg wrote:

Hello,

 

we found a serious bug in the selection of a reference attribute.

I give you an example setup to reconstruct the error.

 

The Setup:

- create two new classes -> A and B.

- create a relation between this two classes 1:N (A1 : BN)

- in the B class add an attribute, lets call it REL for the relationship to the A class

 

The Error:

- create a new object in the A class

- fill in code

---heres the first failure---

- fill in description and add a Pagebreak to it for example:

--EXAMPLE-DESCRIPTION--

This is

A

 

Test

--EXAMPLE-DESCRIPTION--

- now switch to the B class and create a new object while adding the created object in A to the REL Attribute in B

 

If you've follwed the orders correctly you get an exception like this

 

---Exception---

Call: services/json/management/modcard/updatecard
--------------------------------------------------
Error: java.lang.NumberFormatException: For input string: "This isA Test"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Long.parseLong(Long.java:438)
	at java.lang.Long.parseLong(Long.java:478)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractReferenceAttributeType.convertNotNullValue(AbstractReferenceAttributeType.java:20)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractReferenceAttributeType.convertNotNullValue(AbstractReferenceAttributeType.java:6)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractAttributeType.convertValue(AbstractAttributeType.java:17)
	at org.cmdbuild.dao.entry.DBEntry.toNative(DBEntry.java:124)
	at org.cmdbuild.dao.entry.DBEntry.setOnly(DBEntry.java:119)
	at org.cmdbuild.dao.entry.DBCard.set(DBCard.java:17)
	at org.cmdbuild.dao.entry.DBCard.set(DBCard.java:7)
	at org.cmdbuild.data.store.DataViewStore.fillCard(DataViewStore.java:297)
	at org.cmdbuild.data.store.DataViewStore.update(DataViewStore.java:237)
	at org.cmdbuild.logic.data.access.DefaultDataAccessLogic.updateCard(DefaultDataAccessLogic.java:528)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
	at sun.proxy.$Proxy170.updateCard(Unknown Source)
	at org.cmdbuild.servlets.json.management.ModCard.updateCard(ModCard.java:299)
	at sun.reflect.GeneratedMethodAccessor134.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.cmdbuild.servlets.JSONDispatcher.dispatch(JSONDispatcher.java:94)
	at org.cmdbuild.servlets.JSONDispatcher.doPost(JSONDispatcher.java:54)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.AuthFilter.doFilter(AuthFilter.java:142)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.PatchManagerFilter.doFilter(PatchManagerFilter.java:33)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.ConfCheckFilter.doFilter(ConfCheckFilter.java:31)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.cmdbuild.filters.TranslationFilter.doFilter(TranslationFilter.java:39)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:679)

---Exception---

 

The Bug:

If you select the object A for the attribute REL of class B cmdbuild removes the pagebreaks of the description.

If you click save cmdbuild sends the string of the searchfield instead of the real objectid to the server.

It seems like cmdbuild "forget" to save the id while selecting the object in the menu.

 

Same error happens if you write something fictional like "gasdfsags" into the searchfield and press save!

 

Why do you use the description field to search for the object id instead of saving the objectid while selecting it?

Is this a known bug and will it be fixed soon?

 

thanks in advance

cg_admin

 

Previously Tecnoteca wrote:

Thank you for your submission. We've verified that it's a bug related to the combobox component's management. We'll fix it as soon as possible.

It appears to be still present in 2.1.8.

 

Previously Michele wrote:

Previously Tecnoteca wrote:
Thank you for your submission. We've verified that it's a bug related to the combobox component's management. We'll fix it as soon as possible.

It appears to be still present in 2.1.8.

 

It's fixed this ?
Im on 2.1.7 and Im getting this error. I cant continue working with CMDBuild.
 
There is any version fixed ?

The bug has been partially fixed in version 2.2.2

"Partially", because then some users have reported to us other cases in which the bug was still present.
We then carried out an additional fix to solve the remaining problems and the fix will be present in version 2.3 which will be released next month (with CMDBuild "mobile", the new "GUI Framework" and the REST webservice).
CMDBuild Team

Previously Tecnoteca wrote:

The bug has been partially fixed in version 2.2.2
"Partially", because then some users have reported to us other cases in which the bug was still present.
We then carried out an additional fix to solve the remaining problems and the fix will be present in version 2.3 which will be released next month (with CMDBuild "mobile", the new "GUI Framework" and the REST webservice).
CMDBuild Team

 

It's happens only sometimes... It's depends about the selected value in the combobox.
 
Any temporal solution ? Can I recreate the attribute in the class ?

In version 2.3 we will release in late January there will be a new patch for this bug.
CMDBuild Team

Previously Tecnoteca wrote:

In version 2.3 we will release in late January there will be a new patch for this bug.
CMDBuild Team

 

The error still exists in 2.3.0
 
What can I do ¿?
 
In comboboxes I can choose some values, but not others because:
 
Call: services/json/management/modcard/updatecard
--------------------------------------------------
Error: java.lang.NumberFormatException: For input string: "STS-ACE"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
	at java.lang.Long.parseLong(Long.java:410)
	at java.lang.Long.parseLong(Long.java:468)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractReferenceAttributeType.convertNotNullValue(AbstractReferenceAttributeType.java:20)
	...
So... the only thing I can do:
 
 1 -  it's to delete the rows are generating this error
 2 - add it again (diferent Id)
 3 - clear JAVA cache (from admin panel, in server configuration). If not, wont work because description values from old and new rows are same.
 4 - manage the relation. Now you can choose the new row added
 
 
 
Previously Daniel wrote:
Previously Tecnoteca wrote:
In version 2.3 we will release in late January there will be a new patch for this bug.
CMDBuild Team

 

The error still exists in 2.3.0
 
What can I do ¿?
 
In comboboxes I can choose some values, but not others because:
 
Call: services/json/management/modcard/updatecard
--------------------------------------------------
Error: java.lang.NumberFormatException: For input string: "STS-ACE"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
	at java.lang.Long.parseLong(Long.java:410)
	at java.lang.Long.parseLong(Long.java:468)
	at org.cmdbuild.dao.entrytype.attributetype.AbstractReferenceAttributeType.convertNotNullValue(AbstractReferenceAttributeType.java:20)
	...