Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] FW: Desperate - need help getting Ear project to deploy

Hi Chris,

The m2e-wtp project plugins don't have any extension for controlling any facets from Websphere, because it doesn't have any visibility into IBM specific metadata, the WAS runtime classpath libraries should be added to your maven pom dependencies for compilation.  The older WAS facets were used to include WAS binding/ configuration editing tools, which have no maven integration.   These facet can be added manually once in RAD, and the m2e-wtp project configurator won't touch them if updated.


Thanks - Chuck

Senior Architect, RAD Java EE Tools, WTP PMC Lead
IBM Software Lab - Research Triangle Park, NC




From:        "Harris, Christopher P" <chris_harris@xxxxxxxxxx>
To:        Maven Integration for Eclipse users mailing list <m2e-users@xxxxxxxxxxx>
Date:        08/14/2012 02:31 PM
Subject:        Re: [m2e-users] FW: Desperate - need help getting Ear project        to        deploy
Sent by:        m2e-users-bounces@xxxxxxxxxxx




Hi, Fred.
 
Thanks!  The webapp-j2ee14 plug-in worked for this sample Maven .war project.  I’ll use this for my actual .war project that I’ve assembled.
 
Now, final question for this thread:
The webapp-j2ee14 plug-in doesn’t alter the WebSphere Web (Co-existence) and WebSphere Web (Extended) Project Facets as expected.  If I’m not supposed to modify the Project Facets via the IDE, how can I accomplish this using m2e/m2e-wtp?
 
…or can I actually change it via the IDE without any negative repercussions?
 
-          Chris
 
From: m2e-users-bounces@xxxxxxxxxxx [mailto:m2e-users-bounces@xxxxxxxxxxx] On Behalf Of Fred Bricon
Sent:
Tuesday, August 14, 2012 11:36 AM
To:
Maven Integration for Eclipse users mailing list
Subject:
Re: [m2e-users] FW: Desperate - need help getting Ear project to deploy

 
Yeah don't expect maven-eclipse-plugin and m2e to work together. Use one or the other.
 
The Web Facet is set according to the web.xml servlet version. In order to use 2.4, you need to have :
 
<web-app version="2.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/web-app_2_4.xsd">
 
Instead of starting with the webapp-jee5 archetype, use  webapp-j2ee14 instead. Once you have the proper web.xml, the facet will never ever be changed by m2e-wtp again when you execute Maven > Update Project...
I imagine other Websphere dependent facets are installed automatically, after the dynamic web facet, but m2e-wtp has strictly no control over them.
If you still have issues, you can *try* changing these manually in .settings/org.eclipse.wst.common.project.facet.core.xml, but that might very well break stuff.
 
HIH
 
Fred Bricon
 
 
 
On Mon, Aug 13, 2012 at 7:23 PM, Harris, Christopher P <chris_harris@xxxxxxxxxx> wrote:
Fred,
 
Never mind about the maven-eclipse-plugin.
 
I bound the plugin’s eclipse goal to the initialize phase, which prompted m2e to state it is not compatible with that plug-in.  Looks like I’m stuck having to change the Facets via the IDE.
 
Unless you have any suggestions, it looks like this task is impossible to complete until I’m allowed to migrate to WAS 8.
 

-          Chris
 
From: Harris, Christopher P
Sent:
Monday, August 13, 2012 12:02 PM


To:
'Maven Integration for Eclipse users mailing list'

Subject: RE: [m2e-users] Desperate - need help getting Ear project to deploy
 
Fred,
 
Thanks for responding.  I understand about supporting RAD.  Would you have any suggestions on downgrading the Project Facets?
 
By “downgrading”, I mean I need to change “Dynamic Web Module” to 2.4, “WebSphere Web (Co-existence)” to 6.1, “WebSphere Web (Extended)” to 6.1 and the Runtime to “WebSphere Application Server v6.1”.  To strip things down to the simplest scenario, I’m following the example from https://www.ibm.com/developerworks/wikis/download/attachments/113607155/RAD_m2e-Nov.pdf?version=1 (the section “Creating Maven web project”).  When I use the webapp-jee5 archetype, I get saddled with WAS 8.0 and Dynamic Web Module 2.5.  Since I’m not supposed to change the Project Facets outside of the pom, I’m confused about how I’m supposed to go about doing this.  This is the “no-no” I referenced in my original post.
 
