<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>WAR not getting deployed : Failed to read candidate component class: URL</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121369205" />
  <subtitle>WAR not getting deployed : Failed to read candidate component class: URL</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=121369205</id>
  <updated>2026-04-04T15:23:59Z</updated>
  <dc:date>2026-04-04T15:23:59Z</dc:date>
  <entry>
    <title>WAR not getting deployed : Failed to read candidate component class: URL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121369204" />
    <author>
      <name>Komal Prasad</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=121369204</id>
    <updated>2022-02-25T17:52:44Z</updated>
    <published>2022-02-25T15:53:22Z</published>
    <summary type="html">&lt;p&gt;I have added JAVA 8 specific code in this
  class DatabaseInstanceUtil.class e.g.. Function, Lambda &lt;/p&gt;
&lt;p&gt;When I deploy this WAR file, it is not getting deployed. It is failed
  to read class.&lt;br /&gt;
  &lt;br /&gt; But when I comment out this code and deploy it works file....
    &lt;strong&gt;NOTE: Rest of the code in portlet is using JAVA 1.7&lt;br /&gt; So
    moving back to 1.7 works, I have checked maven as well &lt;br /&gt;
    &amp;lt;maven.compiler.source&amp;gt;1.8&amp;lt;/maven.compiler.source&amp;gt;&lt;br /&gt;
      &amp;lt;maven.compiler.target&amp;gt;1.8&amp;lt;/maven.compiler.target&amp;gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
  &lt;br /&gt;
  /u01/liferay/liferay7.3/liferay/liferay-ce-portal-7.3.6-ga7/tomcat-9.0.40/temp/20220221190102606XPPNAENY/UserRepository.war
  copied successfully&lt;br /&gt; 2022-02-21 19:01:22.358 ERROR [Refresh
  Thread: Equinox Container:
  db54901c-1f71-4f81-9699-5612e798caad][DispatcherPortlet:225] Context
  initialization failed&lt;br /&gt;
  org.springframework.beans.factory.BeanDefinitionStoreException: Failed
  to read candidate component class: URL
  [jar:file:/u01/liferay/liferay7.3/liferay/liferay-ce-portal-7.3.6-ga7/osgi/state/org.eclipse.osgi/1366/8/bundleFile!/WEB-INF/classes/com/example/userrepository/util/DatabaseInstanceUtil.class];
  nested exception is java.lang.ArrayIndexOutOfBoundsException: Index
  5120 out of bounds for length 134&lt;br /&gt;         at
  org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:237)&lt;br /&gt;
          at
  org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:204)&lt;br /&gt;
          at
  org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1338)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)&lt;br /&gt;
          at
  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)&lt;br /&gt;
          at
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)&lt;br /&gt;
          at
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)&lt;br /&gt;
          at
  org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)&lt;br /&gt;
          at
  org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:124)&lt;br /&gt;
          at
  org.springframework.web.portlet.context.XmlPortletApplicationContext.loadBeanDefinitions(XmlPortletApplicationContext.java:92)&lt;br /&gt;
          at
  org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)&lt;br /&gt;
          at
  org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)&lt;br /&gt;
          at
  org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)&lt;br /&gt;
          at
  org.springframework.web.portlet.FrameworkPortlet.createPortletApplicationContext(FrameworkPortlet.java:356)&lt;br /&gt;
          at
  org.springframework.web.portlet.FrameworkPortlet.initPortletApplicationContext(FrameworkPortlet.java:294)&lt;br /&gt;
          at
  org.springframework.web.portlet.FrameworkPortlet.initPortletBean(FrameworkPortlet.java:268)&lt;br /&gt;
          at
  org.springframework.web.portlet.GenericPortletBean.init(GenericPortletBean.java:116)&lt;br /&gt;
          at
  javax.portlet.GenericPortlet.init(GenericPortlet.java:143)&lt;br /&gt;      
    at
  com.liferay.portlet.internal.InvokerPortletImpl.init(InvokerPortletImpl.java:248)&lt;br /&gt;
          at
  com.liferay.portal.monitoring.internal.portlet.MonitoringInvokerPortlet.init(MonitoringInvokerPortlet.java:151)&lt;br /&gt;
          at
  com.liferay.portlet.internal.PortletInstanceFactoryImpl.init(PortletInstanceFactoryImpl.java:278)&lt;br /&gt;
          at
  com.liferay.portlet.internal.PortletInstanceFactoryImpl.create(PortletInstanceFactoryImpl.java:181)&lt;br /&gt;
          at
  com.liferay.portal.kernel.portlet.PortletInstanceFactoryUtil.create(PortletInstanceFactoryUtil.java:48)&lt;br /&gt;
          at
  com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:210)&lt;br /&gt;
          at
  com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:108)&lt;br /&gt;
          at
  com.liferay.portal.service.impl.PortletLocalServiceImpl.initWAR(PortletLocalServiceImpl.java:926)&lt;br /&gt;
          at
  jdk.internal.reflect.GeneratedMethodAccessor1198.invoke(Unknown
  Source)&lt;br /&gt;         at
  java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&lt;br /&gt;
          at
  java.base/java.lang.reflect.Method.invoke(Method.java:566)&lt;br /&gt;      
    at
  com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)&lt;br /&gt;
          at
  com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)&lt;br /&gt;
          at com.sun.proxy.$Proxy54.initWAR(Unknown Source)&lt;br /&gt;      
    at
  com.liferay.portal.kernel.service.PortletLocalServiceUtil.initWAR(PortletLocalServiceUtil.java:485)&lt;br /&gt;
          at
  com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:221)&lt;br /&gt;
          at
  com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:97)&lt;br /&gt;
          at
  com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:213)&lt;br /&gt;
          at
  com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:94)&lt;br /&gt;
          at
  com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)&lt;br /&gt;
          at
  com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:189)&lt;br /&gt;
          at
  com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:179)&lt;br /&gt;
          at
  com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)&lt;br /&gt;
          at
  com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:75)&lt;br /&gt;
          at
  com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:57)&lt;br /&gt;
          at
  com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:55)&lt;br /&gt;
          at
  com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:141)&lt;br /&gt;
          at
  com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized(SecurePluginContextListener.java:152)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter._initializeContext(ServletContextListenerExceptionAdapter.java:119)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.adapter.ServletContextListenerExceptionAdapter.contextInitialized(ServletContextListenerExceptionAdapter.java:99)&lt;br /&gt;
          at
  jdk.internal.reflect.GeneratedMethodAccessor184.invoke(Unknown
  Source)&lt;br /&gt;         at
  java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&lt;br /&gt;
          at
  java.base/java.lang.reflect.Method.invoke(Method.java:566)&lt;br /&gt;      
    at
  org.eclipse.equinox.http.servlet.internal.registration.ListenerRegistration$EventListenerInvocationHandler.invoke(ListenerRegistration.java:143)&lt;br /&gt;
          at com.sun.proxy.$Proxy470.contextInitialized(Unknown
  Source)&lt;br /&gt;         at
  org.eclipse.equinox.http.servlet.internal.context.ContextController.doAddListenerRegistration(ContextController.java:398)&lt;br /&gt;
          at
  org.eclipse.equinox.http.servlet.internal.context.ContextController.addListenerRegistration(ContextController.java:352)&lt;br /&gt;
          at
  org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:76)&lt;br /&gt;
          at
  org.eclipse.equinox.http.servlet.internal.customizer.ContextListenerTrackerCustomizer.addingService(ContextListenerTrackerCustomizer.java:1)&lt;br /&gt;
          at
  org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)&lt;br /&gt;
          at
  org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)&lt;br /&gt;
          at
  org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)&lt;br /&gt;
          at
  org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)&lt;br /&gt;
          at
  org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:903)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:891)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:804)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:228)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:487)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1004)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.initListeners(WabBundleProcessor.java:625)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:231)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer._initWabBundle(WebBundleDeployer.java:159)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:88)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:115)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:68)&lt;br /&gt;
          at
  com.liferay.portal.osgi.web.wab.extender.internal.WabFactory.addingBundle(WabFactory.java:50)&lt;br /&gt;
          at
  org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:475)&lt;br /&gt;
          at
  org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:1)&lt;br /&gt;
          at
  org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)&lt;br /&gt;
          at
  org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)&lt;br /&gt;
          at
  org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)&lt;br /&gt;
          at
  org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)&lt;br /&gt;
          at
  org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:230)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:137)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:129)&lt;br /&gt;
          at
  org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:191)&lt;br /&gt;
          at
  org.eclipse.osgi.container.Module.publishEvent(Module.java:476)&lt;br /&gt;
          at
  org.eclipse.osgi.container.Module.doStart(Module.java:578)&lt;br /&gt;      
    at org.eclipse.osgi.container.Module.start(Module.java:449)&lt;br /&gt;  
        at
  org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)&lt;br /&gt;
          at
  org.eclipse.osgi.container.ModuleContainer.start(ModuleContainer.java:777)&lt;br /&gt;
          at
  org.eclipse.osgi.container.ModuleContainer.applyDelta(ModuleContainer.java:768)&lt;br /&gt;
          at
  org.eclipse.osgi.container.ModuleContainer.resolveAndApply(ModuleContainer.java:538)&lt;br /&gt;
          at
  org.eclipse.osgi.container.ModuleContainer.resolve(ModuleContainer.java:484)&lt;br /&gt;
          at
  org.eclipse.osgi.container.ModuleContainer.refresh(ModuleContainer.java:1028)&lt;br /&gt;
          at
  org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1409)&lt;br /&gt;
          at
  org.eclipse.osgi.container.ModuleContainer$ContainerWiring.dispatchEvent(ModuleContainer.java:1)&lt;br /&gt;
          at
  org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)&lt;br /&gt;
          at
  org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)&lt;br /&gt;
  Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 5120 out of
  bounds for length 134&lt;br /&gt;         at
  org.springframework.asm.ClassReader.readClass(Unknown Source)&lt;br /&gt;  
        at org.springframework.asm.ClassReader.accept(Unknown
  Source)&lt;br /&gt;         at
  org.springframework.asm.ClassReader.accept(Unknown Source)&lt;br /&gt;      
    at
  org.springframework.core.type.classreading.SimpleMetadataReader.&amp;lt;init&amp;gt;(SimpleMetadataReader.java:54)&lt;br /&gt;
          at
  org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)&lt;br /&gt;
          at
  org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)&lt;br /&gt;
          at
  org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:213)&lt;br /&gt;
          ... 108 more&lt;/p&gt;</summary>
    <dc:creator>Komal Prasad</dc:creator>
    <dc:date>2022-02-25T15:53:22Z</dc:date>
  </entry>
</feed>
