CMDBuild Forum

New domains fail after Tomcat restart

Dear CMDBuild Team,

I have installed openMAINT and have slightly modified the attributes and relations of some cards.
For instance I have de-activated the UserAsset domain (1:N) for Person and Asset Cards and I have created an identical domain called OwnerAsset (1:N) (Person<->Asset).

Using openMAINT then seems to work perfectly, .....UNTIL I do a Tomcat restart (or reboot)!
Then, I see pop-up errors when I select to see the relations of the cards!

I wonder what is going on with the Tomcat restart and new domains fail to work successfully...

From the cmdbuild.log I copy the following, if you may have any idea what's wrong!

Thank you in advance,
Dimitris

When I try to read the relations of a Person Card:

INFO  2016-09-08 10:19:16 [jsonrpc ] Calling url /management/modcard/getcard
INFO  2016-09-08 10:19:16 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:19:16 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:19:16 [jsonrpc ] Calling url /email/email/readall
INFO  2016-09-08 10:19:16 [jsonrpc ] Calling url /management/modcard/getrelationlist
INFO  2016-09-08 10:19:16 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:19:16 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:19:16 [cmdbuild] getting where clause
WARN  2016-09-08 10:19:16 [sql     ] cannot get content of column 'Person#Country#Description'
WARN  2016-09-08 10:19:16 [sql     ] cannot get content of column 'Person#MainSeat#Description'
INFO  2016-09-08 10:19:16 [cmdbuild] getting where clause
ERROR 2016-09-08 10:19:16 [jsonrpc ] A org.springframework.jdbc.BadSqlGrammarException occurred calling method class org.cmdbuild.servlets.json.management.ModCard.getRelationList: PreparedStatementCallback; bad SQL grammar [SELECT *, count(*) over() AS _SRC__RowsCount FROM (
SELECT
"SRC"."Code" AS "SRC#Code", "SRC"."Description" AS "SRC#Description", "DST"."Code" AS "DST#Code", "DST"."Description" AS "DST#Description", "SRC"."IdClass"::oid AS "_SRC_IdClass", "SRC"."Id" AS "_SRC_Id", "SRC"."User" AS "_SRC_User", "SRC"."BeginDate" AS "_SRC_BeginDate", "DST"."IdClass"::oid AS "_DST_IdClass", "DST"."Id" AS "_DST_Id", "DST"."User" AS "_DST_User", "DST"."BeginDate" AS "_DST_BeginDate", "DOM"."IdDomain"::oid AS "_DOM_IdDomain", "DOM"."_Src" AS "_DOM__Src", "DOM"."Id" AS "_DOM_Id", "DOM"."User" AS "_DOM_User", "DOM"."BeginDate" AS "_DOM_BeginDate", "DOM"."EndDate" AS "_DOM_EndDate", "DOM"."IdObj1" AS "_DOM_IdObj1", "DOM"."IdObj2" AS "_DOM_IdObj2"
FROM "Person" AS "SRC"
JOIN (SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY gis."Map_OwnerAsset" WHERE "gis_Map_OwnerAsset"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj2" AS "IdObj1", "IdObj1" AS "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_ComplexStakeholder" WHERE "Map_ComplexStakeholder"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj2" AS "IdObj1", "IdObj1" AS "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_RoomStakeholder" WHERE "Map_RoomStakeholder"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY gis."Map_HeldByAsset" WHERE "gis_Map_HeldByAsset"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_ClassEmail" WHERE "Map_ClassEmail"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj2" AS "IdObj1", "IdObj1" AS "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_UnitStakeholder" WHERE "Map_UnitStakeholder"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj2" AS "IdObj1", "IdObj1" AS "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_FloorStakeholder" WHERE "Map_FloorStakeholder"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY gis."Map_ContactAsset" WHERE "gis_Map_ContactAsset"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_SuggestedAssigneeWorkorder" WHERE "Map_SuggestedAssigneeWorkorder"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_SupervisorTeam" WHERE "Map_SupervisorTeam"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_UserMovMgmt" WHERE "Map_UserMovMgmt"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj1", "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_ClassMetadata" WHERE "Map_ClassMetadata"."Status" = ? UNION ALL SELECT "Id", "IdDomain", ? AS "_Src", "IdObj2" AS "IdObj1", "IdObj1" AS "IdObj2", "User", "BeginDate", NULL AS "EndDate" FROM ONLY "Map_BuildingStakeholder" WHERE "Map_BuildingStakeholder"."Status" = ?) AS "DOM" ON "SRC"."Id"="DOM"."IdObj1" JOIN (SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Phone" WHERE "Phone"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Workorder" WHERE "Workorder"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "PrinterScanner" WHERE "PrinterScanner"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Floor" WHERE "Floor"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Computer" WHERE "Computer"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Team" WHERE "Team"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericSecuritySystem" WHERE "GenericSecuritySystem"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Alarm" WHERE "Alarm"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "SanitationDevice" WHERE "SanitationDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Building" WHERE "Building"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Lighting" WHERE "Lighting"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericConstructionElement" WHERE "GenericConstructionElement"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Lift" WHERE "Lift"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Equipment" WHERE "Equipment"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Heater" WHERE "Heater"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericItDevice" WHERE "GenericItDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "DoorWindow" WHERE "DoorWindow"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "NetworkDevice" WHERE "NetworkDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericHvacDevice" WHERE "GenericHvacDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericConveyorDevice" WHERE "GenericConveyorDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Sink" WHERE "Sink"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Complex" WHERE "Complex"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Unit" WHERE "Unit"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericElectricalDevice" WHERE "GenericElectricalDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "PlumbingDevice" WHERE "PlumbingDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericTelecommunicationDevice" WHERE "GenericTelecommunicationDevice"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "FireExtinguisher" WHERE "FireExtinguisher"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Room" WHERE "Room"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "WarehouseManagement" WHERE "WarehouseManagement"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Metadata" WHERE "Metadata"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "GenericFurnishingElement" WHERE "GenericFurnishingElement"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Desk" WHERE "Desk"."Status" = ? UNION ALL SELECT "Id", "IdClass", "User", "BeginDate", NULL AS "EndDate", NULL AS "CurrentId", "Code", "Description" FROM ONLY "Email" WHERE "Email"."Status" = ?) AS "DST" ON "DOM"."IdObj2"="DST"."Id"
WHERE "SRC"."Id" = ? AND "SRC"."Status" = ?) AS main
ORDER BY "DST#Description" ASC, "_SRC_Id"
LIMIT 2147483647
OFFSET 0]; nested exception is org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table "gis_Map_OwnerAsset"
  Position: 897