I’ve tried to do this using the maven-eclipse-plugin:
<plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-eclipse-plugin</artifactId>
                        <version>2.9</version>
                        <configuration>
                              <warContextRoot>SomeContextRoot</warContextRoot>
                              <additionalProjectFacets>
                                    <jst.web>2.4</jst.web>
                                    <com.ibm.websphere.extended.web>6.1</com.ibm.websphere.extended.web>
                                    <com.ibm.websphere.coexistence.web>6.1</com.ibm.websphere.coexistence.web>
                              </additionalProjectFacets>
                              <jeeversion>1.4</jeeversion>
                              <wtpdefaultserver>WebSphere Application Server v6.1</wtpdefaultserver>
                        </configuration>
                  </plugin>
 
…but the plug-in never seems to show up in the Maven Console’s output when the project is building.  The Facets don’t change.  I’ve looked at examples on the web, but no one ever binds this plugin to a goal.  They just use the default bindings.
 

-                      Chris
 
From: m2e-users-bounces@xxxxxxxxxxx [mailto:m2e-users-bounces@xxxxxxxxxxx] On Behalf Of Fred Bricon
Sent:
Friday, August 10, 2012 4:42 PM
To:
Maven Integration for Eclipse users mailing list
Subject:
Re: [m2e-users] Desperate - need help getting Ear project to deploy

 

I can't provide help on RAD per se but the first thing you need to look at is the diff between a maven built ear and what's deployed by WTP.

