Weblogic 12c dev install on Windows - MW_HOME issue

I decided to install the Hudson on my laptop yesterday and picked new Weblogic 12c as a app server to host the Hudson war. I've downloaded WLS 12.1.1 Zip distribution for Mac OSX, Windows and Linux from here, and followed the install guidelines to create the domain. By the way, Maxence Button has shared his experience on that and actually I faced with the same issues.  After that I just started domain with <DOMAIN_HOME>\startWebLogic.cmd  and deployed hudson.war - pretty quick and easy.

But this morning when I issued <DOMAIN_HOME>\startWebLogic.cmd command for my 12c dev domain, the following error appeared:

starting weblogic with Java version:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Starting WLS with line:
d:\dev\java\JDK16~1.0_2\bin\java -client   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -XX:PermSize=128m  -XX:MaxPermSize=256m -Dweblogic.Name=myserver -Djava.security.policy=D:\wlserver\server\lib\weblogic.policy  -Xverify:none -Djava.endorsed.dirs=d:\dev\java\JDK16~1.0_2/jre/lib/endorsed;D:\wlserver/endorsed  -da -Dplatform.home=D:\wlserver -Dwls.home=D:\wlserver\server -Dweblogic.home=D:\wlserver\server   -Dweblogic.management.discover=true  -Dwlw.iterativeDev= -Dwlw.testConsole= -Dwlw.logErrorsToConsole=  weblogic.Server
Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/Server
Caused by: java.lang.ClassNotFoundException: weblogic.Server
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: weblogic.Server.  Program will exit.

 Please note D:\wlserver , that's the value of the %WL_HOME% variable and it's poining to the wrong directory,  my WL_HOME should be d:\dev\Oracle\WLS1211Dev\wlserver ! So I started my investigation:

  • <DOMAIN_HOME>\startWeblogic.cmd just calls <DOMAIN_HOME>\bin\startWeblogic.cmd . Nothing special
  • <DOMAIN_HOME>\bin\startWeblogic.cmd calls setDomainEnv.cmd at its beginning
  • setDomainEnv.cmd sets WL_HOME to correct value at the beginning of the script,  and then calls %WL_HOME%\common\bin\commEnv.cmd in the middle of the script
  • commEnv.cmd resets WL_HOME = %MW_HOME%\wlserver ,  but nobody have set MW_HOME  before! Script assumes that MW_HOME have been set externally.  I checked WLS 10.3.5, in that version MW_HOME have been set explicitly in commEnv.cmd
  • setDomainEnv.cmd continue it's execution with the wrong value for the WL_HOME variable,  and the result is ClassNotFound exception at the end of startWeblogic.cmd

So, what are the options to fix this:

  1. Set MW_HOME value in the Windows Environment variables dialog. I do not like this approach, because my laptop has many Oracle Middleware homes.
  2. Modify commEnv.cmd, change the line
    set MW_HOME=%MW_HOME%
    to
    set MW_HOME=<exact location of your WLS 12c Installation>
    Not ideal, because you're modifying standard script, no one guarantee that cannot lead to some side effects
  3. create  <DOMAIN_HOME>\customStartWeblogic.cmd  script in the  with the following commands:

    @REM Change the next line according the location of your WLS 12c Installation
    set MW_HOME=d:\dev\Oracle\WLS1211Dev
    @REM Now execute the standard script
    CALL ".\startWeblogic.cmd"

    Well, that's what I did in my environment and it works pretty well.

Update (Dec, 29):

I've repeated the installation process one more time, logged all the install actions into THIS FILE, and the result was the same.  I start thinking that's OS-related issue, because a lot of guys reported that everything went well on Mac OS X or Linux.  

Comments:

Hi Dmitry,

You solution is cool, and I liked it. But I am concerned about the reason of the problem.

Recently I have installed weblogic 12c on a single node standalone in a 64 bit redhat linux box. And, the MW_HOME took the exact physical location on the disk in the file commEnv.sh. I guess, its taking the location from the installation step, where it's asking to create a new middleware home. I am wondering how come in your case, it's not pointing to the exact physical location! Might be silly, my question is - have you created a new middleware home while installing the server? From log it seems it's pointing to some other middleware home (it's my take from naming convention). Have you used existing middleware home to install it? Should not be as then, setDomainEnv.cmd would have the wrong value too. But, still please recheck it.

Also, please note the used JDK version showing in your log is not certified. It needs to be 1.6.0_29+

Thanks,
Angshu

Posted by guest on December 28, 2011 at 06:22 AM CET #

Hi Dmitry,

You solution is cool, and I liked it. But I am concerned about the reason of the problem.

Recently I have installed weblogic 12c on a single node standalone in a 64 bit redhat linux box. And, the MW_HOME took the exact physical location on the disk in the file commEnv.sh. I guess, its taking the location from the installation step, where it's asking to create a new middleware home. I am wondering how come in your case, it's not pointing to the exact physical location! Might be silly, my question is - have you created a new middleware home while installing the server? From log it seems it's pointing to some other middleware home (it's my take from naming convention). Have you used existing middleware home to install it? Should not be as then, setDomainEnv.cmd would have the wrong value too. But, still please recheck it.

Also, please note the used JDK version showing in your log is not certified. It needs to be 1.6.0_29+

Thanks,
Angshu

Posted by guest on December 28, 2011 at 06:28 AM CET #

Hi Argshu,
I repeated the install process one more time and faced with the same issues. Blog post is updated, you can find the log of all the install steps in the file attached at the bottom of the post.
>Also, please note the used JDK version showing in your log is not certified. It needs to be 1.6.0_29+
Good point, switched to the jdk1.6.0_30

Posted by Dmitry Nefedkin on December 29, 2011 at 03:18 AM CET #

yup exactly the same problem with my install, I think that the zip file for linux and macs has been done corecctly i think that windows is still wip as this file has changed twice so far i expect it will change in a bit or we all move over to macs or redhat boxes for dev work lol

Posted by guest on January 03, 2012 at 09:46 AM CET #

Has the same problem on MAC

Posted by guest on October 18, 2012 at 10:50 AM CEST #

Has the same problem on MAC

Posted by guest on October 18, 2012 at 10:52 AM CEST #

Hi Dmitry.

Thanks for your post, it was really helpfull.

Cheers,
Roger

Posted by guest on April 11, 2013 at 04:23 PM CEST #

please iam intrested in tree drag and drop please uppload example

Posted by guest on December 05, 2013 at 01:05 PM CET #

Could you clarify what drag and drop functionality you meant? How it related to this article?

Posted by Emin Askerov on January 29, 2014 at 10:17 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Oracle ECEMEA Partner Hubs Migration Center Team

We share our skills to maximize your revenue!
Our dedicated team of consultants can rapidly and successfully assist you to adopt and implement the latest of Oracle Technology in your solutions.

Stay Connected
partner.imc
@
beehiveonline.oracle-DOT-com
Google+

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
2
3
4
5
6
9
10
11
12
13
14
16
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today