Tuesday, December 18, 2012

JDeveloper's Integrated Weblogic on Windows 8

JDeveloper on Windows 8 cannot create default domain and start integrated weblogic because of Jython modules cannot recognize the operating system and try to execute scripts for unix operating system.

Error on message log is:

[Waiting for the domain to finish building...]
[11:48:02 PM] Creating Integrated Weblogic domain...
[11:48:18 PM] ERROR:  An error occurred while building the default domain.
Please see this log file for more details:
C:\Users\chris\AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\o.j2ee.adrs\CreateDefaultDomain.log
The Server Instance cannot be started because the Integrated Weblogic domain was not built successfully.

and in CreateDefaultDomain.log there are more details:
....
wlst > Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException:
Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')
wlst > Error:  ADRS_DOMAIN_PASSWORD environment variable not set.
....

To solve this we need to patch the jython-modules.jar. For default JDeveloper installation path we need to go to C:\Oracle\Middleware\wlserver_10.3\common\wlst\modules and extract the jython-modules.jar using an utility like 7-zip. Then we need to open the javashell.py python script inside lib folder and add at line 139 a String for Windows 8 OS:

_osTypeMap = (
        ( "nt", ( 'nt', 'Windows NT', 'Windows NT 4.0', 'WindowsNT',
                  'Windows 2000', 'Windows 2003', 'Windows XP', 'Windows CE',
                  'Windows Vista', 'Windows Server 2008', 'Windows 7', 'Windows 8' )),
        ( "dos", ( 'dos', 'Windows 95', 'Windows 98', 'Windows ME' )),
        ( "mac", ( 'mac', 'MacOS', 'Darwin' )),
        ( "None", ( 'None', )),
        )


Then we need to package jar file again using jar -cvf jython-modules.jar *.* inside jython-modules extracted folder. Then after we backup (just in case) the old jython-modules.jar we override it with our new jython-modules.jar.

I experience this with JDeveloper 11.1.1.6 but i think the same problem will be with 11.1.2.3 as the same version of Weblogic (10.3.5) is incuded in both installations.

As ActiveLow mentioned on comments fix works also for JDeveloper 12.1.2 and Windows 2012.

