Tag Archives: eclipse

Some projects cannot be imported because they already exist in the workspace

**Some projects cannot be imported because they already exist in the workspace**

Some projects cannot be imported because they already exist in the workspace

Before talking about how to solve this problem, let’s talk about how to import the project in eclipse software.

The process is as follows:

Open eclipse software first — & gt; File —> Import —> General —> Existing Project into Workspace —> Enter the selection page and select the first select root directory — & gt; Click Browse – & gt; Select the project you want to load

After a series of operations, the project is either imported successfully, or the problem of this blog may occur. The solution is also very simple. Go back to the file directory of the imported project in the eclipse software, find the. Metadata folder, delete it, and restart the software to import the project.

Solve the problem of “failed to load the JNI shared library” when eclipse starts

How to solve the problem of failed to load the JNI shared library when starting eclipse

Problem Description: when you start eclipse, the following pop-up box appears

At this time, it means that the bits of Eclispe and JDK do not match. At this time, you can check the number of bits corresponding to eclipse and JDK.

Solution steps:

1. Check the version number and digits of JDK

The method is as follows: enter the following command under CMD: Java – version

At this time, if the number of bits of the JDK is not displayed, it means that the JDK is 32 bits

If Java hotspot (TM) 64 bit is displayed, it indicates that the version of this JDK is 64 bit

2. Check the version and number of bits of eclipse

The method is as follows: open the eclipse decompression directory and find the eclipse. File

Then open it with Notepad

If win32.win32.x86_ 64 means that the eclipse version is 64 bit

32-bit version if win32.win32.x86

3. Solution:

Unify the number of bits of JDK and eclipse versions, both of which are 32-bit or both are installed as 64 bit.

How to Solve the error in JSON file of eclipse

Sometimes our back-end brother doesn’t want to write HTML and is lazy to download a front-end page. As a result, the JSON file in it always reports errors

Although it can work normally, red x looks unhappy. How to solve it

This is because eclipse thinks that JSON files do not need comments, so we can turn off the compilation check of the reported compilation errors through eclipse settings

Window → preferences → validation → JSON validator

Remove the check boxes of manual and build, and click apply and close. Just ojbk

After eclipse re checks and compiles the project, it is found that JSON no longer reports compilation exceptions

If you want to check whether the JSON file can be compiled normally, you can copy the content of the JSON file and put it into a gadget to check the JSON format. After searching a lot on the Internet, it is not recommended

 

Error in importing web project from eclipse

        It mainly uses SVN checkout to a web project, and then imports it into eclipse to run. Normally, there should be no problem, but sometimes there are problems. After reading other people’s blogs and really solving the problem, just record it. Because there are many pits, if you want to fall and get up again, you will have an inexplicable emotion

1、 Items have red exclamation marks

        If you import the project into eclipse, the project will have a red exclamation point, and there is no error in the code content. Everyone who came out of Baidu online said that either the JDK version was wrong or there was a problem with the jar package

        Right click the project and select “build path —— > Configure   “Build path”, and then you can see the error item prompted under the libraries column

        My fault is that there is a jar package missing. There is a red cross in front of the jar package and parentheses behind it. Remove the jar package and proceed to the next step

2、 Error when starting Tomcat

        When the project is started, Tomcat starts to report errors

       

      1、The required Server component failed to start so Tomcat is unable to start.

       This error can be double clicked   server   Check the box beginning with publish in an options in the overview

      2. Org.apache.catalina.lifecycleexception: failed to start component exception

      This is mainly caused by the problem of jar package. There are two methods to solve it

   ( 1)   You can download the missing jar package and add it

          My fault is that I deleted the jar package that reported the error and did not import it

    ( 2) This is found on Baidu. It can also solve my current situation. I don’t know the specific principle

          In the Tomcat configuration file/conf/catalina.properties (about 122 lines)

            org.apache.catalina.startup.ContextConfig.jarsToSkip=
            After adding *. Jar
            Change to:
            org.apache.catalina.startup.ContextConfig.jarsToSkip=*.jar

Of course, the above decision is based on the blog of many unknown friends on Baidu after their own pit. It’s not an absolute solution. After falling into the pit, look at the solutions of many friends to make yourself less flustered. Thank you for sharing

 

[Solved] Eclipse Error: java.lang.ClassNotFoundException: ContextLoaderListener

An error is reported after the Tomcat deployment project in eclipse is started:

Shell code

Severe:   Error   configuring   application   listener   of   class   org.springframework.web.context.ContextLoaderListener

java.lang.ClassNotFoundException:   org.springframework.web.context.ContextLoaderListener

at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)

at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)

at   org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)

at   org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)

at   org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)

at   org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4660)

at   org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)

at   org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)

at   java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

at   java.util.concurrent.FutureTask.run(FutureTask.java:138)

at   java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

at   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

at   java.lang.Thread.run(Thread.java:662)

problem background :

The project is a maven project, and the contextloaderlistener class is located in the spring-web-3.1.0.release.jar package. The pom.xml of Maven is checked and dependency introduction is normal. In the Maven dependencies view of the project, you can also see that the spring-web-3.1.0.release.jar package is introduced normally

 

error reason:

After entering the deployment path of Tomcat. Metadata \. Plugins \ org. Eclipse. WST. Server. Core \ tmp0 \ wtpwebapps \, it is found that the Lib directory is not generated in the WEB-INF folder after the project is deployed. Under normal circumstances, the Lib directory will be generated and all dependent jar packages of the project will be deployed to this directory

solution:

1. Right click the item – select properties

Select deployment assembly, click add on the right, and select Java build path entries in the pop-up window. As shown in the figure below:

2. Click Next and select Maven dependencies

3. Click finish, and you can see that Maven dependencies have been added to the web application structure

After the operation, redeploy the project and no more errors will be reported. Then we went to the. Metadata \. Plugins \ org. Eclipse. WST. Server. Core \ tmp0 \ wtpwebapps \ directory and found that the Lib directory was automatically generated under the WEB-INF directory of the project, and all dependent jar packages have been deployed. The problem is therefore solved

 

Eclipseeditor does not contain a main type

Error in eclipse running project editor does not contain a main type

Error reason: the current source package is not added to build path

Solution: right click the item — > Build path—> Configure Build path…

Source—> Add Folder

Check the corresponding directory — > OK

Run the program again, and the error message will not appear

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.

Start Tomcat by debugging in eclipse and report an error

Debug Tomcat in eclipse reports an error with the following error:

FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

ERROR: transport error 202: connect failed: Operation timed out

ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)

JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:750]

The reason for the error is that 127.0.0.1 localhost is not added to the local host configuration