Incorrect context-root in application.xml

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Incorrect context-root in application.xml

Timothy Mcginnis

Hi Folks,

I have a multi-module project running in IBM RSA 7.5.4 with M2Eclipse 0.9.8.200905041414.  It contains a jar, a war, and an ear.

my-project
    my-project-core
    my-project-ear
    my-project-war

In the pom.xml for the ear I have specified that the context-root should be set to MyProjectWeb.

When importing the sub-modules there are 3 application.xml files created.  1 under target, 1 under target/my-project-ear/META-INF and 1 under src/main/application/META-INF.

The 2 under the target directory have the correct context root.

The 1 under the src/main/application/META-INF directory has a context-root of my-project-war instead of MyProjectWeb as specified in the pom.xml.

Any ideas why this is happening?  This isn't an issue when using M2Eclipse to package the ear but I need the projects to be hot-deployable in RSA and then it becomes an issue.

Here is the pom.xml for the ear.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>com.aes.common</groupId>
                <artifactId>my-project</artifactId>
                <version>1.0.4-SNAPSHOT</version>
        </parent>
       
        <groupId>com.aes.common.my-projectr</groupId>
        <artifactId>my-project-ear</artifactId>
        <name>my-project-ear</name>
        <version>1.0.4-SNAPSHOT</version>
        <packaging>ear</packaging>
       
        <description>
        This subproject is the EAR project for the web application.        
        </description>
       
        <scm>
                <connection>scm:cvs:pserver:me@mycvsserver:/cvs:my-project/my-project-ear</connection>
  </scm>
   
   
        <dependencies>
                <dependency>
                        <groupId>com.aes.common.my-project</groupId>
                        <artifactId>my-project-web</artifactId>
                        <type>war</type>
                        <version>${version}</version>
                </dependency>
                <dependency>
                        <groupId>com.aes.common.my-project</groupId>
                        <artifactId>my-project</artifactId>
                        <version>1.0.4-SNAPSHOT</version>
                        <type>jar</type>
                </dependency>
        </dependencies>

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-ear-plugin</artifactId>
                                <configuration>
                                        <version>1.4</version>
                                        <generateApplicationXml>true</generateApplicationXml>
                                        <modules>
                                                <webModule>
                                                        <groupId>com.aes.common.my-project</groupId>
                                                        <artifactId>my-project-web</artifactId>
                                                        <contextRoot>MyProjectWeb</contextRoot>
                                                        <bundleFileName>my-project-web-${version}.war</bundleFileName>
                                                </webModule>
                                        </modules>
                                </configuration>
                        </plugin>
                </plugins>
        </build>
</project>


And here is the resulting src/main/application/META-INF/application.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<application id="Application_ID" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
        <display-name>my-project-ear-1.0.4-SNAPSHOT</display-name>
        <module id="WebModule_1262955510035">
                <web>
                        <web-uri>my-project-web-1.0.4-SNAPSHOT.war</web-uri>
                        <context-root>my-project-web</context-root>
                </web>
        </module>
</application>


Tim McGinnis
717 720-1962
Web Development
AES/PHEAA

==============================================================================
This message contains privileged and confidential information intended for the above addressees only.  If you
receive this message in error please delete or destroy this message and/or attachments.  

The sender of this message will fully cooperate in the civil and criminal prosecution of any individual engaging
in the unauthorized use of this message.
==============================================================================

Reply | Threaded
Open this post in threaded view
|

Re: Incorrect context-root in application.xml

Fred Bricon
This has been fixed in m2eclipse 0.9.9. You can try the latest development build.
The application.xml files under /target are generated by a maven build, but WTP doesn't use any of them.
As a workaround for your development needs, you can manually change the context root in the standard wtp application.xml,
I don't think it'll be overridden later on.

regards,

Fred Bricon

On Fri, Jan 8, 2010 at 2:09 PM, <[hidden email]> wrote:

Hi Folks,

I have a multi-module project running in IBM RSA 7.5.4 with M2Eclipse 0.9.8.200905041414.  It contains a jar, a war, and an ear.

