Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 522233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:20:00+00:00 2026-05-13T08:20:00+00:00

When attempting to execute mvn tomcat:run right after a clean, and with a configured

  • 0

When attempting to execute mvn tomcat:run right after a clean, and with a configured tomcatWebXml specified in the pom, I get a FileNotFoundException.

Here’s the snippet from my POM:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>tomcat-maven-plugin</artifactId>
    <version>1.0-beta-1</version>
    <configuration>                 
        <path>/licensing</path>
        <tomcatWebXml>${basedir}/src/main/mock/web.xml</tomcatWebXml>
    </configuration>
</plugin>

And here’s the error I experience, but only on the first invocation after a clean, subsequent invocations find the file and work fine.

[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Could not create Tomcat configuration

Embedded error: C:\..snip..\src\main\mock\web.xml
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Could not create Tomcat
configuration
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:703)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:553)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:523)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Could not create Tomc
at configuration
        at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
:153)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
        ... 17 more
**Caused by: java.io.FileNotFoundException: C:\...snip..\src\main\mock\web.xml**
        at org.codehaus.mojo.tomcat.AbstractRunMojo.copyFile(AbstractRunMojo.jav
a:326)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.initConfiguration(AbstractRu
nMojo.java:273)
        at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java
:143)
        ... 19 more

Any ideas on how I could resolve this? If it’s an unconditional bug, it would seem to be the sort of thing that would affect anyone & everyone.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:20:00+00:00Added an answer on May 13, 2026 at 8:20 am

    I could reproduce this bug. Not sure why but in the following method of AbstractRunMojo.java:

    private void copyFile( String fromPath, File toFile )
        throws IOException
    {
    
        URL fromURL = getClass().getResource( fromPath );
    
        if ( fromURL == null )
        {
            throw new FileNotFoundException( fromPath );
        }
    
        FileUtils.copyURLToFile( fromURL, toFile );
    }
    

    The call to getClass().getResource( fromPath ) indeed returns a null URL right after a clean and works during subsequent invocations. I didn’t really dig the issue but this seems to be a classloading issue (maybe related to MTOMCAT-25).

    It’s pretty annoying but the workaround is obviously to run the goal a second time after the first failure.

    EDIT: I’ve reported this problem, see MTOMCAT-42, which has been fixed and a new snapshot of the Maven Tomcat Plugin has been published! To use it, add the following snippet to your pom.xml:

      <pluginRepositories>
        <pluginRepository>
          <id>Codehaus Snapshots</id>
          <url>http://snapshots.repository.codehaus.org/</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
          <releases>
            <enabled>true</enabled>  <!-- Workaround for MNG-2974, see note below -->
          </releases>
        </pluginRepository>
      </pluginRepositories>
    

    Then change the version of the plugin to 1.0-SNAPSHOT and try again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 272k
  • Answers 272k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To set an arbitrary property on an object, you can… May 13, 2026 at 1:58 pm
  • Editorial Team
    Editorial Team added an answer You'd use NSFileManager which has really nice convenient methods. There… May 13, 2026 at 1:58 pm
  • Editorial Team
    Editorial Team added an answer SUMMARY: on Mac, there are several APIs and compiler options… May 13, 2026 at 1:58 pm

Related Questions

I frequently get the following error when attempting to execute simple statements against a
I'm using Perforce with Vim on Windows. I currently have an auto command set
I'm attempting to execute a .NET (3.5) command line program from within a VBScript
I am attempting to create a Java source file which will interface with my
I am attempting to output functions common to a set of objects that share

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.