NoClassDefFoundError Due to Path Size Limit in Windows on WebSphere
Symptoms
Wnstall Confluence on Websphere in Windows, the following appears in the atlassian-confluence.log
:
java.lang.NoClassDefFoundError: com/atlassian/confluence/user/actions/UserPickerAction$UsernameToUserTranslatingPaginationSupport
at java.lang.Class.getDeclaredConstructors0(Native Method)
Cause
Most Windows OS have a file path limit of 255 characters. When an application is deployed with a long name, it is possible the deployed application files will reach this path limit. Currently, there is no check performed and the error messages when trying to create such long files are not very descriptive.
Example of installing Confluence on Windows XP Professional '02 sp 2.
and Websphere App Server v 6.0
produced by default this deployed location:
C:\Program Files\IBM\WebSphere\AppServer/profiles/default\wstemp\92668751\workspace\cells\bluetongueNode01Cell\applications\atlassian-confluence-2_2_8_war.ear\atlassian-confluence-2_2_8_war.ear
To get to the class structure of Confluence that needs to be used:
atlassian-confluence-2_2_8.war\WEB-INF\classes\com\atlassian\confluence\user\actions\UserPickerAction$UsernameToUserTranslatingPaginationSupport
Hence the length to that particular class:
$ perl -e 'print length "C:\Program Files\IBM\WebSphere\AppServer/profiles/defa
ult\wstemp\92668751\workspace\cells\bluetongueNode01Cell\applications\atlassian
-confluence-2_2_8_war.ear\atlassian-confluence-2_2_8_war\atlassian-confluence-2
_2_8.war\WEB-INF\classes\com\atlassian\confluence\user\actions\UserPickerAction
$UsernameToUserTranslatingPaginationSupport"';
264
Resolution
Make sure Websphere is installed to the root of the C:\ (or other) drive.