INFO  2016-09-08 10:19:16 [cmdbuild] getting where clause
INFO  2016-09-08 10:19:16 [cmdbuild] getting where clause
INFO  2016-09-08 10:19:16 [cmdbuild] getting where clause
INFO  2016-09-08 10:19:16 [cmdbuild] getting where clause
INFO  2016-09-08 10:19:16 [cmdbuild] getting where clause
INFO  2016-09-08 10:19:16 [jsonrpc ] Calling url /email/template/readall
INFO  2016-09-08 10:19:16 [cmdbuild] reading all templates




When I try to read the Relations of an Asset Card:

INFO  2016-09-08 10:49:06 [jsonrpc ] Calling url /schema/modclass/getattributelist
INFO  2016-09-08 10:49:06 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:49:06 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:49:06 [jsonrpc ] Calling url /schema/modclass/getfktargetingclass
INFO  2016-09-08 10:49:06 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:49:06 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:49:06 [jsonrpc ] Calling url /schema/modclass/getattributelist
INFO  2016-09-08 10:49:06 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:49:06 [cmdbuild] getting all-in-one 'interface org.cmdbuild.services.event.Observer'
INFO  2016-09-08 10:49:06 [jsonrpc ] Calling url /utils/generateid
INFO  2016-09-08 10:49:06 [jsonrpc ] Calling url /email/email/readall
INFO  2016-09-08 10:49:06 [jsonrpc ] Calling url /email/template/readall
INFO  2016-09-08 10:49:06 [cmdbuild] reading all templates
ERROR 2016-09-08 10:49:06 [jsonrpc ] A org.cmdbuild.exception.NotFoundException occurred calling method class org.cmdbuild.servlets.json.schema.ModClass.getAttributeList: DOMAIN_NOTFOUND OwnerAsset
ERROR 2016-09-08 10:49:06 [jsonrpc ] A org.cmdbuild.exception.NotFoundException occurred calling method class org.cmdbuild.servlets.json.schema.ModClass.getAttributeList: DOMAIN_NOTFOUND OwnerAsset

