Eclipse: error starting static resources java.lang.IllegalArgumentException

I have a myproject2 project in my Eclipse IDE. I have a Tomcat application server and I can add myproject2 resource there (this is a Spring MVC project).

Now I closed myproject2 in Eclipse, removed myproject2 from Tomcat resources, and made a new Subversion check with the project name: myproject3.

REstarting IDE. I want to install myproject3 on a Tomcat server so that it is deployed. But all that is available is myproject2. Therefore, I choose it. I can access http: // localhost: 8080 / myproject2 / , but I get this warning and submit to the console:

14.12.2010 11:43:11 org.apache.catalina.startup.HostConfig deployDescriptor WARNING: A docBase C:\Spring\apache-tomcat-6.0.29-windows-x86\apache-tomcat-6.0.29\webapps\myproject2 inside the host appBase has been specified, and will be ignored 14.12.2010 11:43:11 org.apache.catalina.core.StandardContext resourcesStart SERVE: Error starting static Resources java.lang.IllegalArgumentException: Document base C:\Spring\apache-tomcat-6.0.29-windows-x86\apache-tomcat-6.0.29\webapps\myproject3 does not exist or is not a readable directory at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142) at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4249) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4418) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) 14.12.2010 11:43:11 org.apache.catalina.core.StandardContext start SERVE: Error in resourceStart() 14.12.2010 11:43:11 org.apache.catalina.core.StandardContext start SERVE: Error getConfigured 14.12.2010 11:43:11 org.apache.catalina.core.StandardContext start SERVE: Context [/myproject3] startup failed due to previous errors 14.12.2010 11:43:11 org.apache.catalina.core.StandardContext stop INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/myproject3] has not been started 

So what's wrong here? Why don't I have myproject3 to choose what should be deployed to Tomcat?

Somebody knows?

Best wishes.


Update:

.project (myproject2) :

 <projectDescription> <name>myproject</name> <comment>My-Project. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> <projects/> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> </natures> </projectDescription> 

.project (myproject3)

 <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>myproject</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.wst.jsdt.core.javascriptValidator</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.maven.ide.eclipse.maven2Builder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> <nature>org.maven.ide.eclipse.maven2Nature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature> </natures> </projectDescription> 
+4
source share
12 answers

I searched for a few days for this, but I did not find a solution. So I reinstalled everything and installed it from a new project.

0
source

Do you use the integration of Eclipse WTP and Tomcat-server to deploy your application, or do you create a WAR and deploy it yourself to Tomcat?

If you use integration, you can try creating a WAR and deploying it yourself, and then see what happens. Post update - I will follow it.


I read your original question again. Perhaps the problem is with how you created myproject3. I suspect that the project is not necessary for deployment to an Eclipse server. ("Project nature" is an Eclipse concept, a project can have several of them: different parts of the Eclipse project projects to determine which projects they can act on.) You said that you checked the code from Subversion and created the project in one step. This does not necessarily create the right type of project. The Eclipse J2EE deployment mechanism allows you to deploy projects with a specific type of project - I think it is "eclipse.common.project.facet.core.nature". Also, your project needs certain Eclipse developers to be viable; I think that "org.eclipse.wst.common.project.facet.core.builder" is one of them.

The .project file in the root directory of your project contains settings for nature and collectors. You must study these files in two projects.

Q: in the Eclipse workspace, the objects myproject2 / .project and myproject3 / .project are significantly different (in addition to the name)? Post the differences here.

Q: myproject2 in SVN contains a .project file?

The answer to these questions should tell you more. You can carefully examine the various options for checking and creating a project in one step.

+1
source

I think Ladlestein is certainly on the right track, but I can add a little more context to this problem in how I was able to reproduce it:

I have a similar Eclipse (Indigo) setup in which I have a Maven project and use the Eclipse Wcl function to deploy to the Tomcat 7 embedded server. Everything works fine if I import the project as a Maven project from Eclipse, but my problem arises, when I execute the mvn eclipse:clean and mvn eclipse:eclipse commands from the command line. This of course restores the Eclipse .project file, but leaves it without any explicitly important Natures and buildCommands.

I am observing a .project file very similar to the wrong one in the question (in myproject2), and in Eclipse the project is no longer what Eclipse calls the โ€œdynamic web moduleโ€, therefore it is not deployed - and it is not a longer Maven project . I was able to fix this as follows:

First make a Maven project by adding the following to your .project file (I don't know if there is a better way through Eclipse):

 <buildSpec> ... ... <buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> </buildCommand> </buildSpec> <natures> ... ... <nature>org.eclipse.m2e.core.maven2Nature</nature> </natures> 

Now you can verify that the project has been updated by right-clicking on the project and launching Maven > Update Project Configuration...

Then you can make the project deployable using Properties > Project Facets > Dynamic Web Module (checkbox). Below is a complete complete set of instructions for creating your dynamic web module project .

At the end, your .project file should look something like this:

 <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>project1</name> <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.m2e.core.maven2Builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> </natures> </projectDescription> 
+1
source

This is because the project was started before using this server or was configured using this server. Therefore, its path is stored in a folder inside your tomcat directory.

In the tomcat folder go to conf \ Catalina \ localhost \

In this folder, delete the xml file that matches your project.

Alternatively, remove the server and add it again.

+1
source

I would have a similar problem (with eclipse and tomcat7 and WTP), and I decided to manually edit eclipse_workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmpX\server.xml , where tmpX is the temporary folder which caches project publications.

0
source

This problem will be solved only by creating a new project.

0
source

I would have a similar problem (with eclipse and tomcat7 and WTP). Solving it, deleting (commenting) the next line from% CATALINA_HOME% / CONF / server.xml

Context docBase = "[CATALINA_HOME] \ webapps \\ ROOT" path = "reloadable =" false "/">

0
source

Solve my problem. I just copy the .project file from another launched web project and change the project name attribute

0
source

I ran into the same problem. What I did in the server overview (double-click on your server in the server tab) I had to set the deployment path to "MY_SERVER_PATH \ webapps". Hope this will be helpful.

Thanks: -)

0
source

Removing the server instance from my IDE and adding it back solved my problem.

0
source

In my situation, I followed these two steps and the error went away:

1 - right click on the project> properties> project face> runtime Then I deleted the web server. added it back and then applied

2 - restart the IDE

Awkwardly worked for me.

0
source

The problem is solved! Just delete your server instance and start from the new Server.

-1
source

Source: https://habr.com/ru/post/1332085/


All Articles