Application migration to Websphere Liberty

3 days ago 10
ARTICLE AD BOX

I am migrating an application to liberty based. the application is servlet based and Jsp files based. I have created dockerfiles, helm chart and liberty config files like server.xml. my application is packed with its own set of JARs required. I am using parentLast delegation to isolate application from liberty interference.

Current Error:

Caused by: java.lang.LinkageError. loading constraint violation when resolving method "org/eclipse/ equinox/servletbridge/BridgeServl et.registerServletDelegate(Ljavax/ servlet/http/HttpServlet;)V": loader "org/eclipse/osgi/internal/baseadaptor /DefaultClassLoader@d66d27b2" of class "org/eclipse/equinox/http/ servletbridge/internal/Activator" and loader "com/ibm/ws/classloading/internal /ParentLastClassLoader@fc9bb2bd" of class "org/eclipse/equinox/servletbridge/ BridgeServlet" have different types for the method signature.

Root Cause: Liberty servlet-3.0 feature provides HttpServlet (servlet 3.1 API) to parent classloader, while embedded javax.servlet_3.0.0 bundle provides HttpServlet (servlet 3.0 API) to OSGi bundles. Same class name, DIFFERENT Class objects = LinkageError!

For ERROR : I have tried 3 ways:

-> one is keeping servlet feature and removing servlet bundle from packing but it causes HTTPServlet and GenericServlet classes not found error.

-> another is keeping servlet bundle and removing servlet feature but it causes application to not start as liberty requires servlet features to deploy WARs

-> when i keep both of them - causes linkage error as mentioned above.

Read Entire Article