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

java.lang.AbstractMethodError loading the cantaloupe index page #160

Closed
cbeer opened this issue Oct 4, 2017 · 10 comments
Closed

java.lang.AbstractMethodError loading the cantaloupe index page #160

cbeer opened this issue Oct 4, 2017 · 10 comments
Labels
Milestone

Comments

@cbeer
Copy link
Contributor

cbeer commented Oct 4, 2017

We just updated to a build off the develop branch (to fix #159), and now when we load the root page of cantaloupe, we're seeing this exception:

12:57:41.796 [ajp-apr-8009-exec-4] WARN  o.r.C.R.StatusFilter - Exception or error caught by status service
java.lang.AbstractMethodError: org.apache.velocity.runtime.resource.loader.ResourceLoader.getResourceStream(Ljava/lang/String;)Ljava/io/InputStream;
	at org.apache.velocity.Template.process(Template.java:108)
	at org.restlet.ext.velocity.TemplateRepresentation.<init>(TemplateRepresentation.java:176)
	at edu.illinois.library.cantaloupe.resource.AbstractResource.template(AbstractResource.java:488)
	at edu.illinois.library.cantaloupe.RestletApplication$CustomStatusService.toRepresentation(RestletApplication.java:84)
	at org.restlet.service.StatusService.toRepresentation(StatusService.java:442)
	at org.restlet.resource.ServerResource.doCatch(ServerResource.java:262)
	at org.restlet.resource.ServerResource.handle(ServerResource.java:1033)
	at org.restlet.resource.Finder.handle(Finder.java:236)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.routing.Router.doHandle(Router.java:422)
	at org.restlet.routing.Router.handle(Router.java:641)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
	at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:77)
	at org.restlet.Application.handle(Application.java:385)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.routing.Router.doHandle(Router.java:422)
	at org.restlet.routing.Router.handle(Router.java:641)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.routing.Router.doHandle(Router.java:422)
	at org.restlet.routing.Router.handle(Router.java:641)
	at org.restlet.routing.Filter.doHandle(Filter.java:150)
	at org.restlet.routing.Filter.handle(Filter.java:197)
	at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202)
	at org.restlet.Component.handle(Component.java:408)
	at org.restlet.Server.handle(Server.java:507)
	at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63)
	at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143)
	at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
	at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:188)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2549)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2538)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:748)
@adolski
Copy link
Contributor

adolski commented Oct 5, 2017

I can't reproduce this on my end, but the docs for AbstractMethodError say:

Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.

That leads me to wonder if you are doing some kind of hot redeploy?

The following works for me, on develop:

$ mvn clean package -DskipTests
$ cp target/Cantaloupe-3.4-SNAPSHOT.war ~/apache-tomcat-8.0.32/webapps/
$ curl -v http://localhost:8080/Cantaloupe-3.4-SNAPSHOT/
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8080 (#0)
> GET /Cantaloupe-3.4-SNAPSHOT/ HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Cache-Control: max-age=2147483647, public
< Date: Thu, 05 Oct 2017 15:22:53 GMT
< Accept-Ranges: bytes
< Server: Restlet-Framework/2.3.11
< Vary: Origin, Accept-Charset, Accept-Encoding, Accept-Language, Accept
< X-Powered-By: Cantaloupe/3.4-SNAPSHOT
< Content-Type: text/html;charset=UTF-8
< Transfer-Encoding: chunked
< 
* Connection #0 to host localhost left intact
<!DOCTYPE html>
..........

@cbeer
Copy link
Contributor Author

cbeer commented Oct 6, 2017

You're right, that's exactly what happened; sorry to bother you.

@cbeer cbeer closed this as completed Oct 6, 2017
@whikloj
Copy link

whikloj commented Nov 1, 2017

Not for nothing, but I am getting this exact error when trying to deploy the 3.3.3 war from the released zip file and when packaging the 3.3 release branch to an existing Tomcat 7 container.

Trying the develop branch now.

@adolski
Copy link
Contributor

adolski commented Nov 1, 2017

Hi @whikloj,

I've looked into this further and here are my findings:

In version <= 3.3.x, Cantaloupe is using Restlet's Velocity extension to provide support for dynamic templates. Cantaloupe 3.3.2 is using Restlet 2.3.10, which depends on Velocity 1.7.

In Cantaloupe 3.3.3, Restlet was upgraded to version 2.3.11 to fix #107. Restlet 2.3.11 (as I'm just now learning) depends on Velocity 2.0. This is a big upgrade and I don't know why they did this in a bugfix release. They didn't even mention it in their changelog, which is why I didn't know about it. Geez Louise!

In summary:

Cantaloupe <= 3.3.2 + Tomcat 7: works
Cantaloupe 3.3.3 + Tomcat 7: AbstractMethodError
Cantaloupe 3.3.3 + Tomcat 8: works
Cantaloupe 3.4-SNAPSHOT + Tomcat 7: works
Cantaloupe 3.4-SNAPSHOT + Tomcat 8: works

(The Restlet Velocity extension was recently removed in 3.4-SNAPSHOT, so that version isn't affected.)

@adolski adolski reopened this Nov 1, 2017
@adolski adolski added this to the 3.3.4 milestone Nov 1, 2017
@whikloj
Copy link

whikloj commented Nov 2, 2017

Thanks @adolski, I'm running an older RedHat 5 server and I am having some issues compiling (even with -Pnodeps). I'm also unable to remote debug the code as Java 8 seems to have a bug that comes up with -Dmaven.surefire.debug

So I'll go back to 3.3.2 for now.

Here are the tests failing...not a lot of useful information there.

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   FilesystemResolverTest.getFileWithPresentUnreadableFile:98 Expected exception
[ERROR]   FilesystemResolverTest.newStreamSourceWithPresentUnreadableFile:60 Expected exception
[ERROR]   HttpResolverHTTPSTest.newStreamSourceWithPresentUnreadableImage:10->HttpResolverTest.newStreamSourceWithPresentUnreadableImage:86 Expected exception
[ERROR]   HttpResolverHTTPTest.newStreamSourceWithPresentUnreadableImage:10->HttpResolverTest.newStreamSourceWithPresentUnreadableImage:86 Expected exception
[INFO] 
[ERROR] Tests run: 1288, Failures: 4, Errors: 0, Skipped: 20
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9:10.079s
[INFO] Finished at: Thu Nov 02 10:02:40 CDT 2017
[INFO] Final Memory: 37M/386M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project Cantaloupe: There are test failures.
[ERROR] 
[ERROR] Please refer to /opt/cantaloupe/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

@adolski
Copy link
Contributor

adolski commented Nov 2, 2017

I'm not sure about those failures, but they don't look very serious unless you expect to encounter unreadable content with FilesystemResolver or HttpResolver, and it could be the tests themselves that are at fault. You can always pass -DskipTests to Maven.

@schwemmer
Copy link

I am getting the same error when deploying the v3.3.3 according to the instructions on Ubuntu 16.04 LTS. v3.3.2 works as expected. Maybe consider reopening this issue since it seems to me that the latest released version simply does not work, at least not on Ubuntu.

@RussellMcOrmond
Copy link

I can confirm that v3.3.4 works for me (4 for 4 servers I've deployed to so far). Thanks @adolski for doing the release.

@adolski
Copy link
Contributor

adolski commented Nov 17, 2017

Good to hear, @RussellMcOrmond. BTW, would you mind if I added a link to your Docker configuration in the getting started guide?

@RussellMcOrmond
Copy link

Sure, add to the guide. I'll let you know if our delegates script gets too complex to be a good example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants