Wednesday, January 28, 2015

Weblogic 10.3.5 Eclipse 3.7 (Indigo) Integration


Simple Hints:

- Eclipse Install/Uninstall Software - Make sure you have correct server adapters
- Make sure $JAVA_HOME setup
- Set $MW_HOME [MW - MIDDLEWARE] - Where WebLogic zip extract will be placed [~/weblogic/wls1035_dev]
- Use ~/Weblogic/'unzipped_folder'/configure.sh to install WebLogic
- Edit base_domain/init-info/domain-info.xml - match server version
- Check base_domain/logs and run base_domain/startWebLogic.sh
- Edit base_domain/bin/startWebLogic.sh for any java vm setup errors

Default Log files location:

$MW_HOME/user_projects/domains/base_domain/servers/AdminServer/logs

TL;DR!

Almost 4 weeks back, on my first week of new job, my colleague suggested to setup Eclipse Indigo in my new mac book (I got Mavericks and upgraded to Yosemite; which I wouldn't suggest at all) and WebLogic server.

 I was suggested to use the following links. Cool.

http://www.oracle.com/technetwork/developer-tools/eclipse/downloads/oepe-111173-429353.html

http://www.jusuchyne.com/codingchyne/2012/08/installation-of-weblogic-eclipse-integration-on-mac-os-x/

 Got Eclipse installed and WebLogic (latest 12.1.3, aka 12c) installed; started working on integrating WebLogic server to Eclipse, then I noticed WebLogic 12.1.3 is not listed in server type options. So I decided to use 'Download additional server adapter' option in 'Define a New Server' dialog window to get latest adapters. [You can use 'Help' menu -> 'Install New Software' -> Select '--All Available Sites --', then pick the one you need] 

 When I tried to install new server adapter from Oracle WebLogic, it showed lot of conflicts; Another challenge to learn. The best suggested way is, go to the installed list [two ways to get the list: 'Eclipse' Menu -> 'About Eclipse Platform' -> 'Installation Details'; or 'Help' menu -> 'Install New Software' -> 'already installed' link in the dialog window], and find the conflict installation and uninstall them. Using restart method or apply now is up to your patience index. But both worked same [trust me]. 

 So, learnt new things and installed all new Oracle WebLogic server adapter for Eclipse, but still there is no server type option for WebLogic 12.1.3, but 12.1.1. Thank god some one pulled me to do some document read and few meetings to ask newbie stupid questions.  But, I didn't forget it.

 Then using Oracle WebLogic server download list[http://www.oracle.com/technetwork/middleware/weblogic/downloads/wls-main-097127.html], which gave option to download WebLogic 12.1.1, I downloaded and installed [Downloaded Zip distribution of for Mac OSX, Windows, and Linux]. At this time, I memorized the technique to install/uninstall WebLogic server. To uninstall, I just got into to ~/weblogic folder and did 'rm -rf' to remove all subfolder (so clean and simple). To install, copied the unzipped folder to ~/weblogic folder. Then I updated the $MW_HOME. Hope you don't need remind about JAVA_HOME. Then ran 'configure.sh' from the "~/weblogic/'unzipped_folder'. [Adding/updating into ~/.bash_profile is suggested]

  All went well; I could add WebLogic server with Eclipse, by creating the 'base_domain' using 'Create Domain' option - Which creates 'test1' domain [You can use 'Launch Domain Configuration Wizard' which creates 'base_domain']. Don't forget that the default user is 'weblogic' and default password is 'welcome1'. [Note: First few times I was creative to put lot of unguessable passwords (even by me) and eventually I was tired of configuring this one.]

  So, I visited 'localhost:7001/console/login/LoginForm.jsp' and so excited, my first working WebLogic server (almost after a decade) and ready to go! Wonderful isn't it!

  Finally, a day came, my colleague showed me how he is using jUnit for his very minor changes. When I tried to do jUnit setup, colleague pointed that I have to checkout project by project, not whole SVN repo trunk. And I deleted all old repo (Eclipse did it for me. I didnt use 'rm -rf'] and checked out the code for one particular module to run unit tests. When I was ready to run the code, Eclipse was so polite to notify me with big red exclamation, which informed me that the classic code repos was using WebLogic Server 10.3.5. 

 Yes, back to base one; tried to download 10.3.5 from Oracle WebLogic archives, there is no 10.3.5; only 10.3.6. But, the download failed on me more that 5 times. And, the colleague came to rescue; He has WebLogic 10.3.5 download in his local backup. It took an hour to find out email wont send files with size of 375MB; Scavenged for USB, got one USB drive from another colleague (got recommendation from older friend of me, who is working in this new office). Finally, I did WebLogic 10.3.5.0 installation like something I do day-to-day work. And worked. If I m not wrong, it might be my 10th WebLogic Installation. (And it is the last one until I am making this blog)

 Good news was the jUnit tests were passing, after filling the config files with correct info [Avoiding to add password conflicts and account lock issue here]. So curious to setup my WebLogic Server and Eclipse integration. Followed same steps to create base domain, which leads to only 10.3.4.0 version and I did it. Even all went well, server didn't started and showed the error 'domain name not matching the service'. With google suggestion, searched for '10.3.4.0' in base_domain directory and replaced with 10.3.5.0 [init-info/domain-info.xml]; but server didn't start and showed same error. 

 Please go to next paragraph, if you feel exhausted. Almost half day, I tried to get 'Domain Creation Wizard' for 10.3.5.0. Tried to install latest Oracle WebLogic tools, which showed lot of conflicts, even Eclipse Platform 3.7 itself. By following uninstall, apply changes and restart Eclipse; At end of day, I got into a point, where I can't start 'Eclipse App' itself. So, extracted latest Eclipse dowloand and replaced 'Applications'/Eclipse. Eclipse app was opening. And jUnit setup were intact even after this long ravaging acts. Good!

 After ignoring couple of hours, looked back and went to base_domain and run 'startWebLogic.sh' file, which showed the error as '-jrockit' invalid option; which was a valid error. I installed JDK 1.7.0_71/72. Not JRockit version. After searching and finding '-jrockit' (find . | xargs grep -in '-jrockit') and commented the line '@JAVA_VM=-jrockit' [init-info/tokenValue.properties], nothing changed. Finally edited 'bin/startWebLogic.sh' file, added 'JAVA_VM=""' line before the first call of '${JAVA_VM}' made me start the WebLogic Server. [I got an error saying WebLogic Server is already running, and find it (ps aux|grep weblogic) and killed it.]

  Now I followed natural steps to add 'Server' to Eclipse all worked well. It is running now!

Footnote: Later a week, I found the very first installation of SVN support - Subclipse installation were lost on repeated install/uninstall process. Simple Eclipse market place search and drag&drop fixed it!


Additional Notes:

Update USER_MEM_ARGS:

Add following line to bashrc or profile

#setting memory for Weblogic server
export USER_MEM_ARGS="-Xms1028m -Xmx2048m"

Update log time pattern:

To update WebLogic Server logging time format, login into console [http://localhost:7001/console], Environments -> Servers, 'AdminServer', 'Logging' tab -> Advanced Section -> Change 'Date Time Format Pattern' to 'yyyy-MM-dd'T'HH:mm:ss.S Z'. [It was 'MMM d, yyyy h:mm:ss a z'].

Note: Use following line in log4j.properties to reflect common time pattern
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.S Z} %5p [%c]:%L - %m%n

 [using %d{ISO8601} wont result same]

No comments:

Post a Comment