Maven Integration for Eclipse

Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.0.10
  • Fix Version/s: 0.0.11
  • Component/s: None
  • Labels:
    None
  • Environment:
    Latest SVN-Version with embedder 2.1.0.v20070107-1534
  • Number of attachments :
    1

Description

when doing update source folders on a project that contains an EAR packaged project the action fails with the error

[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-ear-plugin:2.3

Cause: Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated

Source folders are not updated due to this.

Issue Links

Activity

Hide
Stephane Nicoll added a comment -

EarModule is an interface. Is the project running ok on command line?

Show
Stephane Nicoll added a comment - EarModule is an interface. Is the project running ok on command line?
Hide
Stefan Seidel added a comment -

Yes it does. A detailed error log says:

[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-ear-plugin:2.3:generate-application-xml' -->
[DEBUG]   (f) artifactTypeMappings = <artifactTypeMappings>
 <artifactTypeMapping mapping="jar" type="ejb-client"/>
</artifactTypeMappings>

[DEBUG]   (f) defaultLibBundleDir = /lib
[DEBUG]   (f) description = EAR das alle noetigen Teile des Portals enthaelt
[DEBUG]   (f) displayName = xpm-portal-ear
[DEBUG]   (f) generatedDescriptorLocation = /home/stefan/testws/xpm-portal/ear/target
[ERROR] project-execute : de.xpm:xpm-portal-ear:ear:0.0.1 (  task-segment: [install] )
Diagnosis: Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
FATAL ERROR: Error executing Maven for a project
[ERROR] reactor-execute : /home/stefan/testws/xpm-portal/ear
Diagnosis: Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
FATAL ERROR: Error executing Maven for a project
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-ear-plugin:2.3



Cause: Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Mon Jan 08 13:48:09 CET 2007
[INFO] Final Memory: 8M/96M
[INFO] ------------------------------------------------------------------------
[INFO] Error for project: Portal-EAR (during install)
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-ear-plugin:2.3



Cause: Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
[INFO] ------------------------------------------------------------------------
[ERROR] reactor-execute : /home/stefan/testws/xpm-portal/ear
FATAL ERROR: Error executing Maven for a project
[INFO] BUILD ERRORS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Mon Jan 08 13:48:10 CET 2007
[INFO] Final Memory: 8M/96M
[INFO] ------------------------------------------------------------------------

This also happends when starting maven2 build from within Eclipse (right click->Run->Maven2 build).

Show
Stefan Seidel added a comment - Yes it does. A detailed error log says:
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-ear-plugin:2.3:generate-application-xml' -->
[DEBUG]   (f) artifactTypeMappings = <artifactTypeMappings>
 <artifactTypeMapping mapping="jar" type="ejb-client"/>
</artifactTypeMappings>

[DEBUG]   (f) defaultLibBundleDir = /lib
[DEBUG]   (f) description = EAR das alle noetigen Teile des Portals enthaelt
[DEBUG]   (f) displayName = xpm-portal-ear
[DEBUG]   (f) generatedDescriptorLocation = /home/stefan/testws/xpm-portal/ear/target
[ERROR] project-execute : de.xpm:xpm-portal-ear:ear:0.0.1 (  task-segment: [install] )
Diagnosis: Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
FATAL ERROR: Error executing Maven for a project
[ERROR] reactor-execute : /home/stefan/testws/xpm-portal/ear
Diagnosis: Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
FATAL ERROR: Error executing Maven for a project
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-ear-plugin:2.3



Cause: Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Mon Jan 08 13:48:09 CET 2007
[INFO] Final Memory: 8M/96M
[INFO] ------------------------------------------------------------------------
[INFO] Error for project: Portal-EAR (during install)
[INFO] ------------------------------------------------------------------------
[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:maven-ear-plugin:2.3



Cause: Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace Error configuring: org.apache.maven.plugins:maven-ear-plugin. Reason: Unable to parse the created DOM for plugin configuration
[INFO] ------------------------------------------------------------------------
[ERROR] reactor-execute : /home/stefan/testws/xpm-portal/ear
FATAL ERROR: Error executing Maven for a project
[INFO] BUILD ERRORS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Mon Jan 08 13:48:10 CET 2007
[INFO] Final Memory: 8M/96M
[INFO] ------------------------------------------------------------------------
This also happends when starting maven2 build from within Eclipse (right click->Run->Maven2 build).
Hide
Stephane Nicoll added a comment -

I don't understand.

If you type 'mvn package' on the command-line you don't have any problem and if you use the eclipse integration it fails with the message above. Sounds very weird to me.

Could you please attach the EAR plugin configuration section of the pom (<build></plugins> ...)

Show
Stephane Nicoll added a comment - I don't understand. If you type 'mvn package' on the command-line you don't have any problem and if you use the eclipse integration it fails with the message above. Sounds very weird to me. Could you please attach the EAR plugin configuration section of the pom (<build></plugins> ...)
Hide
Stefan Seidel added a comment -

Yes indeed. Here's the section:

<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <artifactTypeMappings>
            <artifactTypeMapping type="ejb-client" mapping="jar" />
          </artifactTypeMappings>
          <defaultJavaBundleDir>/lib</defaultJavaBundleDir>
          <modules>
            <webModule>
              <groupId>de.xpm</groupId>
              <artifactId>xpm-portal</artifactId>
              <contextRoot>portal</contextRoot>
            </webModule>
            <jarModule>
              <groupId>de.xpm</groupId>
              <artifactId>xpm-portal-common</artifactId>
              <excluded>true</excluded>
            </jarModule>
            <jarModule>
              <groupId>de.xpm</groupId>
              <artifactId>lucenesearch-ejb</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>de.xpm</groupId>
              <artifactId>searchfacade</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>org.apache.xmlbeans</groupId>
              <artifactId>xbean</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>org.apache.xmlbeans</groupId>
              <artifactId>jsr173_api</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>org.apache.xmlbeans</groupId>
              <artifactId>config</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
          </modules>
        </configuration>
      </plugin>

Without the modules, it works. As soon as I include any module (webModule or jarModule), the build fails.

Show
Stefan Seidel added a comment - Yes indeed. Here's the section:
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <artifactTypeMappings>
            <artifactTypeMapping type="ejb-client" mapping="jar" />
          </artifactTypeMappings>
          <defaultJavaBundleDir>/lib</defaultJavaBundleDir>
          <modules>
            <webModule>
              <groupId>de.xpm</groupId>
              <artifactId>xpm-portal</artifactId>
              <contextRoot>portal</contextRoot>
            </webModule>
            <jarModule>
              <groupId>de.xpm</groupId>
              <artifactId>xpm-portal-common</artifactId>
              <excluded>true</excluded>
            </jarModule>
            <jarModule>
              <groupId>de.xpm</groupId>
              <artifactId>lucenesearch-ejb</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>de.xpm</groupId>
              <artifactId>searchfacade</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>org.apache.xmlbeans</groupId>
              <artifactId>xbean</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>org.apache.xmlbeans</groupId>
              <artifactId>jsr173_api</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            <jarModule>
              <groupId>org.apache.xmlbeans</groupId>
              <artifactId>config</artifactId>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
          </modules>
        </configuration>
      </plugin>
Without the modules, it works. As soon as I include any module (webModule or jarModule), the build fails.
Hide
Stephane Nicoll added a comment -

Side note, I don't understand why you map ejb-client to Jar. Otherwise, your pom is valid.

Really weird; Thanks for the report.

Show
Stephane Nicoll added a comment - Side note, I don't understand why you map ejb-client to Jar. Otherwise, your pom is valid. Really weird; Thanks for the report.
Hide
Eugene Kuleshov added a comment -

Stefan, can you please attach sample project that I can use to reproduce this issue?

Show
Eugene Kuleshov added a comment - Stefan, can you please attach sample project that I can use to reproduce this issue?
Hide
Stefan Seidel added a comment -

There you go.

Show
Stefan Seidel added a comment - There you go.
Hide
Eugene Kuleshov added a comment -

Jason, can you please look at this?

The mvn process-test-resources command actually fail on the atached project from the command line when local repository don't have ear and war artifacts installed, saying that it can't find ear and war project from the reactor modules.

When those artifacts are installed to local repo, running process-test-resources in embedder fail with error:

Failed to configure plugin parameters for: org.apache.maven.plugins:maven-ear-plugin:2.3

Show
Eugene Kuleshov added a comment - Jason, can you please look at this? The mvn process-test-resources command actually fail on the atached project from the command line when local repository don't have ear and war artifacts installed, saying that it can't find ear and war project from the reactor modules. When those artifacts are installed to local repo, running process-test-resources in embedder fail with error: Failed to configure plugin parameters for: org.apache.maven.plugins:maven-ear-plugin:2.3
Hide
Aaron Digulla added a comment -

Jason, there is a bug in MavenExecutionRequestDefaultsPopulator. It doesn't set the fields related to localRepository.

I've fixed the localRepository bug with this code in MavenEmbedder:

request = defaultsPopulator.populateDefaults( request );
request.setLocalRepository(getLocalRepository());
request.setLocalRepositoryPath(getLocalRepository().getBasedir());

With this code, it's possible to have the localRepository both in the user and the global settings file. Without it, the embedder will ignore the value from the global settings file.

Unfortunately, neither this fix nor my patch to start the embedder just once fix this issue here.

Maybe the NPE which my testcase attached to MNG-2722 gives a clue what might be going on. Why does verifyPlugin() return null for a plugin which exists in the repository and why doesn't the DefaultLifecycleExecutor check for this condition?

Show
Aaron Digulla added a comment - Jason, there is a bug in MavenExecutionRequestDefaultsPopulator. It doesn't set the fields related to localRepository. I've fixed the localRepository bug with this code in MavenEmbedder: request = defaultsPopulator.populateDefaults( request ); request.setLocalRepository(getLocalRepository()); request.setLocalRepositoryPath(getLocalRepository().getBasedir()); With this code, it's possible to have the localRepository both in the user and the global settings file. Without it, the embedder will ignore the value from the global settings file. Unfortunately, neither this fix nor my patch to start the embedder just once fix this issue here. Maybe the NPE which my testcase attached to MNG-2722 gives a clue what might be going on. Why does verifyPlugin() return null for a plugin which exists in the repository and why doesn't the DefaultLifecycleExecutor check for this condition?
Hide
Aaron Digulla added a comment -

sigh I just which I could take one or two days off to debug this issue thoroughly

The NPE in MNG-2722 is because ClassWorld isn't reset when the embedder is started again. With the current code, the embedder must not be started more then once.

Unfortunately, the obvious solution to create a new embedder every time to work around the bug here doesn't help, so MNG-2722 is not related to this bug.

Back to square one.

Show
Aaron Digulla added a comment - sigh I just which I could take one or two days off to debug this issue thoroughly The NPE in MNG-2722 is because ClassWorld isn't reset when the embedder is started again. With the current code, the embedder must not be started more then once. Unfortunately, the obvious solution to create a new embedder every time to work around the bug here doesn't help, so MNG-2722 is not related to this bug. Back to square one.
Hide
Eugene Kuleshov added a comment -

I committed new embedder to the trunk and it is working with the attached test project.

Show
Eugene Kuleshov added a comment - I committed new embedder to the trunk and it is working with the attached test project.
Hide
Stefan Seidel added a comment -

Yes, with the new version from SVN it works fine.

Show
Stefan Seidel added a comment - Yes, with the new version from SVN it works fine.
Hide
Tonte Pouncil added a comment - - edited

How can this issue be resolved if I am having this same issue today? I am running on Windows XP, maven 2.0.9 and I have tried using both maven-ear-plugin 2.3.1 and 2.3.2-snapshot with no luck from command prompt. I read somewhere in one of these issue referenced as a duplicate, that I need to not put the version name in the plugin declaration and run the update command -U like so: mvn package -U. I was able to get a success full build only once. Any other build after that gave the documented error of: "Cause: Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated".

Has this been fixed? If so how do I resolve it?

Which new version from SVN are you talking about?

Show
Tonte Pouncil added a comment - - edited How can this issue be resolved if I am having this same issue today? I am running on Windows XP, maven 2.0.9 and I have tried using both maven-ear-plugin 2.3.1 and 2.3.2-snapshot with no luck from command prompt. I read somewhere in one of these issue referenced as a duplicate, that I need to not put the version name in the plugin declaration and run the update command -U like so: mvn package -U. I was able to get a success full build only once. Any other build after that gave the documented error of: "Cause: Class 'org.apache.maven.plugin.ear.EarModule' cannot be instantiated". Has this been fixed? If so how do I resolve it? Which new version from SVN are you talking about?
Hide
Eugene Kuleshov added a comment -

Tonte, at this time it is better to submit a separate issue. Make sure you provide stack trace and specify what version of m2eclipse you are using. Please also note that the latest version is 0.9.6 and it is available from http://m2eclipse.sonatype.org/update/

Show
Eugene Kuleshov added a comment - Tonte, at this time it is better to submit a separate issue. Make sure you provide stack trace and specify what version of m2eclipse you are using. Please also note that the latest version is 0.9.6 and it is available from http://m2eclipse.sonatype.org/update/
Hide
Tonte Pouncil added a comment -

Okay, thanks for the advice. At this time I am not for sure the m2eclipse plugin is a problem for me. I was commenting specifically on maven-ear-plugin. So please disregard my earlier comments.

Thanks!

Show
Tonte Pouncil added a comment - Okay, thanks for the advice. At this time I am not for sure the m2eclipse plugin is a problem for me. I was commenting specifically on maven-ear-plugin. So please disregard my earlier comments. Thanks!

People

Vote (2)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: