oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.34k stars 745 forks source link

Unsatisfied dependencies error when deploying on Glassfish #2353

Open sindelar-fr opened 6 years ago

sindelar-fr commented 6 years ago

As you can see here: server.log

I'm unable to deploy the webapp to glassfish due to some unsatisfied dependencies in Suggester (most likely).

I'm running Oracle Linux 7.5, Glassfish 5.0, Oracle JDK 1.8.0_181. I tried opengrok-1.1 rc39 and rc41.

ahornace commented 6 years ago

I'm not sure if it is a bug or a feature of GlassFish. However, proper binding is specified in SuggesterAppBinder...

I just tried adding @RequestScoped to the REST API endpoints (annotated with @Path) and to SuggesterService and SuggesterServiceImpl. (as suggested here http://mjremijan.blogspot.com/2016/09/cdi-inject-beans-into-path-jax-rs.html)

I'm not sure if this is desired or if it somehow hampers Tomcat.

Still, if the annotations would be that needed then I don't get why it works on Tomcat since Jersey is taking care of the injection. (and Tomcat should not have any saying in that)

Anyway, with the workaround applied I was able to deploy the application but I got another error:

org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP

PWC6199: Generated servlet error:
source value 1.5 is obsolete and will be removed in a future release

PWC6199: Generated servlet error:
target value 1.5 is obsolete and will be removed in a future release

PWC6199: Generated servlet error:
To suppress warnings about obsolete options, use -Xlint:-options.

PWC6197: An error occurred at line: 47 in the jsp file: /menu.jspf
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
  (use -source 7 or higher to enable diamond operator)

It seems that it is trying to compile the jsp with Java 5 version. Has GlassFish even worked anytime recently? I will try to look at it in more detail later.