NutzCN Logo
问答 nutzwk老版本升级Shiro权限框架失败
发布于 33天前 作者 bb3239 103 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

2014年给客户用nutzwk老版本做了一个系统,客户部署在阿里云上,工信部最近在扫描安全漏洞的时候检测到有存在Apache Shiro Java 反序列化漏洞,建议升级Shiro框架到最新版本,pom里面把shiro版本从1.2.3升级到了1.6.0,但是mvn clean install的时候出错。

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project RailCheckPro: Compilation failure: Compilation failure:
[ERROR] /D:/项目201529/checkPro0823/src/main/java/com/stargis/modules/bus/action/TkCheckAction.java:[61,27] 程序包freemarker.template不存在
[ERROR] /D:/项目201529/checkPro0823/src/main/java/com/stargis/modules/bus/action/TkCheckAction.java:[62,27] 程序包freemarker.template不存在
[ERROR] /D:/项目201529/checkPro0823/src/main/java/com/stargis/modules/bus/action/TkCheckAction.java:[63,27] 程序包freemarker.template不存在
[ERROR] /D:/项目201529/checkPro0823/src/main/java/com/stargis/modules/bus/action/TkCheckAction.java:[74,17] 找不到符号
[ERROR]   符号:   类 Configuration
[ERROR]   位置: 类 com.stargis.modules.bus.action.TkCheckAction
[ERROR] /D:/项目201529/checkPro0823/src/main/java/com/stargis/modules/bus/action/TkCheckAction.java:[195,37] 找不到符号
[ERROR]   符号:   类 Configuration
[ERROR]   位置: 类 com.stargis.modules.bus.action.TkCheckAction
[ERROR] /D:/项目201529/checkPro0823/src/main/java/com/stargis/modules/bus/action/TkCheckAction.java:[212,33] 找不到符号
[ERROR]   符号:   类 Template
[ERROR]   位置: 类 com.stargis.modules.bus.action.TkCheckAction
[ERROR] /D:/项目201529/checkPro0823/src/main/java/com/stargis/modules/bus/action/TkCheckAction.java:[254,42] 找不到符号
[ERROR]   符号:   类 TemplateException
[ERROR]   位置: 类 com.stargis.modules.bus.action.TkCheckAction
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

pom如下:

