ejb@glassfish.java.net

Re: appserv-rt conflict with jstl libraries

From: Joseph dela Peņa <masterkurei99_at_gmail.com>
Date: Tue, 12 May 2009 16:58:21 +0800

Hi,

   It should print "Hello There :D" as declared in the previous line.
Anyway, there is nothing wrong with the codes. Whats wrong is
appserv-rt is conflicting with the jstl libraries. The exception
thrown is:

SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NoSuchMethodError:
javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
at org.apache.jasper.compiler.JspUtil.getExpressionFactory(JspUtil.java:1166)
at org.apache.jasper.compiler.JspUtil.validateExpressions(JspUtil.java:628)
at org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1341)
at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1117)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:834)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1482)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2257)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2307)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2313)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:481)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2257)
at org.apache.jasper.compiler.Validator.validate(Validator.java:1837)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:195)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:409)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at gogogo.MyServlet.doPost(MyServlet.java:88)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

On Tue, May 12, 2009 at 4:16 PM, ianaz <ianaz90_at_gmail.com> wrote:
> <c:out value="${myVar}" /> what print? It give an exception?
>
> 2009/5/12 Joseph dela Peņa <masterkurei99_at_gmail.com>
>>
>> Hi,
>>
>>   Thanks for the response.  There is not much codes involved yet.
>> Here is the scenario:
>>
>> 1. I have two simple projects. The first one is a jsp which uses jstl
>> tags.  The second one is a jsp acting as an ejb client, calling a
>> remote stateless session bean.  This second project does not use jstl
>> tags.
>>
>> 2. Both projects works as expected.
>>
>> 3. I tried to combine both projects to come up with a jsp page in jstl
>> tags, and calls remote ejb.  I started by moving the libs of project 2
>> to project 1.  This should enable me to call remote ejb in project 1.
>> These jars are:  appserv-admin.jar, appserv-deployment-client.jar,
>> appserv-ext.jar, appserv-rt.jar, & javaee.jar.
>>
>> 4. I placed these jars one by one and tried running the project as a
>> jar file is added in the WEB-INF\lib directory
>>
>> 5.  The web page displayed correctly until i added appserv-rt.jar
>>
>> Below are the codes that i have on my jsp:
>>
>> <%@ page language="java" contentType="text/html; charset=UTF-8"
>> pageEncoding="UTF-8"%>
>> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
>> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>> "http://www.w3.org/TR/html4/loose.dtd">
>> <html>
>> <head>
>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
>> <title>Insert title here</title>
>> </head>
>> <body>
>>        <c:set var="myVar" value="Hello There :D"/>
>>        <c:out value="${myVar}" />
>> </body>
>> </html>
>>
>>
>>
>> Thanks
>>
>>
>>
>>
>> On Tue, May 12, 2009 at 3:34 PM, ianaz <ianaz90_at_gmail.com> wrote:
>> > Hi Joseph,
>> > it's not clear the problem. Can you post some code please?
>> >
>> >
>> > 2009/5/12 Joseph dela Peņa <masterkurei99_at_gmail.com>
>> >>
>> >> Hi,
>> >>
>> >>    I've started using JSTL tags in my JSP. All was good until i needed
>> >> to
>> >> call a remote EJB from a servlet, store the object to a session, and
>> >> redirect to a JSP page to display the content of the remote object.
>> >> We'll just to clear things, i am able to do this properly using JSP
>> >> expressions <%=myVar%>. And i am able to use <c:out value="${myVar}"
>> >> />
>> >>
>> >> on a project which does not have appserv-rt.jar inside it's lib
>> >> directory. I'm getting a java.lang.NoSuchMethodError:
>> >> javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
>> >> when i add appserv-rt.jar in my lib. I'm using Tomcat 6.0.18 as my web
>> >> server and glassfish as my app server. Below is the complete stack
>> >> trace from tomcat:
>> >>
>> >> SEVERE: Servlet.service() for servlet jsp threw exception
>> >> java.lang.NoSuchMethodError:
>> >> javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory;
>> >> at
>> >>
>> >> org.apache.jasper.compiler.JspUtil.getExpressionFactory(JspUtil.java:1166)
>> >> at
>> >>
>> >> org.apache.jasper.compiler.JspUtil.validateExpressions(JspUtil.java:628)
>> >> at
>> >>
>> >> org.apache.jasper.compiler.Validator$ValidateVisitor.getJspAttribute(Validator.java:1341)
>> >> at
>> >>
>> >> org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1117)
>> >> at
>> >>
>> >> org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:834)
>> >> at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1482)
>> >> at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2257)
>> >> at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2307)
>> >> at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2313)
>> >> at org.apache.jasper.compiler.Node$Root.accept(Node.java:481)
>> >> at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2257)
>> >> at org.apache.jasper.compiler.Validator.validate(Validator.java:1837)
>> >> at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:195)
>> >> at org.apache.jasper.compiler.Compiler.compile(Compiler.java:409)
>> >> at
>> >>
>> >> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
>> >> at
>> >>
>> >> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
>> >> at
>> >>
>> >> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:470)
>> >> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:364)
>> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
>> >> at gogogo.MyServlet.doPost(MyServlet.java:88)
>> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
>> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>> >> at
>> >>
>> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> >> at
>> >>
>> >> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>> >> at
>> >>
>> >> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>> >> at
>> >>
>> >> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>> >> at
>> >>
>> >> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> >> at
>> >>
>> >> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>> >> at
>> >>
>> >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>> >> at
>> >>
>> >> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>> >> at
>> >>
>> >> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>> >> at
>> >> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>> >> at java.lang.Thread.run(Thread.java:619)
>> >>
>> >> This has been driving me nuts for weeks... any help would be deeply
>> >> appreciated.
>> >>
>> >> thanks
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
>> >> For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
>> >>
>> >
>> >
>> >
>> > --
>> > Silvio Rainoldi
>> > Via Rinaldo Simen 6
>> > 6648 Minusio
>> > Switzerland
>> > tel: +41 (0)76 566 03 90
>> > silvio.rainoldi_at_zattix.com
>> > www.zattix.com
>> >
>> >
>> >
>> > *************************************
>> > Notice: The information contained in this message is
>> > intended only for use of the individual(s) named above and
>> > may contain confidential, proprietary or legally privileged
>> > information. No confidentiality or privilege is waived or
>> > lost by any mistransmission. If you are not the intended
>> > recipient of this message you are hereby notified that you
>> > must not use,disseminate, copy it in any form or take any
>> > action in reliance of it. If you have received this message
>> > in error please delete it and any copies of it and notify
>> > the sender immediately.
>> > *************************************
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ejb-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: ejb-help_at_glassfish.dev.java.net
>>
>
>
>
> --
> Silvio Rainoldi
> Via Rinaldo Simen 6
> 6648 Minusio
> Switzerland
> tel: +41 (0)76 566 03 90
> silvio.rainoldi_at_zattix.com
> www.zattix.com
>
>
>
> *************************************
> Notice: The information contained in this message is
> intended only for use of the individual(s) named above and
> may contain confidential, proprietary or legally privileged
> information. No confidentiality or privilege is waived or
> lost by any mistransmission. If you are not the intended
> recipient of this message you are hereby notified that you
> must not use,disseminate, copy it in any form or take any
> action in reliance of it. If you have received this message
> in error please delete it and any copies of it and notify
> the sender immediately.
> *************************************
>