my-project
    my-project-core
    my-project-ear
    my-project-war

In the pom.xml for the ear I have specified that the context-root should be set to MyProjectWeb.

When importing the sub-modules there are 3 application.xml files created.  1 under target, 1 under target/my-project-ear/META-INF and 1 under src/main/application/META-INF.

The 2 under the target directory have the correct context root.

The 1 under the src/main/application/META-INF directory has a context-root of my-project-war instead of MyProjectWeb as specified in the pom.xml.

Any ideas why this is happening?  This isn't an issue when using M2Eclipse to package the ear but I need the projects to be hot-deployable in RSA and then it becomes an issue.

Here is the pom.xml for the ear.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>com.aes.common</groupId>
                <artifactId>my-project</artifactId>
                <version>1.0.4-SNAPSHOT</version>
        </parent>
       
        <groupId>com.aes.common.my-projectr</groupId>
        <artifactId>my-project-ear</artifactId>
        <name>my-project-ear</name>
        <version>1.0.4-SNAPSHOT</version>
        <packaging>ear</packaging>
       
        <description>
        This subproject is the EAR project for the web application.        
        </description>
       
        <scm>
                <connection>scm:cvs:pserver:me@mycvsserver:/cvs:my-project/my-project-ear</connection>
  </scm>
   
   
        <dependencies>
                <dependency>
                        <groupId>com.aes.common.my-project</groupId>
                        <artifactId>my-project-web</artifactId>
                        <type>war</type>
                        <version>${version}</version>
                </dependency>
                <dependency>
                        <groupId>com.aes.common.my-project</groupId>
                        <artifactId>my-project</artifactId>
                        <version>1.0.4-SNAPSHOT</version>
                        <type>jar</type>
                </dependency>
        </dependencies>

        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-ear-plugin</artifactId>
                                <configuration>
                                        <version>1.4</version>
                                        <generateApplicationXml>true</generateApplicationXml>
                                        <modules>
                                                <webModule>
                                                        <groupId>com.aes.common.my-project</groupId>
                                                        <artifactId>my-project-web</artifactId>
                                                        <contextRoot>MyProjectWeb</contextRoot>
                                                        <bundleFileName>my-project-web-${version}.war</bundleFileName>
                                                </webModule>
                                        </modules>
                                </configuration>
                        </plugin>
                </plugins>
        </build>
</project>


And here is the resulting src/main/application/META-INF/application.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<application id="Application_ID" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
        <display-name>my-project-ear-1.0.4-SNAPSHOT</display-name>
        <module id="WebModule_1262955510035">
                <web>
                        <web-uri>my-project-web-1.0.4-SNAPSHOT.war</web-uri>
                        <context-root>my-project-web</context-root>
                </web>
        </module>
</application>


Tim McGinnis
717 720-1962
Web Development
AES/PHEAA

==============================================================================
This message contains privileged and confidential information intended for the above addressees only.  If you
receive this message in error please delete or destroy this message and/or attachments.  

The sender of this message will fully cooperate in the civil and criminal prosecution of any individual engaging
in the unauthorized use of this message.
==============================================================================

Reply | Threaded
Open this post in threaded view
|

Re: Incorrect context-root in application.xml

Timothy Mcginnis

Awesome.  Thank you!

Tim McGinnis
717 720-1962
Web Development
AES/PHEAA



From: "Fred Bricon" <[hidden email]>
To: [hidden email]
Date: 01/08/2010 09:05 AM
Subject: Re: [m2eclipse-user] Incorrect context-root in application.xml





This has been fixed in m2eclipse 0.9.9. You can try the latest development build.
The application.xml files under /target are generated by a maven build, but WTP doesn't use any of them.
As a workaround for your development needs, you can manually change the context root in the standard wtp application.xml,
I don't think it'll be overridden later on.

regards,

Fred Bricon

On Fri, Jan 8, 2010 at 2:09 PM, <tmcginni@...> wrote:

