Tag Archives: IDEA

IDEA Run mapreduce error: PATH Set Error [How to Solve]

Error Message:
[root@node01 servers]# hadoop jar loginVisit.jar cn.itcast.loginVisit.step1.Step1Main
19/07/17 22:14:59 INFO client.RMProxy: Connecting to ResourceManager at node01/192.168.8.100:8032
19/07/17 22:14:59 WARN security.UserGroupInformation: PriviledgedActionException as:root (auth:SIMPLE) cause:java.net.ConnectException: Call From node01.hadoop.com/192.168.8.100 to node02:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
Exception in thread “main” java.net.ConnectException: Call From node01.hadoop.com/192.168.8.100 to node02:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

 

 

Solution:
Step1Main.java, path set error.
TextOutputFormat.setOutputPath(job,new Path(“hdfs://node02:8020/loginVisit/output3”));
Change node02 to node01.

Rabbitmq error of connecting the native idea to Linux: java.net.connectexception: connection timed out: Connect [Solved]

The code is as follows:

        ConnectionFactory connectionFactory = new ConnectionFactory();
        connectionFactory.setHost("192.168.2.135");
        connectionFactory.setPort(5672);
        connectionFactory.setUsername("admin");
        connectionFactory.setPassword("admin");
        connectionFactory.setVirtualHost("/");

        Connection connection=null;
        Channel channel = null;

        try {
            //2.create linke Connection
            connection = connectionFactory.newConnection("Creator");

Error: Java. Net. Connectexception: connection timed out: connect

Cause analysis: first, the IP port account and password are excluded

Error reason: port 5672 is not open. I always thought that everything would be fine as long as the protective wall was closed

Solution:

1. Restart the firewall: systemctl start firewall

2. Open 5672 port: firewall CMD — zone = public — add port = 5672/TCP — permanent

3. Reload: firewall CMD — reload

Run debug:

success!!!

Error reporting of dependency package introduced by idea

      When updating the project today, Maven relies on a service that keeps reporting errors. After checking, it was found that it was due to the lack of dependent packages. But I’m dependent on Bao Mingming

      Download again, as usual… After working for a long time, I found that my dependent package class status is unavailable. As shown in the figure below:

  

 

 

  Well, the solution is simple:

 

 

 

When Maven relies on, it preferentially relies on the local; If local is not available, it will still rely on local…  

The interface method is not rewritten, and the idea does not report an error.

Today, I was a little confused when I was writing interceptors in idea. I inherited handlerinterceptor without any errors. I always thought he would remind me to rewrite methods. As shown below

By checking the data, well, finally find the reason. First, go to the source code of the handlerinterceptor interface

public interface HandlerInterceptor {

	default boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		return true;
	}

	default void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
			@Nullable ModelAndView modelAndView) throws Exception {
	}
	
	default void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler,
			@Nullable Exception ex) throws Exception {
	}
}

Knock on the blackboard. Here’s the point

The above is the source code of the handlerinterceptor interface. You can see that in the higher version of spring webmvc jar package, the handlerinterceptor interface defines the default method, which is a new feature of JDK1.8. In other words, you can rewrite the methods in the interface without any error

So it doesn’t remind you to rewrite. You have to write it yourself

The project is normal in eclipse, and an error is reported in IDEA [How to Solve]

Eclipse has always been used, but many employees of the company use idea, so they want to try. Unexpectedly, after importing Maven project, they always report errors. Finally, they find that there is no XML file in Dao in the compiled target, resulting in errors when the listener loads resources

Finally, after repeated search, we finally found the answer

In pom.xml < build> Add to:

<resources>
   <resource>
      <directory>src/main/java</directory>
      <includes>
         <include>**/*.xml</include>
      </includes>
      <filtering>true</filtering>
   </resource>
   <resource>
      <directory>src/main/resources</directory>
      <filtering>true</filtering>
   </resource>
</resources>
Delete the target folder, recompile, and the project starts.
Something magical happened, the project started. It's a real pain in the ass.

Idea uses git’s pull command to report error 1

Reference blog: https://blog.csdn.net/nan7_/ article/details/25624637

Your local changes would be overwritten by merge. Commit, stage or revert them to proceed

Cause: git conflict

1. Use the GIT repository stash changes command to save your changes

At this time, you will find that the modified parts are gone and return to the original state

2、pull

Download the code on GIT

3、git-repository-Unstash changes

Take out your own code and compare and merge the code

In the comparison page, the version in Git library is on the left, the original version is in the middle, and your own version is on the right

Idea suddenly reports an error for all package names

The broken computer went into sleep mode after work. It couldn’t wake up the next day, so it had to be restarted physically

Results after opening the project, almost all package names reported errors

After some searching, we finally found a solution

Click file in the upper left corner and operate according to the following figure

If an error is reported after restart, Maven project — > Reimport

 

IDEA error: javax/xml/bind/DatatypeConverter [How to Solve]

Error in idea javax/XML/bind/datatypeconverter

java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

Solution:

Import required  javax.xml.bind.jar     Just download an import

The real solution: java.lang.noclassdeffounderror: javax/XML/bind/datatypeconverter

 

This error occurred when using hibernate in the JDK 12.0 environment today. The error log is as follows:
! [] ()
cause of failure:

JAXB API is the API of Java EE, so this jar package is no longer included in Java se 9.0
the concept of module is introduced in Java 9. By default, the jar package of Java EE will no longer be included in Java se
but this API is bundled in Java 6/7/8

solution 1:

Reduce JDK version to JDK 8

solution 2: (pro test feasible)

Manually add these dependent jar packages

<dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-core</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
    </dependency>

Idea debugs locally, and spark reports an error when creating hivecontext

Spark version: 1.6.1

Scala version: 2.10

problem scenario:

when idea debugged the local program, an error was reported when creating the hivecontext. This problem was not found in the morning. In the afternoon, a small Deamon was written in the project. This problem occurred. Here is my code:

import cn.com.xxx.common.config.SparkConfig
import org.apache.spark.sql.hive.HiveContext

object test{
  def main(args: Array[String]): Unit = {
    SparkConfig.init("local[2]", this.getClass.getName)
    val sc = SparkConfig.getSparkContext()
    sc.setLogLevel("WARN")
    val hqlContext = new HiveContext(sc)
    println("hello")
    sc.stop()
  }
}

 

error reporting:

 

  After worrying all morning, I thought my dependency package was not downloaded at first, but there was this package in the build.sbt file in my SBT. I tracked the source code, looked for Du Niang, and so on. Finally, I found the problem. Finally, I located the problem because the type setting of the spark hive dependency package was wrong:

By the way, how do I find the build.sbt file in idea

The culprit is this word, which needs to be changed to “compile”, as shown in the following figure:

Then, click the prompt in the lower right corner, import:

Wait until the update is completed, and then compile here. Success

Big pit, record it here to prevent encountering it again in the future