Skip to content

Not compatible with guava 21 #49

@jdkcn

Description

@jdkcn
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.homolo.demo</groupId>
	<artifactId>demo-webapp</artifactId>
	<packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>demo-webapp Maven Webapp</name>
	<url>http://maven.apache.org</url>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<m2eclipse.wtp.contextRoot>demo</m2eclipse.wtp.contextRoot>
	</properties>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.0.1</version>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>javax.servlet.jsp-api</artifactId>
			<version>2.3.0</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.4</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>21.0</version>
			<type>jar</type>
			<scope>compile</scope>
		</dependency>
	</dependencies>
	<build>
		<finalName>demo-webapp</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jasig.mojo.jspc</groupId>
				<artifactId>jspc-maven-plugin</artifactId>
				<version>2.0.2</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
						</goals>
						<phase>package</phase>
					</execution>
				</executions>
				<!-- Use the Tomcat 8 JSP compiler -->
				<dependencies>
					<dependency>
						<groupId>org.jasig.mojo.jspc</groupId>
						<artifactId>jspc-compiler-tomcat8</artifactId>
						<version>2.0.2</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>
</project>

The jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%><%
    		String str =  com.google.common.base.CharMatcher.javaIsoControl().removeFrom("Hello");
    %><html>
<body>
<h2>Hello World!</h2>
</body>
</html>
Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 3 in the jsp file: /index.jsp
The method javaIsoControl() is undefined for the type CharMatcher
1: <%@ page language="java" contentType="text/html; charset=UTF-8"
2:     pageEncoding="UTF-8"%><%
3:     		String str =  com.google.common.base.CharMatcher.javaIsoControl().removeFrom("Hello");
4:     %><html>
5: <body>
6: <h2>Hello World!</h2>


Stacktrace:
	at org.apache.jasper.JspC.execute(JspC.java:1393)
	at org.codehaus.mojo.jspc.compiler.tomcat7.JspCompilerImpl.compile(JspCompilerImpl.java:130)
	at org.codehaus.mojo.jspc.CompilationMojoSupport.execute(CompilationMojoSupport.java:384)
	... 23 more
Caused by: org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 3 in the jsp file: /index.jsp
The method javaIsoControl() is undefined for the type CharMatcher
1: <%@ page language="java" contentType="text/html; charset=UTF-8"
2:     pageEncoding="UTF-8"%><%
3:     		String str =  com.google.common.base.CharMatcher.javaIsoControl().removeFrom("Hello");
4:     %><html>
5: <body>
6: <h2>Hello World!</h2>


Stacktrace:
	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:199)
	at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:450)
	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:361)
	at org.apache.jasper.JspC.processFile(JspC.java:1221)
	at org.apache.jasper.JspC.execute(JspC.java:1372)
	... 25 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions