Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] EAR Deployment Assembly structure not same as actually deployed to server

Hi Marcel,

The use case is unfortunately complicated by the fact that I am dealing with 10-15yr legacy code that I am trying to make work in an m2e environment, and do not have the ability to modify some critical things:

The full EAR is actually composed of 2 WARS and 2 EJBs.  We can ignore the EJBs for the moment.  Unfortunately, the WARs (WebApp-A and WebApp-B) have to use Parent-First classloading due to the way the codebase was written (and not maintained) over the last 10 years; changing them to parent-last is a significant undertaking that cannot be done at the moment.  Additionally, the WARs have some conflicting dependencies (ex: Spring 1 in one app and Spring 2 in the other).  Similarly, updating dependencies is not feasible at the time.

Based on the above criteria, I cannot use skinnywars, as the classloader for the EAR/lib folder will not have visibility on any config files present in the WEB-INF/lib folder.  I'm okay with that.  I want to deploy the two WARs independently.

My problem is that a spring config of WebApp-B has a classpath dependency on 2 jars from WebApp-A:

WebApp-B spring-servlet.xml:
<beans>
<import resource="classpath:strongauth-spring-servlet-app.xml"/>
</beans>


The original goal when doing this is that WebApp-B is a common WebApp that is used in several different EARs.  But the configuration for  WebAppB should be defined by WebAppA.
WebAppA has the "strongauth-spring-servlet-app.xml" file (and its referenced beans) in 2 jars (ComConfiguration.jar and ComCommon.jar).

So, I am trying to figure out how to package my EAR such that I can give WebAppB visibility over the ComConfiguration and ComCommon jars from WebAppA.  By definition, WebAppB does not have an explicit maven dependency on anything from WebAppA (since it is up to the EAR creator to provide classpath access to the config file(s)).  My first instinct was to place these two jars in the EAR/lib folder such that the classloader for WebAppB will automatically have access to them.  And this is where I started having trouble with my deployment from within Eclipse.

I am using 'run server with resources within the workspace' and 'minimize application files copied to the server' checked.  Additionally, I am also using the -Xquickstart option, but I don't believe that has much bearing.

I checked the deployment.xml and the losseconfig.xmi files, and do not see the jarModules listed in the deployment.xml file.  However, I do see them in the looseconfig.xmi file (the ComCommons.jar and ComConfiguration.jar with the appropriate binariesPath and resourcesPath definitions). 

So then, why don't I see those resources anywhere in my classloader viewer?

I'm losing my mind.  Every configuration *seems* right, but WebSphere is just toying with me.  I also tried to unselect the "minimize application files" option, but to no avail.

Any thoughts or insights would be greatly appreciated.

Thanks,

Eric




On Tue, Feb 16, 2016 at 2:05 PM, Marcel Schutte <maro.schutte@xxxxxxxxx> wrote:
Hi Eric,

Could you please describe which 'publish settings' you use: 'run server with resources within the workspace' or 'run server with resources on server' and whether you have the 'minimize application files copied to the server' checkbox enabled. 

There are some things that I find odd in your setup:

- why do you declare <jarModule> tags in you ear setup, what is the maven packaging type of these dependencies? You don't need a <jarModule> for regular jars, adding them as dependencies is sufficient
- you talk about the dependencies of your war module being added to your ear/lib directory. This is not how maven works, if you declare an artifact of type war as a dependency, that dependency doesn't have transitive dependencies (they are packaged within the WEB-INF/lib by default)
- specifying both a <defaultLibBundleDir> and <bundleDir> seems redundant, for me just the <defaultLibBundleDir>lib</defaultLibBundleDir> is enough for us to get dependencies packaged inside ear/lib

We use eclipse mars with m2e and ibm wdt 8.5.5070 without these issues. We use the run from workspace with minimize files copied enabled, which saves you the republishing step most of the time.

You might want to take a look at the following file that wdt generates, it contains a description of the deployed ear as it is presented to your local websphere server and has been incredibly helpful to me on several occasions:

<workspace>\.metadata\.plugins\com.ibm.etools.wrd.websphere.v85\looseconfigurations\<servername>\<applicationname>\looseconfig.xmi

For completeness and to remove the 'magic' from how all this works, you can start following the deployment settings here:

<wasprofile>\config\cells\<cellname>\applications\<applicationname>.ear\deployments\<applicationname>\deployment.xml

This file is used by websphere to describe an installed application, and in the 'run from workspace' scenario it contains a property called 'was.loose.config' which points to the looseconfig.xmi file.

The effect of opening and closing projects will be reflected in the looseconfig.xmi because you see either a reference to your project's target/classes folder, or a reference to your local repository.

I hope the above gives you some leads in getting this working more smoothly for you, but know that it is possible.

Regards, Marcel Schutte

On Tue, Feb 16, 2016 at 6:55 PM, Eric B <ebenzacar@xxxxxxxxx> wrote:
This is driving me insane.  I've deleted the EAR from the server several times and redeploy it.  If I expand the EAR (in the server view), I see my modules listed there.  But when I look at the classloader viewer, there is are no target folders for the modules added/listed!

