Skip to main content

HOW-TO: OEPE - FastSwap with Maven2 and M2Eclipse Plugin

At the moment there is not enough information if you want to jump start with OEPE (and of course using FastSwap) and Maven2 (using M2Eclipse plugin). This HOW-TO shows you how to achieve this. You need to have Eclipse (3.4 or 3.5), WLS (10.3 or 11) OEPE, Maven2 and M2Eclipse installed correctly before you can follow the steps below:

1. Create a web application with the webapp wizard (dynamic web project). Choose a webapp based on WLS (10.3 in my case). Please change following settings afterwards to be Maven complianced:
  • Source for web: src/main/webapp
  • Source for Java: src/main/java
2. Turn on Maven project on the project above ("mavenized the project") with M2Eclipse.

3. After you mavenized the project you can delete the directory build/classes since Maven uses target/classes directory. Everything should be customized to Maven directory structure automatically.

4. You can add
  • src/test/java - if you need it
  • src/test/resources - and also
  • src/main/resources
And don't forget to give a correct output direcory for each source directory (target/classes or target/test-classes). After that you will have following directory structure in your project:


5. Now you should be able to run maven "package" within your M2Eclipse plugin correctly. And also you should be able to deploy the web app in WLS just by doing "run on server".

6. You can skip this step because you are using OEPE which turned on FastSwap automatically. To make it sure that FastSwap works correctly, you can turn on FastSwap in the weblogic.xml file (please click on the image to make it larger).


Be careful: I get following problem if I turn on FastSwap in my weblogic.xml:
  • After turning on FastSwap in weblogic.xml file, the FastSwap mechanism does not work correctly! A change in a private field does not get updated in my webapp. If I turn this off again and redeploy my webapp, FastSwap is working correctly again. A change in a private field will be updated immediately. Do you get the same problem with your OEPE and WLS 10.3 here?
7. You have to add the "Maven Dependencies" container into your Java EE Module Dependencies for OEPE to be able to use all the jar files inside the Maven dependencies (please click on the image below to make it larger).


8. You made it. Now you can change your classes without having to redeploy the application and at the same time you still have all the advantages of using Maven2 in your project. Have fun!

Cheers,
Lofi.

Comments

steven.p.hicks said…
Good stuff, I did something similar but got a problem when using Spring :-(
Have you used Spring with OEPE and Fastswop enabled?
When I do this I get a error. I raised this on the newsgroup - http://forums.oracle.com/forums/thread.jspa?threadID=977085&tstart=0
I have raised an Oracle case and while the support engineer has re-created my problem, and has raised a bug

Popular posts from this blog

Creating Spring Bean dynamically in the Runtime

In my training someone asked me whether it is possible to create an object (a Spring Bean) dynamically so you can choose which implementation you want to have in the runtime. So at the compile time you don't know what object actually should be created yet. The application should decide what object to be created based on a property file.

1. We create an annotation so we can mark the method which should be able to create the object dynamically:

...
package your.package;
...
@Retention(RetentionPolicy.RUNTIME)
public @interface InjectDynamicObject {
}
...
2. Use the new created annotation in your method which should be able to create the object dynamically:
... @Named("customerBo") public class CustomerBoImpl implements CustomerBo { ...     @Override @InjectDynamicObject public Customer getDynamicCustomer() {         return this.dynamicCustomer; } ...
3. Write an aspect with Pointcut and Advise which change the object returned by the method in the step 2:
... @Named @Aspect public class Dyn…

Enterprise Applications Customization with Microservice

Introduction Today in highly paced enterprise environment you, as the leader of enterprise IT division, need to be fast. Simplicity is the key for the speed. What are the key factors to simplify your IT? Three different areas are very important to take care of: Technology, Organisation and Environment(TOE Framework: http://goo.gl/tQlX5z). Here are some detail points for technology and organisation:

1. Technology: in most enterprises there are already one or more ERP and CRM solutions the so called Enterprise Applications. We need to manage them carefully as they support the business processes. In context of the core compentencies most enterprises customize the enterprise applications to fit their needs. We need to manage the customizations in detail as they represent the core competencies and at the same time the differentiation of our enterprise to other competitors. 2. Organisation: working in a small team with different roles and functions is already proved as the best …

Smart Home Sweet Home with Gigaset Elements?

Introduction
Last week I had a chance to try the Smart Home solution from Gigaset Elements. I read some articles about this product which said how easy to install this product for dummy users. Those articles woke my interest and I began to google products for Smart Home solutions.

In this article (German language) you will find a nice overview about some products for Smart Home, which can be bought in Germany. The Nest product from Google is still not available in Germany. Although it seems that RWE will offer Nest products in Germany in couple of months.

The installation of Gigaset Elements was really easy. The problem I encountered was to add the sirensensor. I had to push hard the button on the siren sensor at the same time with the button on the base, so that they can communicate with each other. After about one hour I managed to install everything properly.

Points to mention
Generally the idea is very nice. Gigaset Elements try to push KISS (Keep it Simple Stupid) principle. Howev…