Skip to content

Commit

Permalink
BeanInstantiationException when opening view from add-on if deployed…
Browse files Browse the repository at this point in the history
… as WAR jmix-framework#1299

(cherry picked from commit 0bc3cf5)
  • Loading branch information
knstvk committed Jan 10, 2023
1 parent e5f59f5 commit 349cc14
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,7 @@ public void loadViewClass(String className) {
}

/**
* Iterates over all registered views and registers their routes if needed.
* Replaces route registration in case a newer view class is available.
* Iterates over all registered views and registers their routes.
*/
public void registerViewRoutes() {
for (ViewInfo viewInfo : getViewInfos()) {
Expand All @@ -583,8 +582,7 @@ public void registerViewRoutes() {
}

/**
* Registers route for the passed viewInfo instance if needed. Replaces
* route registration in case a newer view class is available.
* Registers route for the passed viewInfo instance.
*
* @param viewInfo a viewInfo instance to register route
*/
Expand All @@ -593,8 +591,7 @@ public void registerRoute(ViewInfo viewInfo) {
}

/**
* Registers route for the passed view class if needed. Replaces
* route registration in case a newer view class is available.
* Registers route for the passed view class.
*
* @param viewClass a view class to register route
*/
Expand All @@ -605,14 +602,8 @@ public void registerRoute(Class<? extends View<?>> viewClass) {
}

RouteConfiguration routeConfiguration = getRouteConfiguration();
if (routeConfiguration.isRouteRegistered(viewClass)) {
log.debug("Skipping route '{}' for class '{}' since it was already registered",
route.value(), viewClass.getName());
return;
}

// Controller class can be hot-deployed, thus route path
// was registered for prev version of class
// The route can be already registered because of hot-deploy or different order of init listeners.
if (routeConfiguration.isPathAvailable(route.value())) {
routeConfiguration.removeRoute(route.value());
}
Expand Down

0 comments on commit 349cc14

Please sign in to comment.