Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1907

The Scala hello-world example does not work

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • Scripting Scala 1.0.0
    • None
    • Samples
    • None

    Description

      To get the Scala samples to work I executed the following steps:
      1. The 2.8.1 versions of the scala-compiler and scala-library jars are not available anymore with the group-id "org.scala-lang-osgi" but with the group-id "com.weiglewilczek.scala-lang-osgi" they are.
      The problem is, that the checksum is not defined and thus the jar is not automatically downloaded.
      As an alternative to always downloading manually I added the jars and an install-script to the 'contrib/scripting/scala/config' project

      2. Removed the license header from /contrib/scripting/scala/script/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory as it resulted in entries like the following one in the log file:
      29.12.2010 00:59:35.166 ERROR [Background Update org.apache.sling.scripting.scala.script (74)] org.apache.sling.scripting.c
      ore.impl.ScriptEngineManagerFactory Cannot register ScriptEngineFactory # limitations under the License. java.lang.ClassNotFo
      undException: # limitations under the License. not found by org.apache.sling.scripting.scala.script [74]
      at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
      at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
      at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
      at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:645)
      at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1599)
      at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:904)
      at org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory.registerFactories(ScriptEngineManagerFactory.java:
      146)
      at org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory.refreshScriptEngineManager(ScriptEngineManagerFact
      ory.java:102)
      at org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory.unbindScriptEngineFactory(ScriptEngineManagerFacto
      ry.java:266)
      I consider this as a workaround as the parser should be adapted to ignore lines containing comments.

      3. Installed 'samples/path-based-rtp' as it is needed by the hello-world example

      4. Installed 'contrib/scripting/scala/config', 'contrib/scripting/scala/script' and 'contrib/scripting/scala/samples/hello-world' using 'mvn -PautoInstallBundle clean install -Dsling.url=http://localhost:8888/system/console' as the default Jetty-Port is 8888 and the sling:install plugin is not configured in every pom

      Would'nt it make sense to create a Maven multi module project that builds and installs the projects?

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            mduerig Michael Dürig
            sandro Sandro Boehme
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment