Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 6.1.1 CE GA2, 6.1.20 EE GA2
-
Fix Version/s: 6.1.X EE, 6.2.0 CE M5
-
Component/s: Upgrades
-
Environment:Tomcat 7 + Oracle 11gR2. Portal 6.2.x GIT ID: 6b7defb818ca7be926207855a141e3b30e5898f4.
-
Branch Version/s:6.1.x
-
Backported to Branch:Committed
-
Fix Priority:5
-
Where was the bug?:Java
-
Similar Issues:
Description
When upgrading form 6.0.11 to 6.1.20 the virtual host setting were not migrated.
1) company virtual host was stored in "Company" table in "virtualhost" field
2) site's/organization's virtual host was stored in "LayoutSet" table in "virtualhost" field
In 6.1.20 virtual hosts are stored in the VIRTUALHOST table, but neither of the above settings were migrated to the new place.
After upgrade when accessing the Portal Settings portlet in the ControlPanel, the attached exception is thrown. The company virtual host field is required but it cannot be found.
Reproduction steps:
1) start a 6.0.11 portal with oracle
2) set virtual host
3) upgrade to 6.1.20
4) Go to Control Panel -> Portal Instances -> click on the virtual host:
jodd.bean.BeanException: Simple property not found: hostname Invalid property: 'CompanyImpl#hostname' (actual:'CompanyImpl#hostname', forced=false)

The root cause is that this select:
mysql> select layoutSetId, companyId, virtualHost from LayoutSet where virtualHost != '' and virtualHost is not null; +-------------+-----------+-------------+ | layoutSetId | companyId | virtualHost | +-------------+-----------+-------------+ | 10282 | 10132 | site1.com | +-------------+-----------+-------------+gives the virtualhost in mySql, but not in Oracle11g
The root cause is that empty strings ('') treated differently by Oracle as MySql:
In Oracle:
Gives 0.
The SQL below works on Oracle and MySql too:
It is "Duck typing", so I check if empty strings treats as null with "'' is null".