Check if there is any spaces within your code itself.
for example:
18:47:35,383 ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.alfresco.repo.action.scheduled. FreeMarkerWithLuceneExtensionsModelFactory] for bean with name 'templateActionModelFactory' defined in file [C:\Alfresco
\tomcat\shared\classes\alfresco\extension\scheduled-action-services-context.xml]; nested exception is java.lang.ClassNotFoundException: org.alfresco.repo.action.scheduled. FreeMarkerWithLuceneExtensionsModelFactory
If you look closely you'll see spacing between scheduled. and FreeMarkerWithLuceneExtensionsModelFactory.
This can be caused if the package name is on multiple lines.
For example:
Bad:
<bean id="templateActionModelFactory" class="org.alfresco.repo.action.scheduled.
FreeMarkerWithLuceneExtensionsModelFactory">
Good:
<bean id="templateActionModelFactory" class="org.alfresco.repo.action.scheduled.FreeMarkerWithLuceneExtensionsModelFactory">
Hope this helps.