0

I have an existing Maven project working fine on a java version 1.8.0_241. But this supports vaadin version 7.2.6 and is needed to upgrade to vaadin 8 along with the compatibilty package. After making the necessary changes all the compilation issue are resolved but during execution, we are facing a ClassNotFoundException for one of our class GuiBaseApplication. But the class file was present in the OSGI Bundle guibase-2.2.4-SNAPSHOT.jar being used.

This class is an abstract class extending one class and implementing another class.

public abstract class GuiBaseApplication extends UI implements CrumbTrail
{
    -
    -
}

But when we took the -verbose logs, then could see that class was loaded once as below log.

    **[Loaded com.product.rm.common.guibase.GuiBaseApplication from file:/home/user/bcd/com.product.bss.vaadin/target/guibase-2.2.4-SNAPSHOT.jar]**

Uptill now the Web GUI HTTP server was up and running.

Then trying to connect via the browser, the below error was displayed.

HTTP ERROR 500 javax.servlet.ServletException: com.vaadin.server.ServiceException: com.vaadin.server.ServiceException: com.product.rm.common.guibase.GuiBaseApplication could not be loaded
URI:    /gui
STATUS: 500
MESSAGE:        javax.servlet.ServletException: com.vaadin.server.ServiceException: com.vaadin.server.ServiceException: com.product.rm.common.guibase.GuiBaseApplication could not be loaded
SERVLET:        com.product.rm.bcd.server.webgui.ApplicationServlet-27a56cca
CAUSED BY:      javax.servlet.ServletException: com.vaadin.server.ServiceException: com.vaadin.server.ServiceException: com.product.rm.common.guibase.GuiBaseApplication could not be loaded
CAUSED BY:      com.vaadin.server.ServiceException: com.vaadin.server.ServiceException: com.product.rm.common.guibase.GuiBaseApplication could not be loaded
CAUSED BY:      com.vaadin.server.ServiceException: com.product.rm.common.guibase.GuiBaseApplication could not be loaded
CAUSED BY:      java.lang.ClassNotFoundException: com.product.rm.common.guibase.GuiBaseApplication

Checking on the existing and working version, we could see that this class is loaded two more times as below but with $1 and $2 sign.

[Loaded com.product.rm.common.guibase.GuiBaseApplication$1 from file:/home/user/bcd/com.product.bss.vaadin/target/guibase-2.2.3-SNAPSHOT.jar]
[Loaded com.product.rm.common.guibase.GuiBaseApplication$2 from file:/home/user/bcd/com.product.bss.vaadin/target/guibase-2.2.3-SNAPSHOT.jar]

We checked and confirmed that these 2 classes are GuiBaseApplication$1 and GuiBaseApplication$2 are present in the guibase-2.2.4-SNAPSHOT.jar file but still class loading issue is there.

It will be very helpful if we get some directions for where to look further. What we can try to identify the cause and then resolve the issue.

4

1 回答 1

0

这是 vaadin 中的错误检查页面 https://floriansblog.wordpress.com/2015/04/30/vaadin-osgi-managing-the-classloader/

于 2022-02-21T11:50:25.970 回答