vaadin / portlet

Portlet support for Vaadin Flow
https://vaadin.com
Other
2 stars 3 forks source link

Some Portlet names breaks the app #132

Closed denis-anisimov closed 5 years ago

denis-anisimov commented 5 years ago

I've defined VaadinIPCPortlet class. It broke the app with the exception:

20-Nov-2019 10:32:19.219 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Error during ServletContainerInitializer processing
 javax.servlet.ServletException: WebComponentConfigurationRegistryInitializer failed to collect WebComponentExporter implementations!
    at com.vaadin.flow.server.startup.WebComponentConfigurationRegistryInitializer.onStartup(WebComponentConfigurationRegistryInitializer.java:80)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5225)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:980)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1851)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.vaadin.flow.server.InvalidCustomElementNameException: Tag name 'vaadin-iPC-portlet' given by 'com.vaadin.flow.portal.events.VaadinIPCPortlet' is not a valid custom element name.
    at com.vaadin.flow.server.startup.WebComponentConfigurationRegistryInitializer.validateTagNames(WebComponentConfigurationRegistryInitializer.java:112)
    at com.vaadin.flow.server.startup.WebComponentConfigurationRegistryInitializer.onStartup(WebComponentConfigurationRegistryInitializer.java:75)
    ... 12 more

The logic which derive the portlet tag name should be fixed.

joheriks commented 5 years ago

Another issue with the current name generation is that it is based on the simple class name, causing clashes in the following case:

public class PortletView1 extends Div {
    public static class Portlet extends VaadinPortlet<PortletView1> {}
    ...
}
public class PortletView2 extends Div {
    public static class Portlet extends VaadinPortlet<PortletView2> {}
    ...
}

Both portlet WCs will have tags portlet-portlet.