You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by devnulled <ie...@gmail.com> on 2007/12/13 19:07:02 UTC

Can't Package Axis2 In EAR with Maven2

Unfortunately this is kind of an obtuse question, but I’m hoping someone out
there has ran into this problem before.

I’m currently trying to repackage some existing projects into an EAR for
JBoss (converting from a WAR) because I have some EJB session beans I need
to deploy.  A couple of the sub-projects in the main project I’m trying to
deploy as an EAR contain Axis2 stub clients which use Rampart for
WS-Security.   The .mar’s for WS-Security support are put into a resources
folder under one of the projects, and said project is a dependency of the
only other project using Axis2.

Let me know if I’m leaving-out any details here.. I didn’t actually develop
these stubs, I just tend to be the person who manages our build process.

Whenever I try to include these projects into an EAR using the Maven2 EAR
plugin, I get this error:

[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Failed to initialize ear modules

Embedded error: Unknown artifact type[mar]
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to initialize
ear modules
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
        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.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: Failed to
initialize ear modules
        at
org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:210)
        at
org.apache.maven.plugin.ear.GenerateApplicationXmlMojo.execute(GenerateApplicationXmlMojo.java:96)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more
Caused by: org.apache.maven.plugin.ear.UnknownArtifactTypeException: Unknown
artifact type[mar]
        at
org.apache.maven.plugin.ear.util.ArtifactTypeMappingService.getStandardType(ArtifactTypeMappingService.java:159)
        at
org.apache.maven.plugin.ear.EarModuleFactory.newEarModule(EarModuleFactory.java:65)
        at
org.apache.maven.plugin.ear.AbstractEarMojo.execute(AbstractEarMojo.java:203)
        ... 19 more

If I comment out references to the two projects containing Axis2 artifacts,
I can build the ear just fine.

Here are the entries in the pom file for Axis2 1.3 we’re using:
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-kernel</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-adb</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-api</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-dom</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-impl</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.schema</groupId>
            <artifactId>XmlSchema</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1-rc1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.rampart</groupId>
            <artifactId>rampart-core</artifactId>
            <version>1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.rampart</groupId>
            <artifactId>rampart-policy</artifactId>
            <version>1.3</version>
        </dependency>


I’ve tried a bunch of different scenarios including deleting the mars
themselves out of the resources folder, adding the Axis2 mar plugin, etc,
and still I can’t quite get past this.  Has anyone seen this before or have
any suggestions?

Thanks,

- Brandon
-- 
View this message in context: http://www.nabble.com/Can%27t-Package-Axis2-In-EAR-with-Maven2-tp14321321p14321321.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Can't Package Axis2 In EAR with Maven2

Posted by Martin Gainty <mg...@hotmail.com>.
DevNull that is a very unusual name

I found this link helpful to setup your dev environment
http://ws.apache.org/rampart/developer-guide.html

applicable bits are to
svn http://svn.apache.org/repos/asf/webservices/rampart/trunk/java/

this sets up a development folder called java which has a working
build.xml..!!!

there are 2 properties to setup assuming your username starts as DevNull
${username}=DevNull
dir.mvn2.repo=C:/Documents and
Settings/${username}/.m2/repositoryversion.xmlsec=1.4.0

so an example would be
${dir.mvn2.repo}/org/apache/santuario/xmlsec/${version.xmlsec}/xmlsec-${vers
ion.xmlsec}.jar

cd /java
ant
when all is said and done you have the version specific mar located in /dist
folder

HTH/
Martin--
----- Original Message -----
From: "devnulled" <ie...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Thursday, December 13, 2007 6:14 PM
Subject: Re: Can't Package Axis2 In EAR with Maven2


>
> I just /finally/ came across the fix for this particular problem.   I
haven't
> verified that everything still works because I have more EAR deployment
work
> and testing to do, but this particular problem went away by making all of
> the Rampart dependencies as <scope>provided</scope>.
>
> After talking to a co-worker about how I fixed the problem, it totally
made
> sense given that we really only depend on Rampart at runtime.    I
probably
> would have realized it much sooner had I written the code myself and
having
> an understanding about how Rampart actually works.
>
> Thanks to all those who replied!
>
> - Brandon
>
>
> devnulled wrote:
> >
> > Sumedha,
> >
> > Thanks for the response.   I just created a simple mock project and
added
> > the maven-mar plugin, a couple of logging deps, and an empty mock class,
> > added it as a dependency to the main project, and commented-out
references
> > to the two projects which have Axis2 dependencies.   It worked just fine
> > and built the full EAR.. here is a snippet of my pom.xml where I added
the
> > plugin in the mock project:
> >
> > <build>
> >     <plugins>
> >       <plugin>
> >         <artifactId>maven-ejb-plugin</artifactId>
> >         <configuration>
> >           <ejbVersion>3.0</ejbVersion>
> >           <archive>
> >             <manifest>
> >               <addClasspath>true</addClasspath>
> >             </manifest>
> >           </archive>
> >         </configuration>
> >       </plugin>
> >       <plugin>
> >         <groupId>org.apache.axis2</groupId>
> >         <artifactId>axis2-mar-maven-plugin</artifactId>
> >         <version>1.3</version>
> >         <extensions>true</extensions>
> >         <configuration>
> >           <includeDependencies>false</includeDependencies>
> >         </configuration>
> >       </plugin>
> >     </plugins>
> >   </build>
> >
> >
> > As far as I can tell this plugin gets resolved correctly? On a sidenote,
> > I'm using more than just the default Maven repo so I do have all of the
> > rampart deps, including the mar files in a resources folder).  So it
looks
> > like that is not the problem?
> >
> > Thanks,
> >
> > - Brandon
> >
> >
> > sumedha rubasinghe wrote:
> >>
> >> Brandon,
> >> This looks like mar plug-in is not being recognized inside your build
> >> environment.
> >> 1. Leave out two projects having dependencies to Axis2.
> >> 2. Create a dummy project which just uses Axis2 MAR plug-in.
> >> 3. See if you can get EAR build run with this dummy project included as
a
> >> sub module.
> >>
> >> /sumedha
> >>
> >>> [INFO]
>
>>> ------------------------------------------------------------------------
> >>> [ERROR] BUILD ERROR
> >>> [INFO]
>
>>> ------------------------------------------------------------------------
> >>> [INFO] Failed to initialize ear modules
> >>>
> >>> Embedded error: Unknown artifact type[mar]
> >>> [INFO]
>
>>> ------------------------------------------------------------------------
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-user-help@ws.apache.org
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
http://www.nabble.com/Can%27t-Package-Axis2-In-EAR-with-Maven2-tp14321321p14
326782.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Can't Package Axis2 In EAR with Maven2

