Error 500: javax.servlet.ServletException: Filter [guiceFilter]: could not be initialized

Hi. We’ve been using SCM Manager for some time now on the Tomcat platform but have changed as an enterprise to the IBM WebSphere Liberty platform for all application hosting. After installing SCM Manager on Liberty, and attempting to access the manager, I get the following error in the logs:

Any assistance would be greatly appreciated.

Thanks,
Dan

[3/4/22 9:56:51:437 CST] 00000033 SystemOut O 2022-03-04 09:56:51.437 [Default Executor-thread-4] INFO sonia.scm.boot.BootstrapFilter - fallback to default classloader for GuiceFilter
[3/4/22 9:56:51:438 CST] 00000033 com.sun.jersey.api.core.PackagesResourceConfig I Scanning for root resource and provider classes in the packages:
sonia.scm
[3/4/22 9:56:51:439 CST] 00000033 com.ibm.ws.webcontainer.webapp E SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.ServletException: Filter [guiceFilter]: could not be initialized
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5107)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1007)
at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1159)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:428)
at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:387)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:566)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:500)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:360)
at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:327)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:167)
at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:75)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:504)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:574)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:958)
at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1047)
at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:238)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1160)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:822)
Caused by: javax.servlet.ServletException: Filter [guiceFilter]: could not be initialized
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:157)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:629)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:492)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:293)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:373)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:966)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1140)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5049)
… 20 more
Caused by: javax.servlet.ServletException: java.lang.reflect.InvocationTargetException
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:728)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:674)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:205)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at com.google.inject.servlet.ServletDefinition.init(ServletDefinition.java:117)
at com.google.inject.servlet.ManagedServletPipeline.init(ManagedServletPipeline.java:82)
at com.google.inject.servlet.ManagedFilterPipeline.initPipeline(ManagedFilterPipeline.java:102)
at com.google.inject.servlet.GuiceFilter.init(GuiceFilter.java:172)
at sonia.scm.boot.BootstrapFilter.init(BootstrapFilter.java:154)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:143)
… 27 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:83)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:57)
at java.lang.reflect.Constructor.newInstance(Constructor.java:437)
at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:724)
… 38 more
Caused by: com.sun.jersey.core.spi.scanning.ScannerException: The URI scheme wsjar of the URI wsjar:file:/www/LIBERTY/wlp/usr/servers/LIBERTY/apps/ads-vcs.war!/WEB-INF/classes/sonia/scm is not supported. Package scanning deployment is not supported for such URIs.
Try using a different deployment mechanism such as explicitly declaring root resource and provider classes using an extension of javax.ws.rs.core.Application
at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:228)
at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:142)
at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)
at com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104)
at com.sun.jersey.api.core.PackagesResourceConfig.(PackagesResourceConfig.java:78)
at com.sun.jersey.api.core.PackagesResourceConfig.(PackagesResourceConfig.java:89)
at sonia.scm.api.rest.UriExtensionsConfig.(UriExtensionsConfig.java:77)
… 43 more

Hi Dan,

At a first glance this might be caused by this issue. Could you try to set the java property com.ibm.ws.classloader.useJarUrls to true for SCM-Manager?

Regards
René

This is indeed the issue. Thank you for the rapid reply. FYI, another way to set the useJarUrls property is to add the following to the server.xml file of the liberty profile where the functionality is desired.

 <classloading useJarUrls="true"/>   

Thanks!

Dan

1 Like

Iam closing this thread since there was no activity in the last 30 days.