FYI, m2e-wtp ignores the maven created target/appname folders. All that is published is defined under projectname/.settings/*.component.

Regards,

Fred Bricon
Le 10 août 2012 22:23, "Harris, Christopher P" <chris_harris@xxxxxxxxxx> a écrit :
I did another RAD Clean then Republish.  Now I’m back to app bootstrap only complaining about the missing Dao from the .jar project.
 
This makes no sense whatsoever.  Even if I get the .jar project’s class to be recognized, the bizarre behavior between Clean/Republish vs. Run As… Maven install/Republish is troubling.
 
Chris Harris
Programmer/Analyst
BioLife Plasma Services
Baxter Healthcare Corporation
One Baxter Parkway DF3-1W
Deerfield, Illinois 60015
T 224.948.4739   F 224.948.2885
chris_harris@xxxxxxxxxx
 
From: m2e-users-bounces@xxxxxxxxxxx [mailto:m2e-users-bounces@xxxxxxxxxxx] On Behalf Of Harris, Christopher P
Sent:
Friday, August 10, 2012 3:16 PM
To:
Maven Integration for Eclipse users mailing list
Subject:
Re: [m2e-users] Desperate - need help getting Ear project to deploy

 
Whoops.  Let me clarify that I have
<generateApplicationXml>false</generateApplicationXml>
In my .ear’s pom.xml
 
Interestingly enough, if I do Project-> Clean… and then select all 4 projects that constitue the multi-module project, the next Publish to WAS results in an app bootstrap that only complains about the Dao from the .jar project missing.  It also complained about the MyFaces listener…seems kind of random.  MyFaces did initialize successfully though, so whatever.
 
Am I supposed to do a Clean via RAD and let the workspace build automatically, or am I supposed to use Run As… Maven install?  Am I supposed to even touch Run As… Maven install within RAD?
 

-    Chris
 
From: m2e-users-bounces@xxxxxxxxxxx [mailto:m2e-users-bounces@xxxxxxxxxxx] On Behalf Of Harris, Christopher P
Sent:
Friday, August 10, 2012 3:04 PM
To:
m2e-users@xxxxxxxxxxx
Subject:
[m2e-users] Desperate - need help getting Ear project to deploy

 
Hi,
 
I’ve been battling m2e and RAD for a long time now in an attempt to convert  an existing, working project to a multi-module Maven project.  I’ve managed to convert the app and successfully deploy and run the app within a workspace.  A major problem was discovered when checking the project out into a second workspace.  I wanted to see what another developer would have to go through upon checking the project out.  Everything compiled just fine.  The problem was deploying the compiled .ear app to WebSphere via wtp (Publish) from within the second workspace.  I get stack traces all over the place complaining about ClassNotFoundException’s.  The deployed .war can’t even find classes defined within its own web.xml (the bootstrap class, listeners, servlets, etc.).
 
Looking back to the work I did in the 1st workspace, I know that I was messing with wtp-related settings (Deployment Assembly, Build Path, etc.)…essentially all “no-no’s”.  So, I have no clue how the heck that app is working and running within the 1st workspace.  I had jumped into the conversion before I had stumbled upon this:
https://www.ibm.com/developerworks/wikis/download/attachments/113607155/RAD_m2e-Nov.pdf?version=1 (*note this is June 2012.  I had stumbled upon the Nov. 2011 version.  I’ve been attempting this Maven conversion since May).  I just discovered this new version while typing this, but I’m not seeing anything that will resolve this problem.
 
I can build the project via mvn install in the command line or through RAD (Run As… -> Maven install) and manually deploying either the .ear or .war via Admin Console to WebSphere works (the app starts with no errors and I can actually navigate to and use the app).  So, I know that the issue lies with the .ear generated by m2e within /target in my workspace.  I’m thinking that the problem has to be the way I’ve configured the maven-ear-plugin and the maven-war-plugin.
 
Then again, while typing this, I was able to get the app bootstrapping without ClassNotFoundException’s for classes within the .war (everything listed in web.xml).  It only griped about not finding a Dao object in my .jar project dependency that app bootstrap class uses to initialize Hibernate.  After I added the .jar as a dependency to the .ear project, as an experiment which failed to solve the ClassNotFoundException’s, removed the .jar dependency from the .ear project, removed the app from WAS, cleaned WAS, and then added the app back, I get ClassNotFoundException’s for everything again.  Wth?
 
Can someone please help me sort this out and get this to successfully deploy from within RAD to the test WAS 6.1?  With the situation described in the last paragraph occurring, I am extremely confused as to what the heck is going on here.
 
I have to be able to do deploy from within RAD to the built-in test WAS 6.1 via wtp (Publish).  I’m not the only developer, but I’m the only true Java/web guy here…so this stuff has to be as simple as possible.  This is also holding up me implementing a Maven Repo and CI setup.  I’ve been pampered by using Maven in combination with NetBeans + Tomcat 7, so this m2e experience has been beyond frustrating.  I’ve been using RAD + WAS 6.0/6.1 for the past 3 years, and it’s been a dream of mine to get my apps at work converted to Maven projects.
 
Specifics:
RAD – v8.0.4.1
WebSphere – v6.1.43
M2e – 1.1.0
M2e-wtp – 0.15.2
 
I don’t use the embedded Maven that comes with m2e.  Via RAD’s preferences, I use my external Maven 3.0.4 installation.
 
I’ve taken advantage of some of the features introduced in m2e-wtp 0.14 and 0.15:

1.)    RAD -> preferences… ->Maven -> WTP integration: unchecking “Maven Archiver generates files under the build directory” specifically for my .war project and then all projects as directed.  This allows me to republish to WAS via wtp via “Run server with resources within the workspace”, which allows me to avoid having to manually remove the app from WAS every time I wish to republish.  MANIFEST.MF and pom.properties are then put within src/main/webapp/META-INF, which I exclude from SCM.

2.)    The defaultRootSource tag for the src/main/webapp wb-resource entry within org.eclipse.wst.common.component.

3.)    My .ear project requires a <finalName>, under the <build> section of the pom, that matches the Ear project’s name within the workspace.  This allows me to right-click on the ear project and open the WebSphere Application Server Deployment.
 
I need to switch the CLASSLOADER policy to  PARENT_LAST due to us being stuck with JSF 1.2, specifically MyFaces.  IBM packages JSF 1.1, specifically Sun-RI (pre-Mojarra) into WAS 6.1 (argh).  I’m looking forward to WAS 8.  I deleted the wtp-generated application.xml.  pom.xml is generating the application.xml by default.
 
I am not using skinny wars…for now.  I tried a skinny war setup and had the same ClassNotFoundException problem.  I want to get something simpler working first.
 
Here’s the build portion of my .war’s pom:
<build>
            <!-- Changes the Context Root -->
            <finalName>SomeApp</finalName>
            <plugins>
                  <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                  </plugin>
 
                  <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.2</version>
                        <configuration>
                              <failOnMissingWebXml>false</failOnMissingWebXml>
                              <!-- skinny war file
                              <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes> -->
                              <archive>
                                    <manifest>
                                          <addClasspath>true</addClasspath>
                                          <classpathPrefix>lib/</classpathPrefix>
                                          <!-- <classpathLayoutType>custom</classpathLayoutType>
                                          <customClasspathLayout>$${artifact.artifactId}.$${artifact.extension}</customClasspathLayout> -->
                                    </manifest>
                                    <manifestEntries>
                                          <Implementation-Version>${project.version}</Implementation-Version>
                                    </manifestEntries>
                              </archive>
                        </configuration>
                  </plugin>
            </plugins>
      </build>
 
The build portion of my .ear’s pom:
<build>
            <!-- The finalName must equal the ear project's name to open the App Deployment Descriptor -->
            <finalName>SomeAppEar</finalName>
 
            <plugins>
                  <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-ear-plugin</artifactId>
                        <version>2.5</version>
                        <configuration>
                              <version>5</version>
                              <modules>
                                    <webModule>
                                          <groupId>com.some.group.id</groupId>
                                          <artifactId>SomeAppWar</artifactId>
                                          <contextRoot>SomeApp</contextRoot>
                                          <!-- Necessary to map to m2e-produced war from target directory -->
                                          <bundleFileName>SomeAppWar.war</bundleFileName>
                                    </webModule>
                              </modules>
                              <!-- no-version causes issues in NetBeans/GlassFish -->
                              <fileNameMapping>no-version</fileNameMapping>
                              <!-- Need this to map to ibmconfig files -->
                              <earSourceDirectory>${basedir}\src\main\application</earSourceDirectory>
                              <!-- <archive>
                                    <manifest>
                                          <addClasspath>true</addClasspath>
                                    </manifest>
                              </archive> -->
                        </configuration>
                  </plugin>
            </plugins>
      </build>
 
Here’s the .war dependency as listed within the .ear’s pom:
<dependency>
                  <groupId>com.some.group.id</groupId>
                  <artifactId>SomeAppWar</artifactId>
                  <version>2.0.0-Final</version>
                  <type>war</type>
                  <scope>compile</scope>
            </dependency>
 
Sorry for the novel…just trying to describe everything necessary to understand the situation.
 

-    Chris
 

The information transmitted is intended only for the person(s)or entity to which it is addressed and may contain confidential and/or legally privileged material. Delivery of this message to any person other than the intended recipient(s) is not intended in any way to waive privilege or confidentiality. Any review, retransmission, dissemination or other use of , or taking of any action in reliance upon, this information by entities other than the intended recipient is prohibited. If you receive this in error, please contact the sender and delete the material from any computer.

For Translation:

http://www.baxter.com/email_disclaimer

The information transmitted is intended only for the person(s)or entity to which it is addressed and may contain confidential and/or legally privileged material. Delivery of this message to any person other than the intended recipient(s) is not intended in any way to waive privilege or confidentiality. Any review, retransmission, dissemination or other use of , or taking of any action in reliance upon, this information by entities other than the intended recipient is prohibited. If you receive this in error, please contact the sender and delete the material from any computer.

For Translation:

http://www.baxter.com/email_disclaimer

The information transmitted is intended only for the person(s)or entity to which it is addressed and may contain confidential and/or legally privileged material. Delivery of this message to any person other than the intended recipient(s) is not intended in any way to waive privilege or confidentiality. Any review, retransmission, dissemination or other use of , or taking of any action in reliance upon, this information by entities other than the intended recipient is prohibited. If you receive this in error, please contact the sender and delete the material from any computer.

For Translation:

http://www.baxter.com/email_disclaimer

_______________________________________________
m2e-users mailing list

m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users

The information transmitted is intended only for the person(s)or entity to which it is addressed and may contain confidential and/or legally privileged material. Delivery of this message to any person other than the intended recipient(s) is not intended in any way to waive privilege or confidentiality. Any review, retransmission, dissemination or other use of , or taking of any action in reliance upon, this information by entities other than the intended recipient is prohibited. If you receive this in error, please contact the sender and delete the material from any computer.

For Translation:

http://www.baxter.com/email_disclaimer

_______________________________________________
m2e-users mailing list

m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


 
--
"Have you tried turning it off and on again" - The IT Crowd

The information transmitted is intended only for the person(s)or entity to which it is addressed and may contain confidential and/or legally privileged material. Delivery of this message to any person other than the intended recipient(s) is not intended in any way to waive privilege or confidentiality. Any review, retransmission, dissemination or other use of , or taking of any action in reliance upon, this information by entities other than the intended recipient is prohibited. If you receive this in error, please contact the sender and delete the material from any computer.

For Translation:

http://www.baxter.com/email_disclaimer_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top