Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.

Thx! Lot of info here, will have a look... :)

BTJ

On 29.03.2016 08:35, Jan Bartel wrote:

I can't see anything particularly wrong with the dependencies, except you need to remove com.sun.el:el-ri:1.0.

I'm attaching a very small example project, which is the standard jsf guessNumber webapp, configured to run with the jetty maven plugin.  The only trick to getting this to work is to ensure that:

1. the jsf jars are on the container classpath and not the webapp classpath (in this case this is achieved by adding the jsf jars to the plugin dependencies)
2. the jsf jars are scanned by jetty (this is achieved by the configuration element <containerIncludeJarPattern>.*/jsf-[^/]*\.jar$</containerIncludeJarPattern>

Point 2 above is actually a jetty maven plugin specific way of telling jetty that there are some jars that need scanning for tlds etc.

If you're not using the maven plugin, then the way to do it is to set up a context attribute called "org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern" to some regexps that match the names of the jars that need scanning. In the jetty distro, the pattern in the etc/jetty-deploy.xml file is:  .*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$

So to add in the pattern for jsf, the full final pattern would be:

.*/jsf-[^/]*\.jar$|.*/[^/]*servlet-api-[^/]*\.jar$|.*/javax.servlet.jsp.jstl-.*\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\.jar$

Note that if you need to set this pattern in code instead, you'd need to escape the backslashes like so:

webappContext.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern",
                           "
.*/jsf-[^/]*\\.jar$|.*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/org.apache.taglibs.taglibs-standard-impl-.*\\.jar$");
 
Try playing around with the guessNumber example to make it more like your setup. My guess is that the jsf jars just aren't being initialized correctly, most probably because they're not being scanned, hence the need for the org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern attribute.

You can also turn on debug logging for annotations (org.eclipse.jetty.annotations.LEVEL=DEBUG if using standard jetty logging) and verify that you see the jsf jars being included for scanning. You should see lines like:

Scanning jar [path to]/jsf-impl-2.2.13.jar

Jan
 

On 27 March 2016 at 23:42, Bjørn T Johansen <btj@xxxxxxxxxx> wrote:
Checked my dependencies but I can not find anything strange but perhaps you guys can, I have included the dependencies as a attachment...

BTJ

On Sun, 27 Mar 2016 15:30:55 +1100
Jan Bartel <janb@xxxxxxxxxxx> wrote:

> I don't think your list of dependencies can be correct yet - something must
> be transitively including older versions. The org.mortbay.jasper jars are
> based on Apache's jasper that implement jsp version 2.3.
>
> I think to get any further with this you are going to have to post a full
> list of your dependencies (including the jetty jars) and any config you
> pass in to spring boot so we can see what jars are on the classpath.
>
> regards
> Jan
>
> On 26 March 2016 at 21:30, Bjørn T Johansen <btj@xxxxxxxxxx> wrote:
>
> > Well, I do not actually use jsp but I think JSF is pulling in this. If I
> > remove the jsp jars, I get the following exception:
> >
> > java.lang.ClassNotFoundException: javax.servlet.jsp.JspFactory
> >
> > What's the best way to get rid of this when running Jetty? (When running
> > Tomcat, I have to include org.apache.tomcat.embed:tomcat-embed-jasper).
> >
> >
> > I also get this when compiling:
> >
> > Error:(129, 70) java: cannot access javax.el.ELException
> >   class file for javax.el.ELException not found
> >
> > That's why I have included org.glassfish.web:el-impl:2.2
> >
> >
> > And I tried to use the jars you listed but then I get the following
> > exception:
> >
> > caused by: com.sun.faces.config.ConfigurationException: It appears the JSP
> > version of the container is older than 2.1 and unable to locate the EL RI
> > _expression_ factory, com.sun.el.ExpressionFactoryImpl.  If not using JSP or
> > the EL RI, make sure the context initialization parameter,
> > com.sun.faces.expressionFactory, is properly set. at
> >
> > com.sun.faces.config.ConfigureListener.registerELResolverAndListenerWithJsp(ConfigureListener.java:694)
> >
> >
> > I solved this by adding com.sun.el:el-ri:1.0 and now it compiles again and
> > runs but I still get the same message in the log.
> >
> >
> > BTJ
> >
> >
> > On Sat, 26 Mar 2016 10:47:19 +1100
> > Jan Bartel <janb@xxxxxxxxxxx> wrote:
> >
> > > Bjørn,
> > >
> > > I would recommend that you use the jsp jars that we distribute with
> > jetty.
> > > You'll need these dependencies:
> > >
> > > for jsp:
> > > org.eclipse.jetty:apache-jsp:jar:<version of jetty you're using>
> > >  javax.servlet:javax.servlet-api:jar:3.1.0
> > > org.mortbay.jasper:apache-jsp:jar:8.0.27
> > > org.mortbay.jasper:apache-el:jar:8.0.27
> > > org.eclipse.jdt.core.compiler:ecj:jar:4.4.2
> > >
> > > for jstl:
> > > org.apache.taglibs:taglibs-standard-spec:jar:1.2.5
> > > org.apache.taglibs:taglibs-standard-impl:jar:1.2.5
> > >
> > > Also have a read of the jetty page about jsp and follow the links to
> > > embedded examples:
> > >
> > http://www.eclipse.org/jetty/documentation/9.3.0.v20150612/configuring-jsp.html
> > >
> > > Jan
> > >
> > > On 26 March 2016 at 07:42, Bjørn T Johansen <btj@xxxxxxxxxx> wrote:
> > >
> > > > Hi.
> > > >
> > > > I am trying to switch my Spring Boot, with JSF 2.2, projects from using
> > > > embedded Tomcat to using embedded Jetty and I seems to have it working
> > now,
> > > > just one annoying log message in the log that I can not seem to get
> > rid of:
> > > >
> > > > JSF1027: [null] The ELResolvers for JSF were not registered with the
> > JSP
> > > > container.
> > > >
> > > >
> > > > My dependencies looks like this:
> > > >
> > > > dependencies {
> > > >     compile('org.springframework.boot:spring-boot-starter-actuator')
> > > >     compile('org.springframework.boot:spring-boot-starter-jdbc') {
> > > >         exclude group: 'org.apache.tomcat' , module: 'tomcat-jdbc'
> > > >     }
> > > >     compile('org.projectlombok:lombok:1.16.6')
> > > >     compile('org.springframework.boot:spring-boot-starter-mail')
> > > >     compile('org.springframework.boot:spring-boot-starter-security')
> > > >     compile('org.springframework.boot:spring-boot-starter-web') {
> > > >         exclude module: 'spring-boot-starter-tomcat'
> > > >         exclude module: 'spring-boot-starter-validation'
> > > >         exclude group: 'org.apache.tomcat:embed' , module:
> > > > 'tomcat-embed-el'
> > > >     }
> > > >     compile('org.springframework.boot:spring-boot-starter-jetty')
> > > >     compile('com.zaxxer:HikariCP:2.4.5')
> > > >     compile "org.primefaces:primefaces:$primefaces"
> > > >     compile 'com.google.code.gson:gson:2.6.2'
> > > >     compile 'org.apache.commons:commons-lang3:3.3.2'
> > > >     compile "com.sun.faces:jsf-api:$jsf"
> > > >     compile "com.sun.faces:jsf-impl:$jsf"
> > > >     compile "org.jasypt:jasypt:$jasypt"
> > > >     compile "org.jasypt:jasypt-springsecurity3:$jasypt"
> > > >     compile "org.jasypt:jasypt-spring31:$jasypt"
> > > >     compile 'joda-time:joda-time:2.9.2'
> > > >     compile 'com.google.guava:guava:19.0'
> > > >     compile('javax.servlet:jsp-api:2.0')
> > > >     compile('javax.servlet:javax.servlet-api:3.1.0')
> > > >     compile('org.glassfish.web:el-impl:2.2')
> > > >     runtime('org.postgresql:postgresql:9.4.1208')
> > > > }
> > > >
> > > >
> > > > First, is this a correct configured Jetty project? Also, what is
> > missing,
> > > > can I get rid of that log message or can I just ignore it?
> > > >
> > > >
> > > > Regards,
> > > >
> > > > BTJ
> > > >
> > > > --
> > > >
> > > >
> > -----------------------------------------------------------------------------------------------
> > > > Bjørn T Johansen
> > > >
> > > > btj@xxxxxxxxxx
> > > >
> > > >
> > -----------------------------------------------------------------------------------------------
> > > > Someone wrote:
> > > > "I understand that if you play a Windows CD backwards you hear strange
> > > > Satanic messages"
> > > > To which someone replied:
> > > > "It's even worse than that; play it forwards and it installs Windows"
> > > >
> > > >
> > -----------------------------------------------------------------------------------------------
> > > > _______________________________________________
> > > > jetty-users mailing list
> > > > jetty-users@xxxxxxxxxxx
> > > > To change your delivery options, retrieve your password, or unsubscribe
> > > > from this list, visit
> > > > https://dev.eclipse.org/mailman/listinfo/jetty-users
> > >
> > >
> > >
> > >
> > _______________________________________________
> > jetty-users mailing list
> > jetty-users@xxxxxxxxxxx
> > To change your delivery options, retrieve your password, or unsubscribe
> > from this list, visit
> > https://dev.eclipse.org/mailman/listinfo/jetty-users
> >
>
>
>

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users



--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
Expert assistance from the creators of Jetty and CometD
 

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

 


Back to the top