Packet conflict issues encountered in the development of Hadoop+javaweb

Source: Internet
Author: User
Tags throw exception

1.HDFS + WEB Project News java.lang.VerifyError ... Abnormal

Throw exception:

Exception in thread "main" Java.lang.VerifyError: (Class:com/google/common/collect/interners, Method:newweakinterner Signature: () Lcom/google/common/collect/interner;) Incompatible argument to function

At Org.apache.hadoop.util.stringinterner.<clinit> (stringinterner.java:48)

At Org.apache.hadoop.conf.Configuration.loadResource (configuration.java:2472)

At Org.apache.hadoop.conf.Configuration.loadResources (configuration.java:2364)

At Org.apache.hadoop.conf.Configuration.getProps (configuration.java:2281)

At Org.apache.hadoop.conf.Configuration.get (configuration.java:888)

At Org.apache.hadoop.conf.Configuration.getTrimmed (configuration.java:907)

At Org.apache.hadoop.conf.Configuration.getBoolean (configuration.java:1308)

At Org.apache.hadoop.fs.FileSystem.get (filesystem.java:366)

The conflict comes from both the Weld-osgi-bundle.jar and Guava-11.0.2.jar packages in Java_ee_6. The Com/google/common/collect/interners class is a tool class used by HDFs to create a Interner class when creating filesystem, but Weld-osgi-bundle.jar and Guava-11.0.2.jar have the same structure, but there is no interners class in Weld-osgi-bundle.jar, resulting in a conflict during the run.

Workaround One:

Apply the Web project to Java EE 5. The author's project using Java EE 5 is sufficient, if you have a project that uses Java EE 6 functionality can be implemented by additional import of the required tools.

Workaround Two:

Add Java EE 6 package via ADD JARs ... Imported in the same way.

Note: Do not place packages in Java EE 6 directly under Webroot/web-inf/lib, which can also cause package conflicts

2. Report Abnormal Java.lang.NoSuchMethodError:org.eclipse.jdt.internal.compiler.CompilationRejava.lang.NoSuchMethodError: Org.eclipse.jdt.internal.compiler.CompilationResult.getProblems ()

These are:

The Hadoop-related jar relies on third-party jar packages such as jetty, Servlets, and other conflicts in the current project.

1. If you use MAVEN, after you exclude these jar packages from the Pom file, it is normal to start the access page:

<dependency>

<groupId>org.apache.hadoop</groupId> <artifactId>hadoop-common</artifactId> <version>${hadoop.version}</version> <exclusions> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> </exclusion> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-util</artifactId> </exclusion> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>jsp-2.1</artifactId> </exclusion> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>jsp-api-2.1</artifactId> </exclusion> <exclusion> <groupId>org.mortbay.jetty</groupId> <artifactId>servlet-api-2.1</artifactId> </exclusion> <exclusion> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </exclusion> <exclusion> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> </exclusion> <exclusion> <groupId>Tomcat</groupId> <artifactId>jasper-compiler</artifactId> </exclusion> <exclusion> <groupId>Tomcat</groupId> <artifactId>jasper-runtime</artifactId> </exclusion> </exclusions> </dependency>2, if you manually in the Lib to join, which will be removed these several packages, at present I am doing so, can be used to run (there is a specific version number, I did not write, but the front is the same) Jersey-server-1.9.jar Jasper-runtime-5.5.23.jar Jasper-compiler-5.5.23.jar Servlet-api.jar Jsp-api.jar Jetty-util.jar Jetty.jar finally you can also view other people's: http://brandnewuser.iteye.com/blog/2208969 http://www.micmiu.com/exception/jee-hadoop-nosuchmethod-error-getproblems/

Packet conflict issues encountered in the development of Hadoop+javaweb

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.