Dear Dimitris,

it's not so easy to spot the problem just from the stacktrace so I'll try to ask you some more details:

what happened to the "User" reference on the assets? Is it still active?

have you created any reference attribute for the new domain OwnerAsset?

can you try to reactivate the original domain UserAsset and clear the cache of the server (Administration -> Setup -> Server management)?

 

Kind regards

CMDBuild Team

 

 

Previously Dimitris wrote:

Dear CMDBuild Team,

I have installed openMAINT and have slightly modified the attributes and relations of some cards.
For instance I have de-activated the UserAsset domain (1:N) for Person and Asset Cards and I have created an identical domain called OwnerAsset (1:N) (Person<->Asset).

Using openMAINT then seems to work perfectly, .....UNTIL I do a Tomcat restart (or reboot)!
Then, I see pop-up errors when I select to see the relations of the cards!

I wonder what is going on with the Tomcat restart and new domains fail to work successfully...

From the cmdbuild.log I copy the following, if you may have any idea what's wrong!

Thank you in advance,
Dimitris

Dear CMDBuild Team,

Firstly, I realized that same behavior and same error messages appear when I clear cache, as when rebooting and tomcat restart.

Secondly, I surprisingly discovered that AFTER clear cache I cannot see any attribute in the "Asset" class in the Administration module! All other classes are ok, and all other tabs of that class are ok. In addition, if I choose to edit and save any of the new domains (after clear cache), I get an error  message like this:

Call: services/json/schema/modclass/savedomain
-----------------------------------------------
Error: org.cmdbuild.exception.NotFoundException: DOMAIN_NOTFOUND HeldByAsset

Thirdly, considering your questions:

-

The "UserAsset" domain is active, but I have de-activated its appearance in "Person" class and "Asset" class. Thus, it is actually active only in the "Company" subclass.

-Indeed I have created an attribute in the "Asset" class which is reference to the new domain OwnerAsset.

-I re-activated the original domain UserAsset and then cleared cache but same error messages appeared (even after deactivation of my new domains).

 

Please, any help is highly appreciated!

Best regards,

Dimitris

 

Previously Tecnoteca wrote:

Dear Dimitris,

it's not so easy to spot the problem just from the stacktrace so I'll try to ask you some more details:

what happened to the "User" reference on the assets? Is it still active?

have you created any reference attribute for the new domain OwnerAsset?

can you try to reactivate the original domain UserAsset and clear the cache of the server (Administration -> Setup -> Server management)?

 

Kind regards

CMDBuild Team

 

 

Previously Dimitris wrote:

Dear CMDBuild Team,

I have installed openMAINT and have slightly modified the attributes and relations of some cards.
For instance I have de-activated the UserAsset domain (1:N) for Person and Asset Cards and I have created an identical domain called OwnerAsset (1:N) (Person<->Asset).

Using openMAINT then seems to work perfectly, .....UNTIL I do a Tomcat restart (or reboot)!
Then, I see pop-up errors when I select to see the relations of the cards!

I wonder what is going on with the Tomcat restart and new domains fail to work successfully...

From the cmdbuild.log I copy the following, if you may have any idea what's wrong!

Thank you in advance,
Dimitris

 

I am not sure if the following is related to my previously described problem, however it seems weird to me.

 

I realized that all new classes and new relations I create are put in the database under the gis schema and with alfresco as owner, while the great majority of existing tables is under the public schema and postgres as owner.

Another side effect of that, is that I cannot see the classes I create in the menu....

How to deal with that, please?

 

Dimitris

 

 

I think that could be your problem, classes and tables must be in the public schema, not in the gis one.

I suggest you to start again from a previous backup and remember to follow the correct procedure when restoring databases with gis schema. See the cmdbuild technical manual http://www.cmdbuild.org/file/manuali/technical-manual-in-english page 8.

 

Best regards

CMDBuild Team

 

Previously Dimitris wrote:

I am not sure if the following is related to my previously described problem, however it seems weird to me.

 

I realized that all new classes and new relations I create are put in the database under the gis schema and with alfresco as owner, while the great majority of existing tables is under the public schema and postgres as owner.

Another side effect of that, is that I cannot see the classes I create in the menu....

How to deal with that, please?

 

Dimitris

 

 

 

Indeed, that was my problem!

 

Thank you CMDBuild Team!