Custom jars in MWS

Hi,

I am trying to attach a document to a task from CouchDb. I am using LightCouch to communicate with the database. I have added the LightCouch jar file on my project’s build path on designer as well as on MWS under the folder Software AG_directory/MWS/lib and subsequently restarted the server. I however get a java.lang.ClassNotFoundException when I run the project. The server seems to not pick up the jar file. The error logs are as follows:

2017-04-03 09:29:44 CAT (jsf:ERROR) [qtp1770949258-226] [RID:32] - Render phase of the portlet failed
java.lang.ClassNotFoundException: org.lightcouch.CouchDbClient cannot be found by mws.war.TestTaskInbox_0.9.0.v20170331-1309
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at caf.war.TestTaskInbox.taskview.TaskViewDefaultviewView.initialize(TaskViewDefaultviewView.java:206)
at com.webmethods.caf.faces.bean.BasePortletPageBean.callInitialize(BasePortletPageBean.java:232)
at com.webmethods.caf.faces.bean.BaseViewBean.preRenderResponse(BaseViewBean.java:103)
at com.webmethods.caf.faces.bean.FacesBeanPhaseListener.preRenderView(FacesBeanPhaseListener.java:39)
at com.webmethods.caf.faces.bean.BasePhaseListener.processEvent(BasePhaseListener.java:38)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108)
at javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:118)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2169)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2142)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:301)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245)
at com.webmethods.caf.faces.application.CAFApplication.publishEvent(CAFApplication.java:627)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.webmethods.caf.faces.portlet.PortletLifecycle$RenderResponsePhase.execute(PortletLifecycle.java:860)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.webmethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:317)
at com.webmethods.caf.faces.portlet.PortletLifecycle.render(PortletLifecycle.java:260)
at com.webmethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:457)
at com.webmethods.portal.framework.portletcontainer.impl.PortletApplicationHandler.process(PortletApplicationHandler.java:607)
at com.webmethods.portal.framework.portletcontainer.servlet.PortletServlet.service(PortletServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:595)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.Dispatcher.include(Dispatcher.java:115)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.dispatch(PortletContainer.java:223)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.process(PortletContainer.java:132)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.renderPortlet(PortletContainer.java:105)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.processRequest(PortletBean.java:197)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.getContentInternal(PortletBean.java:85)
at com.webmethods.portal.framework.portlet.beans.BasicPortletBean.getContent(BasicPortletBean.java:151)
at com.webmethods.portal.mech.portlet.impl.PortletMechanics.getPortletContent(PortletMechanics.java:96)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:430)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:402)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.renderPageContent(DefaultRenderer.java:479)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.render(DefaultRenderer.java:341)
at com.webmethods.portal.framework.presentation.PresentationManager.handlePres(PresentationManager.java:444)
at com.webmethods.portal.framework.dispatch.DispatchManager.pres(DispatchManager.java:721)
at com.webmethods.portal.framework.dispatch.DispatchManager.handle(DispatchManager.java:551)
at com.webmethods.portal.framework.dispatch.DispatchManager.handleDispatch(DispatchManager.java:448)
at com.webmethods.portal.framework.impl.PortalServlet.service(PortalServlet.java:329)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)
at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:364)
at com.webmethods.caf.faces.servlet.GZIPFilter.doFilter(GZIPFilter.java:48)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.NTLMV1Filter.doFilter(NTLMV1Filter.java:55)
at com.webmethods.portal.framework.impl.NTLMFilter.doFilter(NTLMFilter.java:26)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.RequestFilter.doFilter(RequestFilter.java:63)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.JsfPartialAjaxRequestFilter.doFilter(JsfPartialAjaxRequestFilter.java:77)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.SpnegoFilterWrapper.doFilter(SpnegoFilterWrapper.java:85)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at com.webmethods.portal.webapp.jetty7.MwsServer.handle(MwsServer.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)
2017-04-03 09:29:44 CAT (jsf:ERROR) [qtp1770949258-226] [RID:32] - Caught FacesException in FacesPortlet
java.lang.ClassNotFoundException: org.lightcouch.CouchDbClient cannot be found by mws.war.TestTaskInbox_0.9.0.v20170331-1309
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at caf.war.TestTaskInbox.taskview.TaskViewDefaultviewView.initialize(TaskViewDefaultviewView.java:206)
at com.webmethods.caf.faces.bean.BasePortletPageBean.callInitialize(BasePortletPageBean.java:232)
at com.webmethods.caf.faces.bean.BaseViewBean.preRenderResponse(BaseViewBean.java:103)
at com.webmethods.caf.faces.bean.FacesBeanPhaseListener.preRenderView(FacesBeanPhaseListener.java:39)
at com.webmethods.caf.faces.bean.BasePhaseListener.processEvent(BasePhaseListener.java:38)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108)
at javax.faces.event.ComponentSystemEvent.processListener(ComponentSystemEvent.java:118)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2169)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2142)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:301)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:245)
at com.webmethods.caf.faces.application.CAFApplication.publishEvent(CAFApplication.java:627)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
at com.webmethods.caf.faces.portlet.PortletLifecycle$RenderResponsePhase.execute(PortletLifecycle.java:860)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.webmethods.caf.faces.portlet.PortletLifecycle.phase(PortletLifecycle.java:317)
at com.webmethods.caf.faces.portlet.PortletLifecycle.render(PortletLifecycle.java:260)
at com.webmethods.caf.faces.portlet.FacesPortlet.render(FacesPortlet.java:457)
at com.webmethods.portal.framework.portletcontainer.impl.PortletApplicationHandler.process(PortletApplicationHandler.java:607)
at com.webmethods.portal.framework.portletcontainer.servlet.PortletServlet.service(PortletServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:595)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.Dispatcher.include(Dispatcher.java:115)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.dispatch(PortletContainer.java:223)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.process(PortletContainer.java:132)
at com.webmethods.portal.framework.portletcontainer.PortletContainer.renderPortlet(PortletContainer.java:105)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.processRequest(PortletBean.java:197)
at com.webmethods.portal.framework.portletcontainer.beans.PortletBean.getContentInternal(PortletBean.java:85)
at com.webmethods.portal.framework.portlet.beans.BasicPortletBean.getContent(BasicPortletBean.java:151)
at com.webmethods.portal.mech.portlet.impl.PortletMechanics.getPortletContent(PortletMechanics.java:96)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:430)
at com.webmethods.portal.mech.storage.page.PortletHelper.renderContent(PortletHelper.java:402)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.renderPageContent(DefaultRenderer.java:479)
at com.webmethods.portal.framework.presentation.renderers.DefaultRenderer.render(DefaultRenderer.java:341)
at com.webmethods.portal.framework.presentation.PresentationManager.handlePres(PresentationManager.java:444)
at com.webmethods.portal.framework.dispatch.DispatchManager.pres(DispatchManager.java:721)
at com.webmethods.portal.framework.dispatch.DispatchManager.handle(DispatchManager.java:551)
at com.webmethods.portal.framework.dispatch.DispatchManager.handleDispatch(DispatchManager.java:448)
at com.webmethods.portal.framework.impl.PortalServlet.service(PortalServlet.java:329)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83)
at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:364)
at com.webmethods.caf.faces.servlet.GZIPFilter.doFilter(GZIPFilter.java:48)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.NTLMV1Filter.doFilter(NTLMV1Filter.java:55)
at com.webmethods.portal.framework.impl.NTLMFilter.doFilter(NTLMFilter.java:26)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.RequestFilter.doFilter(RequestFilter.java:63)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.JsfPartialAjaxRequestFilter.doFilter(JsfPartialAjaxRequestFilter.java:77)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at com.webmethods.portal.framework.impl.SpnegoFilterWrapper.doFilter(SpnegoFilterWrapper.java:85)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at com.webmethods.portal.webapp.jetty7.MwsServer.handle(MwsServer.java:127)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)

Kindly assist.

Thanks,
Keneilwe

1 Like

We are using version 9.12

Hi Keneilwe,

custom jars for MWS should be placed under MWS/lib/ext instead of MWS/lib.

Regards,
Holger

Thanks for your response.

I moved my jar file to MWS/lib/ext as advised and I restarted the server. I continue to get the same error.

The 9-12 server administration guide has that custom jars should be added to the location Software AG_directory/MWS/lib. I have attached a screenshot.

Regards,
Keneilwe

Have you don’t the extra step of running the command that updates the OSGi profile as described in the “Adding Custom JAR Files” section of the MWS admin guide?

MWS runs inside of an OSGi runtime, so you must do extra work to convert plain jar files (that are not already OSGi bundles) into OSGi bundles and provision those OSGi bundles to the OSGi profile to make them available. The “Software AG_directory
/MWS/bin/mws.[bat | sh] update” command does that work for you after you have copied new jar files to the MWS/lib folder.

Alternatively, MWS 9.12 also supports autodeploy of jar files by copying them to the MWS\server\default\deploy folder, so that may be more convenient than those other steps and wouldn’t require a restart of the server.

3 Likes

Thanks Eric, I copied the jar into the deploy folder as you advised and it worked.

Regards,
Keneilwe