<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.sta</groupId>
	<artifactId>RailCheckPro</artifactId>
	<packaging>war</packaging>
	<version>1.0-SNAPSHOT</version>
	<name>RailCheckPro</name>
	<url></url>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>
	<developers>
		
	</developers>

	<repositories>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.34</version>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>druid</artifactId>
			<version>1.0.13</version>
		</dependency>
		<dependency>
			<groupId>org.codehaus.jettison</groupId>
			<artifactId>jettison</artifactId>
			<version>1.3.5</version>
			<exclusions>
				<exclusion>
					<groupId>stax</groupId>
					<artifactId>stax-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutz</artifactId>
			<version>1.b.52</version>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutz-web</artifactId>
			<version>1.b.49</version>
		</dependency>
		<dependency>
			<groupId>com.octo.captcha</groupId>
			<artifactId>jcaptcha-all</artifactId>
			<version>1.0-RC6</version>
			<exclusions>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring</artifactId>
				</exclusion>
				<exclusion>
					<groupId>net.sf.ehcache</groupId>
					<artifactId>ehcache</artifactId>
				</exclusion>
				<exclusion>
					<groupId>hsqldb</groupId>
					<artifactId>hsqldb</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-dbcp</groupId>
					<artifactId>commons-dbcp</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-pool</groupId>
					<artifactId>commons-pool</artifactId>
				</exclusion>
				<exclusion>
					<groupId>quartz</groupId>
					<artifactId>quartz</artifactId>
				</exclusion>
				<exclusion>
					<groupId>concurrent</groupId>
					<artifactId>concurrent</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xerces</groupId>
					<artifactId>xmlParserAPIs</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-collections</groupId>
					<artifactId>commons-collections</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xerces</groupId>
					<artifactId>xercesImpl</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.brickred</groupId>
			<artifactId>socialauth</artifactId>
			<version>4.5</version>
			<exclusions>
				<exclusion>
					<groupId>org.json</groupId>
					<artifactId>json</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.openid4java</groupId>
					<artifactId>openid4java-consumer</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.velocity</groupId>
			<artifactId>velocity</artifactId>
			<version>1.7</version>
		</dependency>
		<dependency>
			<groupId>velocity-tools</groupId>
			<artifactId>velocity-tools-view</artifactId>
			<version>1.4</version>
		</dependency>
		<dependency>
			<groupId>velocity-tools</groupId>
			<artifactId>velocity-tools-generic</artifactId>
			<version>2.0-beta1</version>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutz-integration-shiro</artifactId>
			<version>1.b.52.r2</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-web</artifactId>
			<version>1.6.0</version>
		</dependency>
		<dependency>
			<groupId>org.apache.shiro</groupId>
			<artifactId>shiro-core</artifactId>
			<version>1.6.0</version>
		</dependency>
		<dependency>
			<groupId>org.nutz</groupId>
			<artifactId>nutz-integration-quartz</artifactId>
			<version>1.b.52</version>
		</dependency>
		<dependency>
			<groupId>org.quartz-scheduler</groupId>
			<artifactId>quartz</artifactId>
			<version>2.2.1</version>
			<exclusions>
				<exclusion>
					<groupId>c3p0</groupId>
					<artifactId>c3p0</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>commons-digester</groupId>
			<artifactId>commons-digester</artifactId>
			<version>2.1</version>
		</dependency>
		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
			<version>20090211</version>
		</dependency>
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils-core</artifactId>
			<version>1.8.3</version>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.6</version>
		</dependency>
		<dependency>
			<groupId>commons-pool</groupId>
			<artifactId>commons-pool</artifactId>
			<version>1.6</version>
		</dependency>
		<dependency>
			<groupId>com.google.code.google-collections</groupId>
			<artifactId>google-collect</artifactId>
			<version>snapshot-20080530</version>
		</dependency>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.1.3</version>
		</dependency>
		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.3.1</version>
		</dependency>
		<dependency>
			<groupId>com.oracle</groupId>
			<artifactId>ojdbc14</artifactId>
			<version>10.2.0.4.0</version>
			<scope>system</scope>
			<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/ojdbc14.jar</systemPath>
		</dependency>

		<!-- Web begin -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>jsp-api</artifactId>
			<version>2.2</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
			<version>1.2</version>
		</dependency>
		<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>fastjson</artifactId>
			<version>1.2.6</version>
		</dependency>
		<dependency>
			<groupId>org.osgeo</groupId>
			<artifactId>proj4j</artifactId>
			<version>0.1.0</version>
		</dependency>

		<dependency>
			<groupId>maven</groupId>
			<artifactId>dom4j</artifactId>
			<version>1.7-20060614</version>
			<exclusions>
				<exclusion>
					<groupId>jaxen</groupId>
					<artifactId>jaxen</artifactId>
				</exclusion>
				<exclusion>
					<groupId>jaxme</groupId>
					<artifactId>jaxme-api</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xpp3</groupId>
					<artifactId>xpp3</artifactId>
				</exclusion>
				<exclusion>
					<groupId>msv</groupId>
					<artifactId>xsdlib</artifactId>
				</exclusion>
				<exclusion>
					<groupId>msv</groupId>
					<artifactId>relaxngDatatype</artifactId>
				</exclusion>
				<exclusion>
					<groupId>pull-parser</groupId>
					<artifactId>pull-parser</artifactId>
				</exclusion>
				<exclusion>
					<groupId>stax</groupId>
					<artifactId>stax-api</artifactId>
				</exclusion>
				<exclusion>
					<groupId>junitperf</groupId>
					<artifactId>junitperf</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>1.7.5</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.7.5</version>
		</dependency>

	</dependencies>
	<build>
		<sourceDirectory>src/main/java</sourceDirectory>
		<!--<outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>-->
		<finalName>RailCheckPro</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>jar</goal>
						</goals>
						<phase>prepare-package</phase>
						<configuration>
							<excludes>
								<exclude>src/main/resources/**/*</exclude>
							</excludes>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.3</version>
				<configuration>
					<archiveClasses>true</archiveClasses>
					<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
					<warSourceExcludes>game.html</warSourceExcludes>
					<warSourceExcludes>WEB-INF/classes/cn/**,WEB-INF/classes/org/**</warSourceExcludes>
					<webResources>
						<resource>
							<directory>src/main/resources</directory>
							<targetPath>WEB-INF/classes</targetPath>
							<includes>
								<include>**</include>
							</includes>
						</resource>
					</webResources>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.17</version>
				<configuration>
					<forkMode>once</forkMode>
					<argLine>-Dfile.encoding=UTF-8</argLine>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat6-maven-plugin</artifactId>
				<version>2.0-beta-1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.tomcat.maven</groupId>
				<artifactId>tomcat7-maven-plugin</artifactId>
				<version>2.0-beta-1</version>
			</plugin>
		</plugins>
	</build>
</project>
3 回复

说的是freemarker吧?

程序包freemarker.template不存在

@wendal @Wizzercn freemarker是存在的,Java类中引用到freemarker.template的地方也没报错,就是mvn clean install就报错。已经解决了,之前用的是freemarker.jar引用的,我现在改成了maven引用就没问题了

添加回复
请先登陆
回到顶部