Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting java.lang.NoSuchMethodException: org.eclipse.equinox.http.servlet.HttpServiceServlet.sessionDestroyed(java.lang.String) #511

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -285,22 +285,13 @@ public static class InternalHttpServiceServlet implements HttpSessionListener, H
// private static final long serialVersionUID = 7477982882399972088L;
private final Servlet httpServiceServlet = new HttpServiceServlet();
private ClassLoader contextLoader;
private final Method sessionDestroyed;
private final Method sessionIdChanged;

//removing the final keyword
private Method sessionDestroyed;
private Method sessionIdChanged;

public InternalHttpServiceServlet() {
Class<?> clazz = httpServiceServlet.getClass();

try {
sessionDestroyed = clazz.getMethod("sessionDestroyed", new Class<?>[] { String.class }); //$NON-NLS-1$
} catch (Exception e) {
throw new IllegalStateException(e);
}
try {
sessionIdChanged = clazz.getMethod("sessionIdChanged", new Class<?>[] { String.class }); //$NON-NLS-1$
} catch (Exception e) {
throw new IllegalStateException(e);
}
//removed the constructor code because it wasn't correct , method object was created using reflaction but wrong parameters were getting passed to it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must confess that delete things here completely seems incorrect to me, maybe instead you want them to be initialized on first access (e.g. with a protected method) that the can be override if desired (e.g. that seems to be what you are trying here).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delaying the problem won't help. These methods must exist or there must be an alternatives that exist in their place. Moreover, the sample code is using Jetty 9.4.x while Eclipse is using 12.x with ee8, so that seems completely unworkable to me as well. I tried to get the thing to even compile without errors with no luck. Before we can informatively discuss what can be changed, there needs to exist something that actually runs and demonstrates the problem are trying to fix.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that @anjali-birla tries to extend this Equinox class in some way and probably doing whatever is suitable in that situation then

}

@Override
Expand Down