In Eclipse: "Run as" on Tomcat

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

In Eclipse: "Run as" on Tomcat

prashant.ladha
While trying to  make "Spring-loaded" work with Appfuse, I was attempting to start my multi-module Appfuse setup using Eclipse's "Run as" option.

Details are copied at http://pastebin.com/AqnSWyHM

Small snippet of the error is :
Oct 05, 2014 1:07:55 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: [74] in the generated java file: [D:\workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\chsms-web\org\apache\jsp\login_jsp.java]
The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory

An error occurred at line: [93] in the generated java file: [D:\workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\chsms-web\org\apache\jsp\login_jsp.java]
The method getDispatcherType() is undefined for the type HttpServletRequest

An error occurred at line: 17 in the jsp file: /common/taglibs.jsp
The method getELContext() is undefined for the type PageContext
14: <%@ taglib uri="http://www.appfuse.org/tags/spring" prefix="appfuse" %>
15: <%@ taglib prefix="t" tagdir="/WEB-INF/tags" %>
16:
17: <c:set var="ctx" value="${pageContext.request.contextPath}"/>
18: <c:set var="datePattern"><fmt:message key="date.format"/></c:set>
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: In Eclipse: "Run as" on Tomcat

mraible
Administrator
It looks like Eclipse might have an older version of the Servlet API in its classpath. If you want to save yourself some pain, I'd recommend using IDEA. It's worth the $200. ;)

http://raibledesigns.com/rd/entry/why_i_prefer_intellij_idea

On Oct 4, 2014, at 1:41 PM, prashant.ladha <[hidden email]> wrote:

> While trying to  make "Spring-loaded" work with Appfuse, I was attempting to
> start my multi-module Appfuse setup using Eclipse's "Run as" option.
>
> Details are copied at http://pastebin.com/AqnSWyHM
>
> Small snippet of the error is :
> Oct 05, 2014 1:07:55 AM org.apache.catalina.core.ApplicationDispatcher
> invoke
> SEVERE: Servlet.service() for servlet jsp threw exception
> org.apache.jasper.JasperException: Unable to compile class for JSP:
>
> An error occurred at line: [74] in the generated java file:
> [D:\workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\chsms-web\org\apache\jsp\login_jsp.java]
> The method getJspApplicationContext(ServletContext) is undefined for the
> type JspFactory
>
> An error occurred at line: [93] in the generated java file:
> [D:\workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\work\Catalina\localhost\chsms-web\org\apache\jsp\login_jsp.java]
> The method getDispatcherType() is undefined for the type HttpServletRequest
>
> An error occurred at line: 17 in the jsp file: /common/taglibs.jsp
> The method getELContext() is undefined for the type PageContext
> 14: <%@ taglib uri="http://www.appfuse.org/tags/spring" prefix="appfuse" %>
> 15: <%@ taglib prefix="t" tagdir="/WEB-INF/tags" %>
> 16:
> 17: <c:set var="ctx" value="${pageContext.request.contextPath}"/>
> 18: <c:set var="datePattern"><fmt:message key="date.format"/></c:set>
>
>
>
> --
> View this message in context: http://appfuse.547863.n4.nabble.com/In-Eclipse-Run-as-on-Tomcat-tp4657317.html
> Sent from the AppFuse - Dev mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: In Eclipse: "Run as" on Tomcat

prashant.ladha
Surprisingly, I got the latest version of almost everyone.
Latest, Eclipse Luna.
Tried it with both Apache Tomcat 8 and 7.

But you are right, I found the servlet-api.jar in below path.
workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\helloworld-web\WEB-INF\lib

Surprisingly, I found servlet-api.2.3.jar in the WAR file generate using maven.
I also found servlet-api-2.3.jar in the Eclipse WTP folders workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps.

I am confusing if it is Eclipse who is putting servlet.2.3  or is it some configuration that is pointing to an incorrect version somewhere.

Any ideas on this?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: In Eclipse: "Run as" on Tomcat

prashant.ladha
Although, being beginner in maven, I understand that because of velocity, the servlet-api.jar 2.3 is making into the EAR file.

[DEBUG]    org.apache.velocity:velocity-tools:jar:2.0:runtime
[DEBUG]       commons-digester:commons-digester:jar:1.8:compile
[DEBUG]       commons-chain:commons-chain:jar:1.1:runtime
[DEBUG]       commons-logging:commons-logging:jar:1.1:compile
[DEBUG]          javax.servlet:servlet-api:jar:2.3:compile
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: In Eclipse: "Run as" on Tomcat

mraible
Administrator
In reply to this post by prashant.ladha
I would try running "mvn jetty:run" from the command line and see if that works. If it does, then it's something Eclipse is doing (I think).

On Sat, Oct 4, 2014 at 3:04 PM, prashant.ladha <[hidden email]> wrote:
Surprisingly, I got the latest version of almost everyone.
Latest, Eclipse Luna.
Tried it with both Apache Tomcat 8 and 7.

But you are right, I found the servlet-api.jar in below path.
workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\helloworld-web\WEB-INF\lib

Surprisingly, I found servlet-api.2.3.jar in the WAR file generate using
maven.
I also found servlet-api-2.3.jar in the Eclipse WTP folders
workspace-eclipse\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps.

I am confusing if it is Eclipse who is putting servlet.2.3  or is it some
configuration that is pointing to an incorrect version somewhere.

Any ideas on this?




--
View this message in context: http://appfuse.547863.n4.nabble.com/In-Eclipse-Run-as-on-Tomcat-tp4657317p4657319.html
Sent from the AppFuse - Dev mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: In Eclipse: "Run as" on Tomcat

mraible
Administrator
In reply to this post by prashant.ladha
Here's what the latest version of AppFuse has:

        <dependency>
            <groupId>struts-menu</groupId>
            <artifactId>struts-menu</artifactId>
            <version>${struts.menu.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>xml-apis</groupId>
                    <artifactId>xml-apis</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>velocity</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>velocity-tools</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-tools</artifactId>
            <version>2.0</version>
            <scope>runtime</scope>
        </dependency>

On Sat, Oct 4, 2014 at 3:33 PM, prashant.ladha <[hidden email]> wrote:
Although, being beginner in maven, I understand that because of velocity, the
servlet-api.jar 2.3 is making into the EAR file.

[DEBUG]    org.apache.velocity:velocity-tools:jar:2.0:runtime
[DEBUG]       commons-digester:commons-digester:jar:1.8:compile
[DEBUG]       commons-chain:commons-chain:jar:1.1:runtime
[DEBUG]       commons-logging:commons-logging:jar:1.1:compile
[DEBUG]          javax.servlet:servlet-api:jar:2.3:compile



--
View this message in context: http://appfuse.547863.n4.nabble.com/In-Eclipse-Run-as-on-Tomcat-tp4657317p4657320.html
Sent from the AppFuse - Dev mailing list archive at Nabble.com.

Loading...