27 comments:

  1. 11.1.2.3 confirmed, also had to add change *.* to Lib\*.*

    ReplyDelete
  2. Nice to see that fix works for 11.1.2.3 too. Thanks for your feedback.

    ReplyDelete
  3. It works. Thanks a lot!

    ReplyDelete
  4. Hi,

    Thank you for the post.

    I have applied your solution and after that I got following errors. Can you please help me resolve them.

    wlst >
    wlst > Initializing WebLogic Scripting Tool (WLST) ...
    wlst >
    wlst > Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.
    wlst >
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\adfmWLSTCommands.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\adfmWLSTCommands.py", line 46, in ?
    wlst > ImportError: no module named pprint
    wlst > "
    wlst >
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\igfConfig.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\igfConfig.py", line 14, in ?
    wlst > ImportError: no module named igfConfig_handler
    wlst > "
    wlst >
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\mdsWLSTCommands.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\mdsWLSTCommands.py", line 67, in ?
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ora_util.py", line 35, in addScriptHandlers
    wlst > AttributeError: class 'org.python.modules.os' has no attribute 'path'
    wlst > "
    wlst >
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\Opss.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\Opss.py", line 14, in ?
    wlst > ImportError: no module named Opss_handler
    wlst > "
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\oracledfw.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\oracledfw.py", line 27, in ?
    wlst > AttributeError: class 'org.python.modules.os' has no attribute 'path'
    wlst > "
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\oracledms.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\oracledms.py", line 434, in ?
    wlst > AttributeError: class 'org.python.modules.os' has no attribute 'path'
    wlst > "
    wlst >
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\OracleLibOVD.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\OracleLibOVD.py", line 10, in ?
    wlst > ImportError: no module named OracleLibOVD_handler
    wlst > "
    wlst > Error execing the Python script "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\sslconfig.py" caused an error "Traceback (innermost last):
    wlst > File "C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\sslconfig.py", line 18, in ?
    wlst > ImportError: no module named shutil
    wlst > "
    wlst > Welcome to WebLogic Server Administration Scripting Shell
    wlst >
    wlst > Type help() for help on available commands
    wlst >
    wlst > Problem invoking WLST - Traceback (innermost last):
    wlst > File "C:\Users\Rajasree\AppData\Roaming\JDeveloper\system11.1.1.6.38.62.29\o.j2ee.adrs\CreateDefaultDomain.py", line 13, in ?
    wlst > AttributeError: class 'org.python.modules.os' has no attribute 'environ'
    wlst >
    Elapsed time: 48952 ms


    Thanks,

    ReplyDelete
    Replies
    1. I think you mistype something? what steps are you made before the error?

      Delete
    2. I have isntalled JDeveloped. Followed all the instructions mentioned in here - adding Windows 8 in javashell.py python script. Opened Jdeveloper and tried to start weblogic server and got this error.

      Delete
    3. Did u got the solution.. i stuck at the same.. can you plz let me know how u resolved it...

      Delete
  5. I had the same problem with JDeveloper 12.1.2 and windows 2012.
    Added the string 'Windows Server 2012' and everything worked fine.

    ReplyDelete
  6. Thanks for the feedback. I updated the article to include windows 2012 too

    ReplyDelete
  7. Hi,

    I was trying to create a new weblogic domain to support webcenter portal and content products. However, I got the following error on the 70% progress:

    --------------------------------------------------------------------------------------------------------------------------
    Preparing...
    Extracting Domain Contents...
    Creating Domain Security Information...
    Domain Creation Failed!


    Domain Location: C:\Oracle\Middleware\user_projects\domains\base_domain


    Reason: null


    Exception:


    Traceback (innermost last):
    File "", line 86, in ?
    ImportError: no module named javaos
    --------------------------------------------------------------------------------------------------------------------------

    Server OS: Windows 8.1
    FMW Version: 11.1.1.9

    Your help would be greatly appreciated.

    Thanks,

    ReplyDelete
  8. I have try 12.1.3 on windows 10 and in my test works without any modification. Are you sure it did not work before you add the 'Windows 10'?

    ReplyDelete
  9. This is what I get in Windows 10 after modification
    ""C:\Oracle\Middleware\Oracle_Home2\oracle_common\common\bin\wlst.cmd" "D:\jdeveloper\system12.2.1.0.42.151011.0031\o.j2ee.adrs\BuildDefaultDomain1.py""
    Process started
    wlst >
    wlst > Initializing WebLogic Scripting Tool (WLST) ...
    wlst >
    wlst > Error execing the Python script "/C:/Oracle/Middleware/Oracle_Home2/oracle_common/modules/internal/features/oracle.fmwshare.pyjar.jar!/wlstScriptDir/lib/PdkHandler.py" caused an error "Traceback (innermost last):
    wlst > File "", line 1, in ?
    wlst > File "C:\Oracle\Middleware\Oracle_Home2\oracle_common\modules\internal\features\oracle.fmwshare.pyjar.jar\wlstScriptDir/lib/PdkHandler.py", line 15, in ?
    wlst > File "C:\Oracle\Middleware\Oracle_Home2\oracle_common\modules\internal\features\oracle.fmwshare.pyjar.jar\wlstScriptDir/lib/ProducerHelperHandler.py", line 21, in ?
    wlst > ImportError: no module named re
    wlst > "
    wlst > Error execing the Python script "/C:/Oracle/Middleware/Oracle_Home2/oracle_common/modules/internal/features/oracle.fmwshare.pyjar.jar!/wlstScriptDir/lib/PortletClientHandler.py" caused an error "Traceback (innermost last):
    wlst > File "", line 1, in ?
    wlst > File "C:\Oracle\Middleware\Oracle_Home2\oracle_common\modules\internal\features\oracle.fmwshare.pyjar.jar\wlstScriptDir/lib/PortletClientHandler.py", line 14, in ?
    wlst > ImportError: no module named re
    wlst > "
    wlst > Error execing the Python script "/C:/Oracle/Middleware/Oracle_Home2/oracle_common/modules/internal/features/oracle.fmwshare.pyjar.jar!/wlstScriptDir/lib/ProducerHelperHandler.py" caused an error "Traceback (innermost last):
    wlst > File "", line 1, in ?
    wlst > File "C:\Oracle\Middleware\Oracle_Home2\oracle_common\modules\internal\features\oracle.fmwshare.pyjar.jar\wlstScriptDir/lib/ProducerHelperHandler.py", line 21, in ?
    wlst > ImportError: no module named re
    wlst > "
    ........

    ReplyDelete
  10. I haven't try it but i do not think you need to modify jdeveloper 12.2.1 to work with windows 10. It should work out of the box.

    ReplyDelete
  11. Did you use the generic installer or the Windows 64 bit one?

    ReplyDelete
  12. Error its only happening with generic installer on 12c. Check my new post https://unversioned.blogspot.gr/2015/12/jdeveloper-12c-generic-installer-cannot-create-weblogic-domain.html

    ReplyDelete
  13. Thanks for the help, worked for Windows 10 as well. used Winrar to edit and repackage

    ReplyDelete
    Replies
    1. Hi jayanth,


      How to resolve please tell me step by step.

      Delete
  14. I installed JDEVLOVER 12c after installed when i start Web logic server i am getting below error.
    Starting WLS with line:
    Error: Could not find or load main class XXXXXX\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\DefaultDomain
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=512m; support was removed in 8.0
    Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=1024m; support was removed in 8.0
    Stopping Derby server...
    Derby server stopped.
    [Starting IntegratedWebLogicServer.]
    [waiting for the server to complete its initialization...]
    Process exited.
    [IntegratedWebLogicServer terminated.]

    Can any one help me on this

    ReplyDelete
  15. Thanks for this! Had to add "Windows 10" and that seems to have done the trick!

    ReplyDelete
  16. After repackaging the jython-modules.jar on windows 10 I am seeing this error on windows 10 when I tried to create a domain
    wlst > Initializing WebLogic Scripting Tool (WLST) ...
    wlst >
    wlst > Error execing the Python script "/C:/Jdev_Latest/oracle_common/modules/internal/features/oracle.fmwshare.pyjar.jar!/wlstScriptDir/lib/PdkHandler.py" caused an error "Traceback (innermost last):
    wlst > File "", line 1, in ?
    wlst > File "C:\Jdev_Latest\oracle_common\modules\internal\features\oracle.fmwshare.pyjar.jar\wlstScriptDir/lib/PdkHandler.py", line 15, in ?
    wlst > File "C:\Jdev_Latest\oracle_common\modules\internal\features\oracle.fmwshare.pyjar.jar\wlstScriptDir/lib/ProducerHelperHandler.py", line 21, in ?
    wlst > ImportError: no module named re
    wlst > "
    wlst > Error execing the Python script "/C:/Jdev_Latest

    ReplyDelete
    Replies
    1. i am also facing same issue...have you got any solution on above error??

      Delete
  17. same error as well when i repack the jar (windows 2012R2)

    ReplyDelete

Note: Only a member of this blog may post a comment.