Skip to content

Commit

Permalink
fix broken tomee-webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
lherschi committed Sep 10, 2024
1 parent 4e0e448 commit 37ea96e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public Method run() {
try {
final Object cp = getURLClassPath((URLClassLoader) getClassLoader());
final Class<?> clazz = cp.getClass();
return clazz.getDeclaredMethod("addURL", URL.class);
return clazz.getDeclaredMethod("getURLs");
} catch (final Exception e) {
throw new LoaderRuntimeException(e);
}
Expand All @@ -168,7 +168,7 @@ protected void rebuild() {
final Object cp = getURLClassPath((URLClassLoader) getClassLoader());
final Method getURLsMethod = getGetURLsMethod();
//noinspection NullArgumentToVariableArgMethod
final URL[] urls = (URL[]) getURLsMethod.invoke(cp, (Object) null);
final URL[] urls = (URL[]) getURLsMethod.invoke(cp);

if (urls.length < 1) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1738,12 +1738,12 @@ public void afterStart(final StandardContext standardContext) {

// if appInfo is null this is a failed deployment... just ignore
final ContextInfo contextInfo = getContextInfo(standardContext);
contextInfo.module = null; // shouldnt be there after startup (actually we shouldnt need it from info tree but our scanning does)
if (contextInfo != null && contextInfo.appInfo == null) {
return;
} else if (contextInfo == null) { // openejb webapp loaded from the LoaderServlet
return;
}
contextInfo.module = null; // shouldnt be there after startup (actually we shouldnt need it from info tree but our scanning does)

final String id = getId(standardContext);
WebAppInfo currentWebAppInfo = null;
Expand Down
4 changes: 4 additions & 0 deletions tomee/tomee-webapp/src/main/assembly/war.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<directory>${project.basedir}/src/main/webapp</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}/webjars-resources/META-INF/resources</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/target/classes</directory>
<outputDirectory>/</outputDirectory>
Expand Down

0 comments on commit 37ea96e

Please sign in to comment.