Hi Folks,


I have a multi-module project running in IBM RSA 7.5.4 with M2Eclipse 0.9.8.200905041414.  It contains a jar, a war, and an ear.


my-project

    my-project-core

    my-project-ear

    my-project-war


In the pom.xml for the ear I have specified that the context-root should be set to MyProjectWeb.


When importing the sub-modules there are 3 application.xml files created.  1 under target, 1 under target/my-project-ear/META-INF and 1 under src/main/application/META-INF.


The 2 under the target directory have the correct context root.


The 1 under the src/main/application/META-INF directory has a context-root of my-project-war instead of MyProjectWeb as specified in the pom.xml.


Any ideas why this is happening?  This isn't an issue when using M2Eclipse to package the ear but I need the projects to be hot-deployable in RSA and then it becomes an issue.


Here is the pom.xml for the ear.


<
project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
       
<modelVersion>4.0.0</modelVersion>
       
<parent>
               
<groupId>com.aes.common</groupId>
               
<artifactId>my-project</artifactId>
               
<version>1.0.4-SNAPSHOT</version>
       
</parent>
       
       
<groupId>com.aes.common.my-projectr</groupId>
       
<artifactId>my-project-ear</artifactId>
       
<name>my-project-ear</name>
       
<version>1.0.4-SNAPSHOT</version>
       
<packaging>ear</packaging>
       
       
<description>
        This subproject is the EAR project for the web application.        

       
</description>
       
       
<scm>
               
<connection>scm:cvs:pserver:me@mycvsserver:/cvs:my-project/my-project-ear</connection>
 
</scm>
   
   
       
<dependencies>
               
<dependency>
                       
<groupId>com.aes.common.my-project</groupId>
                       
<artifactId>my-project-web</artifactId>
                       
<type>war</type>
                       
<version>${version}</version>
               
</dependency>
               
<dependency>
                       
<groupId>com.aes.common.my-project</groupId>
                       
<artifactId>my-project</artifactId>
                       
<version>1.0.4-SNAPSHOT</version>
                       
<type>jar</type>
               
</dependency>
       
</dependencies>

       
<build>
               
<plugins>
                       
<plugin>
                               
<groupId>org.apache.maven.plugins</groupId>
                               
<artifactId>maven-ear-plugin</artifactId>
                               
<configuration>
                                       
<version>1.4</version>
                                       
<generateApplicationXml>true</generateApplicationXml>
                                       
<modules>
                                               
<webModule>
                                                       
<groupId>com.aes.common.my-project</groupId>
                                                       
<artifactId>my-project-web</artifactId>
                                                       
<contextRoot>MyProjectWeb</contextRoot>
                                                       
<bundleFileName>my-project-web-${version}.war</bundleFileName>
                                               
</webModule>
                                       
</modules>
                               
</configuration>
                       
</plugin>
               
</plugins>
       
</build>
</
project>


And here is the resulting src/main/application/META-INF/application.xml file.


<?
xml version="1.0" encoding="UTF-8"?>
<
application id="Application_ID" version="1.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
       
<display-name>my-project-ear-1.0.4-SNAPSHOT</display-name>
       
<module id="WebModule_1262955510035">
               
<web>
                       
<web-uri>my-project-web-1.0.4-SNAPSHOT.war</web-uri>
                       
<context-root>my-project-web</context-root>
               
</web>
       
</module>
</
application>


Tim McGinnis
717 720-1962
Web Development
AES/PHEAA

==============================================================================
This message contains privileged and confidential information intended for the above addressees only.  If you
receive this message in error please delete or destroy this message and/or attachments.  

The sender of this message will fully cooperate in the civil and criminal prosecution of any individual engaging
in the unauthorized use of this message.
==============================================================================



==============================================================================
This message contains privileged and confidential information intended for the above addressees only.  If you
receive this message in error please delete or destroy this message and/or attachments.  

The sender of this message will fully cooperate in the civil and criminal prosecution of any individual engaging
in the unauthorized use of this message.
==============================================================================