The only thing I haven't tried was to recreate a new WAS profile and use that, but I don't see/understand how that could make a difference.  

This whole ordeal is starting to be significantly frustrating.

Thanks,

Eric


On Tue, Feb 16, 2016 at 12:12 PM, Art Kaufmann <art.kaufmann@xxxxxxxxxxxxx> wrote:
In the "Servers" view I remove the application from the server, then Publish (I have things set to manually publish); then add it back and publish again. In fact, I was doing that very thing when I saw your first e-mail.

Cheers,

Art

Art Kaufmann
Chief Architect, IRIS (Traceability Server)
"The life so short, the craft so long to learn"
"By hammer and hand do all things stand"

3960 Fabian Way
Palo Alto, CA 94303

art.kaufmann@xxxxxxxxxxxxx
www.frequentz.com
O:  (650)397-2553
M:  (310)418-8410
This E-mail and its attachments may contain proprietary and/or confidential information belonging to Frequentz, LLC. Dissemination and copying of this E-mail is strictly prohibited. This E-mail is intended solely for the use of the individual and entity to which it is addressed. If you have received this E-mail in error, please notify the sender immediately and delete the original and any copies.

On Tue, Feb 16, 2016 at 9:09 AM, Eric B <ebenzacar@xxxxxxxxx> wrote:
Art,

Thanks for confirming that I'm not going nuts.  What/where/how do you have to delete and reinstall?  The Eclipse project?  The entry in the POM file?  This is a major stumbling block for me and has caused me hours of grief already chasing ClassLoading ghosts.

Thanks,

Eric

On Tue, Feb 16, 2016 at 12:05 PM, Art Kaufmann <art.kaufmann@xxxxxxxxxxxxx> wrote:
I've experienced the same thing publishing from Eclipse Mars with the WAS 8.5 tooling. I, too, suspect the tooling. Some of the time, when I add a Module or Utility JAR to the application, I have to delete and reinstall it.

Cheers,
  Art

Art Kaufmann
Chief Architect, IRIS (Traceability Server)
"The life so short, the craft so long to learn"
"By hammer and hand do all things stand"

3960 Fabian Way
Palo Alto, CA 94303

art.kaufmann@xxxxxxxxxxxxx
www.frequentz.com
O:  (650)397-2553
M:  (310)418-8410
This E-mail and its attachments may contain proprietary and/or confidential information belonging to Frequentz, LLC. Dissemination and copying of this E-mail is strictly prohibited. This E-mail is intended solely for the use of the individual and entity to which it is addressed. If you have received this E-mail in error, please notify the sender immediately and delete the original and any copies.

On Tue, Feb 16, 2016 at 8:57 AM, Eric B <ebenzacar@xxxxxxxxx> wrote:
I don't know exactly where the issue lies for my problem; if it is a problem with the way I am attempting to use m2e-wtp, the maven-ear-plugin, or something with the connector that publishes my Eclipse project to the server.  I am hoping someone could at least point me in the right direction.

I have an EAR that I am trying to build and deploy to WebSphere.  In my pom, my configuration is as follows:

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.10.1</version>
<configuration>
<version>5</version>
<defaultLibBundleDir>lib/</defaultLibBundleDir>
<modules>

<webModule>
<groupId>com.ics.strongauth</groupId>
<artifactId>AuthRenfClientWeb</artifactId>
<contextRoot>strongauth</contextRoot>
</webModule>
<jarModule>
<groupId>${project.groupId}</groupId>
<artifactId>ComCommons</artifactId>
<bundleDir>/lib</bundleDir>
</jarModule>
<jarModule>
<groupId>${project.groupId}</groupId>
<artifactId>ComConfiguration</artifactId>
<bundleDir>/lib</bundleDir>
</jarModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>


Each of the listed modules are listed as dependencies in the pom.xml file.

If I check the deployment assembly for my project, I see things appropriately structured.  A bunch of files have been added to the EAR's /lib folder (dependencies from AuthRenfClientWeb) as well as the my two projects ComCommons and ComConfiguration.

If I right-click my project and Export -> Ear, I find a ComCommons.jar and ComConfiguration.jar in my /lib folder.  

However, if I try to publish my project to my WebSphere server, it ignores/skips the jarModules.  There are no entries in any Classloader pointing to the classpaths for ComCommons/target and ComConfiguration/target, as I would expect.

If I close the projects, then it publishes the actual ComCommon.jar and ComConfiguration.jar files to the /lib folder (as expected).

So the problem only occurs if the projects are opened, as it is supposed to just add an entry to the target folder in the classpath.

Is this an m2e-wtp integration issue?  Is this a WebSphere Developer Tools error?  I tend to believe it is a problem with the WebSphere connector, but not sure.

Thanks!

Eric




However

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users



--

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users


Back to the top