java.lang.NullPointerException

openhab.org | 1 week ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Seeing following error on startup with latest Launchpad from trunk {noformat} 20.07.2015 20:29:10.310 *INFO* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.sling.scripting.core.impl.ScriptCacheImpl)] org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory Script extension 'jspf' is now handled by ScriptEngine 'Apache Sling Scripting JSP Support', version='2.1.6', class='org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine' 20.07.2015 20:29:10.310 *INFO* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.sling.scripting.core.impl.ScriptCacheImpl)] org.apache.sling.scripting.core.impl.ScriptEngineManagerFactory Script extension 'jspx' is now handled by ScriptEngine 'Apache Sling Scripting JSP Support', version='2.1.6', class='org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine' 20.07.2015 20:29:10.311 *INFO* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.sling.scripting.core.impl.ScriptCacheImpl)] org.apache.sling.scripting.core Service [361, [org.osgi.service.event.EventHandler]] ServiceEvent UNREGISTERING 20.07.2015 20:29:10.316 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.sling.scripting.core.impl.ScriptCacheImpl)] org.apache.sling.scripting.core [org.apache.sling.scripting.core.impl.ScriptCacheImpl(114)] The deactivate method has thrown an exception (java.lang.IllegalStateException: Service already unregistered.) java.lang.IllegalStateException: Service already unregistered. at org.apache.felix.framework.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:136) at org.apache.sling.scripting.core.impl.ScriptCacheImpl.deactivate(ScriptCacheImpl.java:269) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231) at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:39) at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:624) at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:508) at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:149) at org.apache.felix.scr.impl.manager.SingleComponentManager.disposeImplementationObject(SingleComponentManager.java:355) at org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:170) at org.apache.felix.scr.impl.manager.SingleComponentManager.ungetService(SingleComponentManager.java:929) at org.apache.felix.scr.impl.manager.SingleComponentManager.ungetService(SingleComponentManager.java:915) at org.apache.felix.framework.ServiceRegistrationImpl.ungetFactoryUnchecked(ServiceRegistrationImpl.java:384) {noformat} Looking at {{ScriptCacheImpl}} the service reg is getting unregistered at two place. So probably at {{configureCache}} it should null the reference

    Apache's JIRA Issue Tracker | 2 years ago | Chetan Mehrotra
    java.lang.IllegalStateException: Service already unregistered.
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    When camel-scr (2.15-SNAPSHOT) is deployed and used with Apache Karaf - 2.3.0.redhat-611412 The following errors are generated when SCR got the CamelComponent or lost the Component {code} 2014-12-26 11:13:49,453 | ERROR | r-1.0.0-thread-2 | osgi-camel-scr | ? ? | 255 - com.redhat.gpe.training.osgi-camel-scr - 1.0.0 | [com.redhat.gpe.training.osgi.camel.BootStrap(52)] The gotCamelComponent method has thrown an exception java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51] at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:39)[82:org.apache.felix.scr:1.8.0.redhat-611412] {code} {code} 2014-12-26 11:22:50,355 | ERROR | l Console Thread | osgi-camel-scr | ? ? | 255 - com.redhat.gpe.training.osgi-camel-scr - 1.0.0 | [com.redhat.gpe.training.osgi.camel.BootStrap(52)] The lostCamelComponent method has thrown an exception java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51] at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:39)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:624)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:508)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BindMethod.invoke(BindMethod.java:37)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.manager.DependencyManager.invokeUnbindMethod(DependencyManager.java:1711)[82:org.apache.felix.scr:1.8.0.redhat-611412] {code} Here is the code used as example : {code} import org.apache.camel.CamelContext; import org.apache.camel.RoutesBuilder; import org.apache.camel.scr.AbstractCamelRunner; import org.apache.camel.spi.ComponentResolver; import org.apache.felix.scr.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; @Component(label = BootStrap.COMPONENT_LABEL, description = BootStrap.COMPONENT_DESCRIPTION) @Properties({ @Property(name = "camelContextId", value = "camel-scr-exercise"), @Property(name = "active", value = "true") }) @References({ @Reference(name = "camelComponent",referenceInterface = ComponentResolver.class, cardinality = ReferenceCardinality.MANDATORY_MULTIPLE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY, bind = "gotCamelComponent", unbind = "lostCamelComponent") }) public class BootStrap extends AbstractCamelRunner { public static final String COMPONENT_LABEL = "bootstrap.CamelScrExercise"; public static final String COMPONENT_DESCRIPTION = "This is the description for camel-scr-exercise."; public static final Logger LOGGER = LoggerFactory.getLogger(BootStrap.class); @Override protected List<RoutesBuilder> getRouteBuilders() { LOGGER.info("Load Camel Routes definition"); List<RoutesBuilder> routesBuilders = new ArrayList<>(); routesBuilders.add(new GreeterRoute()); return routesBuilders; } } {code}

    Apache's JIRA Issue Tracker | 2 years ago | Charles Moulliard
    java.lang.IllegalArgumentException: argument type mismatch
  4. 0

    When camel-scr (2.15-SNAPSHOT) is deployed and used with Apache Karaf - 2.3.0.redhat-611412 The following errors are generated when SCR got the CamelComponent or lost the Component {code} 2014-12-26 11:13:49,453 | ERROR | r-1.0.0-thread-2 | osgi-camel-scr | ? ? | 255 - com.redhat.gpe.training.osgi-camel-scr - 1.0.0 | [com.redhat.gpe.training.osgi.camel.BootStrap(52)] The gotCamelComponent method has thrown an exception java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51] at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:39)[82:org.apache.felix.scr:1.8.0.redhat-611412] {code} {code} 2014-12-26 11:22:50,355 | ERROR | l Console Thread | osgi-camel-scr | ? ? | 255 - com.redhat.gpe.training.osgi-camel-scr - 1.0.0 | [com.redhat.gpe.training.osgi.camel.BootStrap(52)] The lostCamelComponent method has thrown an exception java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_51] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_51] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_51] at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_51] at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:231)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:39)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:624)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:508)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.helper.BindMethod.invoke(BindMethod.java:37)[82:org.apache.felix.scr:1.8.0.redhat-611412] at org.apache.felix.scr.impl.manager.DependencyManager.invokeUnbindMethod(DependencyManager.java:1711)[82:org.apache.felix.scr:1.8.0.redhat-611412] {code} Here is the code used as example : {code} import org.apache.camel.CamelContext; import org.apache.camel.RoutesBuilder; import org.apache.camel.scr.AbstractCamelRunner; import org.apache.camel.spi.ComponentResolver; import org.apache.felix.scr.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; @Component(label = BootStrap.COMPONENT_LABEL, description = BootStrap.COMPONENT_DESCRIPTION) @Properties({ @Property(name = "camelContextId", value = "camel-scr-exercise"), @Property(name = "active", value = "true") }) @References({ @Reference(name = "camelComponent",referenceInterface = ComponentResolver.class, cardinality = ReferenceCardinality.MANDATORY_MULTIPLE, policy = ReferencePolicy.DYNAMIC, policyOption = ReferencePolicyOption.GREEDY, bind = "gotCamelComponent", unbind = "lostCamelComponent") }) public class BootStrap extends AbstractCamelRunner { public static final String COMPONENT_LABEL = "bootstrap.CamelScrExercise"; public static final String COMPONENT_DESCRIPTION = "This is the description for camel-scr-exercise."; public static final Logger LOGGER = LoggerFactory.getLogger(BootStrap.class); @Override protected List<RoutesBuilder> getRouteBuilders() { LOGGER.info("Load Camel Routes definition"); List<RoutesBuilder> routesBuilders = new ArrayList<>(); routesBuilders.add(new GreeterRoute()); return routesBuilders; } } {code}

    Apache's JIRA Issue Tracker | 2 years ago | Charles Moulliard
    java.lang.IllegalArgumentException: argument type mismatch

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at org.openhab.binding.tcp.AbstractDatagramChannelBinding.deactivate()
    2. org.openhab.binding
      AbstractDatagramChannelBinding.deactivate
      1. org.openhab.binding.tcp.AbstractDatagramChannelBinding.deactivate(AbstractDatagramChannelBinding.java:733)
      1 frame
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_65]
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_65]
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_65]
      4. java.lang.reflect.Method.invoke(Method.java:497)[:1.8.0_65]
      4 frames
    4. Apache Felix Declarative Services
      SingleComponentManager.ungetService
      1. org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)
      2. org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)
      3. org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615)
      4. org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499)
      5. org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:295)
      6. org.apache.felix.scr.impl.manager.SingleComponentManager.disposeImplementationObject(SingleComponentManager.java:342)[32:org.apache.felix.scr:2.0.2]
      7. org.apache.felix.scr.impl.manager.SingleComponentManager.deleteComponent(SingleComponentManager.java:157)[32:org.apache.felix.scr:2.0.2]
      8. org.apache.felix.scr.impl.manager.SingleComponentManager.ungetService(SingleComponentManager.java:913)[32:org.apache.felix.scr:2.0.2]
      9. org.apache.felix.scr.impl.manager.SingleComponentManager.ungetService(SingleComponentManager.java:902)[32:org.apache.felix.scr:2.0.2]
      9 frames
    5. Eclipse OSGi
      ServiceFactoryUse$2.run
      1. org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$2.run(ServiceFactoryUse.java:260)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      2. org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$2.run(ServiceFactoryUse.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      2 frames
    6. Java RT
      AccessController.doPrivileged
      1. java.security.AccessController.doPrivileged(Native Method)[:1.8.0_65]
      1 frame
    7. Eclipse OSGi
      BundleContextImpl.ungetService
      1. org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryUngetService(ServiceFactoryUse.java:258)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      2. org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.ungetService(ServiceFactoryUse.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      3. org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.ungetService(ServiceConsumer.java:50)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      4. org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.ungetService(ServiceRegistrationImpl.java:581)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      5. org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.ungetService(ServiceRegistry.java:540)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      6. org.eclipse.osgi.internal.framework.BundleContextImpl.ungetService(BundleContextImpl.java:661)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
      6 frames
    8. Apache Felix Configuration Admin Service
      UpdateThread.run
      1. org.apache.felix.cm.impl.helper.BaseTracker.ungetRealService(BaseTracker.java:207)[7:org.apache.felix.configadmin:1.8.8]
      2. org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:161)[7:org.apache.felix.configadmin:1.8.8]
      3. org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[7:org.apache.felix.configadmin:1.8.8]
      4. org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1444)[7:org.apache.felix.configadmin:1.8.8]
      5. org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1400)[7:org.apache.felix.configadmin:1.8.8]
      6. org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)[7:org.apache.felix.configadmin:1.8.8]
      7. org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)[7:org.apache.felix.configadmin:1.8.8]
      7 frames
    9. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
      1 frame