Showing posts with label Apache. Show all posts
Showing posts with label Apache. Show all posts

Tuesday, March 6, 2018

Practical Apache Sling: Caveats Part I

This is a continuing saga so the post will be updated as I meet and deal with the various quirks and undocumented caveats:


  • At the time of writing the latest version of Apache Sling Feature can only be installed on to Karaf 4.2.0.M2. This is not obvious from the description of the process required to install Apache Sling 0.1.1-SNAPSHOT as a feature at: https://sling.apache.org/documentation/karaf.html#sling-karaf-featureshttps://sling.apache.org/documentation/karaf.html#sling-karaf-features
  • Again - at the time of writing, the starter WAR for Sling - org.apache.sling.starter-10-webapp.war, fails to run on Apache Tomcat - apache-tomcat-9.0.0.M8. You can get the Sling WAR to run on apache-tomcat-8.5.28. Even on apache-tomcat-8.5.28, you may need to unpack the war and tweak the web.xml for overlapping mapping issues for JSPs
  • With Tomcat (8.5.28) it was still not possible to just install Sling and have it run correctly. The overall system seems to be depend on being the root application and links are broken if an arbitrary context is chosen/created. My simple fix for now has been to simply unpack the Sling war contents into the ROOT webapp

Saturday, February 16, 2008

Jackrabbit 1.4 and Problems with Failed Document Uploads

For those who prefer to live and bleed on the cutting edge of things, you must have already started experimenting with Jackrabbit 1.4 that came out in Janurary, 2008.

Well then most of you must have alse encountered a problem with uploading documents that worked perfectly with previous versions but fails. The upload succeeds, but unless the repository is manually restarted, attempts to access the newly uploaded document throws an exception with the following stack trace :

javax.jcr.RepositoryException: Internal error while retrieving value of /SecondTest/nb/field/*Value3*: name can't be null: name can't be null at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:470) at org.apache.jackrabbit.core.PropertyImpl.getStream(PropertyImpl.java:479) at com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getFieldValue(ContentServiceImpl.java:677) at com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentFromNode(ContentServiceImpl.java:393) at com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentByNameAndType(ContentServiceImpl.java:351) at com.sun.portal.cms.mirage.service.custom.impl.ContentServiceImpl.getContentsByType(ContentServiceImpl.java:434) at com.sun.portal.cms.portlet.ccd.beans.ContentCreationBean.changeContentType(ContentCreationBean.java:220)
Caused by: java.lang.NullPointerException: name can't be null
at java.io.FilePermission.init(FilePermission.java:171)
at java.io.FilePermission.(FilePermission.java:264)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.FileInputStream.(FileInputStream.java:100)
at org.apache.jackrabbit.core.value.BLOBInTempFile.getStream(BLOBInTempFile.java:145) at org.apache.jackrabbit.core.value.InternalValue.toJCRValue(InternalValue.java:366) at org.apache.jackrabbit.core.PropertyImpl.getValue(PropertyImpl.java:466)
      ... 97 more
java.lang.NullPointerException: name can't be null

Well thanks to the following my problem is at least temporarily solved:
http://www.mail-archive.com/users@jackrabbit.apache.org/msg06191.html

A better understanding of the problem is called for so that I can address it more appropriately in the future.
But for now setting the system property org.jackrabbit.useDataStore to false fixes it immediately.