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

JcrInstaller fails to startup if wrong sling:OsgiConfig is present

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Installer Core 3.9.0
    • Component/s: Installer
    • Labels:
      None
    • Environment:
      osx

      Description

      After deploying a wrong osgi config, JcrInstaller won't get active again, if launchpad is restarted.

      Reproduction steps:

      • start launchpad
        java -jar org.apache.sling.launchpad-9.jar
        
      • create info logger for class org.apache.sling.installer.provider.jcr.impl.JcrInstaller with Info Level
      • create wrong OSGi org.apache.felix.webconsole.plugins.event.internal.PluginServlet.config file
        max.size=I"sfdg"
        service.pid="org.apache.felix.webconsole.plugins.event.internal.PluginServlet"
        
      • deploy the previous created OSGi config file
        curl -v -F 'org.apache.felix.webconsole.plugins.event.internal.PluginServlet.config=@org.apache.felix.webconsole.plugins.event.internal.PluginServlet.config' \
        -F "jcr:primaryType=sling:OsgiConfig" \
        http://admin:admin@localhost:8080/apps/jcrtest/install
        
      • JcrInstaller creates log entry:
        02.02.2018 15:17:31.872 *WARN* [JcrInstaller.2] org.apache.sling.installer.provider.jcr.impl.JcrInstaller Exception in runOneCycle()
        java.lang.NumberFormatException: For input string: "sfdg"
        	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
        	at java.lang.Integer.parseInt(Integer.java:580)
        	at java.lang.Integer.valueOf(Integer.java:766)
        	at org.apache.felix.cm.file.ConfigurationHandler.readSimple(ConfigurationHandler.java:457)
        	at org.apache.felix.cm.file.ConfigurationHandler.readValue(ConfigurationHandler.java:352)
        	at org.apache.felix.cm.file.ConfigurationHandler.readInternal(ConfigurationHandler.java:306)
        	at org.apache.felix.cm.file.ConfigurationHandler.read(ConfigurationHandler.java:265)
        	at org.apache.sling.installer.core.impl.InternalResource.readDictionary(InternalResource.java:257)
        	at org.apache.sling.installer.core.impl.InternalResource.create(InternalResource.java:98)
        	at org.apache.sling.installer.core.impl.OsgiInstallerImpl.createResources(OsgiInstallerImpl.java:373)
        	at org.apache.sling.installer.core.impl.OsgiInstallerImpl.updateResources(OsgiInstallerImpl.java:413)
        	at org.apache.sling.installer.provider.jcr.impl.JcrInstaller.runOneCycle(JcrInstaller.java:549)
        	at org.apache.sling.installer.provider.jcr.impl.JcrInstaller$StoppableThread.run(JcrInstaller.java:322)
        
      • now stop launchpad instance
      • start again and check the previously created logger for JcrInstaller
      • throws following exception:
        02.02.2018 15:35:01.210 *INFO* [pool-9-thread-1] org.apache.sling.installer.provider.jcr.impl.JcrInstaller Activating Apache Sling JCR Installer
        02.02.2018 15:35:01.211 *ERROR* [pool-9-thread-1] org.apache.sling.installer.provider.jcr.impl.JcrInstaller Repository exception during startup - deactivating installer!
        javax.jcr.LoginException: Cannot derive user name for bundle org.apache.sling.installer.provider.jcr [123] and sub service null
        	at org.apache.sling.jcr.base.AbstractSlingRepository2.loginService(AbstractSlingRepository2.java:311)
        	at org.apache.sling.installer.provider.jcr.impl.JcrInstaller$StoppableThread.<init>(JcrInstaller.java:217)
        	at org.apache.sling.installer.provider.jcr.impl.JcrInstaller.start(JcrInstaller.java:355)
        	at org.apache.sling.installer.provider.jcr.impl.JcrInstaller.activate(JcrInstaller.java:342)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
        	at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
        	at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
        	at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
        	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
        	at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
        	at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:298)
        	at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:109)
        	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:906)
        	at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:879)
        	at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:823)
        	at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:347)
        	at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:247)
        	at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:350)
        	at org.apache.felix.framework.Felix.getService(Felix.java:3721)
        	at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:470)
        	at org.apache.sling.commons.osgi.SortingServiceTracker.addingService(SortingServiceTracker.java:79)
        	at org.apache.sling.installer.core.impl.SortingServiceTracker.addingService(SortingServiceTracker.java:45)
        	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
        	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
        	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
        	at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
        	at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
        	at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
        	at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
        	at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
        	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4579)
        	at org.apache.felix.framework.Felix.registerService(Felix.java:3571)
        	at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
        	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:887)
        	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:874)
        	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:132)
        	at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:941)
        	at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:741)
        	at org.apache.felix.scr.impl.manager.ExtendedServiceEvent.activateManagers(ExtendedServiceEvent.java:59)
        	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:144)
        	at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990)
        	at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838)
        	at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545)
        	at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4579)
        	at org.apache.felix.framework.Felix.access$000(Felix.java:105)
        	at org.apache.felix.framework.Felix$1.serviceChanged(Felix.java:419)
        	at org.apache.felix.framework.ServiceRegistry.unregisterService(ServiceRegistry.java:170)
        	at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:144)
        	at org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.executeServiceRegistrations(ServiceUserMapperImpl.java:315)
        	at org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.access$000(ServiceUserMapperImpl.java:60)
        	at org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl$1.run(ServiceUserMapperImpl.java:295)
        	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        	at java.lang.Thread.run(Thread.java:748)
        

        Attachments

          Activity

            People

            • Assignee:
              cziegeler Carsten Ziegeler
              Reporter:
              luckyluke Lukas Kummer
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: