发步项目到本地tomcat,启动后,一直包错:
警告: Failed to retrieve JNDI naming context for container [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/smp]] so no cleanup was performed for that container
javax.naming.NamingException: No naming context bound to this class loader
javax.naming.NamingException: No naming context bound to this class loader
查找原因发现是jdk版本号的问题,由于本地jdk版本号为1.8,而maven编译插件中指定的jdk版本号为1.6,故一直报错,无法成功启动,修改版本号后问题解决。
<!-- compiler插件, 设定JDK版本 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> <source>1.6</source> <target>1.6</target> <showWarnings>true</showWarnings> </configuration> </plugin>