Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] .war project not copying .jar project dependency to WAS tmp folder

When working with one of the RAD versions, it is important to know how your WTP server is setup, I mean the entry in the 'servers' view. Do you have run with resources in workspace selected, do you have minize files copied selected?

If yes, then take a look at the file (from memory, so forgive any small errors in this path) in <workspace>/.metadata/.plugins/<someibmblabla.v7/<several levels/looseconfig.xmi This is the file that contains the EAR layout as it is seen by your websphere server. It has been a great help in troubleshooting deployment errors.

On Tue, Aug 14, 2012 at 9:20 PM, Harris, Christopher P <chris_harris@xxxxxxxxxx> wrote:

Ah ha!  I think I’ve identified this bug…or a derivate/cousin of it:

http://dev.eclipse.org/mhonarc/lists/m2e-users/msg02523.html

https://issues.sonatype.org/browse/MECLIPSEWTP-245

 

In answer to your question: Yes, I did clean the server instance.  

 

In preparation for this reply, here are the steps that I just took to reproduce this problem:

1.)    Removed the app from WAS 6.1

2.)    Cleaned the server

3.)    Since I had my jar artifact still in the tmp1 folder (C:\workspaceM2E\.metadata\.plugins\org.eclipse.wst.server.core\tmp1), I closed RAD 8.0.4.1 so I could delete the folder representing my .war project and also my jar artifact contained within it

4.)    I deleted said folder representing my .war project.

5.)    Opened RAD again and executed a Clean on the 4 maven projects, except the .jar project was open in the workspace

6.)    Started WAS 6.1, right-clicked the server and clicked on “Add and Remove…”

7.)    Added the.ear project from the workspace to WAS 6.1, which caused an automatic Publish.  (Interestingly enough, when expanding the “+’s” for my .ear project on the “Add and Remove…”, the .jar is not listed under the .war)

8.)    The app bootstrapped/initialized without any errors complaining about the war project not being able to find a class in the .jar project (Hibernate initialized and I could see my mappings populating the console)

9.)    I repeated steps 1-5, except this time I closed the .jar project in the workspace

10.) I repeated steps 6-7   (Interestingly enough, when expanding the “+’s” for my .ear project on the “Add and Remove…”, the .jar is listed under the .war)

11.) The app bootstrapped/initialized with the 1 error complaining about the war project not being able to find a class in the .jar project (no Hibernate mappings populating the console)

 

I just iterated through this entire 11-step process twice, each iteration yielding the same results.

 

I’m not implementing a war overlay though.  My jar project is listed as having a packaging of “jar”.  This jar is simply a “utility” jar project that’s meant to be shared by two separate war projects, each residing their own separate, respective .ear projects.  Basically, the jar project handles all the common Hibernate mappings.  Plus, the other .war project is still a vanilla Eclipse project at the moment.

 

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 Fred Bricon
Sent: Tuesday, August 14, 2012 11:45 AM
To: Maven Integration for Eclipse users mailing list
Subject: Re: [m2e-users] .war project not copying .jar project dependency to WAS tmp folder

 

We had reports of random deployment problems here and there.  Your component file looks legit. That's the only thing m2e-wtp does wrt deployment (declare what to deploy). 

There may be a bug in WTP itself or the server adapter itself (WAS).

  
Have you tried cleaning the server instance? removing the app from the server and adding it back? deleting the server and recreating it?

 

cc'ing, Chuck Bridgham, WTP/IBM RAD guru.

 

Regards,

 

Fred Bricon.

 

On Mon, Aug 13, 2012 at 9:21 PM, Harris, Christopher P <chris_harris@xxxxxxxxxx> wrote:

Hi,

 

I have a bizarre situation that I can’t wrap my head around.

 

I have 4 projects that comprise a multi-module project: a parent pom, an ear, a war, and a jar.  The problem is with the jar project.

 

The jar project is listed as a dependency in my war’s pom.  The jar is listed correctly.  It shows up under “Resolved Dependencies” within the “Dependency Hierarchy” tab.  The bizarre part is when I publish the ear project to my WAS 6.1 test server within the IDE.  During application bootstrap/initialization, all 3rd-party .jar’s on the classpath are loaded as indicated by the console.  I get 1 error.  That 1 error indicates that the a class listed in the jar project could not be found.

 

I located the tmp folder where the published application resides:

C:\workspaceM2E\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\

 

My war project is listed in this tmp folder.  If I navigate down to the war project’s WEB-INF/lib folder, I find all the 3rd-party jar dependencies listed except for my jar project.  My jar project’s artifact should be in here.

 

If I build the project using “Run As… à Maven install” or build the project using Maven itself, the jar project’s artifact .jar is sitting inside the .war artifact upon inspection of my local repo.

 

As an experiment, I copied the missing .jar project artifact into the tmp folder and restarted WAS.   Sure enough, the app initialized just fine without any ClassNotFoundException’s complaining about any classes from the jar project.

 

The jar project is listed in my war’s org.eclipse.wst.common.component:

<dependent-module archiveName="AppJar-2.0.0-Final.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/AppJar/AppJar">

            <dependency-type>uses</dependency-type>

        </dependent-module>

 

My war’s pom lists the jar project dependency as such:

 

<dependency>

                  <groupId>com.some.group.id</groupId>

                  <artifactId>AppJar</artifactId>

                  <version>2.0.0-Final</version>

                  <scope>compile</scope>

            </dependency>

 

Do I have something wrong with the configuration?  Is this a bug?

 

-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


_______________________________________________
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




--
Fotografie
http://schutte.name/


Back to the top