Posted by devnulled <ie...@gmail.com>.
I just /finally/ came across the fix for this particular problem.   I haven't
verified that everything still works because I have more EAR deployment work
and testing to do, but this particular problem went away by making all of
the Rampart dependencies as <scope>provided</scope>.

After talking to a co-worker about how I fixed the problem, it totally made
sense given that we really only depend on Rampart at runtime.    I probably
would have realized it much sooner had I written the code myself and having
an understanding about how Rampart actually works.

Thanks to all those who replied!

- Brandon


devnulled wrote:
> 
> Sumedha,
> 
> Thanks for the response.   I just created a simple mock project and added
> the maven-mar plugin, a couple of logging deps, and an empty mock class,
> added it as a dependency to the main project, and commented-out references
> to the two projects which have Axis2 dependencies.   It worked just fine
> and built the full EAR.. here is a snippet of my pom.xml where I added the
> plugin in the mock project:
> 
> <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-ejb-plugin</artifactId>
>         <configuration>
>           <ejbVersion>3.0</ejbVersion>
>           <archive>
>             <manifest>
>               <addClasspath>true</addClasspath>
>             </manifest>
>           </archive>
>         </configuration>
>       </plugin>
>       <plugin>
>         <groupId>org.apache.axis2</groupId>
>         <artifactId>axis2-mar-maven-plugin</artifactId>
>         <version>1.3</version>
>         <extensions>true</extensions>
>         <configuration>
>           <includeDependencies>false</includeDependencies>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
> 
> 
> As far as I can tell this plugin gets resolved correctly? On a sidenote,
> I'm using more than just the default Maven repo so I do have all of the
> rampart deps, including the mar files in a resources folder).  So it looks
> like that is not the problem?
> 
> Thanks,
> 
> - Brandon
> 
> 
> sumedha rubasinghe wrote:
>> 
>> Brandon,
>> This looks like mar plug-in is not being recognized inside your build
>> environment.
>> 1. Leave out two projects having dependencies to Axis2.
>> 2. Create a dummy project which just uses Axis2 MAR plug-in.
>> 3. See if you can get EAR build run with this dummy project included as a
>> sub module.
>> 
>> /sumedha
>> 
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [ERROR] BUILD ERROR
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Failed to initialize ear modules
>>>
>>> Embedded error: Unknown artifact type[mar]
>>> [INFO]
>>> ------------------------------------------------------------------------
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-Package-Axis2-In-EAR-with-Maven2-tp14321321p14326782.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Can't Package Axis2 In EAR with Maven2

Posted by devnulled <ie...@gmail.com>.
Sumedha,

Thanks for the response.   I just created a simple mock project and added
the maven-mar plugin, a couple of logging deps, and an empty mock class,
added it as a dependency to the main project, and commented-out references
to the two projects which have Axis2 dependencies.   It worked just fine and
built the full EAR.. here is a snippet of my pom.xml where I added the
plugin in the mock project:

<build>
    <plugins>
      <plugin>
        <artifactId>maven-ejb-plugin</artifactId>
        <configuration>
          <ejbVersion>3.0</ejbVersion>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-mar-maven-plugin</artifactId>
        <version>1.3</version>
        <extensions>true</extensions>
        <configuration>
          <includeDependencies>false</includeDependencies>
        </configuration>
      </plugin>
    </plugins>
  </build>


As far as I can tell this plugin gets resolved correctly? On a sidenote, I'm
using more than just the default Maven repo so I do have all of the rampart
deps, including the mar files in a resources folder).  So it looks like that
is not the problem?

Thanks,

- Brandon


sumedha rubasinghe wrote:
> 
> Brandon,
> This looks like mar plug-in is not being recognized inside your build
> environment.
> 1. Leave out two projects having dependencies to Axis2.
> 2. Create a dummy project which just uses Axis2 MAR plug-in.
> 3. See if you can get EAR build run with this dummy project included as a
> sub module.
> 
> /sumedha
> 
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Failed to initialize ear modules
>>
>> Embedded error: Unknown artifact type[mar]
>> [INFO]
>> ------------------------------------------------------------------------
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Can%27t-Package-Axis2-In-EAR-with-Maven2-tp14321321p14324846.html
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Can't Package Axis2 In EAR with Maven2

Posted by su...@wso2.com.
Brandon,
This looks like mar plug-in is not being recognized inside your build
environment.
1. Leave out two projects having dependencies to Axis2.
2. Create a dummy project which just uses Axis2 MAR plug-in.
3. See if you can get EAR build run with this dummy project included as a
sub module.

/sumedha

> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Failed to initialize ear modules
>
> Embedded error: Unknown artifact type[mar]
> [INFO]
> ------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org