Unable to “Run on Server” a webapp from Eclipse

后端 未结 15 1425
悲哀的现实
悲哀的现实 2021-01-30 11:20

When running my WebApp project from Eclipse most of times it run correctly. But if by mistake to stop server, I kill it in \"Console\" view on instead of \"Stop\" Server from \"

相关标签:
15条回答
  • 2021-01-30 11:56

    I encountered the same issue and cleaning and recreating server does not help. But when I deployed another project, it was able to start successfully. After much comparison, I found differences in the .project files. So I copy the contents of the .project file of the working project into the one that has problem, add it back to the server and it works. Following is the contents of the .project file that works. Note that you need to change the name of the project accordingly:

    <?xml version="1.0" encoding="UTF-8"?>
    <projectDescription>
    <name>Project Name</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.jdt.core.javabuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.common.project.facet.core.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
        <buildCommand>
            <name>org.eclipse.wst.validation.validationbuilder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
        <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
        <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
        <nature>org.eclipse.jdt.core.javanature</nature>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>
    

    0 讨论(0)
  • 2021-01-30 11:56

    Steps which I followed and will work 100%:

    1. Clean your server and your server working directory by right clicking on the server
    2. Delete the server folder from your project explorer window
    3. Remove server from the runtime environment ie from Eclipse -> Window -> Preferences -> Server -> Runtime Environments
    4. Shut eclipse and start again
    5. Run the file on server again reconfigure the Apache server
    6. Problem is solved
    0 讨论(0)
  • 2021-01-30 11:58

    Just do maven -> Update project configuration and clean/build from your eclipse. Project will be loaded.

    0 讨论(0)
  • 2021-01-30 11:59

    I suffered from this problem, but cause was different. Problem sprang from wrong server name([Project Name] != [Server Name]). I thought that i could figure out by recreate Server.

    This Problem can solve by following below steps:

    1. Remove Server : right click on [Severs] and remove server.
    2. Delete Server : right click on [Project Explorer] and delete Server(you created).
    3. Clean Project : menu[Project -> Clean]
    4. Create Server : right click on [Severs] and new server.
    5. Edit server.xml : Edit server.xml foor your web server.
    6. Add Server : right click on [Severs] and remove server.
    0 讨论(0)
  • 2021-01-30 11:59

    I was quite puzzled by the problem because I had another jar dependency working before the issue occurred. I am using Eclipse Luna which already had m2e integration and none of the above solutions worked for me.

    The problem started when adding a new jar dependency to a maven war project, but it still worked well when that one was commented out in the pom. Luckily I was able to compare both projects and eventually the issue was related to a missing project facet in the new jar project: Utility Module.

    1. Right Button on the project: Project Facets
    2. Check "Utility Module" and save
    3. Remove the application from tomcat and publish it again.
    0 讨论(0)
  • 2021-01-30 11:59

    I have stopped using this method of running my webapp. I use mvn tomcat:run instead. Much easier. Though I don't know how to debug.

    0 讨论(0)
提交回复
热议问题