This is the quickest and simplest procedure that I know to setup an Eclipse environment to develop Java customizations for IBM Maximo products.
Eclipse Installation
The first step is to install Eclipse on the development system.
Download Eclipse 3.5 from Eclipse website.
Extract the downloaded zip file into a local folder (e.g. C:\Eclipse).
Java Runtime Environment
Eclipse requires a Java VM to run. If you try to launch Eclipse (C:\Eclipse\eclipse.exe) and you don't have a suitable JVM installed you will get the following error.
The best approach is to use the Java Virtual Machine (JVM) embedded in the application server in which Maximo runs. This ensures that you are using the right version of JRE.
The JRE must be copied into C:\Eclipse\jre. For WebShpere application server it is located in [WebSphere]\AppServer\java\jre folder.
After this, try to execute C:\Eclipse\eclipse.exe to ensure that everything is ok.
Configuring Eclipse for Maximo development
The right Java compiler must be selected:
- Maximo 6: Java 1.4
- Maximo 7: Java 1.5
- Maximo 7.5: Java 1.6
Project Setup
Create an empty Java project.
Extract [SMPDIR]\maximo\deployment\default\maximo.ear into a folder named maximo in your workspace.
Refresh project tree in Eclipse (F5).
Add the following jars to the project classpath: Project > Properties > Java Build Path > Libraries > Add Jars.
- maximo/lib/*.jar
- maximo/businessobjects.jar
Create a class named AssetCust in src\custom\app\asset (package custom.app.asset) and paste the following code into it.
package custom.app.asset; import java.rmi.RemoteException; import psdi.app.asset.Asset; import psdi.mbo.MboSet; import psdi.util.MXException; public class AssetCust extends Asset { public AssetCust(MboSet ms) throws MXException, RemoteException { super(ms); } public void save()throws MXException, RemoteException { super.save(); int id = getInt("ASSETID"); String desc = getString("DESCRIPTION"); System.out.println("Saving Asset ID=" + id + " desc=" + desc); } }
The custom Mbo class gets quickly compiled and is ready to be deployed on your Maximo server.
AppBean development
If you need to develop application customization you need to add some more libraries to your project classpath.
The first one is the j2ee.jar file which can be found in [SMPDIR]\maximo\applications\maximo\lib folder.
The second library must be built manually. If you go in the folder where you extracted the maximo.ear file, you will see a maximouiweb.war file. Extract this file (it is a zip file) to a directory named maximouiweb. Refresh project tree in Eclipse (F5) and include maximouiweb.war\WEB-INF\classes class folder to your classpath.
Nice description, thanks!
ReplyDeleteHi Bruno, This is indeed a quicker way. However, when attempting to add the jar libraries
ReplyDelete<< Project > Properties > Java Build Path > Libraries > Add Jars.
maximo/lib/*.jar
maximo/businessobjects.jar>>
there are none visible. Any thoughts? Thanks in advance for all useful posts.
Have you extracted the maximo.ear into a folder named maximo ?
ReplyDeleteRemember to refresh project tree in Eclipse selecting the project and pressing F5.
Otherwise try to select the project properties, Java Build Path, Libraries, Add External Jars...
Hi Bruno, what about the server that will run this application ?
ReplyDeleteI mean what about the compilation process ?
I'm not sure to get your point.
ReplyDeleteHowever, I personally do the following steps to update Maximo server with the new code:
1. Stop the Maximo application server
2. Open the businessobjects.jar located into WebSphere (not SMP) with a zip file manager (I personally use 7Zip)
3. Copy and paste the updated class files from the Eclipse bin folder into the right path in 7Zip
4. Close businessobjects.jar
5. Start the Maximo application server
This process is much more faster that redeploying the maximo.ear.
However, I suggest to use it only for development purposes and to follow the documented process for production environments.
How to get the Maximo application server??
DeleteCan you pleas provide the link to download.
Hi Bruno,
DeleteI want to know what risk and any factors involved to not have hot deployments on production Websphere , can highlight any critical ones
I know for sure one is if we manually copy/edit jars/classes there is chance of corrupting it
and other one is many of Websphere wsadmin restore and other commands may not work properly if manually changed configurations files , app files
Thank you Bruno for your answer,
ReplyDeletejust another question please : I'm currently involved in a project to add a module in IBM Maximo (may contain an application to administer the customers and invoices ... applications that Maximo didn't offer)
Can you please give me a general procedure to follow to succeed my project.
thank you very much Bruno.
I personally clone one of the existing applications starting from the one that is similar to what I need.
ReplyDeleteThen I clean the new application as much as possible deleting all tabs, sections, tables and fields that I don't need.
Then I start to add my own custom content.
The Application Designer is not the best editor in the world but is useful especially in the setup of panels. Some fine tuning can be also made exporting, modifying and importing back the application XML definition.
The Application Developer Guide is a must. You can download it here: http://publib.boulder.ibm.com/infocenter/tivihelp/v3r1/index.jsp?topic=%2Fcom.ibm.mam.doc_7.1%2Fmam_welcome.htm
One last suggestion... export and backup frequently all the intermediate versions of the application XML definition.
Hi i use this plug in and it is more than enough for me
ReplyDeletehttp://maximodeveloper.sourceforge.net/Manual.html
where can i get the maximo source code to start with it
ReplyDeletedid we get it freely as i move my carrer towards maximo
need source code to configure project freely please do help me
in this regard
Maximo is not OpenSource!
DeleteYou cannot have its source code unless you work in IBM :-)
As far as I know there is not downloadable trial version of Maximo so you to have a valid license to download and install it.
Then you can get the maximo.ear file.
Hello, thanks a lot for nice "How-to".
ReplyDeleteI have some uncommon situation. I need to write class than extends "psdi.webclient.system.beans.DataBean". Than class can be located at "maximo.ear\maximouiweb.war\WEB-INF\classes\psdi\webclient\system\beans\". But when i trying to create new one and set superclass "DataBean", eclipse cant find that class. Can somebody help to resolve this issue?
DataBean class is not located into businessobjects.jar.
DeleteThe described procedure is only for MBO development.
If you want to develop app beans you need to include the classes located under [SMPDIR]\maximo\applications\maximo\maximouiweb\webmodule\WEB-INF\classes
I typically zip this folder and rename it tp maximouiweb.jar. Then I include this jar in the project classpath.
Hi,
DeleteI tried your approach zipping the folder and rename to .jar but it is not working? It would be great if you can be more details?
Thanks.
I have added a new paragraph 'AppBean development' at the end of the article.
DeleteIt should work.
Thanks for the great content. I can't seem to drop AppBean Class changes into 7Zip (maximouiweb.war) as I can with MBO changes. Is there a trick to get around this? Or does it required an EAR rebuild?
DeleteThe uiweb.war is not compressed.
DeleteJust put your classes in maximouiweb.war\WEB-INF\classes folder.
Aha, too simple. thanks for your time.
DeleteHi Bruno,
ReplyDeleteSuppose I use an outside API(using their jar) for processing something in cron. Where in server exactly should I place this jar so that this api is available for the cron server at run time
I see two options:
Delete1. Add your jars into [SMPDIR]\maximo\applications\maximo\lib. Rebuild and redeploy the Maximo EAR.
2. Add your jars to Maximo classpath into Application Servers > Maximo Server > Server Infrastructure > Java and Process Definition > Process Definition > Additional Properties > Java Virtual Machine > Classpath.
Please let me know which one works.
Hi Bruno,
ReplyDeleteI am new in Java customization. Whenever I compile your code in Eclipse it's throwing the below errors. Could you please tell me what will be the Main class in your source which you have mentioned in this article ? One more thing I am using Maximo Developer Plugin in my eclipse.
Thanks in Advance.
Exception in thread "main" java.lang.NoClassDefFoundError: org.apache.log4j.LogManager
Hi Bruno,
ReplyDeleteI'm new in Maximo Developer. But when I install the plugin in Eclipse and try to navigate to the source folder in Maximo view by click "Mbos Presentation" I have this Error " Connection to database not present, could not initialize Maximo developer ". So what the is the solution and what kind of Eclipse must to use "Helios, Galileo, Indigo or what".
Thanks in Advance.
I don't use Maximo developer. Just plain Eclipse.
DeleteActually working on Eclipse Juno.
make backup of maximo.properties
Deleteand try to set mxe.db.password=
and delete mxe.encrypted=true and delete encrypted password
I used "Maximo developer", and this helped me.
Thanks,
DeleteBut Андрей Батыренко I try what you explained but it didn't work for me
please explain more and what value I set to (mxe.db.password= ?)
Thanks,
DeleteIt Done after applied the steps that Андрей Батыренко explained but the missing step is to rebuild the maximo.ear file and republish the ear file on the server. thanks again but I have another issue that how can I see the source code and edit in a class methods that is under psdi folder, for example how can edit in Asset class.
In "mxe.db.password=" you must enter password for user from which maximo connect to database. You specified it on installation step.
DeleteYou will not have or see the IBM out-of-box *.java source codes since they are IBM's property and not open source.
DeleteHi Bruno,
ReplyDeleteI did customization , how I can create maximo war from eclipse ?.
Thanks in Advance.
This comment has been removed by the author.
ReplyDeletehi Bruno....nice description....
ReplyDelete* Is there any document to learn about maximo development(MBO,Field class etc)
All the free resources I know are listed here: http://maximodev.blogspot.com/p/java-customization.html
DeleteHi, Bruno!
ReplyDeleteThe Eclipse package ("Galileo package") from the link to "Eclipse website", that you posted, doesn't work with JRE 1.6.
When I try to launch eclipse.exe, it throws error that some components need jre 1.5.
Then I've followed by the link "Eclipse IDE for Java Developers" from the page:
http://www.eclipse.org/downloads/
dowload that package (actually it's the "Kepler package"), and now it works.
Are there critical differences between these packages "Eclipse IDE for Java Developers", that could broke our classes? (Kepler Packages, Juno Packages, Indigo Packages, Helios Packages, Galileo Packages, Ganymede Packages, Europa Packages).
How should I choose the "right" package?
I work with Maximo 7.5 on WebSphere 7.
Thanks in Advance.
I use Juno for Maximo 7.1 and 7.5 without any problem.
Deletewhere can I find the smpdir pls. I can't understand this part. thank you
ReplyDelete@sandra sio : it depends on which folder your installation has been done.. basically you find the SMP directory in
DeleteE:\IBM
or
C:\IBM
or
E:\Program files \IBM
hope that helps.
This comment has been removed by a blog administrator.
ReplyDeleteHi Bruno, i followed all the instructions mentioned above. i started the MXServer. what changes do i expect from the custom Asset script class we did? thanks!
ReplyDelete